Skip to content

The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.

1.0 KB
Raw Blame
import assert from 'node:assert/strict';
import { readFile, writeFile, access } from 'node:fs/promises';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const root = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
const metadata = JSON.parse(await readFile(path.join(root, 'release.json'), 'utf8'));
assert.equal(metadata.target, process.platform === 'win32' && process.arch === 'x64' ? 'win-x64' : process.platform === 'darwin' && process.arch === 'arm64' ? 'mac-arm64' : '', 'Install the package for this OS/CPU');
const node = path.join(root, 'runtime/node', process.platform === 'win32' ? 'node.exe' : 'bin/node');
await access(node);
const config = JSON.parse(await readFile(path.join(root, '.mcp.json'), 'utf8'));
Object.assign(config.mcpServers.openmotion, { command: node, args: ['--experimental-strip-types', '--import', './bootstrap.mjs', 'mcp.ts'], cwd: root });
await writeFile(path.join(root, 'plugin/.mcp.json'), JSON.stringify(config, null, 2) + '\n');
console.log('Thin plugin configured for: ' + root);