@remotion/studio-server 4.0.506 → 4.0.507

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 (44) hide show
  1. package/dist/codemods/effect-param-expression.js +2 -0
  2. package/dist/codemods/update-keyframes/update-keyframes.js +2 -0
  3. package/dist/helpers/coding-agent-registry.d.ts +35 -0
  4. package/dist/helpers/coding-agent-registry.js +447 -22
  5. package/dist/helpers/editor-registry.d.ts +1 -0
  6. package/dist/helpers/editor-registry.js +31 -3
  7. package/dist/helpers/open-in-editor.js +5 -5
  8. package/dist/helpers/parse-keyframe-easing-expression.js +3 -0
  9. package/dist/helpers/resolve-editor.d.ts +2 -0
  10. package/dist/helpers/resolve-editor.js +4 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/preview-server/api-routes.js +5 -4
  13. package/dist/preview-server/handler.d.ts +1 -1
  14. package/dist/preview-server/routes/add-render.js +2 -0
  15. package/dist/preview-server/routes/can-update-sequence-props.js +28 -5
  16. package/dist/preview-server/routes/copy-render-output-to-asset.d.ts +3 -0
  17. package/dist/preview-server/routes/copy-render-output-to-asset.js +58 -0
  18. package/dist/preview-server/routes/default-coding-agent.d.ts +2 -6
  19. package/dist/preview-server/routes/default-coding-agent.js +17 -88
  20. package/dist/preview-server/routes/default-editor.d.ts +1 -6
  21. package/dist/preview-server/routes/default-editor.js +13 -113
  22. package/dist/preview-server/routes/open-in-editor.js +1 -1
  23. package/dist/preview-server/routes/update-config.d.ts +7 -0
  24. package/dist/preview-server/routes/update-config.js +188 -0
  25. package/dist/preview-server/start-server.d.ts +1 -1
  26. package/dist/preview-server/studio-protocol/handle-discovery.js +3 -4
  27. package/dist/preview-server/studio-protocol/handle-install.js +1 -1
  28. package/dist/preview-server/studio-protocol/handle-license-key.js +2 -2
  29. package/dist/preview-server/studio-protocol/origin-policy.d.ts +2 -5
  30. package/dist/preview-server/studio-protocol/origin-policy.js +6 -30
  31. package/dist/routes.d.ts +1 -1
  32. package/dist/routes.js +0 -1
  33. package/dist/start-studio.d.ts +1 -1
  34. package/package.json +8 -8
  35. package/web/coding-agent-icons/claude-code.png +0 -0
  36. package/web/coding-agent-icons/codex.png +0 -0
  37. package/web/coding-agent-icons/copilot.png +0 -0
  38. package/web/coding-agent-icons/cursor.png +0 -0
  39. package/dist/preview-server/routes/delete-effect-keyframe.d.ts +0 -3
  40. package/dist/preview-server/routes/delete-effect-keyframe.js +0 -89
  41. package/dist/preview-server/routes/delete-sequence-keyframe.d.ts +0 -3
  42. package/dist/preview-server/routes/delete-sequence-keyframe.js +0 -82
  43. package/dist/preview-server/routes/save-props-mutex.d.ts +0 -1
  44. package/dist/preview-server/routes/save-props-mutex.js +0 -11
@@ -30,7 +30,8 @@ const editorDefinitions = {
30
30
  vscode: {
31
31
  darwin: [
32
32
  {
33
- name: 'VS Code',
33
+ name: 'Code',
34
+ nameWithType: 'Code',
34
35
  bundleIdentifiers: ['com.microsoft.VSCode'],
35
36
  applicationNames: ['Visual Studio Code.app'],
36
37
  executable: 'Contents/Resources/app/bin/code',
@@ -38,6 +39,7 @@ const editorDefinitions = {
38
39
  },
39
40
  {
40
41
  name: 'VS Code Insiders',
42
+ nameWithType: 'VS Code Insiders',
41
43
  bundleIdentifiers: ['com.microsoft.VSCodeInsiders'],
42
44
  applicationNames: ['Visual Studio Code - Insiders.app'],
43
45
  executable: 'Contents/Resources/app/bin/code-insiders',
@@ -46,7 +48,8 @@ const editorDefinitions = {
46
48
  ],
47
49
  linux: [
48
50
  {
49
- name: 'VS Code',
51
+ name: 'Code',
52
+ nameWithType: 'Code',
50
53
  paths: () => [
51
54
  '/usr/share/code/bin/code',
52
55
  '/snap/bin/code',
@@ -57,6 +60,7 @@ const editorDefinitions = {
57
60
  },
58
61
  {
59
62
  name: 'VS Code Insiders',
63
+ nameWithType: 'VS Code Insiders',
60
64
  paths: () => [
61
65
  '/snap/bin/code-insiders',
62
66
  '/usr/bin/code-insiders',
@@ -67,7 +71,8 @@ const editorDefinitions = {
67
71
  ],
68
72
  win32: [
69
73
  {
70
- name: 'VS Code',
74
+ name: 'Code',
75
+ nameWithType: 'Code',
71
76
  paths: (context) => getWindowsEnvironmentPaths(context, [
72
77
  'Microsoft VS Code',
73
78
  'Code.exe',
@@ -76,6 +81,7 @@ const editorDefinitions = {
76
81
  },
77
82
  {
78
83
  name: 'VS Code Insiders',
84
+ nameWithType: 'VS Code Insiders',
79
85
  paths: (context) => getWindowsEnvironmentPaths(context, [
80
86
  'Microsoft VS Code Insiders',
81
87
  'Code - Insiders.exe',
@@ -88,6 +94,7 @@ const editorDefinitions = {
88
94
  darwin: [
89
95
  {
90
96
  name: 'Cursor',
97
+ nameWithType: 'Cursor Editor',
91
98
  bundleIdentifiers: ['com.todesktop.230313mzl4w4u92'],
92
99
  applicationNames: ['Cursor.app'],
93
100
  executable: 'Contents/Resources/app/bin/cursor',
@@ -97,6 +104,7 @@ const editorDefinitions = {
97
104
  linux: [
98
105
  {
99
106
  name: 'Cursor',
107
+ nameWithType: 'Cursor Editor',
100
108
  paths: (context) => [
101
109
  '/usr/bin/cursor',
102
110
  '/usr/local/bin/cursor',
@@ -108,6 +116,7 @@ const editorDefinitions = {
108
116
  win32: [
109
117
  {
110
118
  name: 'Cursor',
119
+ nameWithType: 'Cursor Editor',
111
120
  paths: (context) => getWindowsEnvironmentPaths(context, ['cursor', 'Cursor.exe']),
112
121
  commands: ['Cursor.exe', 'cursor.cmd'],
113
122
  },
@@ -117,6 +126,7 @@ const editorDefinitions = {
117
126
  darwin: [
118
127
  {
119
128
  name: 'Windsurf',
129
+ nameWithType: 'Windsurf',
120
130
  bundleIdentifiers: ['com.exafunction.windsurf'],
121
131
  applicationNames: ['Windsurf.app'],
122
132
  executable: 'Contents/Resources/app/bin/windsurf',
@@ -126,6 +136,7 @@ const editorDefinitions = {
126
136
  linux: [
127
137
  {
128
138
  name: 'Windsurf',
139
+ nameWithType: 'Windsurf',
129
140
  paths: (context) => [
130
141
  '/usr/bin/windsurf',
131
142
  '/usr/local/bin/windsurf',
@@ -137,6 +148,7 @@ const editorDefinitions = {
137
148
  win32: [
138
149
  {
139
150
  name: 'Windsurf',
151
+ nameWithType: 'Windsurf',
140
152
  paths: (context) => getWindowsEnvironmentPaths(context, ['Windsurf', 'Windsurf.exe']),
141
153
  commands: ['Windsurf.exe', 'windsurf.cmd'],
142
154
  },
@@ -146,6 +158,7 @@ const editorDefinitions = {
146
158
  darwin: [
147
159
  {
148
160
  name: 'Zed',
161
+ nameWithType: 'Zed',
149
162
  bundleIdentifiers: ['dev.zed.Zed'],
150
163
  applicationNames: ['Zed.app'],
151
164
  executable: 'Contents/MacOS/cli',
@@ -153,6 +166,7 @@ const editorDefinitions = {
153
166
  },
154
167
  {
155
168
  name: 'Zed Preview',
169
+ nameWithType: 'Zed Preview',
156
170
  bundleIdentifiers: ['dev.zed.Zed-Preview'],
157
171
  applicationNames: ['Zed Preview.app'],
158
172
  executable: 'Contents/MacOS/cli',
@@ -162,6 +176,7 @@ const editorDefinitions = {
162
176
  linux: [
163
177
  {
164
178
  name: 'Zed',
179
+ nameWithType: 'Zed',
165
180
  paths: (context) => [
166
181
  '/usr/bin/zedit',
167
182
  '/usr/bin/zeditor',
@@ -175,6 +190,7 @@ const editorDefinitions = {
175
190
  win32: [
176
191
  {
177
192
  name: 'Zed',
193
+ nameWithType: 'Zed',
178
194
  paths: (context) => getWindowsEnvironmentPaths(context, ['Zed', 'Zed.exe']),
179
195
  commands: ['Zed.exe'],
180
196
  },
@@ -184,6 +200,7 @@ const editorDefinitions = {
184
200
  darwin: [
185
201
  {
186
202
  name: 'VSCodium',
203
+ nameWithType: 'VSCodium',
187
204
  bundleIdentifiers: ['com.vscodium', 'com.visualstudio.code.oss'],
188
205
  applicationNames: ['VSCodium.app'],
189
206
  executable: 'Contents/Resources/app/bin/codium',
@@ -193,6 +210,7 @@ const editorDefinitions = {
193
210
  linux: [
194
211
  {
195
212
  name: 'VSCodium',
213
+ nameWithType: 'VSCodium',
196
214
  paths: (context) => [
197
215
  '/usr/bin/codium',
198
216
  '/usr/share/vscodium-bin/bin/codium',
@@ -206,6 +224,7 @@ const editorDefinitions = {
206
224
  win32: [
207
225
  {
208
226
  name: 'VSCodium',
227
+ nameWithType: 'VSCodium',
209
228
  paths: (context) => getWindowsEnvironmentPaths(context, ['VSCodium', 'VSCodium.exe']),
210
229
  commands: ['VSCodium.exe', 'codium.cmd'],
211
230
  },
@@ -215,6 +234,7 @@ const editorDefinitions = {
215
234
  darwin: [
216
235
  {
217
236
  name: 'WebStorm',
237
+ nameWithType: 'WebStorm',
218
238
  bundleIdentifiers: ['com.jetbrains.WebStorm'],
219
239
  applicationNames: ['WebStorm.app'],
220
240
  executable: 'Contents/MacOS/webstorm',
@@ -224,6 +244,7 @@ const editorDefinitions = {
224
244
  linux: [
225
245
  {
226
246
  name: 'WebStorm',
247
+ nameWithType: 'WebStorm',
227
248
  paths: (context) => [
228
249
  '/snap/bin/webstorm',
229
250
  node_path_1.default.posix.join(context.homeDirectory, '.local/share/JetBrains/Toolbox/scripts/webstorm'),
@@ -234,6 +255,7 @@ const editorDefinitions = {
234
255
  win32: [
235
256
  {
236
257
  name: 'WebStorm',
258
+ nameWithType: 'WebStorm',
237
259
  paths: (context) => {
238
260
  const localAppData = context.env.LOCALAPPDATA;
239
261
  return localAppData
@@ -250,6 +272,7 @@ const editorDefinitions = {
250
272
  darwin: [
251
273
  {
252
274
  name: 'Sublime Text',
275
+ nameWithType: 'Sublime Text',
253
276
  bundleIdentifiers: [
254
277
  'com.sublimetext.4',
255
278
  'com.sublimetext.3',
@@ -267,6 +290,7 @@ const editorDefinitions = {
267
290
  linux: [
268
291
  {
269
292
  name: 'Sublime Text',
293
+ nameWithType: 'Sublime Text',
270
294
  paths: () => ['/usr/bin/subl', '/snap/bin/subl'],
271
295
  commands: ['subl'],
272
296
  },
@@ -274,6 +298,7 @@ const editorDefinitions = {
274
298
  win32: [
275
299
  {
276
300
  name: 'Sublime Text',
301
+ nameWithType: 'Sublime Text',
277
302
  paths: (context) => [
278
303
  ...getWindowsEnvironmentPaths(context, [
279
304
  'Sublime Text',
@@ -405,6 +430,7 @@ const findDarwinEditor = async ({ id, variants, context, }) => {
405
430
  return {
406
431
  id,
407
432
  name: variant.name,
433
+ nameWithType: variant.nameWithType,
408
434
  process: executablePath,
409
435
  command: variant.command,
410
436
  };
@@ -441,6 +467,7 @@ const findExecutableEditor = ({ id, variants, context, additionalPaths, }) => {
441
467
  return {
442
468
  id,
443
469
  name: variants[0].name,
470
+ nameWithType: variants[0].nameWithType,
444
471
  process: executablePath,
445
472
  command: executablePath,
446
473
  };
@@ -452,6 +479,7 @@ const findExecutableEditor = ({ id, variants, context, additionalPaths, }) => {
452
479
  return {
453
480
  id,
454
481
  name: variant.name,
482
+ nameWithType: variant.nameWithType,
455
483
  process: executablePath,
456
484
  command: executablePath,
457
485
  };
@@ -87,12 +87,12 @@ const displayNameForEditor = {
87
87
  '/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl': 'Sublime Text Dev',
88
88
  '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl': 'Sublime Text',
89
89
  '/Applications/WebStorm.app/Contents/MacOS/webstorm': 'WebStorm',
90
- '/Applications/Cursor.app/Contents/MacOS/Cursor': 'Cursor',
90
+ '/Applications/Cursor.app/Contents/MacOS/Cursor': 'Cursor Editor',
91
91
  '/Applications/Windsurf.app/Contents/MacOS/Windsurf': 'Windsurf',
92
92
  'Brackets.exe': 'Brackets',
93
93
  'Code - Insiders.exe': 'VS Code Insiders',
94
- 'Code.exe': 'VS Code',
95
- 'Cursor.exe': 'Cursor',
94
+ 'Code.exe': 'Code',
95
+ 'Cursor.exe': 'Cursor Editor',
96
96
  'Windsurf.exe': 'Windsurf',
97
97
  'Zed.exe': 'Zed',
98
98
  'VSCodium.exe': 'VS Codium',
@@ -118,8 +118,8 @@ const displayNameForEditor = {
118
118
  'webstorm64.exe': 'WebStorm',
119
119
  atom: 'Atom',
120
120
  brackets: 'Brackets',
121
- code: 'VS Code',
122
- cursor: 'Cursor',
121
+ code: 'Code',
122
+ cursor: 'Cursor Editor',
123
123
  windsurf: 'Windsurf',
124
124
  zed: 'Zed',
125
125
  zedit: 'Zed',
@@ -29,6 +29,9 @@ const getMemberExpressionKeyframeEasing = (name) => {
29
29
  if (name === 'linear') {
30
30
  return studio_shared_1.LINEAR_KEYFRAME_EASING;
31
31
  }
32
+ if (name === 'step1') {
33
+ return studio_shared_1.HOLD_KEYFRAME_EASING;
34
+ }
32
35
  if (name === 'ease') {
33
36
  return studio_shared_1.EASE_KEYFRAME_EASING;
34
37
  }
@@ -6,10 +6,12 @@ export type ResolvedEditor = (ProcessAndCommand & {
6
6
  type: 'built-in';
7
7
  id: BuiltInEditor | null;
8
8
  name: string;
9
+ nameWithType: string;
9
10
  }) | (ResolvedCustomEditorExecutable & {
10
11
  type: 'custom';
11
12
  id: 'custom';
12
13
  name: string;
14
+ nameWithType: string;
13
15
  editor: CustomEditor;
14
16
  });
15
17
  type ResolveEditorDependencies = {
@@ -19,7 +19,7 @@ const defaultDependencies = {
19
19
  warnedEditors,
20
20
  };
21
21
  const resolveEditor = async ({ defaultEditor, logLevel, preferredEditor, }, overrides = {}) => {
22
- var _a;
22
+ var _a, _b;
23
23
  const dependencies = {
24
24
  ...defaultDependencies,
25
25
  warn: (message) => {
@@ -40,6 +40,7 @@ const resolveEditor = async ({ defaultEditor, logLevel, preferredEditor, }, over
40
40
  type: 'custom',
41
41
  id: 'custom',
42
42
  name: defaultEditor.name,
43
+ nameWithType: defaultEditor.name,
43
44
  editor: defaultEditor,
44
45
  };
45
46
  }
@@ -56,6 +57,7 @@ const resolveEditor = async ({ defaultEditor, logLevel, preferredEditor, }, over
56
57
  type: 'custom',
57
58
  id: 'custom',
58
59
  name: defaultEditor.name,
60
+ nameWithType: defaultEditor.name,
59
61
  editor: defaultEditor,
60
62
  };
61
63
  }
@@ -85,6 +87,7 @@ const resolveEditor = async ({ defaultEditor, logLevel, preferredEditor, }, over
85
87
  type: 'built-in',
86
88
  id: null,
87
89
  name: (_a = (0, open_in_editor_1.getDisplayNameForEditor)(legacyEditor.command)) !== null && _a !== void 0 ? _a : legacyEditor.command,
90
+ nameWithType: (_b = (0, open_in_editor_1.getDisplayNameForEditor)(legacyEditor.command)) !== null && _b !== void 0 ? _b : legacyEditor.command,
88
91
  };
89
92
  };
90
93
  exports.resolveEditor = resolveEditor;
package/dist/index.d.ts CHANGED
@@ -36,7 +36,7 @@ export declare const StudioServerInternals: {
36
36
  forceNew: boolean;
37
37
  rspack: boolean;
38
38
  getStudioRuntimeConfig: () => import("@remotion/studio-shared").StudioRuntimeConfig;
39
- getDefaultCodingAgent: () => "claude-code" | "codex" | "cursor" | "github-copilot" | null;
39
+ getDefaultCodingAgent: () => "claude-code" | "codex" | "copilot" | "cursor" | null;
40
40
  getDefaultEditor: () => import("@remotion/renderer").DefaultEditor | null;
41
41
  configFile: string | null;
42
42
  }) => Promise<import("./start-studio").StartStudioResult>;
@@ -12,6 +12,7 @@ const batch_update_keyframe_settings_1 = require("./routes/batch-update-keyframe
12
12
  const cancel_render_1 = require("./routes/cancel-render");
13
13
  const composition_component_info_1 = require("./routes/composition-component-info");
14
14
  const convert_figma_clipboard_to_svg_1 = require("./routes/convert-figma-clipboard-to-svg");
15
+ const copy_render_output_to_asset_1 = require("./routes/copy-render-output-to-asset");
15
16
  const default_coding_agent_1 = require("./routes/default-coding-agent");
16
17
  const default_editor_1 = require("./routes/default-editor");
17
18
  const delete_effect_1 = require("./routes/delete-effect");
@@ -52,13 +53,14 @@ const unsubscribe_from_default_props_1 = require("./routes/unsubscribe-from-defa
52
53
  const unsubscribe_from_file_existence_1 = require("./routes/unsubscribe-from-file-existence");
53
54
  const unsubscribe_from_sequence_props_1 = require("./routes/unsubscribe-from-sequence-props");
54
55
  const update_available_1 = require("./routes/update-available");
56
+ const update_config_1 = require("./routes/update-config");
55
57
  const update_default_props_1 = require("./routes/update-default-props");
56
58
  const update_effect_keyframe_settings_1 = require("./routes/update-effect-keyframe-settings");
57
59
  const update_element_install_target_1 = require("./routes/update-element-install-target");
58
- const update_public_license_1 = require("./routes/update-public-license");
59
60
  const update_sequence_keyframe_settings_1 = require("./routes/update-sequence-keyframe-settings");
60
61
  exports.allApiRoutes = {
61
62
  '/api/composition-component-info': composition_component_info_1.compositionComponentInfoHandler,
63
+ '/api/copy-render-output-to-asset': copy_render_output_to_asset_1.copyRenderOutputToAssetHandler,
62
64
  '/api/convert-figma-clipboard-to-svg': convert_figma_clipboard_to_svg_1.convertFigmaClipboardToSvgHandler,
63
65
  '/api/cancel': cancel_render_1.handleCancelRender,
64
66
  '/api/render': add_render_1.handleAddRender,
@@ -68,6 +70,7 @@ exports.allApiRoutes = {
68
70
  '/api/find-in-file': find_in_file_1.findInFileHandler,
69
71
  '/api/open-in-file-explorer': open_in_file_explorer_1.handleOpenInFileExplorer,
70
72
  '/api/open-in-editor': open_in_editor_1.openInEditorHandler,
73
+ '/api/open-in-coding-agent': default_coding_agent_1.openInCodingAgentHandler,
71
74
  '/api/register-client-render': register_client_render_1.registerClientRenderHandler,
72
75
  '/api/unregister-client-render': unregister_client_render_1.unregisterClientRenderHandler,
73
76
  '/api/update-default-props': update_default_props_1.updateDefaultPropsHandler,
@@ -102,11 +105,9 @@ exports.allApiRoutes = {
102
105
  '/api/delete-static-file': delete_static_file_1.deleteStaticFileHandler,
103
106
  '/api/rename-static-file': rename_static_file_1.renameStaticFileHandler,
104
107
  '/api/restart-studio': restart_studio_1.handleRestartStudio,
105
- '/api/update-public-license': update_public_license_1.updatePublicLicenseHandler,
108
+ '/api/update-config': update_config_1.updateConfigHandler,
106
109
  '/api/default-coding-agent-info': default_coding_agent_1.getDefaultCodingAgentInfoHandler,
107
- '/api/update-default-coding-agent': default_coding_agent_1.updateDefaultCodingAgentHandler,
108
110
  '/api/default-editor-info': default_editor_1.getDefaultEditorInfoHandler,
109
- '/api/update-default-editor': default_editor_1.updateDefaultEditorHandler,
110
111
  '/api/install-package': install_dependency_1.handleInstallPackage,
111
112
  '/api/insert-jsx-element': insert_jsx_element_1.insertJsxElementHandler,
112
113
  '/api/insert-element': insert_element_1.insertElementHandler,
@@ -9,7 +9,7 @@ export declare const handleRequest: <Req, Res>({ remotionRoot, request, response
9
9
  entryPoint: string;
10
10
  binariesDirectory: string | null;
11
11
  configFile: string | null;
12
- getDefaultCodingAgent: () => "claude-code" | "codex" | "cursor" | "github-copilot" | null;
12
+ getDefaultCodingAgent: () => "claude-code" | "codex" | "copilot" | "cursor" | null;
13
13
  getDefaultEditor: () => DefaultEditor | null;
14
14
  handler: ApiHandler<Req, Res>;
15
15
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
@@ -59,6 +59,7 @@ const handleAddRender = ({ input, entryPoint, remotionRoot, logLevel, binariesDi
59
59
  offthreadVideoThreads: input.offthreadVideoThreads,
60
60
  mediaCacheSizeInBytes: input.mediaCacheSizeInBytes,
61
61
  sampleRate: input.sampleRate,
62
+ licenseKey: input.licenseKey,
62
63
  },
63
64
  logLevel,
64
65
  });
@@ -131,6 +132,7 @@ const handleAddRender = ({ input, entryPoint, remotionRoot, logLevel, binariesDi
131
132
  chromeMode: input.chromeMode,
132
133
  offthreadVideoThreads: input.offthreadVideoThreads,
133
134
  mediaCacheSizeInBytes: input.mediaCacheSizeInBytes,
135
+ licenseKey: input.licenseKey,
134
136
  },
135
137
  entryPoint,
136
138
  remotionRoot,
@@ -51,6 +51,10 @@ const video_config_values_1 = require("../../helpers/video-config-values");
51
51
  const jsx_component_identity_1 = require("../jsx-component-identity");
52
52
  const jsx_element_not_found_at_location_error_1 = require("../jsx-element-not-found-at-location-error");
53
53
  const can_update_effect_props_1 = require("./can-update-effect-props");
54
+ // A file write synchronously notifies every sequence subscription. Status
55
+ // computation is read-only, so all subscribers can share one parsed snapshot
56
+ // until the notification burst has finished.
57
+ let cachedSequencePropsStatusAst = null;
54
58
  const staticStatus = (codeValue, numericExpression) => ({
55
59
  status: 'static',
56
60
  codeValue,
@@ -921,11 +925,30 @@ const computeSequenceOnlyPropsRecord = ({ jsxElement, jsxElementNode, ast, keys,
921
925
  };
922
926
  const computeSequencePropsStatusFromContent = ({ fileContents, nodePath, componentIdentity, keys, assetKeys = [], effects, videoConfigValues, }) => {
923
927
  var _a;
924
- const ast = (0, parse_ast_1.parseAst)(fileContents);
925
- const videoConfigIdentifierValues = (0, video_config_values_1.getVideoConfigIdentifierValues)({
926
- ast,
927
- videoConfigValues,
928
- });
928
+ if ((cachedSequencePropsStatusAst === null || cachedSequencePropsStatusAst === void 0 ? void 0 : cachedSequencePropsStatusAst.fileContents) !== fileContents) {
929
+ cachedSequencePropsStatusAst = null;
930
+ const snapshot = {
931
+ fileContents,
932
+ ast: (0, parse_ast_1.parseAst)(fileContents),
933
+ videoConfigIdentifierValues: new Map(),
934
+ };
935
+ cachedSequencePropsStatusAst = snapshot;
936
+ queueMicrotask(() => {
937
+ if (cachedSequencePropsStatusAst === snapshot) {
938
+ cachedSequencePropsStatusAst = null;
939
+ }
940
+ });
941
+ }
942
+ const { ast } = cachedSequencePropsStatusAst;
943
+ const videoConfigCacheKey = JSON.stringify(videoConfigValues);
944
+ let videoConfigIdentifierValues = cachedSequencePropsStatusAst.videoConfigIdentifierValues.get(videoConfigCacheKey);
945
+ if (videoConfigIdentifierValues === undefined) {
946
+ videoConfigIdentifierValues = (0, video_config_values_1.getVideoConfigIdentifierValues)({
947
+ ast,
948
+ videoConfigValues,
949
+ });
950
+ cachedSequencePropsStatusAst.videoConfigIdentifierValues.set(videoConfigCacheKey, videoConfigIdentifierValues);
951
+ }
929
952
  const jsxElementNode = (0, exports.findJsxElementNodeAtNodePath)(ast, nodePath);
930
953
  const jsxElement = (_a = jsxElementNode === null || jsxElementNode === void 0 ? void 0 : jsxElementNode.openingElement) !== null && _a !== void 0 ? _a : null;
931
954
  if (!jsxElement || !jsxElementNode) {
@@ -0,0 +1,3 @@
1
+ import type { CopyRenderOutputToAssetRequest, CopyRenderOutputToAssetResponse } from '@remotion/studio-shared';
2
+ import type { ApiHandler } from '../api-types';
3
+ export declare const copyRenderOutputToAssetHandler: ApiHandler<CopyRenderOutputToAssetRequest, CopyRenderOutputToAssetResponse>;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.copyRenderOutputToAssetHandler = void 0;
7
+ const node_fs_1 = require("node:fs");
8
+ const promises_1 = require("node:fs/promises");
9
+ const node_path_1 = __importDefault(require("node:path"));
10
+ const resolve_output_path_1 = require("../../helpers/resolve-output-path");
11
+ const copyRenderOutputToAssetHandler = async ({ input: { assetPath, outputPath }, publicDir, remotionRoot }) => {
12
+ if (assetPath.length === 0) {
13
+ throw new Error('Asset path cannot be empty');
14
+ }
15
+ const source = (0, resolve_output_path_1.resolveOutputPath)(remotionRoot, outputPath);
16
+ const destination = node_path_1.default.join(publicDir, assetPath);
17
+ const relativeToPublicDir = node_path_1.default.relative(publicDir, destination);
18
+ if (relativeToPublicDir.startsWith('..') ||
19
+ node_path_1.default.isAbsolute(relativeToPublicDir)) {
20
+ throw new Error(`Not allowed to write to ${relativeToPublicDir}`);
21
+ }
22
+ if (!(0, node_fs_1.existsSync)(source)) {
23
+ throw new Error(`${outputPath} does not exist`);
24
+ }
25
+ const sourceStat = (0, node_fs_1.statSync)(source);
26
+ if (!sourceStat.isFile()) {
27
+ throw new Error(`${outputPath} is not a file`);
28
+ }
29
+ if (source === destination) {
30
+ return { created: false };
31
+ }
32
+ if ((0, node_fs_1.existsSync)(destination)) {
33
+ const destinationStat = (0, node_fs_1.statSync)(destination);
34
+ if (!destinationStat.isFile() || destinationStat.size !== sourceStat.size) {
35
+ throw new Error(`File with name ${assetPath} already exists and is different`);
36
+ }
37
+ return { created: false };
38
+ }
39
+ (0, node_fs_1.mkdirSync)(node_path_1.default.dirname(destination), { recursive: true });
40
+ try {
41
+ await (0, promises_1.copyFile)(source, destination, node_fs_1.constants.COPYFILE_EXCL);
42
+ return { created: true };
43
+ }
44
+ catch (error) {
45
+ if (error instanceof Error &&
46
+ 'code' in error &&
47
+ error.code === 'EEXIST' &&
48
+ (0, node_fs_1.existsSync)(destination)) {
49
+ const destinationStat = (0, node_fs_1.statSync)(destination);
50
+ if (destinationStat.isFile() &&
51
+ destinationStat.size === sourceStat.size) {
52
+ return { created: false };
53
+ }
54
+ }
55
+ throw error;
56
+ }
57
+ };
58
+ exports.copyRenderOutputToAssetHandler = copyRenderOutputToAssetHandler;
@@ -1,8 +1,4 @@
1
- import type { GetDefaultCodingAgentInfoRequest, GetDefaultCodingAgentInfoResponse, UpdateDefaultCodingAgentRequest, UpdateDefaultCodingAgentResponse } from '@remotion/studio-shared';
1
+ import type { GetDefaultCodingAgentInfoRequest, GetDefaultCodingAgentInfoResponse, OpenInCodingAgentRequest, OpenInCodingAgentResponse } from '@remotion/studio-shared';
2
2
  import type { ApiHandler } from '../api-types';
3
- export declare const updateDefaultCodingAgentInConfig: ({ configContents, defaultCodingAgent, }: {
4
- configContents: string;
5
- defaultCodingAgent: "claude-code" | "codex" | "cursor" | "github-copilot" | null;
6
- }) => string;
7
3
  export declare const getDefaultCodingAgentInfoHandler: ApiHandler<GetDefaultCodingAgentInfoRequest, GetDefaultCodingAgentInfoResponse>;
8
- export declare const updateDefaultCodingAgentHandler: ApiHandler<UpdateDefaultCodingAgentRequest, UpdateDefaultCodingAgentResponse>;
4
+ export declare const openInCodingAgentHandler: ApiHandler<OpenInCodingAgentRequest, OpenInCodingAgentResponse>;
@@ -1,103 +1,32 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.updateDefaultCodingAgentHandler = exports.getDefaultCodingAgentInfoHandler = exports.updateDefaultCodingAgentInConfig = void 0;
37
- const node_fs_1 = require("node:fs");
38
- const renderer_1 = require("@remotion/renderer");
39
- const recast = __importStar(require("recast"));
40
- const parse_ast_1 = require("../../codemods/parse-ast");
41
- const file_watcher_1 = require("../../file-watcher");
3
+ exports.openInCodingAgentHandler = exports.getDefaultCodingAgentInfoHandler = void 0;
42
4
  const coding_agent_registry_1 = require("../../helpers/coding-agent-registry");
43
- const updateDefaultCodingAgentInConfig = ({ configContents, defaultCodingAgent, }) => {
44
- const ast = (0, parse_ast_1.parseAst)(configContents);
45
- recast.types.visit(ast.program, {
46
- visitExpressionStatement(path) {
47
- const { expression } = path.node;
48
- if (expression.type === 'CallExpression' &&
49
- expression.callee.type === 'MemberExpression' &&
50
- !expression.callee.computed &&
51
- expression.callee.object.type === 'Identifier' &&
52
- expression.callee.object.name === 'Config' &&
53
- expression.callee.property.type === 'Identifier' &&
54
- expression.callee.property.name === 'setDefaultCodingAgent') {
55
- path.prune();
56
- return false;
57
- }
58
- this.traverse(path);
59
- },
60
- });
61
- const configWithoutExistingCalls = recast.print(ast, {
62
- lineTerminator: '\n',
63
- }).code;
64
- if (defaultCodingAgent === null) {
65
- return configWithoutExistingCalls;
66
- }
67
- const separator = configWithoutExistingCalls.endsWith('\n') ? '' : '\n';
68
- return `${configWithoutExistingCalls}${separator}Config.setDefaultCodingAgent('${defaultCodingAgent}');\n`;
69
- };
70
- exports.updateDefaultCodingAgentInConfig = updateDefaultCodingAgentInConfig;
71
5
  const getDefaultCodingAgentInfoHandler = async ({ getDefaultCodingAgent }) => {
72
6
  const installedCodingAgents = await (0, coding_agent_registry_1.getAvailableCodingAgents)();
73
7
  return {
74
8
  defaultCodingAgent: getDefaultCodingAgent(),
75
- installedCodingAgents: installedCodingAgents.map(({ id, name }) => ({
9
+ installedCodingAgents: installedCodingAgents.map(({ iconDataUrl, id, name, nameWithType }) => ({
10
+ iconDataUrl,
76
11
  id,
77
12
  name,
13
+ nameWithType,
78
14
  })),
79
15
  };
80
16
  };
81
17
  exports.getDefaultCodingAgentInfoHandler = getDefaultCodingAgentInfoHandler;
82
- const updateDefaultCodingAgentHandler = ({ input, configFile }) => {
83
- if (configFile === null || configFile === undefined) {
84
- return Promise.resolve({
85
- success: false,
86
- reason: 'No Remotion config file was loaded.',
87
- });
88
- }
89
- if (input.defaultCodingAgent !== null &&
90
- !renderer_1.defaultCodingAgentIds.includes(input.defaultCodingAgent)) {
91
- return Promise.resolve({
92
- success: false,
93
- reason: `Unknown coding agent: ${input.defaultCodingAgent}`,
94
- });
18
+ const openInCodingAgentHandler = async ({ input, logLevel, remotionRoot }) => {
19
+ const codingAgent = (await (0, coding_agent_registry_1.getAvailableCodingAgents)()).find((agent) => agent.id === input.codingAgentId);
20
+ if (!codingAgent) {
21
+ return { success: false };
95
22
  }
96
- const configContents = (0, node_fs_1.readFileSync)(configFile, 'utf8');
97
- (0, file_watcher_1.writeFileAndNotifyFileWatchers)(configFile, (0, exports.updateDefaultCodingAgentInConfig)({
98
- configContents,
99
- defaultCodingAgent: input.defaultCodingAgent,
100
- }), undefined);
101
- return Promise.resolve({ success: true });
23
+ return {
24
+ success: await (0, coding_agent_registry_1.launchCodingAgent)({
25
+ codingAgent,
26
+ projectPath: remotionRoot,
27
+ logLevel,
28
+ prompt: input.prompt,
29
+ }),
30
+ };
102
31
  };
103
- exports.updateDefaultCodingAgentHandler = updateDefaultCodingAgentHandler;
32
+ exports.openInCodingAgentHandler = openInCodingAgentHandler;
@@ -1,8 +1,3 @@
1
- import type { GetDefaultEditorInfoRequest, GetDefaultEditorInfoResponse, UpdateDefaultEditorRequest, UpdateDefaultEditorResponse } from '@remotion/studio-shared';
1
+ import type { GetDefaultEditorInfoRequest, GetDefaultEditorInfoResponse } from '@remotion/studio-shared';
2
2
  import type { ApiHandler } from '../api-types';
3
- export declare const updateDefaultEditorInConfig: ({ configContents, defaultEditor, }: {
4
- configContents: string;
5
- defaultEditor: "cursor" | "sublime-text" | "vscode" | "vscodium" | "webstorm" | "windsurf" | "zed" | null;
6
- }) => string;
7
3
  export declare const getDefaultEditorInfoHandler: ApiHandler<GetDefaultEditorInfoRequest, GetDefaultEditorInfoResponse>;
8
- export declare const updateDefaultEditorHandler: ApiHandler<UpdateDefaultEditorRequest, UpdateDefaultEditorResponse>;