@assemblyline-agents/remotion 0.1.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.
- package/LICENSE +21 -0
- package/README.md +41 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server.d.ts +2 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +219 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/process.d.ts +9 -0
- package/dist/process.d.ts.map +1 -0
- package/dist/process.js +43 -0
- package/dist/process.js.map +1 -0
- package/dist/workspace.d.ts +10 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +51 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +50 -0
- package/skills/remotion/SKILL.md +30 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OpenEve contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @assemblyline-agents/remotion
|
|
2
|
+
|
|
3
|
+
Official Assembly Line stdio connection for a Remotion project.
|
|
4
|
+
|
|
5
|
+
This package launches an Assembly Line-maintained, workspace-scoped MCP server that
|
|
6
|
+
invokes Remotion's supported CLI. It does not use `@remotion/mcp`: Remotion
|
|
7
|
+
deprecated that documentation-oriented MCP server in favor of Agent Skills and
|
|
8
|
+
the CLI.
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
Install Remotion in the video project:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install remotion @remotion/cli
|
|
16
|
+
assembly-line add remotion agent
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Point the connection at the project when it is not the agent root:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { defineRemotionConnection } from "@assemblyline-agents/remotion";
|
|
23
|
+
|
|
24
|
+
export default defineRemotionConnection({
|
|
25
|
+
projectRoot: "/workspace/video",
|
|
26
|
+
entryPoint: "src/index.ts",
|
|
27
|
+
access: {
|
|
28
|
+
read: true,
|
|
29
|
+
write: { approval: "always" }
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`list_compositions` and `check_versions` are read operations. `render_video`
|
|
35
|
+
and `render_still` require write authority because they create files. Entry
|
|
36
|
+
points, props, output paths, codecs, and render limits are typed; output paths
|
|
37
|
+
and symlink targets cannot escape `projectRoot`.
|
|
38
|
+
|
|
39
|
+
The default CLI invocation is `npx --no-install remotion`. A deployment owner
|
|
40
|
+
can set `remotionCommand` and `remotionArgs` to another trusted project-local
|
|
41
|
+
launcher. Models and runtime-created connections cannot change the executable.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type StdioMcpPluginConnectionOptions } from "@assemblyline-agents/core";
|
|
2
|
+
export interface RemotionConnectionOptions extends StdioMcpPluginConnectionOptions {
|
|
3
|
+
/** Directory containing the Remotion project and all readable/writable media. */
|
|
4
|
+
projectRoot?: string;
|
|
5
|
+
/** Trusted executable used to invoke the Remotion CLI. Defaults to `npx`. */
|
|
6
|
+
remotionCommand?: string;
|
|
7
|
+
/** Trusted arguments before the Remotion subcommand. Defaults to `--no-install remotion`. */
|
|
8
|
+
remotionArgs?: string[];
|
|
9
|
+
/** Optional project entry point, relative to projectRoot. */
|
|
10
|
+
entryPoint?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function defineRemotionConnection(options: RemotionConnectionOptions): import("@assemblyline-agents/core").McpStdioClientConnectionDefinition;
|
|
13
|
+
export declare const openevePlugin: import("@assemblyline-agents/core").PluginModule;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,+BAA+B,EACrC,MAAM,2BAA2B,CAAC;AAKnC,MAAM,WAAW,yBAA0B,SAAQ,+BAA+B;IAChF,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6FAA6F;IAC7F,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,0EAwB1E;AAED,eAAO,MAAM,aAAa,kDAA0C,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { connectionPluginMetadata, definePlugin, defineStdioMcpPluginConnection } from "@assemblyline-agents/core";
|
|
4
|
+
const PLUGIN = connectionPluginMetadata("remotion");
|
|
5
|
+
const MCP_SERVER_PATH = fileURLToPath(new URL("./mcp-server.js", import.meta.url));
|
|
6
|
+
export function defineRemotionConnection(options) {
|
|
7
|
+
const { projectRoot: configuredProjectRoot, remotionCommand = "npx", remotionArgs = ["--no-install", "remotion"], entryPoint, ...connection } = options;
|
|
8
|
+
const projectRoot = resolve(configuredProjectRoot ?? connection.cwd ?? process.cwd());
|
|
9
|
+
const serverArgs = [
|
|
10
|
+
MCP_SERVER_PATH,
|
|
11
|
+
"--project-root",
|
|
12
|
+
projectRoot,
|
|
13
|
+
"--remotion-command",
|
|
14
|
+
remotionCommand,
|
|
15
|
+
...remotionArgs.flatMap((argument) => ["--remotion-arg", argument]),
|
|
16
|
+
...(entryPoint ? ["--entry-point", entryPoint] : [])
|
|
17
|
+
];
|
|
18
|
+
return defineStdioMcpPluginConnection(PLUGIN, {
|
|
19
|
+
...connection,
|
|
20
|
+
command: connection.command ?? process.execPath,
|
|
21
|
+
args: connection.args ?? serverArgs,
|
|
22
|
+
cwd: connection.cwd ?? projectRoot
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export const openevePlugin = definePlugin({ connections: [PLUGIN] });
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,wBAAwB,EACxB,YAAY,EACZ,8BAA8B,EAE/B,MAAM,2BAA2B,CAAC;A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],"names":[],"mappings":""}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
import { runProcess } from "./process.js";
|
|
6
|
+
import { RemotionWorkspace } from "./workspace.js";
|
|
7
|
+
const TOOLS = [
|
|
8
|
+
{
|
|
9
|
+
name: "list_compositions",
|
|
10
|
+
description: "List composition IDs and dimensions from the configured Remotion project.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
entryPoint: { type: "string", description: "Optional project-relative entry point override." },
|
|
15
|
+
props: { type: "object", additionalProperties: true }
|
|
16
|
+
},
|
|
17
|
+
additionalProperties: false
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "check_versions",
|
|
22
|
+
description: "Run Remotion's version compatibility check in the configured project.",
|
|
23
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false }
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "render_video",
|
|
27
|
+
description: "Render one Remotion composition to a workspace-scoped video file.",
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: "object",
|
|
30
|
+
required: ["compositionId", "outputPath"],
|
|
31
|
+
properties: {
|
|
32
|
+
compositionId: { type: "string", minLength: 1 },
|
|
33
|
+
outputPath: { type: "string", minLength: 1 },
|
|
34
|
+
entryPoint: { type: "string" },
|
|
35
|
+
props: { type: "object", additionalProperties: true },
|
|
36
|
+
codec: { type: "string", enum: ["h264", "h265", "av1", "vp8", "vp9", "prores"] },
|
|
37
|
+
concurrency: { type: "integer", minimum: 1, maximum: 64 },
|
|
38
|
+
crf: { type: "number", minimum: 0, maximum: 51 },
|
|
39
|
+
frames: { type: "string", pattern: "^-?[0-9]+(?:-(?:-?[0-9]+)?)?$" },
|
|
40
|
+
overwrite: { type: "boolean" }
|
|
41
|
+
},
|
|
42
|
+
additionalProperties: false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "render_still",
|
|
47
|
+
description: "Render one frame of a Remotion composition to a workspace-scoped image file.",
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: "object",
|
|
50
|
+
required: ["compositionId", "outputPath"],
|
|
51
|
+
properties: {
|
|
52
|
+
compositionId: { type: "string", minLength: 1 },
|
|
53
|
+
outputPath: { type: "string", minLength: 1 },
|
|
54
|
+
entryPoint: { type: "string" },
|
|
55
|
+
props: { type: "object", additionalProperties: true },
|
|
56
|
+
frame: { type: "integer" },
|
|
57
|
+
imageFormat: { type: "string", enum: ["png", "jpeg", "pdf", "webp"] },
|
|
58
|
+
overwrite: { type: "boolean" }
|
|
59
|
+
},
|
|
60
|
+
additionalProperties: false
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
const options = parseServerOptions(process.argv.slice(2));
|
|
65
|
+
const workspace = new RemotionWorkspace(options.projectRoot);
|
|
66
|
+
const server = new Server({ name: "openeve-remotion", version: "0.1.0" }, {
|
|
67
|
+
capabilities: { tools: {} },
|
|
68
|
+
instructions: "Remotion operations are restricted to the configured project root."
|
|
69
|
+
});
|
|
70
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
71
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
72
|
+
try {
|
|
73
|
+
return await callTool(request.params.name, recordValue(request.params.arguments));
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
return toolResult({
|
|
77
|
+
error: error instanceof Error ? error.message : String(error)
|
|
78
|
+
}, true);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
await server.connect(new StdioServerTransport());
|
|
82
|
+
async function callTool(name, input) {
|
|
83
|
+
if (name === "check_versions") {
|
|
84
|
+
const result = await runRemotion(["versions"]);
|
|
85
|
+
return toolResult(result);
|
|
86
|
+
}
|
|
87
|
+
if (name === "list_compositions") {
|
|
88
|
+
const args = ["compositions", ...entryArguments(input), ...propsArguments(input.props), "--log=error"];
|
|
89
|
+
return toolResult(await runRemotion(args));
|
|
90
|
+
}
|
|
91
|
+
if (name === "render_video") {
|
|
92
|
+
const outputPath = outputFile(stringValue(input.outputPath, "outputPath"));
|
|
93
|
+
const args = [
|
|
94
|
+
"render",
|
|
95
|
+
...entryArguments(input),
|
|
96
|
+
stringValue(input.compositionId, "compositionId"),
|
|
97
|
+
outputPath,
|
|
98
|
+
...propsArguments(input.props),
|
|
99
|
+
`--codec=${enumValue(input.codec, ["h264", "h265", "av1", "vp8", "vp9", "prores"], "h264")}`,
|
|
100
|
+
...(input.concurrency === undefined ? [] : [`--concurrency=${integerValue(input.concurrency, "concurrency", 1, 64)}`]),
|
|
101
|
+
...(input.crf === undefined ? [] : [`--crf=${numberValue(input.crf, "crf", 0, 51)}`]),
|
|
102
|
+
...(input.frames === undefined ? [] : [`--frames=${frameRange(input.frames)}`]),
|
|
103
|
+
...(input.overwrite === false ? ["--overwrite=false"] : []),
|
|
104
|
+
"--log=error"
|
|
105
|
+
];
|
|
106
|
+
return toolResult({ outputPath, ...(await runRemotion(args)) });
|
|
107
|
+
}
|
|
108
|
+
if (name === "render_still") {
|
|
109
|
+
const outputPath = outputFile(stringValue(input.outputPath, "outputPath"));
|
|
110
|
+
const args = [
|
|
111
|
+
"still",
|
|
112
|
+
...entryArguments(input),
|
|
113
|
+
stringValue(input.compositionId, "compositionId"),
|
|
114
|
+
outputPath,
|
|
115
|
+
...propsArguments(input.props),
|
|
116
|
+
...(input.frame === undefined ? [] : [`--frame=${integerValue(input.frame, "frame", -1_000_000, 1_000_000)}`]),
|
|
117
|
+
`--image-format=${enumValue(input.imageFormat, ["png", "jpeg", "pdf", "webp"], "png")}`,
|
|
118
|
+
...(input.overwrite === false ? ["--overwrite=false"] : []),
|
|
119
|
+
"--log=error"
|
|
120
|
+
];
|
|
121
|
+
return toolResult({ outputPath, ...(await runRemotion(args)) });
|
|
122
|
+
}
|
|
123
|
+
throw new Error(`Unknown Remotion tool: ${name}`);
|
|
124
|
+
}
|
|
125
|
+
function runRemotion(args) {
|
|
126
|
+
return runProcess(options.remotionCommand, [...options.remotionArgs, ...args], {
|
|
127
|
+
cwd: workspace.root
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function entryArguments(input) {
|
|
131
|
+
const candidate = typeof input.entryPoint === "string" ? input.entryPoint : options.entryPoint;
|
|
132
|
+
return candidate ? [workspace.input(candidate, "entryPoint")] : [];
|
|
133
|
+
}
|
|
134
|
+
function propsArguments(value) {
|
|
135
|
+
if (value === undefined)
|
|
136
|
+
return [];
|
|
137
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
138
|
+
throw new Error("props must be a JSON object.");
|
|
139
|
+
}
|
|
140
|
+
const serialized = JSON.stringify(value);
|
|
141
|
+
if (Buffer.byteLength(serialized) > 1024 * 1024) {
|
|
142
|
+
throw new Error("props must be smaller than 1 MiB.");
|
|
143
|
+
}
|
|
144
|
+
return [`--props=${serialized}`];
|
|
145
|
+
}
|
|
146
|
+
function outputFile(value) {
|
|
147
|
+
return workspace.output(value, "outputPath");
|
|
148
|
+
}
|
|
149
|
+
function parseServerOptions(args) {
|
|
150
|
+
let projectRoot = process.cwd();
|
|
151
|
+
let remotionCommand = "npx";
|
|
152
|
+
const remotionArgs = [];
|
|
153
|
+
let entryPoint;
|
|
154
|
+
for (let index = 0; index < args.length; index += 2) {
|
|
155
|
+
const flag = args[index];
|
|
156
|
+
const value = args[index + 1];
|
|
157
|
+
if (!flag || value === undefined)
|
|
158
|
+
throw new Error(`Missing value for ${flag ?? "server option"}.`);
|
|
159
|
+
if (flag === "--project-root")
|
|
160
|
+
projectRoot = resolve(value);
|
|
161
|
+
else if (flag === "--remotion-command")
|
|
162
|
+
remotionCommand = value;
|
|
163
|
+
else if (flag === "--remotion-arg")
|
|
164
|
+
remotionArgs.push(value);
|
|
165
|
+
else if (flag === "--entry-point")
|
|
166
|
+
entryPoint = value;
|
|
167
|
+
else
|
|
168
|
+
throw new Error(`Unknown Remotion MCP server option: ${flag}`);
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
projectRoot,
|
|
172
|
+
remotionCommand,
|
|
173
|
+
remotionArgs: remotionArgs.length > 0 ? remotionArgs : ["--no-install", "remotion"],
|
|
174
|
+
...(entryPoint ? { entryPoint } : {})
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function recordValue(value) {
|
|
178
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
179
|
+
? value
|
|
180
|
+
: {};
|
|
181
|
+
}
|
|
182
|
+
function stringValue(value, name) {
|
|
183
|
+
if (typeof value !== "string" || !value.trim())
|
|
184
|
+
throw new Error(`${name} must be a non-empty string.`);
|
|
185
|
+
return value;
|
|
186
|
+
}
|
|
187
|
+
function integerValue(value, name, minimum, maximum) {
|
|
188
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < minimum || value > maximum) {
|
|
189
|
+
throw new Error(`${name} must be an integer from ${minimum} to ${maximum}.`);
|
|
190
|
+
}
|
|
191
|
+
return value;
|
|
192
|
+
}
|
|
193
|
+
function numberValue(value, name, minimum, maximum) {
|
|
194
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < minimum || value > maximum) {
|
|
195
|
+
throw new Error(`${name} must be a number from ${minimum} to ${maximum}.`);
|
|
196
|
+
}
|
|
197
|
+
return value;
|
|
198
|
+
}
|
|
199
|
+
function enumValue(value, allowed, fallback) {
|
|
200
|
+
if (value === undefined)
|
|
201
|
+
return fallback;
|
|
202
|
+
if (typeof value !== "string" || !allowed.includes(value)) {
|
|
203
|
+
throw new Error(`Value must be one of: ${allowed.join(", ")}.`);
|
|
204
|
+
}
|
|
205
|
+
return value;
|
|
206
|
+
}
|
|
207
|
+
function frameRange(value) {
|
|
208
|
+
if (typeof value !== "string" || !/^-?[0-9]+(?:-(?:-?[0-9]+)?)?$/u.test(value)) {
|
|
209
|
+
throw new Error("frames must be one frame or a Remotion frame range such as 0-90.");
|
|
210
|
+
}
|
|
211
|
+
return value;
|
|
212
|
+
}
|
|
213
|
+
function toolResult(value, isError = false) {
|
|
214
|
+
return {
|
|
215
|
+
content: [{ type: "text", text: JSON.stringify(value, null, 2) }],
|
|
216
|
+
...(isError ? { isError: true } : {})
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=mcp-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EAGvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AASnD,MAAM,KAAK,GAAW;IACpB;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,2EAA2E;QACxF,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iDAAiD,EAAE;gBAC9F,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE;aACtD;YACD,oBAAoB,EAAE,KAAK;SAC5B;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,uEAAuE;QACpF,WAAW,EAAE,EAAE,IAAI,EAAE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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../src/process.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3C,OAAO,CAAC,aAAa,CAAC,CAuCxB"}
|
package/dist/process.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
const MAX_CAPTURE_BYTES = 256 * 1024;
|
|
3
|
+
export function runProcess(command, args, options) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
const child = spawn(command, args, {
|
|
6
|
+
cwd: options.cwd,
|
|
7
|
+
env: process.env,
|
|
8
|
+
shell: false,
|
|
9
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
10
|
+
});
|
|
11
|
+
let stdout = "";
|
|
12
|
+
let stderr = "";
|
|
13
|
+
let capturedBytes = 0;
|
|
14
|
+
const capture = (target, chunk) => {
|
|
15
|
+
capturedBytes += chunk.byteLength;
|
|
16
|
+
if (capturedBytes > MAX_CAPTURE_BYTES) {
|
|
17
|
+
child.kill("SIGKILL");
|
|
18
|
+
reject(new Error(`Process output exceeded ${MAX_CAPTURE_BYTES} bytes.`));
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (target === "stdout")
|
|
22
|
+
stdout += chunk.toString();
|
|
23
|
+
else
|
|
24
|
+
stderr += chunk.toString();
|
|
25
|
+
};
|
|
26
|
+
child.stdout.on("data", (chunk) => capture("stdout", chunk));
|
|
27
|
+
child.stderr.on("data", (chunk) => capture("stderr", chunk));
|
|
28
|
+
child.once("error", reject);
|
|
29
|
+
const timeout = setTimeout(() => {
|
|
30
|
+
child.kill("SIGKILL");
|
|
31
|
+
reject(new Error(`Process timed out after ${options.timeoutMs ?? 30 * 60_000}ms.`));
|
|
32
|
+
}, options.timeoutMs ?? 30 * 60_000);
|
|
33
|
+
child.once("close", (code, signal) => {
|
|
34
|
+
clearTimeout(timeout);
|
|
35
|
+
if (code === 0) {
|
|
36
|
+
resolve({ stdout: stdout.trim(), stderr: stderr.trim() });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
reject(new Error(`${command} exited with ${code ?? signal ?? "unknown status"}${stderr.trim() ? `: ${stderr.trim()}` : ""}`));
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../src/process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,iBAAiB,GAAG,GAAG,GAAG,IAAI,CAAC;AAOrC,MAAM,UAAU,UAAU,CACxB,OAAe,EACf,IAAc,EACd,OAA4C;IAE5C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE;YACjC,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;SAClC,CAAC,CAAC;QACH,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,MAAM,OAAO,GAAG,CAAC,MAA2B,EAAE,KAAa,EAAQ,EAAE;YACnE,aAAa,IAAI,KAAK,CA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AE,CAAC,CAAC;gBAC1D,OAAO;YACT,CAAC;YACD,MAAM,CAAC,IAAI,KAAK,CACd,GAAG,OAAO,gBAAgB,IAAI,IAAI,MAAM,IAAI,gBAAgB,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAC3G,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class RemotionWorkspace {
|
|
2
|
+
readonly root: string;
|
|
3
|
+
constructor(root: string);
|
|
4
|
+
input(value: string, name: string): string;
|
|
5
|
+
output(value: string, name: string): string;
|
|
6
|
+
private lexical;
|
|
7
|
+
private assertInside;
|
|
8
|
+
private existingAncestor;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAYA,qBAAa,iBAAiB;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM;IAIxB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAQ1C,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAW3C,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,gBAAgB;CASzB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, realpathSync } from "node:fs";
|
|
2
|
+
import { dirname, isAbsolute, relative, resolve } from "node:path";
|
|
3
|
+
export class RemotionWorkspace {
|
|
4
|
+
root;
|
|
5
|
+
constructor(root) {
|
|
6
|
+
this.root = realpathSync(resolve(root));
|
|
7
|
+
}
|
|
8
|
+
input(value, name) {
|
|
9
|
+
const candidate = this.lexical(value, name);
|
|
10
|
+
if (!existsSync(candidate))
|
|
11
|
+
throw new Error(`${name} does not exist: ${value}`);
|
|
12
|
+
const real = realpathSync(candidate);
|
|
13
|
+
this.assertInside(real, name);
|
|
14
|
+
return real;
|
|
15
|
+
}
|
|
16
|
+
output(value, name) {
|
|
17
|
+
const candidate = this.lexical(value, name);
|
|
18
|
+
if (existsSync(candidate))
|
|
19
|
+
this.assertInside(realpathSync(candidate), name);
|
|
20
|
+
const parent = dirname(candidate);
|
|
21
|
+
const existingAncestor = this.existingAncestor(parent);
|
|
22
|
+
this.assertInside(realpathSync(existingAncestor), name);
|
|
23
|
+
mkdirSync(parent, { recursive: true });
|
|
24
|
+
this.assertInside(realpathSync(parent), name);
|
|
25
|
+
return candidate;
|
|
26
|
+
}
|
|
27
|
+
lexical(value, name) {
|
|
28
|
+
if (!value.trim())
|
|
29
|
+
throw new Error(`${name} must be a non-empty path.`);
|
|
30
|
+
const candidate = resolve(this.root, value);
|
|
31
|
+
this.assertInside(candidate, name);
|
|
32
|
+
return candidate;
|
|
33
|
+
}
|
|
34
|
+
assertInside(candidate, name) {
|
|
35
|
+
const relation = relative(this.root, candidate);
|
|
36
|
+
if (relation.startsWith("..") || isAbsolute(relation)) {
|
|
37
|
+
throw new Error(`${name} must stay inside ${this.root}.`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
existingAncestor(value) {
|
|
41
|
+
let candidate = value;
|
|
42
|
+
while (!existsSync(candidate)) {
|
|
43
|
+
const parent = dirname(candidate);
|
|
44
|
+
if (parent === candidate)
|
|
45
|
+
break;
|
|
46
|
+
candidate = parent;
|
|
47
|
+
}
|
|
48
|
+
return candidate;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../src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.d.ts",
|
|
8
|
+
"default": "./dist/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@modelcontextprotocol/sdk": "^1.25.2",
|
|
13
|
+
"@assemblyline-agents/core": "0.1.0"
|
|
14
|
+
},
|
|
15
|
+
"description": "Official OpenEve workspace-scoped Remotion CLI connection plugin.",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"skills"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=22.19.0"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/jasonbadeaux/openeve.git",
|
|
27
|
+
"directory": "packages/remotion"
|
|
28
|
+
},
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/jasonbadeaux/openeve/issues"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/jasonbadeaux/openeve#readme",
|
|
33
|
+
"author": "OpenEve contributors",
|
|
34
|
+
"keywords": [
|
|
35
|
+
"openeve",
|
|
36
|
+
"ai",
|
|
37
|
+
"agents",
|
|
38
|
+
"remotion",
|
|
39
|
+
"video",
|
|
40
|
+
"rendering",
|
|
41
|
+
"plugin"
|
|
42
|
+
],
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc -p tsconfig.json",
|
|
48
|
+
"check": "tsc -p tsconfig.json --noEmit"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: remotion
|
|
3
|
+
description: Build, inspect, and render code-driven videos in the configured Remotion project.
|
|
4
|
+
---
|
|
5
|
+
# Remotion
|
|
6
|
+
|
|
7
|
+
Use Remotion for repeatable, code-driven video layouts, motion graphics,
|
|
8
|
+
captions, branded overlays, and parameterized variations. Inspect the existing
|
|
9
|
+
project and composition IDs before changing source code or rendering.
|
|
10
|
+
|
|
11
|
+
Keep composition source deterministic:
|
|
12
|
+
|
|
13
|
+
- Drive timing from frames and the composition FPS.
|
|
14
|
+
- Put reusable colors, typography, spacing, and durations in named constants.
|
|
15
|
+
- Use project-local media assets and preserve their aspect ratios.
|
|
16
|
+
- For TikTok, Reels, or Shorts, prefer a 9:16 composition such as 1080x1920.
|
|
17
|
+
- Keep important faces, products, captions, and calls to action inside safe
|
|
18
|
+
areas rather than against the edge.
|
|
19
|
+
- Use props for copy, media paths, colors, and variant decisions that should be
|
|
20
|
+
reusable across renders.
|
|
21
|
+
|
|
22
|
+
Call `list_compositions` before rendering when the composition ID or dimensions
|
|
23
|
+
are uncertain. Use `render_still` to review representative frames before
|
|
24
|
+
spending time on a full render. Rendering creates files and therefore requires
|
|
25
|
+
the connection's write policy.
|
|
26
|
+
|
|
27
|
+
Do not pass arbitrary CLI flags through another tool. Use only the typed
|
|
28
|
+
connection inputs. Keep every entry point and output inside the configured
|
|
29
|
+
project root. Check the project's Remotion license requirements before using
|
|
30
|
+
renders commercially or at automation scale.
|