mirror of
https://github.com/nexu-io/openmotion.git
synced 2026-12-02 06:59:39 +08:00
Load completed final-video bytes over the MCP App server-tool connection so Codex transcript truncation cannot corrupt first playback. Preserve pinned identity, bounded retries, duplicate-delivery handling and one final video per delivery. Validated with 10 passing PR checks, full packaged public-tool and two-round rendering regressions, and user-confirmed native Codex first-load acceptance.
14 lines
716 B
JavaScript
14 lines
716 B
JavaScript
import { App } from '@modelcontextprotocol/ext-apps';
|
|
import { mountFinalVideo } from './final-video-component.js';
|
|
const app = new App({ name: 'OpenMotion final video', version: '1.0.0' }, {});
|
|
document.documentElement.dataset.motionUi = '';
|
|
const root = document.createElement('main'); document.body.append(root);
|
|
const ui = mountFinalVideo(root, app);
|
|
app.ontoolinput = ui.setInput;
|
|
app.ontoolresult = ui.update;
|
|
app.onteardown = async () => { ui.destroy(); return {}; };
|
|
app.onhostcontextchanged = context => { if (context.theme) document.documentElement.dataset.theme = context.theme; };
|
|
await app.connect();
|
|
const theme = app.getHostContext()?.theme;
|
|
if (theme) document.documentElement.dataset.theme = theme;
|