Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: add a dynamic motion graphics option to launch videos

[._.]/ Adam Eivyc757b411991c
diff --git a/client/src/components/apps/LaunchVideoPanel.jsx b/client/src/components/apps/LaunchVideoPanel.jsx
index 2573c3ffb9..4e41eaa791 100644
--- a/client/src/components/apps/LaunchVideoPanel.jsx
+++ b/client/src/components/apps/LaunchVideoPanel.jsx
@@ -26,6 +26,7 @@ function LaunchVideoForm({ appId, onQueued }) {
const [direction, setDirection] = useState('');
const [format, setFormat] = useState('landscape');
const [duration, setDuration] = useState(20);
+ const [motionGraphics, setMotionGraphics] = useState(false);
const [music, setMusic] = useState(false);
const [generateMusic, setGenerateMusic] = useState(false);
const [musicTrack, setMusicTrack] = useState('');
@@ -46,7 +47,7 @@ function LaunchVideoForm({ appId, onQueued }) {
if (submitting.current) return;
submitting.current = true;
await createAppLaunchVideo(appId, {
- tone, direction, format, targetDurationSec: duration,
+ tone, direction, format, targetDurationSec: duration, motionGraphics,
...(music ? (generateMusic ? { generateMusic: true } : { musicTrack }) : {}),
...picker.pin,
}, { silent: true }).then(onQueued).finally(() => { submitting.current = false; });
@@ -62,6 +63,7 @@ function LaunchVideoForm({ appId, onQueued }) {
<div><label htmlFor="launch-direction">Direction (optional)</label><textarea id="launch-direction" className={inputClass} maxLength={2000} value={direction} onChange={event => setDirection(event.target.value)} /></div>
<div><label htmlFor="launch-format">Format</label><select id="launch-format" className={inputClass} value={format} onChange={event => setFormat(event.target.value)}>{['landscape', 'vertical', 'square'].map(value => <option key={value} value={value}>{value}</option>)}</select></div>
<div><label htmlFor="launch-duration">Duration (15–120 seconds)</label><input id="launch-duration" type="number" min={15} max={120} step={1} required className={inputClass} value={duration} onChange={event => setDuration(event.target.value === '' ? '' : Number(event.target.value))} /></div>
+ <div><label htmlFor="launch-motion-graphics"><input id="launch-motion-graphics" type="checkbox" checked={motionGraphics} onChange={event => setMotionGraphics(event.target.checked)} /> Dynamic motion graphics</label><p className="text-sm text-port-text-muted">Beat-cut showreel style: kinetic type, color-field swaps and generative shapes around the key flow.</p></div>
<div><label htmlFor="launch-music"><input id="launch-music" type="checkbox" checked={music} onChange={event => setMusic(event.target.checked)} /> Include music</label></div>
{music && <div><label htmlFor="launch-generate-music"><input id="launch-generate-music" type="checkbox" checked={generateMusic} onChange={event => setGenerateMusic(event.target.checked)} /> Generate original music</label><p className="text-sm text-port-text-muted">The agent uses your configured music engine; provider charges may apply.</p></div>}
{music && !generateMusic && <fieldset className="space-y-2">
diff --git a/client/src/components/apps/LaunchVideoPanel.test.jsx b/client/src/components/apps/LaunchVideoPanel.test.jsx
index ca6ae3b9e2..7683d9f5f9 100644
--- a/client/src/components/apps/LaunchVideoPanel.test.jsx
+++ b/client/src/components/apps/LaunchVideoPanel.test.jsx
@@ -36,7 +36,7 @@ describe('launch video drawer', () => {
expect(screen.getByRole('button', { name: 'Queuing…' }).disabled).toBe(true);
expect(createAppLaunchVideo).toHaveBeenCalledTimes(1);
expect(createAppLaunchVideo).toHaveBeenCalledWith('example', {
- tone: 'cinematic', direction: '', format: 'vertical', targetDurationSec: 22, musicTrack: 'track-1a2b.wav',
+ tone: 'cinematic', direction: '', format: 'vertical', targetDurationSec: 22, motionGraphics: false, musicTrack: 'track-1a2b.wav',
provider: 'example-provider', model: 'example-model',
}, { silent: true });
finish({ taskId: 'task-example' });
@@ -47,15 +47,16 @@ describe('launch video drawer', () => {
expect(createAppLaunchVideo).toHaveBeenCalledTimes(1);
});
- it('queues generated music without requiring a library track for a longer video', async () => {
+ it('queues generated music and motion graphics without requiring a library track for a longer video', async () => {
createAppLaunchVideo.mockReset().mockResolvedValue({ taskId: 'task-generated' });
renderPanel('/?launchVideo=true');
+ fireEvent.click(screen.getByLabelText('Dynamic motion graphics'));
fireEvent.change(screen.getByLabelText('Duration (15–120 seconds)'), { target: { value: '90' } });
fireEvent.click(screen.getByLabelText('Include music'));
expect(screen.getByLabelText('Generate original music').checked).toBe(false);
fireEvent.click(screen.getByLabelText('Generate original music'));
fireEvent.click(screen.getByRole('button', { name: 'Queue launch video' }));
- await waitFor(() => expect(createAppLaunchVideo).toHaveBeenCalledWith('example', expect.objectContaining({ targetDurationSec: 90, generateMusic: true }), { silent: true }));
+ await waitFor(() => expect(createAppLaunchVideo).toHaveBeenCalledWith('example', expect.objectContaining({ targetDurationSec: 90, generateMusic: true, motionGraphics: true }), { silent: true }));
expect(createAppLaunchVideo.mock.calls[0][1].musicTrack).toBeUndefined();
});
diff --git a/docs/HTML_COMPOSITIONS.md b/docs/HTML_COMPOSITIONS.md
index 0f25e4cbd6..b949f99bb4 100644
--- a/docs/HTML_COMPOSITIONS.md
+++ b/docs/HTML_COMPOSITIONS.md
@@ -70,7 +70,8 @@ explicitly when either binary is unavailable; route and queue tests still run.
This option is required for directories rooted at `launch-videos/` and can also
be applied to other composition directories. An app's **Launch Video** tab
(`/apps/<appId>/launch-video`, also linked from Overview) queues a user-triggered CoS task with
-tone, direction, format, duration (15–120 seconds), optional generated original
+tone, direction, format, duration (15–120 seconds), an optional **Dynamic motion
+graphics** style, optional generated original
music or an existing Music-library track (each listed with its filename and an
inline audio preview), and an optional
provider/model/effort pin (Auto uses the normal CoS provider selection).
@@ -82,6 +83,13 @@ instrumental prompt, waits for its media job, and passes the resulting library
filename to the renderer. Shorter music beds loop to fill the video. A generation
failure is reported instead of silently dropping the soundtrack.
+Dynamic motion graphics (`motionGraphics: true`, off by default) asks the agent for
+a beat-cut showreel instead of a paced walkthrough: palette color-field swaps,
+kinetic typography, easing showcases, generative geometry seeded from `t`, an
+optional HUD frame, and a name lockup endcard, with the recreated key flow kept
+as one or two beats. The same privacy and reading-time gates apply, so every
+kinetic word and HUD label is a storyboard line with a readable hold.
+
The task supplies the selected app repository and process ports separately from
the PortOS media API origin. Product evidence comes from that repository; PortOS
serves only as the orchestration/rendering service unless it is the selected app.
diff --git a/server/lib/validation.js b/server/lib/validation.js
index ab4b17ccde..d0c918ee6f 100644
--- a/server/lib/validation.js
+++ b/server/lib/validation.js
@@ -2448,6 +2448,7 @@ export const appLaunchVideoRequestSchema = z.object({
format: z.enum(['landscape', 'vertical', 'square']).default('landscape'),
targetDurationSec: z.number().int().min(15).max(120).default(20),
generateMusic: z.boolean().default(false),
+ motionGraphics: z.boolean().default(false),
musicTrack: z.string().min(1).max(255).regex(/^[^/\\]+$/).optional(),
}).strict();
diff --git a/server/routes/apps/launchVideos.test.js b/server/routes/apps/launchVideos.test.js
index df8027f05d..db446582d3 100644
--- a/server/routes/apps/launchVideos.test.js
+++ b/server/routes/apps/launchVideos.test.js
@@ -43,6 +43,7 @@ describe('user-triggered launch videos', () => {
expect(task.prompt).toContain('"targetDurationSec":18');
expect(task.prompt).toContain(`launch-videos/example/${response.body.runId}`);
expect(task.prompt).toContain('Do not read .env*');
+ expect(task.prompt).toContain('"motionGraphics":false');
expect(task.prompt).toContain('Only report success after complete');
expect(task.provider).toBeUndefined();
addTask.mockClear();
@@ -59,16 +60,19 @@ describe('user-triggered launch videos', () => {
it('queues a two-minute managed-app video with explicit music generation and product context', async () => {
getAppById.mockResolvedValue({ id: 'example', name: 'Example Product', repoPath: process.cwd(), processes: [{ name: 'example-ui', port: 4321 }], secret: 'never-forward' });
- expect((await submit({ targetDurationSec: 120, generateMusic: true })).status).toBe(202);
+ expect((await submit({ targetDurationSec: 120, generateMusic: true, motionGraphics: true })).status).toBe(202);
const [task] = addTask.mock.calls[0];
expect(task.prompt).toContain('"name":"Example Product"');
expect(task.prompt).toContain('"port":4321');
expect(task.prompt).toContain('"generateMusic":true');
+ expect(task.prompt).toContain('"motionGraphics":true');
+ expect(task.prompt).toContain('When motionGraphics is true');
expect(task.prompt).toContain('"targetDurationSec":120');
expect(task.prompt).toContain('NOT the selected app');
expect(task.prompt).toContain('/api/music/generate');
expect(task.prompt).not.toContain('never-forward');
expect((await submit({ targetDurationSec: 121 })).status).toBe(400);
+ expect((await submit({ motionGraphics: 'yes' })).status).toBe(400);
expect((await submit({ generateMusic: true, musicTrack: 'example.wav' })).status).toBe(400);
expect(addTask).toHaveBeenCalledTimes(1);
});
diff --git a/server/services/taskPromptDefaults/appLaunchVideo.js b/server/services/taskPromptDefaults/appLaunchVideo.js
index 26055d8dd9..256b114f78 100644
--- a/server/services/taskPromptDefaults/appLaunchVideo.js
+++ b/server/services/taskPromptDefaults/appLaunchVideo.js
@@ -8,6 +8,7 @@ Write only to the supplied output directory (plus the runner's completion sentin
- storyboard.json: {"posterSec":5,"scenes":[{"durationSec":20,"lines":[{"text":"Plan your next great project","wordCount":5,"holdSec":2}]}]}.
Every scene has durationSec; every visible text element has text, its exact whitespace-separated wordCount, and holdSec. Total 15–120 seconds and within two seconds of the chosen target. Each hold is at least max(0.8, 0.3 * wordCount) and fits its scene. Implement those holds faithfully, including transitions. Choose posterSec at the strongest settled beat.
- index.html and local assets: globalThis.portosComposition = {durationSec, fps:24, width, height, async seek(t){...}}. Use dimensions 1920x1080 (landscape), 1080x1920 (vertical), or 1080x1080 (square). Seek deterministically from t; await fonts and any asynchronous work. No wall-clock animations, external URLs, popups, workers or browser storage. Keep HTML/CSS/JS/SVG/JSON/Markdown/text UTF-8. No raster screenshots or footage.
+When motionGraphics is true, make a dynamic motion-graphics piece: a designer's showreel built around this product, not a slideshow of recreated screens. Cut on a steady beat (a new beat every one to two seconds, landing on bar boundaries when music is present) and give each beat a distinct technique: bold color-field swaps drawn from the app's palette, oversized kinetic typography (scale, mask and slide reveals; repeated-word patterns), easing-curve showcases (expo, back, elastic, bounce), generative geometry computed from t (tiling patterns, radial bursts, particle fields, wireframe forms), shape morphs, and a logo/name lockup endcard. A thin HUD overlay (corner crop marks, timecode, beat counter) may frame the piece. Keep the recreated key flow as one or two punchy beats so the evidence-backed claim still lands. All motion stays a pure function of t: seeded pseudo-randomness only, never Math.random or timers. Every word shown, including repeated kinetic words and HUD labels, is a storyboard line whose hold meets the reading-time gate; keep HUD text to digits and symbols. When motionGraphics is false, favor a clear, paced product walkthrough.
When generateMusic is true, the user explicitly requests original instrumental music. Compose a music prompt matching the storyboard and tone, using only fictional/public product context. First GET /api/music/engines from the supplied PortOS service API base. Select a ready, platformSupported engine (prefer defaultEngine when ready), using its ready default model or a model marked ready in modelReadyById. If none is ready, report the setup requirement and stop. POST {"prompt":"<your musical direction>","instrumentalOnly":true,"engine":"<selected engine id>","modelId":"<selected model id>","durationSec":<duration within the engine limits>} to the supplied PortOS service API base + /api/music/generate with the same Authorization header as rendering. Aim for targetDurationSec within the engine duration limits; a shorter music bed is looped and faded by the renderer to fill the video. Do not install models or change provider settings. Subscribe to /api/html-composition/<jobId>/events (the shared media queue stream) until complete; take result.filename from that completed job as musicTrack in the render JSON. Cancel that job via /api/html-composition/<jobId>/cancel if canceled. If generation fails, report the failure rather than silently rendering without music. This API may write its generated track to the Music library; do not write arbitrary files there yourself. When generateMusic is false, never generate music; preserve the supplied library musicTrack, if any.
Render using the supplied POST URL and JSON payload (adding only the completed generated musicTrack when requested) with the agent's Authorization: Bearer credential from PORTOS_API_TOKEN; never print or persist the credential. Privacy and readability checks fail closed and name the file/pattern or scene/line. Replace offending content, never bypass the gates. A queued job is not success: subscribe to its /events SSE endpoint until complete, error or canceled. Do not poll. On cancellation, cancel the media job with its /cancel endpoint. Keep the CoS run active through rendering. Only report success after complete. The server copies the validated plan, storyboard and caption plus MP4 and poster into the run directory and registers the video in Media History.
`;
diff --git a/server/services/taskPromptDefaults/integrity.snapshot.json b/server/services/taskPromptDefaults/integrity.snapshot.json
index 027e796dbb..ccedbe5ecd 100644
--- a/server/services/taskPromptDefaults/integrity.snapshot.json
+++ b/server/services/taskPromptDefaults/integrity.snapshot.json
@@ -2,7 +2,7 @@
"DEFAULT_TASK_PROMPTS": {
"accessibility": "46f628a44a919bb788de8761e86ca0e1",
"api-contract": "d52e00ec53eb5618df1a769efccc08f3",
- "app-launch-video": "0247e82d4ae6e812dbd666d3bd75ad62",
+ "app-launch-video": "71962a1f6f902d93f2c8840e3281301b",
"better-cognitive-load": "a1fe22f6ef936131456c55a6b0623204",
"better-complexity": "c99f67b43ff54a1c8cf0176c721d9c06",
"better-dependency-freedom": "8a79c8be829f926bbc7720ee29818d53",
@@ -64,7 +64,7 @@
"PROMPT_VERSIONS": {
"accessibility": 5,
"api-contract": 2,
- "app-launch-video": 2,
+ "app-launch-video": 3,
"better-cognitive-load": 1,
"better-complexity": 2,
"better-dependency-freedom": 1,
@@ -131,7 +131,8 @@
"cf02b10a5993baf473e0d320771f26b6"
],
"app-launch-video": [
- "fa15ea11b4cf49f31ae17513ff780421"
+ "fa15ea11b4cf49f31ae17513ff780421",
+ "0247e82d4ae6e812dbd666d3bd75ad62"
],
"better-complexity": [
"c92b99080d0453d70bb26a412fb48ce9"
diff --git a/server/services/taskPromptDefaults/versions.js b/server/services/taskPromptDefaults/versions.js
index c23595edb6..17668c67c4 100644
--- a/server/services/taskPromptDefaults/versions.js
+++ b/server/services/taskPromptDefaults/versions.js
@@ -7,7 +7,7 @@
// Prompt versions — bump when a default prompt changes so existing instances auto-upgrade.
// Only non-customized prompts (promptCustomized !== true) are upgraded.
export const PROMPT_VERSIONS = {
- 'app-launch-video': 2,
+ 'app-launch-video': 3,
'model-comparison-refresh': 4, // v4: installed inventory, sourced composite estimates and authenticated import
// Current claim-flow bumps retire the Copilot fallback, drive local reviewers
// fail closed, verify the remote merge state, and clean up without force-delete.