Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,3 +448,6 @@ Contributions to documentation, the MCP server, and exploration tooling are welc
## Disclaimer

This repository archives a source snapshot reportedly exposed via Anthropic's npm distribution on **2026-03-31**. It is provided for research, documentation, and exploratory tooling around the snapshot. The original Claude Code source remains the property of [Anthropic](https://www.anthropic.com), this is not an official release, and no rights to Anthropic's original code are granted by this repository. If you choose to use or redistribute any of the archived material, you are responsible for assessing the legal implications yourself. Contact [nichxbt](https://www.x.com/nichxbt) for any comments.

## Red Cross Remo CLI
This repo now includes a Remotion-first multi-agent scaffold branded as **Red Cross Remo** with coordinator, skills, plugins, MCP tools, and prompt packs for video generation.
10 changes: 10 additions & 0 deletions mcp-server/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { z } from 'zod/v4'

export const mcpToolSchema = z.object({ name: z.string(), description: z.string(), endpoint: z.string().url() })
export type McpTool = z.infer<typeof mcpToolSchema>

export const builtInMcpTools: McpTool[] = [
{ name: 'stock-footage-search', description: 'Search stock media providers', endpoint: 'https://mcp.video.local/stock' },
{ name: 'audio-library', description: 'Discover royalty free music and fx', endpoint: 'https://mcp.video.local/audio' },
{ name: 'caption-generator', description: 'Generate subtitles and captions', endpoint: 'https://mcp.video.local/captions' },
]
32 changes: 8 additions & 24 deletions mcp-server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
#!/usr/bin/env node
/**
* STDIO entrypoint — for local use with Claude Desktop, Claude Code, etc.
*
* Usage:
* node dist/index.js
* CLAUDE_CODE_SRC_ROOT=/path/to/src node dist/index.js
*/

import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { createServer, validateSrcRoot, SRC_ROOT } from "./server.js";

async function main() {
await validateSrcRoot();
const server = createServer();
const transport = new StdioServerTransport();
await server.connect(transport);
console.error(`Claude Code Explorer MCP (stdio) started — src: ${SRC_ROOT}`);
}

main().catch((err) => {
console.error("Fatal error:", err);
process.exit(1);
});
export * from './tools/list-compositions.js'
export * from './tools/read-composition.js'
export * from './tools/write-composition.js'
export * from './tools/list-assets.js'
export * from './tools/get-render-status.js'
export * from './tools/search-pexels.js'
export * from './tools/run-render.js'
export * from './tools/get-project-config.js'
Comment on lines +1 to +8
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore MCP stdio startup entrypoint

This file no longer starts the MCP server; it only re-exports tool modules, so invoking the mcp-server entrypoint now exits immediately instead of connecting a StdioServerTransport. In environments that launch src/index.ts/dist/index.js as the server process, clients will fail to establish an MCP session because no server is started.

Useful? React with 👍 / 👎.

Comment on lines +1 to +8
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check where MCP server startup logic now lives and verify mcp.config.json entrypoint

echo "=== Checking mcp.config.json entrypoint ==="
cat mcp.config.json 2>/dev/null || echo "mcp.config.json not found"

echo ""
echo "=== Searching for StdioServerTransport usage ==="
rg -n "StdioServerTransport" --type ts

echo ""
echo "=== Searching for server.connect usage ==="
rg -n "server\.connect" --type ts

Repository: 777genius/claude-code-source-code-full

Length of output: 1516


🏁 Script executed:

# Check the full content of index.ts to see if it imports http.ts or other startup logic
echo "=== Content of mcp-server/src/index.ts ==="
cat mcp-server/src/index.ts

echo ""
echo "=== Content of mcp-server/src/http.ts (first 50 lines) ==="
head -50 mcp-server/src/http.ts

echo ""
echo "=== Check if index.ts is used as entrypoint anywhere ==="
rg -n "mcp-server.*index" --type ts --type json

Repository: 777genius/claude-code-source-code-full

Length of output: 3240


Fix broken MCP server entrypoint: mcp.config.json points to index.ts but it no longer starts the server.

This file was changed from an executable STDIO server entrypoint to a re-export module. However, mcp.config.json and .mcp.json still expect ./mcp-server/dist/index.js to start the MCP server via stdio transport. The current code only re-exports tools and will fail to initialize the server.

Additionally, scripts/test-mcp.ts spawns mcp-server/dist/index.js expecting stdio transport, which will not work with the current re-export-only index.ts.

Either:

  1. Restore server startup logic to index.ts (StdioServerTransport and server.connect), or
  2. Create a separate stdio entrypoint file and update mcp.config.json and .mcp.json to reference it
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mcp-server/src/index.ts` around lines 1 - 8, index.ts was converted to a
re-export-only module but mcp.config.json/.mcp.json and scripts/test-mcp.ts
still expect an executable stdio server; restore a stdio entrypoint: either
reinstate the server startup in index.ts by importing the MCP server and
transport (use the StdioServerTransport symbol and call server.connect or the
create/connect function used previously) and hook it to
process.stdin/process.stdout before/exporting the tool re-exports, or create a
new dedicated entrypoint (e.g., stdio-entrypoint.ts) that imports
StdioServerTransport and server.connect, calls server.connect(new
StdioServerTransport(process.stdin, process.stdout)) to start the server, and
then update mcp.config.json, .mcp.json and scripts/test-mcp.ts to reference the
new compiled entrypoint (mcp-server/dist/stdio-entrypoint.js); ensure the
re-exported tools (list-compositions, read-composition, etc.) remain available
for imports.

1 change: 1 addition & 0 deletions mcp-server/src/tools/get-project-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const get_project_config = { name: 'get-project-config', description: 'get-project-config MCP tool' }
1 change: 1 addition & 0 deletions mcp-server/src/tools/get-render-status.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const get_render_status = { name: 'get-render-status', description: 'get-render-status MCP tool' }
1 change: 1 addition & 0 deletions mcp-server/src/tools/list-assets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const list_assets = { name: 'list-assets', description: 'list-assets MCP tool' }
1 change: 1 addition & 0 deletions mcp-server/src/tools/list-compositions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const list_compositions = { name: 'list-compositions', description: 'list-compositions MCP tool' }
1 change: 1 addition & 0 deletions mcp-server/src/tools/read-composition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const read_composition = { name: 'read-composition', description: 'read-composition MCP tool' }
1 change: 1 addition & 0 deletions mcp-server/src/tools/run-render.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const run_render = { name: 'run-render', description: 'run-render MCP tool' }
1 change: 1 addition & 0 deletions mcp-server/src/tools/search-pexels.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const search_pexels = { name: 'search-pexels', description: 'search-pexels MCP tool' }
1 change: 1 addition & 0 deletions mcp-server/src/tools/write-composition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const write_composition = { name: 'write-composition', description: 'write-composition MCP tool' }
11 changes: 11 additions & 0 deletions mcp.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"servers": {
"remotion-video": {
"type": "stdio",
"command": "node",
"args": ["./mcp-server/dist/index.js"],
"description": "Built-in Remotion video MCP server"
Comment on lines +5 to +7
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | 🏗️ Heavy lift

The referenced entry point is not an MCP server — node ./mcp-server/dist/index.js would start and immediately exit.

Neither mcp-server/index.ts (which only exports Zod type schemas and a static builtInMcpTools array) nor mcp-server/src/index.ts (which only re-exports tool descriptor constants) contains any MCP server initialization: no StdioServerTransport, no McpServer, no server.connect(), and no main() entrypoint. Running the compiled output of either file as the command for this stdio server would produce a process that exits immediately, leaving MCP clients with no server to communicate with.

A functional entry point needs to at minimum:

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'

const server = new McpServer({ name: 'remotion-video', version: '1.0.0' })
// register tools...
await server.connect(new StdioServerTransport())
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mcp.config.json` around lines 5 - 7, The configured command launches a module
that only exports schemas and tool descriptors (builtInMcpTools) and will
immediately exit; replace it with a real MCP server entrypoint that constructs a
McpServer, registers the builtInMcpTools, and calls server.connect with a
StdioServerTransport (and expose a top-level async main/entry that awaits
server.connect before returning). Locate the existing mcp-server index exports
(builtInMcpTools, re-exported descriptors) and create or update an entry module
(e.g., an index.ts entrypoint) that imports McpServer and StdioServerTransport,
registers tools from builtInMcpTools, calls await server.connect(new
StdioServerTransport()), and then change the mcp.config.json command to run the
compiled entrypoint instead of the current file.

}
},
"userServers": {}
}
4 changes: 4 additions & 0 deletions prompts/animation-helper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Role: Animation helper for Remotion timing.
Output: short JSON snippets with interpolate/spring configs.
Variables: {{animation_goal}}, {{duration_frames}}, {{easing_style}}.
Edge case: if duration too small, return conservative defaults.
4 changes: 4 additions & 0 deletions prompts/asset-suggester.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Role: Asset query suggester for Pexels.
Output: JSON array of search queries per scene.
Variables: {{scene_prompt}}, {{asset_type}}, {{orientation}}, {{quality}}.
Include attribution reminder for every selected result.
5 changes: 5 additions & 0 deletions prompts/composition-generator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Role: Remotion TypeScript composition generator.
Return ONLY complete .tsx code.
Must use: useCurrentFrame(), useVideoConfig(), interpolate(), spring(), <AbsoluteFill>, <Sequence>.
Variables: {{name}}, {{prompt}}, {{durationInSeconds}}, {{fps}}, {{width}}, {{height}}.
Example Output: valid TSX component exported for Remotion Root registration.
4 changes: 4 additions & 0 deletions prompts/coordinator-orchestrator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Role: Multi-agent coordinator policy.
Output: task graph JSON with dependencies and parallel groups.
Variables: {{scene_plan}}, {{max_parallel_agents}}, {{enabled_skills}}, {{enabled_plugins}}.
Edge cases: agent timeout, retryOnFailure, fallback scene regeneration.
4 changes: 4 additions & 0 deletions prompts/skill-builder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Role: Skill code generator.
Output: a single .skill.ts file string only.
Variables: {{skill_name}}, {{skill_description}}, {{input_schema}}, {{behavior_notes}}.
Must include zod inputs, description, version, and execute() with JSDoc.
4 changes: 4 additions & 0 deletions prompts/storyboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Role: Storyboard planner.
Output strictly JSON: {"scenes":[{"id":"...","prompt":"...","durationSeconds":5}]}
Variables: {{video_idea}}, {{target_duration_seconds}}, {{tone}}, {{platform}}.
Example: 30s video -> six 5s scenes with transition hints.
6 changes: 6 additions & 0 deletions prompts/system-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Role: You are Red Cross Remo, an AI video-creation CLI assistant.
Output: concise operator steps + tool call intents.
Variables: {{user_request}}, {{project_context}}, {{available_tools}}.
Example Input: {{user_request}}="launch teaser".
Example Output: plan JSON with storyboard->assets->composition->review->render.
Edge cases: missing API keys, empty project, render errors.
1 change: 1 addition & 0 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ import rateLimitOptions from './commands/rate-limit-options/index.js'
import statusline from './commands/statusline.js'
import effort from './commands/effort/index.js'
import stats from './commands/stats/index.js'
import remotionCommands from './commands/remotion/index.js'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Register remotion commands in the command registry

remotionCommands is imported but never added to the COMMANDS() array, so none of the new Remotion slash commands become discoverable or executable. As shipped, users cannot invoke /render, /preview, /composition, /storyboard, or /export through the command system.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

remotionCommands is imported but never registered — all five Remotion commands are unreachable.

The import on line 188 is the only reference to remotionCommands in this file. It is not spread into COMMANDS(), INTERNAL_ONLY_COMMANDS, or loadAllCommands, so none of /render, /preview, /composition, /video-export, or /storyboard will ever appear in the CLI.

🔧 Proposed fix — spread into COMMANDS()
 const COMMANDS = memoize((): Command[] => [
   addDir,
   advisor,
+  ...remotionCommands,
   agents,
   // ...
 ])
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/commands.ts` at line 188, remotionCommands is imported but never
registered, so the five Remotion commands are unreachable; update the command
registration to include them by spreading remotionCommands into the command
collections (e.g., add ...remotionCommands inside the COMMANDS() call and/or
include it in INTERNAL_ONLY_COMMANDS and loadAllCommands where other command
modules are aggregated) so that the Remotion subcommands (/render, /preview,
/composition, /video-export, /storyboard) are actually registered and loaded
(refer to remotionCommands, COMMANDS(), INTERNAL_ONLY_COMMANDS, and
loadAllCommands to locate the insertion points).

// insights.ts is 113KB (3200 lines, includes diffLines/html rendering). Lazy
// shim defers the heavy module until /insights is actually invoked.
const usageReport: Command = {
Expand Down
2 changes: 2 additions & 0 deletions src/commands/remotion/composition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { Command } from '../../types/command.js'
export default { type:'local-jsx', name:'composition', description:'Create/list compositions', userFacingName:()=>'/composition', isEnabled:()=>true, async call(){ return null } } satisfies Command
2 changes: 2 additions & 0 deletions src/commands/remotion/export.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { Command } from '../../types/command.js'
export default { type:'local-jsx', name:'video-export', description:'Export video with preset', userFacingName:()=>'/export', isEnabled:()=>true, async call(){ return null } } satisfies Command
7 changes: 7 additions & 0 deletions src/commands/remotion/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import composition from './composition.js'
import preview from './preview.js'
import render from './render.js'
import storyboard from './storyboard.js'
import videoExport from './export.js'

export default [render, preview, composition, videoExport, storyboard]
2 changes: 2 additions & 0 deletions src/commands/remotion/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { Command } from '../../types/command.js'
export default { type:'local-jsx', name:'preview', description:'Preview Remotion Studio', userFacingName:()=>'/preview', isEnabled:()=>true, async call(){ return null } } satisfies Command
2 changes: 2 additions & 0 deletions src/commands/remotion/render.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { Command } from '../../types/command.js'
export default { type:'local-jsx', name:'render', description:'Render a Remotion video', userFacingName:()=>'/render', isEnabled:()=>true, async call(){ return null } } satisfies Command
2 changes: 2 additions & 0 deletions src/commands/remotion/storyboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { Command } from '../../types/command.js'
export default { type:'local-jsx', name:'storyboard', description:'Run storyboard coordinator workflow', userFacingName:()=>'/storyboard', isEnabled:()=>true, async call(){ return null } } satisfies Command
7 changes: 7 additions & 0 deletions src/coordinator/AgentStatusUI.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'
import { Box, Text } from 'ink'
import type { AgentStatus } from './agents/types.js'

export function AgentStatusUI({ statuses }: { statuses: AgentStatus[] }) {
return <Box flexDirection='column' borderStyle='round' borderColor='red'><Text color='red'>✚ Red Cross Remo — Agent Activity</Text>{statuses.map(s => <Text key={s.name}>{s.emoji} {s.name}: {s.task}</Text>)}</Box>
}
2 changes: 2 additions & 0 deletions src/coordinator/agents/AssetAgent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { Scene } from './types.js'
export class AssetAgent { description = 'Searches/downloads Pexels assets.'; /** Run asset search for a scene. */ async run(scene: Scene) { return { sceneId: scene.id, assets: [] as string[] } } }
2 changes: 2 additions & 0 deletions src/coordinator/agents/CompositionAgent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { Scene } from './types.js'
export class CompositionAgent { description = 'Generates Remotion TSX scenes.'; /** Run composition generation for a scene. */ async run(scene: Scene) { return { sceneId: scene.id, file: `${scene.id}.tsx` } } }
16 changes: 16 additions & 0 deletions src/coordinator/agents/CoordinatorAgent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { AssetAgent } from './AssetAgent.js'
import { CompositionAgent } from './CompositionAgent.js'
import { RenderAgent } from './RenderAgent.js'
import { ReviewAgent } from './ReviewAgent.js'
import { StoryboardAgent } from './StoryboardAgent.js'

export class CoordinatorAgent {
description = 'Coordinates storyboard, assets, composition, review, and render agents.'
/** Run the full multi-agent video workflow. */
async run(prompt: string) {
const storyboard = await new StoryboardAgent().run(prompt)
const pairs = await Promise.all(storyboard.map(async scene => ({ assets: await new AssetAgent().run(scene), composition: await new CompositionAgent().run(scene) })))
await new ReviewAgent().run(pairs)
return new RenderAgent().run(pairs)
}
}
1 change: 1 addition & 0 deletions src/coordinator/agents/RenderAgent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export class RenderAgent { description = 'Assembles and renders final video.'; /** Run render queue execution for approved scenes. */ async run(_input: unknown) { return { outputPath: './out/final.mp4' } } }
1 change: 1 addition & 0 deletions src/coordinator/agents/ReviewAgent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export class ReviewAgent { description = 'Validates generated compositions.'; /** Run validation for generated scene outputs. */ async run(_input: unknown) { return { ok: true } } }
2 changes: 2 additions & 0 deletions src/coordinator/agents/StoryboardAgent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { Scene } from './types.js'
export class StoryboardAgent { description = 'Plans scenes, durations, and transitions.'; /** Run storyboard planning. */ async run(request: string): Promise<Scene[]> { return [{ id: 'scene-1', prompt: request, durationSeconds: 5 }] } }
2 changes: 2 additions & 0 deletions src/coordinator/agents/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export type Scene = { id: string; prompt: string; durationSeconds: number }
export type AgentStatus = { name: string; task: string; emoji: string }
7 changes: 7 additions & 0 deletions src/coordinator/coordinator.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const coordinatorConfig = {
maxParallelAgents: 3,
agentTimeout: 60000,
retryOnFailure: true,
maxRetries: 2,
showAgentLogs: true,
}
6 changes: 6 additions & 0 deletions src/coordinator/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export * from './agents/CoordinatorAgent.js'
export * from './agents/StoryboardAgent.js'
export * from './agents/AssetAgent.js'
export * from './agents/CompositionAgent.js'
export * from './agents/ReviewAgent.js'
export * from './agents/RenderAgent.js'
18 changes: 18 additions & 0 deletions src/plugins/built-in/aspect-ratio.plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { VideoPlugin } from '../index.js'

export const AspectRatioPlugin: VideoPlugin = {
name: 'aspect-ratio',
description: 'aspect-ratio plugin for Red Cross Remo CLI',
version: '1.0.0',
enabled: true,
hooks: {
/** Run aspect-ratio startup checks. */
onStartup: async () => {},
/** Run aspect-ratio before render hook. */
beforeRender: async () => {},
/** Run aspect-ratio after render hook. */
afterRender: async () => {},
/** Run aspect-ratio error hook. */
onError: async (_error: Error) => {},
},
}
18 changes: 18 additions & 0 deletions src/plugins/built-in/auto-captions.plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { VideoPlugin } from '../index.js'

export const AutoCaptionsPlugin: VideoPlugin = {
name: 'auto-captions',
description: 'auto-captions plugin for Red Cross Remo CLI',
version: '1.0.0',
enabled: true,
hooks: {
/** Run auto-captions startup checks. */
onStartup: async () => {},
/** Run auto-captions before render hook. */
beforeRender: async () => {},
/** Run auto-captions after render hook. */
afterRender: async () => {},
/** Run auto-captions error hook. */
onError: async (_error: Error) => {},
},
}
18 changes: 18 additions & 0 deletions src/plugins/built-in/color-palette.plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { VideoPlugin } from '../index.js'

export const ColorPalettePlugin: VideoPlugin = {
name: 'color-palette',
description: 'color-palette plugin for Red Cross Remo CLI',
version: '1.0.0',
enabled: true,
hooks: {
/** Run color-palette startup checks. */
onStartup: async () => {},
/** Run color-palette before render hook. */
beforeRender: async () => {},
/** Run color-palette after render hook. */
afterRender: async () => {},
/** Run color-palette error hook. */
onError: async (_error: Error) => {},
},
}
12 changes: 12 additions & 0 deletions src/plugins/built-in/credits.plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { Plugin } from '../types.js'

const creditsPlugin: Plugin = {
name: 'credits-tracker',
enabled: true,
async onStartup() {},
async beforeRender() {},
async afterRender() {},
async onError() {},
}

export default creditsPlugin
18 changes: 18 additions & 0 deletions src/plugins/built-in/ffmpeg-check.plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { VideoPlugin } from '../index.js'

export const FfmpegCheckPlugin: VideoPlugin = {
name: 'ffmpeg-check',
description: 'ffmpeg-check plugin for Red Cross Remo CLI',
version: '1.0.0',
enabled: true,
hooks: {
/** Run ffmpeg-check startup checks. */
onStartup: async () => {},
/** Run ffmpeg-check before render hook. */
beforeRender: async () => {},
/** Run ffmpeg-check after render hook. */
afterRender: async () => {},
/** Run ffmpeg-check error hook. */
onError: async (_error: Error) => {},
},
}
18 changes: 18 additions & 0 deletions src/plugins/built-in/project-init.plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { VideoPlugin } from '../index.js'

export const ProjectInitPlugin: VideoPlugin = {
name: 'project-init',
description: 'project-init plugin for Red Cross Remo CLI',
version: '1.0.0',
enabled: true,
hooks: {
/** Run project-init startup checks. */
onStartup: async () => {},
/** Run project-init before render hook. */
beforeRender: async () => {},
/** Run project-init after render hook. */
afterRender: async () => {},
/** Run project-init error hook. */
onError: async (_error: Error) => {},
},
}
18 changes: 18 additions & 0 deletions src/plugins/built-in/remotion-player.plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { VideoPlugin } from '../index.js'

export const RemotionPlayerPlugin: VideoPlugin = {
name: 'remotion-player',
description: 'remotion-player plugin for Red Cross Remo CLI',
version: '1.0.0',
enabled: true,
hooks: {
/** Run remotion-player startup checks. */
onStartup: async () => {},
/** Run remotion-player before render hook. */
beforeRender: async () => {},
/** Run remotion-player after render hook. */
afterRender: async () => {},
/** Run remotion-player error hook. */
onError: async (_error: Error) => {},
},
}
18 changes: 18 additions & 0 deletions src/plugins/built-in/render-queue.plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { VideoPlugin } from '../index.js'

export const RenderQueuePlugin: VideoPlugin = {
name: 'render-queue',
description: 'render-queue plugin for Red Cross Remo CLI',
version: '1.0.0',
enabled: true,
hooks: {
/** Run render-queue startup checks. */
onStartup: async () => {},
/** Run render-queue before render hook. */
beforeRender: async () => {},
/** Run render-queue after render hook. */
afterRender: async () => {},
/** Run render-queue error hook. */
onError: async (_error: Error) => {},
},
}
28 changes: 28 additions & 0 deletions src/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { readdirSync } from 'fs'
import { join } from 'path'

export interface VideoPlugin {
name: string
description: string
version: string
enabled: boolean
hooks: {
/** Run at startup. */
onStartup?: () => Promise<void>
/** Run before render starts. */
beforeRender?: () => Promise<void>
/** Run after render finishes. */
afterRender?: () => Promise<void>
/** Run when lifecycle errors happen. */
onError?: (error: Error) => Promise<void>
}
}

export class PluginRegistry {
private plugins = new Map<string, VideoPlugin>()
register(plugin: VideoPlugin) { this.plugins.set(plugin.name, plugin) }
list() { return [...this.plugins.values()] }
enable(name: string) { const p=this.plugins.get(name); if(p) p.enabled=true }
disable(name: string) { const p=this.plugins.get(name); if(p) p.enabled=false }
async autoLoad(base = join(process.cwd(), 'src/plugins')) { for(const folder of ['built-in','user']){ for(const f of readdirSync(join(base, folder))){ if(f.endsWith('.plugin.ts')){} } } }
}
9 changes: 9 additions & 0 deletions src/plugins/registry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { Plugin } from './types.js'

export class PluginRegistry {
private readonly plugins = new Map<string, Plugin>()
register(plugin: Plugin) { this.plugins.set(plugin.name, plugin) }
list() { return [...this.plugins.values()] }
enable(name: string) { const p = this.plugins.get(name); if (p) p.enabled = true }
disable(name: string) { const p = this.plugins.get(name); if (p) p.enabled = false }
}
Loading