@remotion/studio-server 4.0.532 → 4.0.534

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 (46) hide show
  1. package/dist/detect-outdated-remotion-skills.d.ts +4 -0
  2. package/dist/detect-outdated-remotion-skills.js +3 -2
  3. package/dist/helpers/coding-agent-registry.d.ts +1 -0
  4. package/dist/helpers/coding-agent-registry.js +30 -6
  5. package/dist/helpers/editor-registry.d.ts +1 -0
  6. package/dist/helpers/editor-registry.js +24 -1
  7. package/dist/helpers/open-in-editor.d.ts +1 -1
  8. package/dist/helpers/open-in-editor.js +65 -83
  9. package/dist/helpers/running-processes.d.ts +12 -0
  10. package/dist/helpers/running-processes.js +88 -0
  11. package/dist/helpers/video-config-numeric-expression.js +29 -20
  12. package/dist/helpers/video-config-values.d.ts +6 -3
  13. package/dist/helpers/video-config-values.js +42 -26
  14. package/dist/preview-server/api-routes.js +4 -0
  15. package/dist/preview-server/file-existence-watchers.js +11 -6
  16. package/dist/preview-server/routes/add-sequence-keyframe.js +0 -1
  17. package/dist/preview-server/routes/can-update-effect-props.d.ts +4 -6
  18. package/dist/preview-server/routes/can-update-effect-props.js +5 -28
  19. package/dist/preview-server/routes/can-update-sequence-props.d.ts +6 -8
  20. package/dist/preview-server/routes/can-update-sequence-props.js +11 -12
  21. package/dist/preview-server/routes/default-coding-agent.js +2 -0
  22. package/dist/preview-server/routes/default-editor.js +5 -1
  23. package/dist/preview-server/routes/delete-keyframes.d.ts +2 -2
  24. package/dist/preview-server/routes/delete-keyframes.js +0 -1
  25. package/dist/preview-server/routes/find-in-file.js +7 -2
  26. package/dist/preview-server/routes/insert-element.js +17 -7
  27. package/dist/preview-server/routes/install-remotion-skill.d.ts +2 -1
  28. package/dist/preview-server/routes/install-remotion-skill.js +87 -56
  29. package/dist/preview-server/routes/open-in-editor.js +1 -1
  30. package/dist/preview-server/routes/remotion-skills-info.d.ts +2 -1
  31. package/dist/preview-server/routes/remotion-skills-info.js +57 -3
  32. package/dist/preview-server/routes/reorder-sequence.js +6 -3
  33. package/dist/preview-server/routes/save-sequence-props.js +0 -1
  34. package/dist/preview-server/routes/shared-memory-capture-support.d.ts +3 -0
  35. package/dist/preview-server/routes/shared-memory-capture-support.js +13 -0
  36. package/dist/preview-server/routes/split-sequences.js +2 -1
  37. package/dist/preview-server/routes/subscribe-to-sequence-props.js +1 -2
  38. package/dist/preview-server/routes/unsubscribe-from-sequence-props.js +0 -1
  39. package/dist/preview-server/routes/update-sequence-keyframe-settings.js +0 -1
  40. package/dist/preview-server/routes/wrap-node.js +13 -4
  41. package/dist/preview-server/sequence-props-watchers.d.ts +3 -5
  42. package/dist/preview-server/sequence-props-watchers.js +9 -17
  43. package/dist/preview-server/update-available.js +17 -0
  44. package/dist/routes.js +3 -1
  45. package/dist/start-studio.js +7 -3
  46. package/package.json +8 -8
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeRemotionSkillHandler = exports.installRemotionSkillHandler = void 0;
3
+ exports.upgradeRemotionSkillHandler = exports.removeRemotionSkillHandler = exports.installRemotionSkillHandler = void 0;
4
4
  const node_child_process_1 = require("node:child_process");
5
5
  const renderer_1 = require("@remotion/renderer");
6
6
  const package_manager_spawn_options_1 = require("../../helpers/package-manager-spawn-options");
@@ -13,19 +13,28 @@ const changeRemotionSkill = async ({ action, remotionRoot, input: { skill }, log
13
13
  throw new Error(`Unknown Remotion skill: ${JSON.stringify(skill)}`);
14
14
  }
15
15
  if (changingSkillsInProjects.has(remotionRoot)) {
16
- throw new Error('A skill is already being installed or removed. Please try again once it finishes.');
16
+ throw new Error('A skill is already being installed, upgraded, or removed. Please try again once it finishes.');
17
17
  }
18
18
  changingSkillsInProjects.add(remotionRoot);
19
19
  try {
20
- const installedSkill = (0, remotion_skills_info_1.getRemotionSkillsInfo)({ remotionRoot }).skills.find(({ name }) => name === skill);
20
+ const currentInfo = (0, remotion_skills_info_1.getRemotionSkillsInfo)({ remotionRoot });
21
+ const installedSkill = currentInfo.skills.find(({ name }) => name === skill);
21
22
  const removingGlobally = action === 'remove' &&
22
23
  (installedSkill === null || installedSkill === void 0 ? void 0 : installedSkill.installedInProject) === false &&
23
24
  installedSkill.installedGlobally;
24
- if (action === 'remove' &&
25
- !removingGlobally &&
26
- !(installedSkill === null || installedSkill === void 0 ? void 0 : installedSkill.installedInProject)) {
25
+ if (action !== 'install' &&
26
+ !(installedSkill === null || installedSkill === void 0 ? void 0 : installedSkill.installedInProject) &&
27
+ !(installedSkill === null || installedSkill === void 0 ? void 0 : installedSkill.installedGlobally)) {
27
28
  throw new Error(`${skill} is not installed.`);
28
29
  }
30
+ const scopes = action === 'upgrade'
31
+ ? currentInfo.installations
32
+ .filter((installation) => installation.name === skill && installation.outdated)
33
+ .map(({ scope }) => scope)
34
+ : [removingGlobally ? 'global' : 'project'];
35
+ if (scopes.length === 0) {
36
+ throw new Error(`${skill} is already up to date.`);
37
+ }
29
38
  const packageManager = (0, get_package_manager_1.getPackageManager)({
30
39
  remotionRoot,
31
40
  packageManager: undefined,
@@ -38,61 +47,79 @@ const changeRemotionSkill = async ({ action, remotionRoot, input: { skill }, log
38
47
  : process.platform === 'win32'
39
48
  ? 'npx.cmd'
40
49
  : 'npx';
41
- const commandArgs = action === 'install'
42
- ? ['add', `remotion-dev/skills@${skill}`, '--yes']
43
- : ['remove', ...(removingGlobally ? ['--global'] : []), skill, '--yes'];
44
- const args = useBunx
45
- ? ['--silent', 'skills@1.5.26', ...commandArgs]
46
- : ['--yes', '--loglevel=error', 'skills@1.5.26', ...commandArgs];
47
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, renderer_1.RenderInternals.chalk.gray(`╭─ ${executable} ${args.join(' ')}`));
48
- const time = Date.now();
49
- try {
50
- await new Promise((resolve, reject) => {
51
- const child = (0, node_child_process_1.spawn)(executable, args, {
52
- cwd: remotionRoot,
53
- env: { ...process.env, DISABLE_TELEMETRY: '1' },
54
- stdio: ['ignore', 'pipe', 'pipe'],
55
- ...(0, package_manager_spawn_options_1.getPackageManagerSpawnOptions)(),
50
+ for (const scope of scopes) {
51
+ const commandArgs = action === 'remove'
52
+ ? [
53
+ 'remove',
54
+ ...(scope === 'global' ? ['--global'] : []),
55
+ skill,
56
+ '--yes',
57
+ ]
58
+ : [
59
+ 'add',
60
+ `remotion-dev/skills@${skill}`,
61
+ ...(scope === 'global' ? ['--global'] : []),
62
+ '--yes',
63
+ ];
64
+ const args = useBunx
65
+ ? ['--silent', 'skills@1.7.0', ...commandArgs]
66
+ : ['--yes', '--loglevel=error', 'skills@1.7.0', ...commandArgs];
67
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, renderer_1.RenderInternals.chalk.gray(`╭─ ${executable} ${args.join(' ')}`));
68
+ const time = Date.now();
69
+ try {
70
+ await new Promise((resolve, reject) => {
71
+ const child = (0, node_child_process_1.spawn)(executable, args, {
72
+ cwd: remotionRoot,
73
+ env: { ...process.env, DISABLE_TELEMETRY: '1' },
74
+ stdio: ['ignore', 'pipe', 'pipe'],
75
+ ...(0, package_manager_spawn_options_1.getPackageManagerSpawnOptions)(),
76
+ });
77
+ let output = '';
78
+ const onData = (data) => {
79
+ output = (output + data.toString()).slice(-8000);
80
+ data
81
+ .toString()
82
+ .trim()
83
+ .split('\n')
84
+ .forEach((line) => renderer_1.RenderInternals.Log.info({ indent: true, logLevel }, line));
85
+ };
86
+ child.stdout.on('data', onData);
87
+ child.stderr.on('data', onData);
88
+ child.on('error', reject);
89
+ child.on('close', (code, signal) => {
90
+ if (code === 0) {
91
+ resolve();
92
+ }
93
+ else {
94
+ reject(new Error(`Could not ${action} ${skill} (exit code ${code}, signal ${signal}). ${output.trim()}`));
95
+ }
96
+ });
56
97
  });
57
- let output = '';
58
- const onData = (data) => {
59
- output = (output + data.toString()).slice(-8000);
60
- data
61
- .toString()
62
- .trim()
63
- .split('\n')
64
- .forEach((line) => renderer_1.RenderInternals.Log.info({ indent: true, logLevel }, line));
65
- };
66
- child.stdout.on('data', onData);
67
- child.stderr.on('data', onData);
68
- child.on('error', reject);
69
- child.on('close', (code, signal) => {
70
- if (code === 0) {
71
- resolve();
72
- }
73
- else {
74
- reject(new Error(`Could not ${action} ${skill} (exit code ${code}, signal ${signal}). ${output.trim()}`));
98
+ const info = (0, remotion_skills_info_1.getRemotionSkillsInfo)({ remotionRoot });
99
+ const updatedSkill = info.skills.find(({ name }) => name === skill);
100
+ if (action === 'install' && !(updatedSkill === null || updatedSkill === void 0 ? void 0 : updatedSkill.installedInProject)) {
101
+ throw new Error(`The installer finished, but ${skill} was not found in the project. Please try again.`);
102
+ }
103
+ if (action === 'upgrade') {
104
+ const upgradedInstallation = info.installations.find((installation) => installation.name === skill && installation.scope === scope);
105
+ if (!upgradedInstallation || upgradedInstallation.outdated) {
106
+ throw new Error(`The installer finished, but ${skill} ${scope === 'global' ? 'globally' : 'in the project'} is still out of date. Please try again.`);
75
107
  }
76
- });
77
- });
78
- const info = (0, remotion_skills_info_1.getRemotionSkillsInfo)({ remotionRoot });
79
- const updatedSkill = info.skills.find(({ name }) => name === skill);
80
- if (action === 'install' && !(updatedSkill === null || updatedSkill === void 0 ? void 0 : updatedSkill.installedInProject)) {
81
- throw new Error(`The installer finished, but ${skill} was not found in the project. Please try again.`);
108
+ }
109
+ if (action === 'remove' &&
110
+ (removingGlobally
111
+ ? updatedSkill === null || updatedSkill === void 0 ? void 0 : updatedSkill.installedGlobally
112
+ : updatedSkill === null || updatedSkill === void 0 ? void 0 : updatedSkill.installedInProject)) {
113
+ throw new Error(`The remover finished, but ${skill} is still installed ${removingGlobally ? 'globally' : 'in the project'}. Please try again.`);
114
+ }
115
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, renderer_1.RenderInternals.chalk.gray('╰─ '), `Done in ${Date.now() - time}ms`);
82
116
  }
83
- if (action === 'remove' &&
84
- (removingGlobally
85
- ? updatedSkill === null || updatedSkill === void 0 ? void 0 : updatedSkill.installedGlobally
86
- : updatedSkill === null || updatedSkill === void 0 ? void 0 : updatedSkill.installedInProject)) {
87
- throw new Error(`The remover finished, but ${skill} is still installed ${removingGlobally ? 'globally' : 'in the project'}. Please try again.`);
117
+ catch (error) {
118
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, renderer_1.RenderInternals.chalk.gray('╰─ '), renderer_1.RenderInternals.chalk.red(`Errored in ${Date.now() - time}ms`));
119
+ throw error;
88
120
  }
89
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, renderer_1.RenderInternals.chalk.gray('╰─ '), `Done in ${Date.now() - time}ms`);
90
- return info;
91
- }
92
- catch (error) {
93
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, renderer_1.RenderInternals.chalk.gray('╰─ '), renderer_1.RenderInternals.chalk.red(`Errored in ${Date.now() - time}ms`));
94
- throw error;
95
121
  }
122
+ return (0, remotion_skills_info_1.getRemotionSkillsInfo)({ remotionRoot });
96
123
  }
97
124
  finally {
98
125
  changingSkillsInProjects.delete(remotionRoot);
@@ -106,3 +133,7 @@ const removeRemotionSkillHandler = (input) => {
106
133
  return changeRemotionSkill({ ...input, action: 'remove' });
107
134
  };
108
135
  exports.removeRemotionSkillHandler = removeRemotionSkillHandler;
136
+ const upgradeRemotionSkillHandler = (input) => {
137
+ return changeRemotionSkill({ ...input, action: 'upgrade' });
138
+ };
139
+ exports.upgradeRemotionSkillHandler = upgradeRemotionSkillHandler;
@@ -56,7 +56,7 @@ const openInEditorHandler = async ({ input, remotionRoot, logLevel, getDefaultEd
56
56
  lineNumber: stack.originalLineNumber,
57
57
  vsCodeNewWindow: false,
58
58
  logLevel,
59
- });
59
+ }, remotionRoot);
60
60
  return {
61
61
  success: didOpen,
62
62
  };
@@ -1,7 +1,8 @@
1
- import type { GetRemotionSkillsInfoRequest, GetRemotionSkillsInfoResponse } from '@remotion/studio-shared';
1
+ import type { GetRemotionSkillsInfoRequest, GetRemotionSkillsInfoResponse, OpenRemotionSkillRequest } from '@remotion/studio-shared';
2
2
  import type { ApiHandler } from '../api-types';
3
3
  export declare const getRemotionSkillsInfo: ({ remotionRoot, homeDirectory, }: {
4
4
  remotionRoot: string;
5
5
  homeDirectory?: string | undefined;
6
6
  }) => GetRemotionSkillsInfoResponse;
7
7
  export declare const remotionSkillsInfoHandler: ApiHandler<GetRemotionSkillsInfoRequest, GetRemotionSkillsInfoResponse>;
8
+ export declare const openRemotionSkillHandler: ApiHandler<OpenRemotionSkillRequest, void>;
@@ -3,32 +3,86 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.remotionSkillsInfoHandler = exports.getRemotionSkillsInfo = void 0;
6
+ exports.openRemotionSkillHandler = exports.remotionSkillsInfoHandler = exports.getRemotionSkillsInfo = void 0;
7
7
  const node_fs_1 = require("node:fs");
8
8
  const node_os_1 = require("node:os");
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
+ const version_1 = require("remotion/version");
11
+ const semver_1 = __importDefault(require("semver"));
10
12
  const detect_outdated_remotion_skills_1 = require("../../detect-outdated-remotion-skills");
13
+ const open_directory_in_finder_1 = require("../../open-directory-in-finder");
11
14
  const remotion_skill_names_1 = require("../../remotion-skill-names");
12
15
  const getRemotionSkillsInfo = ({ remotionRoot, homeDirectory = (0, node_os_1.homedir)(), }) => {
16
+ var _a;
13
17
  const skillsDirectories = (0, detect_outdated_remotion_skills_1.getRemotionSkillsDirectories)({
14
18
  cwd: remotionRoot,
15
19
  homeDirectory,
16
20
  });
21
+ const installations = remotion_skill_names_1.remotionSkillNames.flatMap((name) => {
22
+ return ['project', 'global'].flatMap((scope) => {
23
+ const { installed, version } = (0, detect_outdated_remotion_skills_1.readRemotionSkill)(node_path_1.default.join(skillsDirectories[scope], name, 'SKILL.md'));
24
+ if (!installed) {
25
+ return [];
26
+ }
27
+ return [
28
+ {
29
+ name,
30
+ scope,
31
+ version,
32
+ outdated: version === null ||
33
+ semver_1.default.valid(version) === null ||
34
+ semver_1.default.lt(version, version_1.VERSION),
35
+ },
36
+ ];
37
+ });
38
+ });
17
39
  const skills = remotion_skill_names_1.remotionSkillNames.map((name) => ({
18
40
  name,
19
- installedInProject: (0, node_fs_1.existsSync)(node_path_1.default.join(skillsDirectories.project, name, 'SKILL.md')),
20
- installedGlobally: (0, node_fs_1.existsSync)(node_path_1.default.join(skillsDirectories.global, name, 'SKILL.md')),
41
+ installedInProject: installations.some((installation) => installation.name === name && installation.scope === 'project'),
42
+ installedGlobally: installations.some((installation) => installation.name === name && installation.scope === 'global'),
21
43
  }));
22
44
  const isSkillAvailable = (skillName) => {
23
45
  const skill = skills.find(({ name }) => name === skillName);
24
46
  return Boolean((skill === null || skill === void 0 ? void 0 : skill.installedInProject) || (skill === null || skill === void 0 ? void 0 : skill.installedGlobally));
25
47
  };
48
+ const restartSkillDirectories = [skillsDirectories.global];
49
+ let directory = node_path_1.default.resolve(remotionRoot);
50
+ while (true) {
51
+ restartSkillDirectories.push(node_path_1.default.join(directory, '.agents', 'skills'));
52
+ const parent = node_path_1.default.dirname(directory);
53
+ if (parent === directory || (0, node_fs_1.existsSync)(node_path_1.default.join(directory, '.git'))) {
54
+ break;
55
+ }
56
+ directory = parent;
57
+ }
58
+ const studioRestartSkill = (_a = ['remotion-studio', 'remotion-best-practices'].find((name) => restartSkillDirectories.some((skillsDirectory) => (0, node_fs_1.existsSync)(node_path_1.default.join(skillsDirectory, name, 'SKILL.md'))))) !== null && _a !== void 0 ? _a : null;
26
59
  return {
60
+ studioServerStartedByAgent: Boolean(process.env.CURSOR_AGENT || process.env.CLAUDECODE === '1'),
61
+ studioRestartSkill,
27
62
  remotionUpgradeSkillAvailable: isSkillAvailable('remotion-upgrade'),
28
63
  remotionInteractivitySkillAvailable: isSkillAvailable('remotion-interactivity'),
64
+ installations,
29
65
  skills,
30
66
  };
31
67
  };
32
68
  exports.getRemotionSkillsInfo = getRemotionSkillsInfo;
33
69
  const remotionSkillsInfoHandler = ({ remotionRoot }) => Promise.resolve((0, exports.getRemotionSkillsInfo)({ remotionRoot }));
34
70
  exports.remotionSkillsInfoHandler = remotionSkillsInfoHandler;
71
+ const openRemotionSkillHandler = ({ remotionRoot, input: { skill, scope } }) => {
72
+ if (!remotion_skill_names_1.remotionSkillNames.some((name) => name === skill)) {
73
+ throw new Error(`Unknown Remotion skill: ${JSON.stringify(skill)}`);
74
+ }
75
+ if (scope !== 'project' && scope !== 'global') {
76
+ throw new Error(`Unknown skill scope: ${JSON.stringify(scope)}`);
77
+ }
78
+ const directories = (0, detect_outdated_remotion_skills_1.getRemotionSkillsDirectories)({
79
+ cwd: remotionRoot,
80
+ homeDirectory: (0, node_os_1.homedir)(),
81
+ });
82
+ const skillDirectory = node_path_1.default.join(directories[scope], skill);
83
+ if (!(0, node_fs_1.existsSync)(node_path_1.default.join(skillDirectory, 'SKILL.md'))) {
84
+ throw new Error(`${skill} is not installed ${scope === 'global' ? 'globally' : 'in the project'}.`);
85
+ }
86
+ return (0, open_directory_in_finder_1.openDirectoryInFinder)(skillDirectory, directories[scope]);
87
+ };
88
+ exports.openRemotionSkillHandler = openRemotionSkillHandler;
@@ -11,7 +11,7 @@ const sequence_node_path_mutation_1 = require("../sequence-node-path-mutation");
11
11
  const undo_stack_1 = require("../undo-stack");
12
12
  const formatting_1 = require("./log-updates/formatting");
13
13
  const source_file_write_queue_1 = require("./source-file-write-queue");
14
- const reorderSequenceHandler = ({ input: { fileName, sourceNodePath, targetNodePath, position, clientId }, remotionRoot, logLevel, }) => {
14
+ const reorderSequenceHandler = ({ input: { fileName, sourceNodePaths, targetNodePath, position, clientId }, remotionRoot, logLevel, }) => {
15
15
  return (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
16
16
  var _a;
17
17
  var _b;
@@ -23,9 +23,12 @@ const reorderSequenceHandler = ({ input: { fileName, sourceNodePath, targetNodeP
23
23
  action: 'modify',
24
24
  });
25
25
  const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
26
- const result = await (0, codemods_1.reorderNode)({
26
+ const result = await (0, codemods_1.reorderNodes)({
27
27
  project: { files: { [absolutePath]: fileContents }, rootDir: remotionRoot },
28
- node: { filePath: absolutePath, nodePath: sourceNodePath.nodePath },
28
+ nodes: sourceNodePaths.map((sourceNodePath) => ({
29
+ filePath: absolutePath,
30
+ nodePath: sourceNodePath.nodePath,
31
+ })),
29
32
  target: { filePath: absolutePath, nodePath: targetNodePath.nodePath },
30
33
  position,
31
34
  });
@@ -492,7 +492,6 @@ const saveSequencePropsHandler = ({ input: { edits, addedKeyframes, movedKeyfram
492
492
  nodePath: (_a = updatedNodePaths.get(`${absolutePath}:${JSON.stringify(target.nodePath.nodePath)}`)) !== null && _a !== void 0 ? _a : target.nodePath.nodePath,
493
493
  componentIdentity: null,
494
494
  effects: [],
495
- videoConfigValues: target.nodePath.videoConfigValues,
496
495
  };
497
496
  const newStatus = (0, can_update_sequence_props_1.computeSequencePropsStatusFromContent)({
498
497
  ...statusInput,
@@ -0,0 +1,3 @@
1
+ import type { ApiRoutes } from '@remotion/studio-shared';
2
+ import type { ApiHandler } from '../api-types';
3
+ export declare const sharedMemoryCaptureSupportHandler: ApiHandler<ApiRoutes['/api/shared-memory-capture-support']['Request'], ApiRoutes['/api/shared-memory-capture-support']['Response']>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sharedMemoryCaptureSupportHandler = void 0;
4
+ const renderer_1 = require("@remotion/renderer");
5
+ const sharedMemoryCaptureSupportHandler = async ({ input, binariesDirectory, logLevel }) => {
6
+ const supported = await renderer_1.RenderInternals.probeSharedMemoryCapture({
7
+ ...input,
8
+ binariesDirectory,
9
+ logLevel,
10
+ });
11
+ return { supported };
12
+ };
13
+ exports.sharedMemoryCaptureSupportHandler = sharedMemoryCaptureSupportHandler;
@@ -37,10 +37,11 @@ const splitSequencesHandler = ({ input: { sequences }, remotionRoot, logLevel })
37
37
  files: { [absolutePath]: fileContents },
38
38
  rootDir: remotionRoot,
39
39
  },
40
- splits: fileSequences.map(({ nodePath, sequenceKeys, splitFrame }) => ({
40
+ splits: fileSequences.map(({ nodePath, sequenceKeys, splitFrame, videoConfigValues }) => ({
41
41
  node: { filePath: absolutePath, nodePath },
42
42
  sequenceKeys,
43
43
  frame: splitFrame,
44
+ videoConfig: videoConfigValues !== null && videoConfigValues !== void 0 ? videoConfigValues : undefined,
44
45
  })),
45
46
  });
46
47
  const output = (_b = (_a = result.changes[0]) === null || _a === void 0 ? void 0 : _a.nextContents) !== null && _b !== void 0 ? _b : fileContents;
@@ -32,7 +32,7 @@ const subscribeToSequenceProps = ({ input, remotionRoot, logLevel }) => {
32
32
  // Let each subscription produce its usual not-found response.
33
33
  }
34
34
  }
35
- const results = input.requests.map(({ fileName, line, column, nodePath, componentIdentity, keys, assetKeys, effects, clientId, videoConfigValues, }, index) => (0, sequence_props_watchers_1.subscribeToSequencePropsWatchers)({
35
+ const results = input.requests.map(({ fileName, line, column, nodePath, componentIdentity, keys, assetKeys, effects, clientId, }, index) => (0, sequence_props_watchers_1.subscribeToSequencePropsWatchers)({
36
36
  fileName,
37
37
  line,
38
38
  column,
@@ -44,7 +44,6 @@ const subscribeToSequenceProps = ({ input, remotionRoot, logLevel }) => {
44
44
  effects,
45
45
  remotionRoot,
46
46
  clientId,
47
- videoConfigValues,
48
47
  logLevel,
49
48
  }));
50
49
  return Promise.resolve({ results });
@@ -11,7 +11,6 @@ const unsubscribeFromSequenceProps = ({ input: { fileName, nodePath, clientId, s
11
11
  sequenceKeys,
12
12
  assetKeys,
13
13
  effectKeys,
14
- videoConfigValues: nodePath.videoConfigValues,
15
14
  });
16
15
  return Promise.resolve(undefined);
17
16
  };
@@ -87,7 +87,6 @@ const updateSequenceKeyframeSettingsHandler = ({ input: { fileName, nodePath, ke
87
87
  nodePath: updatedNodePath,
88
88
  componentIdentity: null,
89
89
  effects: [],
90
- videoConfigValues: nodePath.videoConfigValues,
91
90
  });
92
91
  const updatedSubscriptionKey = { ...nodePath, nodePath: updatedNodePath };
93
92
  return {
@@ -10,9 +10,10 @@ const format_log_file_location_1 = require("../format-log-file-location");
10
10
  const sequence_node_path_mutation_1 = require("../sequence-node-path-mutation");
11
11
  const undo_stack_1 = require("../undo-stack");
12
12
  const source_file_write_queue_1 = require("./source-file-write-queue");
13
- const wrapNodeHandler = ({ input: { fileName, nodePath, wrapper, width, height, timing }, remotionRoot, logLevel, }) => {
13
+ const wrapNodeHandler = ({ input: { fileName, compositionId, nodePath, wrapper, width, height, timing }, remotionRoot, logLevel, }) => {
14
14
  return (0, source_file_write_queue_1.withSourceFileWriteQueue)(() => {
15
15
  var _a;
16
+ var _b, _c;
16
17
  try {
17
18
  const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
18
19
  remotionRoot,
@@ -56,8 +57,16 @@ const wrapNodeHandler = ({ input: { fileName, nodePath, wrapper, width, height,
56
57
  throw new Error('Could not wrap JSX node');
57
58
  }
58
59
  const output = change.nextContents;
59
- const remappings = result.nodePathRemappings.map(({ oldNodePath, newNodePath }) => ({ oldNodePath, newNodePath }));
60
- const nodePathMutation = (0, sequence_node_path_mutation_1.broadcastSequenceNodePathMutation)([{ absolutePath, remappings }], null);
60
+ const remappings = result.nodePathRemappings.map(({ oldNodePath, newNodePath, oldJsxName, newJsxName }) => ({
61
+ oldNodePath,
62
+ newNodePath,
63
+ oldJsxName,
64
+ newJsxName,
65
+ }));
66
+ const insertedNodePath = (_b = (_a = remappings.find((remapping) => remapping.oldNodePath === null)) === null || _a === void 0 ? void 0 : _a.newNodePath) !== null && _b !== void 0 ? _b : null;
67
+ const nodePathMutation = (0, sequence_node_path_mutation_1.broadcastSequenceNodePathMutation)([{ absolutePath, remappings }], insertedNodePath !== null
68
+ ? { compositionId, absolutePath, nodePath: insertedNodePath }
69
+ : null);
61
70
  const line = result.logLine;
62
71
  (0, undo_stack_1.pushTransactionToUndoStack)({
63
72
  snapshots: [
@@ -100,7 +109,7 @@ const wrapNodeHandler = ({ input: { fileName, nodePath, wrapper, width, height,
100
109
  return Promise.resolve({
101
110
  success: false,
102
111
  reason: err.message,
103
- stack: (_a = err.stack) !== null && _a !== void 0 ? _a : '',
112
+ stack: (_c = err.stack) !== null && _c !== void 0 ? _c : '',
104
113
  });
105
114
  }
106
115
  });
@@ -1,6 +1,6 @@
1
1
  import { type SubscribeToSequencePropsResponse } from '@remotion/studio-shared';
2
- import type { SequenceNodePath, VideoConfigValues } from 'remotion';
3
- export declare const subscribeToSequencePropsWatchers: ({ fileName, line, column, nodePath: preferredNodePath, resolvedNodePath, componentIdentity, keys, assetKeys, effects, remotionRoot, clientId, logLevel, videoConfigValues, }: {
2
+ import type { SequenceNodePath } from 'remotion';
3
+ export declare const subscribeToSequencePropsWatchers: ({ fileName, line, column, nodePath: preferredNodePath, resolvedNodePath, componentIdentity, keys, assetKeys, effects, remotionRoot, clientId, logLevel, }: {
4
4
  fileName: string;
5
5
  line: number;
6
6
  column: number;
@@ -13,9 +13,8 @@ export declare const subscribeToSequencePropsWatchers: ({ fileName, line, column
13
13
  remotionRoot: string;
14
14
  clientId: string;
15
15
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
16
- videoConfigValues: VideoConfigValues;
17
16
  }) => SubscribeToSequencePropsResponse;
18
- export declare const unsubscribeFromSequencePropsWatchers: ({ fileName, nodePath, remotionRoot, clientId, sequenceKeys, assetKeys, effectKeys, videoConfigValues, }: {
17
+ export declare const unsubscribeFromSequencePropsWatchers: ({ fileName, nodePath, remotionRoot, clientId, sequenceKeys, assetKeys, effectKeys, }: {
19
18
  fileName: string;
20
19
  nodePath: SequenceNodePath;
21
20
  remotionRoot: string;
@@ -23,6 +22,5 @@ export declare const unsubscribeFromSequencePropsWatchers: ({ fileName, nodePath
23
22
  sequenceKeys: string[];
24
23
  assetKeys: string[];
25
24
  effectKeys: string[][];
26
- videoConfigValues: VideoConfigValues | null;
27
25
  }) => void;
28
26
  export declare const unsubscribeClientSequencePropsWatchers: (clientId: string) => void;
@@ -14,8 +14,8 @@ const live_events_1 = require("./live-events");
14
14
  const node_path_cache_1 = require("./node-path-cache");
15
15
  const can_update_sequence_props_1 = require("./routes/can-update-sequence-props");
16
16
  const sequencePropsWatchers = {};
17
- const getWatcherKey = (nodePath, assetKeys) => `${(0, studio_shared_1.stringifySequenceSubscriptionKey)(nodePath)}:${assetKeys.join('\0')}:${JSON.stringify(nodePath.videoConfigValues)}`;
18
- const getSequencePropsStatus = ({ fileName, line, column, preferredNodePath, resolvedNodePath, componentIdentity, keys, assetKeys, effects, remotionRoot, logLevel, videoConfigValues, }) => {
17
+ const getWatcherKey = (nodePath, assetKeys) => `${(0, studio_shared_1.stringifySequenceSubscriptionKey)(nodePath)}:${assetKeys.join('\0')}`;
18
+ const getSequencePropsStatus = ({ fileName, line, column, preferredNodePath, resolvedNodePath, componentIdentity, keys, assetKeys, effects, remotionRoot, logLevel, }) => {
19
19
  if (preferredNodePath) {
20
20
  try {
21
21
  const fromNodePath = (0, can_update_sequence_props_1.computeSequencePropsStatus)({
@@ -26,7 +26,6 @@ const getSequencePropsStatus = ({ fileName, line, column, preferredNodePath, res
26
26
  assetKeys,
27
27
  effects,
28
28
  remotionRoot,
29
- videoConfigValues,
30
29
  });
31
30
  return {
32
31
  status: fromNodePath,
@@ -35,7 +34,7 @@ const getSequencePropsStatus = ({ fileName, line, column, preferredNodePath, res
35
34
  nodePath: preferredNodePath,
36
35
  sequenceKeys: keys,
37
36
  effectKeys: effects,
38
- videoConfigValues,
37
+ videoConfigValues: null,
39
38
  },
40
39
  success: true,
41
40
  };
@@ -60,7 +59,6 @@ const getSequencePropsStatus = ({ fileName, line, column, preferredNodePath, res
60
59
  assetKeys,
61
60
  effects,
62
61
  remotionRoot,
63
- videoConfigValues,
64
62
  });
65
63
  }
66
64
  catch (error) {
@@ -79,7 +77,7 @@ const getSequencePropsStatus = ({ fileName, line, column, preferredNodePath, res
79
77
  nodePath: cachedNodePath,
80
78
  sequenceKeys: keys,
81
79
  effectKeys: effects,
82
- videoConfigValues,
80
+ videoConfigValues: null,
83
81
  },
84
82
  success: true,
85
83
  };
@@ -96,14 +94,13 @@ const getSequencePropsStatus = ({ fileName, line, column, preferredNodePath, res
96
94
  assetKeys,
97
95
  effects,
98
96
  remotionRoot,
99
- videoConfigValues,
100
97
  }),
101
98
  nodePath: {
102
99
  absolutePath: node_path_1.default.resolve(remotionRoot, fileName),
103
100
  nodePath: resolvedNodePath,
104
101
  sequenceKeys: keys,
105
102
  effectKeys: effects,
106
- videoConfigValues,
103
+ videoConfigValues: null,
107
104
  },
108
105
  success: true,
109
106
  };
@@ -125,11 +122,10 @@ const getSequencePropsStatus = ({ fileName, line, column, preferredNodePath, res
125
122
  effects,
126
123
  remotionRoot,
127
124
  logLevel,
128
- videoConfigValues,
129
125
  });
130
126
  return status;
131
127
  };
132
- const subscribeToSequencePropsWatchers = ({ fileName, line, column, nodePath: preferredNodePath, resolvedNodePath = null, componentIdentity, keys, assetKeys, effects, remotionRoot, clientId, logLevel, videoConfigValues, }) => {
128
+ const subscribeToSequencePropsWatchers = ({ fileName, line, column, nodePath: preferredNodePath, resolvedNodePath = null, componentIdentity, keys, assetKeys, effects, remotionRoot, clientId, logLevel, }) => {
133
129
  var _a;
134
130
  const initialResult = getSequencePropsStatus({
135
131
  fileName,
@@ -143,7 +139,6 @@ const subscribeToSequencePropsWatchers = ({ fileName, line, column, nodePath: pr
143
139
  effects,
144
140
  remotionRoot,
145
141
  logLevel,
146
- videoConfigValues,
147
142
  });
148
143
  if (!initialResult.success) {
149
144
  return initialResult;
@@ -170,9 +165,8 @@ const subscribeToSequencePropsWatchers = ({ fileName, line, column, nodePath: pr
170
165
  if (event.type === 'deleted') {
171
166
  return;
172
167
  }
173
- if (event.originatorClientId === clientId) {
174
- return;
175
- }
168
+ // Even the editing client needs the saved expression: its optimistic
169
+ // numeric value only describes the instance that initiated the edit.
176
170
  if (event.type === 'changed' && event.skipSequencePropsUpdate) {
177
171
  return;
178
172
  }
@@ -184,7 +178,6 @@ const subscribeToSequencePropsWatchers = ({ fileName, line, column, nodePath: pr
184
178
  keys,
185
179
  assetKeys,
186
180
  effects,
187
- videoConfigValues,
188
181
  });
189
182
  const previousEffectChain = result.effects.map((effect) => effect.canUpdate && effect.callee);
190
183
  const newEffectChain = initialResult.success &&
@@ -227,14 +220,13 @@ const subscribeToSequencePropsWatchers = ({ fileName, line, column, nodePath: pr
227
220
  return initialResult;
228
221
  };
229
222
  exports.subscribeToSequencePropsWatchers = subscribeToSequencePropsWatchers;
230
- const unsubscribeFromSequencePropsWatchers = ({ fileName, nodePath, remotionRoot, clientId, sequenceKeys, assetKeys, effectKeys, videoConfigValues, }) => {
223
+ const unsubscribeFromSequencePropsWatchers = ({ fileName, nodePath, remotionRoot, clientId, sequenceKeys, assetKeys, effectKeys, }) => {
231
224
  const absolutePath = node_path_1.default.resolve(remotionRoot, fileName);
232
225
  const watcherKey = getWatcherKey({
233
226
  absolutePath,
234
227
  nodePath,
235
228
  sequenceKeys,
236
229
  effectKeys,
237
- videoConfigValues,
238
230
  }, assetKeys);
239
231
  if (!sequencePropsWatchers[clientId] ||
240
232
  !sequencePropsWatchers[clientId][watcherKey]) {
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.isUpdateAvailableWithTimeout = exports.getRemotionVersion = exports.isUpdateAvailable = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
7
8
  const semver_1 = __importDefault(require("semver"));
8
9
  const detect_outdated_remotion_skills_1 = require("../detect-outdated-remotion-skills");
9
10
  const get_latest_remotion_version_1 = require("../get-latest-remotion-version");
@@ -15,6 +16,22 @@ const getSkillsUpdateInfo = ({ remotionRoot, currentVersion, }) => {
15
16
  }).project;
16
17
  return {
17
18
  skillsUpdateAvailable: projectSkills.type === 'outdated',
19
+ skillsUpdateDetails: projectSkills.type === 'outdated'
20
+ ? {
21
+ outdatedSkills: projectSkills.outdatedSkillNames.map((name) => {
22
+ const { version } = (0, detect_outdated_remotion_skills_1.readRemotionSkill)(node_path_1.default.join(projectSkills.skillsDirectory, name, 'SKILL.md'));
23
+ return {
24
+ name,
25
+ installedVersion: version,
26
+ reason: version === null
27
+ ? 'missing-version'
28
+ : semver_1.default.valid(version) === null
29
+ ? 'invalid-version'
30
+ : 'older-version',
31
+ };
32
+ }),
33
+ }
34
+ : null,
18
35
  };
19
36
  };
20
37
  const isUpdateAvailable = async ({ remotionRoot, currentVersion, logLevel, getLatestVersion, }) => {
package/dist/routes.js CHANGED
@@ -102,7 +102,7 @@ const handleRemotionConfig = (response, remotionRoot) => {
102
102
  response.end(JSON.stringify(body));
103
103
  return Promise.resolve();
104
104
  };
105
- const handleFallback = async ({ remotionRoot, hash, response, request, getCurrentInputProps, getEnvVariables, publicDir, getRenderQueue, getRenderDefaults, getNumberOfAudioTags, getAudioLatencyHint, getExperimentalKeepAudioContextAlive, getPreviewSampleRate, gitSource, logLevel, enableCrossSiteIsolation, getStudioRuntimeConfig, getDefaultEditor, }) => {
105
+ const handleFallback = async ({ remotionRoot, hash, outputHash, response, request, getCurrentInputProps, getEnvVariables, publicDir, getRenderQueue, getRenderDefaults, getNumberOfAudioTags, getAudioLatencyHint, getExperimentalKeepAudioContextAlive, getPreviewSampleRate, gitSource, logLevel, enableCrossSiteIsolation, getStudioRuntimeConfig, getDefaultEditor, }) => {
106
106
  var _a, _b;
107
107
  const acceptsHtml = ((_a = request.headers.accept) !== null && _a !== void 0 ? _a : '').includes('text/html');
108
108
  if (request.method === 'GET' && acceptsHtml) {
@@ -142,6 +142,7 @@ const handleFallback = async ({ remotionRoot, hash, response, request, getCurren
142
142
  response.end(bundler_1.BundlerInternals.indexHtml({
143
143
  importMap: null,
144
144
  staticHash: hash,
145
+ outputHash,
145
146
  publicPath: '/',
146
147
  editorName: displayName,
147
148
  envVariables: getEnvVariables(),
@@ -470,6 +471,7 @@ const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPref
470
471
  return handleFallback({
471
472
  remotionRoot,
472
473
  hash: staticHash,
474
+ outputHash,
473
475
  response,
474
476
  request,
475
477
  getCurrentInputProps,