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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: give launch videos their own app tab with agent choice, track previews, and downloads
[._.]/ Adam Eivy80eb6f74d4eb
diff --git a/client/src/components/apps/AppDetailView.jsx b/client/src/components/apps/AppDetailView.jsxindex e6fa4e1b08..7f52e0e499 100644--- a/client/src/components/apps/AppDetailView.jsx+++ b/client/src/components/apps/AppDetailView.jsx@@ -4,7 +4,7 @@ import {ArrowLeft, Play, Square, RotateCcw, ExternalLink, Gamepad2, Hammer, RefreshCw,Pencil, AlertTriangle, Sparkles, LayoutDashboard, Zap, Dog, FileText, GitBranch,Compass, CircleDot, GitPullRequest, Ticket, Cpu, ShieldCheck, BookOpen, Boxes,- ListChecks,+ ListChecks, Clapperboard,} from 'lucide-react';import DeployPanel from './DeployPanel';import EditAppDrawer from './EditAppDrawer';@@ -33,6 +33,7 @@ import ReferencesTab from './tabs/ReferencesTab';import SubmodulesTab from './tabs/SubmodulesTab';import DatadogTab from './tabs/DatadogTab';import UpdateTab from './tabs/UpdateTab';+import LaunchVideoPanel from './LaunchVideoPanel';import TabPills from '../ui/TabPills';// Icons live here rather than on `APP_DETAIL_TABS` so `constants.js` stays@@ -47,6 +48,7 @@ export const APP_DETAIL_TAB_ICONS = {issues: CircleDot,'pull-requests': GitPullRequest,jira: Ticket,+ 'launch-video': Clapperboard,processes: Cpu,quality: ShieldCheck,references: BookOpen,@@ -336,6 +338,8 @@ function AppDetail() {return <PullRequestsTab appId={appId} appName={app.name} />;case 'jira':return <JiraTab app={app} onRefresh={fetchApp} />;+ case 'launch-video':+ return <LaunchVideoPanel app={app} />;case 'processes':return <ProcessesTab appId={app.id} pm2ProcessNames={app.pm2ProcessNames} />;case 'quality':diff --git a/client/src/components/apps/LaunchVideoPanel.jsx b/client/src/components/apps/LaunchVideoPanel.jsxindex a54a621b7a..cd9e7ae38f 100644--- a/client/src/components/apps/LaunchVideoPanel.jsx+++ b/client/src/components/apps/LaunchVideoPanel.jsx@@ -1,34 +1,124 @@import { useEffect, useRef, useState } from 'react';import { Link, useSearchParams } from 'react-router';+import { Download } from 'lucide-react';import Drawer from '../Drawer';+import ProviderModelSelector from '../ProviderModelSelector';+import useProviderModels from '../../hooks/useProviderModels';import { useAsyncAction } from '../../hooks/useAsyncAction';import { copyToClipboard } from '../../lib/clipboard';import socket from '../../services/socket';import { createAppLaunchVideo, getAppLaunchVideos } from '../../services/apiApps';import { listPipelineMusicLibrary } from '../../services/apiPipeline';+import { enabledProcessProviderFilter } from '../../utils/providerTypes';+import { formatBytes, formatDateTime, formatDurationSec } from '../../utils/formatters';const inputClass = 'w-full rounded border border-port-border bg-port-bg p-2 text-port-text';const buttonClass = 'rounded bg-port-accent px-3 py-2 text-white disabled:opacity-50';+const videoUrl = video => `/data/videos/${encodeURIComponent(video.filename)}`;+const posterUrl = video => `/data/video-thumbnails/${encodeURIComponent(video.thumbnail)}`;-export default function LaunchVideoPanel({ app }) {- const [search, setSearch] = useSearchParams();- const open = search.get('launchVideo') === 'true';+// The run is an agent task, so it takes the same provider/model/effort pin as+// every other manual CoS dispatch. Mounted only while the drawer is open, so+// the provider catalog is fetched on demand.+function LaunchVideoForm({ appId, onQueued }) {const [tone, setTone] = useState('default');const [direction, setDirection] = useState('');const [format, setFormat] = useState('landscape');const [duration, setDuration] = useState(20);const [music, setMusic] = useState(false);const [musicTrack, setMusicTrack] = useState('');- const [tracks, setTracks] = useState([]);+ const [tracks, setTracks] = useState(null);+ const [effort, setEffort] = useState('');+ const [error, setError] = useState('');+ const submitting = useRef(false);+ const {+ providers, selectedProviderId, selectedModel, availableModels, loading: providersLoading,+ setSelectedProviderId, setSelectedModel,+ } = useProviderModels({ filter: enabledProcessProviderFilter, allowDefault: true, preselectDefaults: true, silent: true, withEffort: true });++ useEffect(() => {+ let active = true;+ listPipelineMusicLibrary({ silent: true }).then(result => {+ if (active) setTracks(result.tracks);+ }).catch(err => { if (active) { setTracks([]); setError(err.message); } });+ return () => { active = false; };+ }, []);++ const [submit, running] = useAsyncAction(async () => {+ if (submitting.current) return;+ submitting.current = true;+ setError('');+ await createAppLaunchVideo(appId, {+ tone, direction, format, targetDurationSec: duration,+ ...(music ? { musicTrack } : {}),+ ...(selectedProviderId ? { provider: selectedProviderId } : {}),+ ...(selectedModel ? { model: selectedModel } : {}),+ ...(effort ? { effort } : {}),+ }, { silent: true }).then(onQueued, err => setError(err.message)).finally(() => { submitting.current = false; });+ });++ return <form className="space-y-4" onSubmit={event => { event.preventDefault(); submit(); }}>+ {error && <p role="alert" className="text-port-error">{error}</p>}+ <section className="space-y-2">+ <div className="text-xs uppercase tracking-wide text-gray-500">Agent</div>+ <ProviderModelSelector+ providers={providers}+ selectedProviderId={selectedProviderId}+ selectedModel={selectedModel}+ availableModels={availableModels}+ loading={providersLoading}+ onProviderChange={id => { setSelectedProviderId(id); setEffort(''); }}+ onModelChange={setSelectedModel}+ effort={effort}+ onEffortChange={setEffort}+ emptyProviderOption="Auto (default)"+ emptyModelOption="Default model"+ highlightToolUse+ />+ </section>+ <div><label htmlFor="launch-tone">Tone</label><select id="launch-tone" className={inputClass} value={tone} onChange={event => setTone(event.target.value)}>{['default', 'polished', 'deadpan', 'cinematic', 'parody'].map(value => <option key={value} value={value}>{value}</option>)}</select></div>+ <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–25 seconds)</label><input id="launch-duration" type="number" min={15} max={25} step={1} required className={inputClass} value={duration} onChange={event => setDuration(event.target.value === '' ? '' : Number(event.target.value))} /></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 && <fieldset className="space-y-2">+ <legend>Music-library track</legend>+ {tracks === null && <p className="text-sm text-port-text-muted">Loading tracks…</p>}+ {tracks?.length === 0 && <p>Add a track to the Music library first.</p>}+ {!!tracks?.length && <ul className="max-h-80 space-y-2 overflow-y-auto">+ {tracks.map((track, index) => {+ const id = `launch-track-${index}`;+ return <li key={track.filename} className={`rounded border p-2 ${musicTrack === track.filename ? 'border-port-accent' : 'border-port-border'}`}>+ <label htmlFor={id} className="flex cursor-pointer items-start gap-2">+ <input id={id} type="radio" name="launch-track" required value={track.filename} checked={musicTrack === track.filename} onChange={() => setMusicTrack(track.filename)} className="mt-1" />+ <span className="min-w-0">+ <span className="block truncate text-port-text">{track.label || track.filename}</span>+ <span className="block truncate font-mono text-xs text-gray-500">{track.filename} · {formatDateTime(track.updatedAt)} · {formatBytes(track.sizeBytes)}</span>+ </span>+ </label>+ <audio controls preload="none" className="mt-2 h-8 w-full" src={`/data/music/${encodeURIComponent(track.filename)}`} aria-label={`Preview ${track.label || track.filename}`} />+ </li>;+ })}+ </ul>}+ </fieldset>}+ <p className="text-sm text-port-text-muted">These options are submitted together. Follow and cancel the run in CoS agents.</p>+ <button type="submit" className={buttonClass} disabled={running || duration === '' || (music && !musicTrack)}>{running ? 'Queuing…' : 'Queue launch video'}</button>+ </form>;+}++export default function LaunchVideoPanel({ app }) {+ const [search, setSearch] = useSearchParams();+ const open = search.get('launchVideo') === 'true';const [videos, setVideos] = useState([]);const [error, setError] = useState('');const [queued, setQueued] = useState(false);- const submitting = useRef(false);- const setOpen = value => setSearch(prev => {+ const setParam = (key, value) => setSearch(prev => {const next = new URLSearchParams(prev);- if (value) next.set('launchVideo', 'true'); else next.delete('launchVideo');+ if (value) next.set(key, value); else next.delete(key);return next;});+ // The previewed take lives in the URL so a specific video is linkable.+ const selected = videos.find(video => video.id === search.get('video')) ?? videos[0];useEffect(() => {let active = true;@@ -46,51 +136,37 @@ export default function LaunchVideoPanel({ app }) {return () => { active = false; socket.off('video-gen:completed', completed); socket.off('connect', load); };}, [app.id]);- useEffect(() => {- if (!open) return;- let active = true;- listPipelineMusicLibrary({ silent: true }).then(result => {- if (active) setTracks(result.tracks);- }).catch(err => { if (active) setError(err.message); });- return () => { active = false; };- }, [open]);-- const [submit, running] = useAsyncAction(async () => {- if (submitting.current) return;- submitting.current = true;- await createAppLaunchVideo(app.id, {- tone, direction, format, targetDurationSec: duration,- ...(music ? { musicTrack } : {}),- }, { silent: true }).then(() => setQueued(true)).finally(() => { submitting.current = false; });- });-return <section className="rounded-lg border border-port-border bg-port-card p-4 space-y-3"><div className="flex flex-wrap items-center justify-between gap-3">- <h2 className="font-semibold">Launch video</h2>- <button type="button" className={buttonClass} onClick={() => { setQueued(false); setOpen(true); }}>+ <h2 className="font-semibold">Launch videos</h2>+ <button type="button" className={buttonClass} onClick={() => { setQueued(false); setParam('launchVideo', 'true'); }}>{videos.length ? 'Make another launch video' : 'Make launch video'}</button></div><p className="text-sm text-port-text-muted">Plan a short video using recreated screens and fictional content. Nothing is uploaded or posted.</p>{error && <p role="alert" className="text-port-error">{error}</p>}- {videos[0] && <div className="space-y-2">- <video controls preload="metadata" className="max-h-80 w-full" src={`/data/videos/${encodeURIComponent(videos[0].filename)}`} poster={`/data/video-thumbnails/${encodeURIComponent(videos[0].thumbnail)}`} aria-label="Latest launch video" />- <p className="whitespace-pre-wrap">{videos[0].caption}</p>- <button type="button" className="text-port-accent" onClick={() => copyToClipboard(videos[0].caption)}>Copy caption</button>- <Link className="ml-4 text-port-accent" to="/media/history">Media History</Link>+ {!videos.length && !error && <p className="text-sm text-port-text-muted">No launch videos yet.</p>}+ {selected && <div className="space-y-2">+ <video key={selected.id} controls preload="metadata" className="max-h-[60vh] w-full bg-black" src={videoUrl(selected)} poster={posterUrl(selected)} aria-label="Selected launch video" />+ <div className="flex flex-wrap items-center gap-4 text-sm">+ <span className="text-port-text-muted">{formatDateTime(selected.createdAt)}{Number.isFinite(selected.durationSec) ? ` · ${formatDurationSec(selected.durationSec)}` : ''}</span>+ <a className="inline-flex items-center gap-1 text-port-accent" href={videoUrl(selected)} download={`${app.id}-launch-video-${selected.id}.mp4`}><Download size={14} aria-hidden="true" />Download</a>+ <button type="button" className="text-port-accent" onClick={() => copyToClipboard(selected.caption)}>Copy caption</button>+ <Link className="text-port-accent" to="/media/history">Media History</Link>+ </div>+ <p className="whitespace-pre-wrap">{selected.caption}</p></div>}- <Drawer open={open} onClose={() => setOpen(false)} title="Make launch video" size="sm">- {queued ? <div className="space-y-3"><p>Launch video queued. Closing this drawer leaves the run active.</p><Link className="text-port-accent" to="/cos/agents">Open CoS agents to follow or cancel the run</Link></div> :- <form className="space-y-4" onSubmit={event => { event.preventDefault(); submit(); }}>- <div><label htmlFor="launch-tone">Tone</label><select id="launch-tone" className={inputClass} value={tone} onChange={event => setTone(event.target.value)}>{['default', 'polished', 'deadpan', 'cinematic', 'parody'].map(value => <option key={value} value={value}>{value}</option>)}</select></div>- <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–25 seconds)</label><input id="launch-duration" type="number" min={15} max={25} step={1} required className={inputClass} value={duration} onChange={event => setDuration(event.target.value === '' ? '' : Number(event.target.value))} /></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-track">Music-library track</label><select id="launch-track" required className={inputClass} value={musicTrack} onChange={event => setMusicTrack(event.target.value)}><option value="">Choose a track</option>{tracks.map(track => <option key={track.filename} value={track.filename}>{track.label}</option>)}</select>{!tracks.length && <p>Add a track to the Music library first.</p>}</div>}- <p className="text-sm text-port-text-muted">These options are submitted together. Follow and cancel the run in CoS agents.</p>- <button type="submit" className={buttonClass} disabled={running || duration === '' || (music && !musicTrack)}>{running ? 'Queuing…' : 'Queue launch video'}</button>- </form>}+ {videos.length > 1 && <ul aria-label="Launch video takes" className="grid grid-cols-2 gap-2 sm:grid-cols-4 lg:grid-cols-6">+ {videos.map(video => <li key={video.id}>+ <button type="button" aria-pressed={video.id === selected?.id} onClick={() => setParam('video', video.id)} className={`w-full overflow-hidden rounded border text-left ${video.id === selected?.id ? 'border-port-accent' : 'border-port-border'}`}>+ <img src={posterUrl(video)} alt="" loading="lazy" className="aspect-video w-full object-cover" />+ <span className="block truncate p-1 text-xs text-port-text-muted">{formatDateTime(video.createdAt)}</span>+ </button>+ </li>)}+ </ul>}+ <Drawer open={open} onClose={() => setParam('launchVideo', null)} title="Make launch video" size="md">+ {queued ? <div className="space-y-3"><p>Launch video queued. Closing this drawer leaves the run active.</p><Link className="text-port-accent" to="/cos/agents">Open CoS agents to follow or cancel the run</Link></div>+ : open && <LaunchVideoForm appId={app.id} onQueued={() => setQueued(true)} />}</Drawer></section>;}diff --git a/client/src/components/apps/LaunchVideoPanel.test.jsx b/client/src/components/apps/LaunchVideoPanel.test.jsxindex 4650733f91..ab70d7011d 100644--- a/client/src/components/apps/LaunchVideoPanel.test.jsx+++ b/client/src/components/apps/LaunchVideoPanel.test.jsx@@ -2,28 +2,43 @@ import { describe, it, expect, vi } from 'vitest';import { render, screen, fireEvent, waitFor } from '@testing-library/react';import { MemoryRouter } from 'react-router';import LaunchVideoPanel from './LaunchVideoPanel';-import { createAppLaunchVideo } from '../../services/apiApps';+import { createAppLaunchVideo, getAppLaunchVideos } from '../../services/apiApps';vi.mock('../../services/apiApps', () => ({ getAppLaunchVideos: vi.fn(async () => ({ videos: [] })), createAppLaunchVideo: vi.fn() }));-vi.mock('../../services/apiPipeline', () => ({ listPipelineMusicLibrary: async () => ({ tracks: [{ filename: 'example.wav', label: 'Example track' }] }) }));+vi.mock('../../services/apiPipeline', () => ({ listPipelineMusicLibrary: async () => ({ tracks: [{ filename: 'track-1a2b.wav', label: 'Example track', sizeBytes: 2048, updatedAt: '2026-01-01T00:00:00.000Z' }] }) }));vi.mock('../../services/socket', () => ({ default: { on: vi.fn(), off: vi.fn() } }));vi.mock('../../lib/clipboard', () => ({ copyToClipboard: vi.fn() }));+// The picker's tool-use annotation fetches from apiLocalLlm; park it unresolved.+vi.mock('../../services/apiLocalLlm', () => ({ getToolUseModels: () => new Promise(() => {}), getVisionModels: async () => ({ models: [] }) }));+const provider = { id: 'example-provider', name: 'Example Provider', type: 'cli', enabled: true, models: ['example-model'], defaultModel: 'example-model' };+vi.mock('../../hooks/useProviderModels', () => ({ default: () => ({+ providers: [provider], selectedProviderId: 'example-provider', selectedModel: 'example-model',+ availableModels: ['example-model'], loading: false, setSelectedProviderId: vi.fn(), setSelectedModel: vi.fn(),+}) }));++const renderPanel = (path = '/') => render(<MemoryRouter initialEntries={[path]}><LaunchVideoPanel app={{ id: 'example' }} /></MemoryRouter>);describe('launch video drawer', () => {- it('submits options once and leaves the run active on close', async () => {+ it('submits options with the agent pin once and leaves the run active on close', async () => {let finish;createAppLaunchVideo.mockImplementation(() => new Promise(resolve => { finish = resolve; }));- render(<MemoryRouter><LaunchVideoPanel app={{ id: 'example' }} /></MemoryRouter>);+ renderPanel();fireEvent.click(screen.getByRole('button', { name: 'Make launch video' }));fireEvent.change(screen.getByLabelText('Tone'), { target: { value: 'cinematic' } });fireEvent.change(screen.getByLabelText('Format'), { target: { value: 'vertical' } });fireEvent.change(screen.getByLabelText('Duration (15–25 seconds)'), { target: { value: '22' } });fireEvent.click(screen.getByLabelText('Include music'));- await screen.findByRole('option', { name: 'Example track' });- fireEvent.change(screen.getByLabelText('Music-library track'), { target: { value: 'example.wav' } });+ // Each track is identifiable by name + file and audible before choosing it.+ const choice = await screen.findByRole('radio', { name: /Example track/ });+ expect(screen.getByText(/track-1a2b\.wav/)).toBeTruthy();+ expect(screen.getByLabelText('Preview Example track').getAttribute('src')).toBe('/data/music/track-1a2b.wav');+ fireEvent.click(choice);fireEvent.click(screen.getByRole('button', { name: 'Queue launch video' }));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: 'example.wav' }, { silent: true });+ expect(createAppLaunchVideo).toHaveBeenCalledWith('example', {+ tone: 'cinematic', direction: '', format: 'vertical', targetDurationSec: 22, musicTrack: 'track-1a2b.wav',+ provider: 'example-provider', model: 'example-model',+ }, { silent: true });finish({ taskId: 'task-example' });await waitFor(() => expect(screen.getByText('Launch video queued. Closing this drawer leaves the run active.')).toBeTruthy());expect(screen.getByRole('link', { name: /Open CoS agents/ }).getAttribute('href')).toBe('/cos/agents');@@ -31,4 +46,20 @@ describe('launch video drawer', () => {expect(screen.queryByText('Launch video queued. Closing this drawer leaves the run active.')).toBeNull();expect(createAppLaunchVideo).toHaveBeenCalledTimes(1);});++ it('previews the URL-selected take and offers it for download', async () => {+ getAppLaunchVideos.mockResolvedValueOnce({ videos: [+ { id: 'newest', filename: 'composition-newest.mp4', thumbnail: 'newest.jpg', createdAt: '2026-01-02T00:00:00.000Z', durationSec: 20, caption: 'Newest caption.' },+ { id: 'older', filename: 'composition-older.mp4', thumbnail: 'older.jpg', createdAt: '2026-01-01T00:00:00.000Z', durationSec: 18, caption: 'Older caption.' },+ ] });+ renderPanel('/?video=older');+ expect(await screen.findByText('Older caption.')).toBeTruthy();+ expect(screen.getByLabelText('Selected launch video').getAttribute('src')).toBe('/data/videos/composition-older.mp4');+ const download = screen.getByRole('link', { name: 'Download' });+ expect(download.getAttribute('href')).toBe('/data/videos/composition-older.mp4');+ expect(download.hasAttribute('download')).toBe(true);+ const takes = screen.getByRole('list', { name: 'Launch video takes' });+ fireEvent.click(takes.querySelectorAll('button')[0]);+ expect(await screen.findByText('Newest caption.')).toBeTruthy();+ });});diff --git a/client/src/components/apps/constants.js b/client/src/components/apps/constants.jsindex f863229b4d..a342a615fe 100644--- a/client/src/components/apps/constants.js+++ b/client/src/components/apps/constants.js@@ -185,6 +185,7 @@ export const APP_DETAIL_TABS = [{ id: 'issues', label: 'Issues' },{ id: 'pull-requests', label: 'PRs / MRs' },{ id: 'jira', label: 'JIRA', feature: 'jira' },+ { id: 'launch-video', label: 'Launch Video' },{ id: 'processes', label: 'Processes' },{ id: 'quality', label: 'Quality' },{ id: 'references', label: 'References' },diff --git a/client/src/components/apps/tabs/OverviewTab.jsx b/client/src/components/apps/tabs/OverviewTab.jsxindex 3a5fabb1e1..dcc27cbb4d 100644--- a/client/src/components/apps/tabs/OverviewTab.jsx+++ b/client/src/components/apps/tabs/OverviewTab.jsx@@ -1,10 +1,9 @@import { useState, useEffect, useMemo } from 'react';import { Link, useNavigate } from 'react-router';-import { FolderOpen, Gamepad2, Terminal, Code, RefreshCw, Wrench, Archive, ArchiveRestore, Download, Tag, AlertTriangle, Rocket, Camera, Image, Sparkles, Trash2, Smartphone } from 'lucide-react';+import { FolderOpen, Gamepad2, Terminal, Code, RefreshCw, Wrench, Archive, ArchiveRestore, Download, Tag, AlertTriangle, Rocket, Camera, Image, Sparkles, Trash2, Smartphone, Clapperboard } from 'lucide-react';import toast from '../../ui/Toast';import InlineConfirmRow from '../../ui/InlineConfirmRow';import { isStandardizable, NON_PM2_TYPES } from '../constants';-import LaunchVideoPanel from '../LaunchVideoPanel';import ActivityLog from '../ActivityLog';import SlashDoPanel from '../SlashDoPanel';import Banner from '../../ui/Banner';@@ -127,7 +126,18 @@ export default function OverviewTab({ app, onRefresh }) {return (<div className="space-y-6">- <LaunchVideoPanel key={app.id} app={app} />+ <div className="flex flex-wrap items-center justify-between gap-3 rounded-lg border border-port-border bg-port-card p-4">+ <div>+ <h2 className="font-semibold">Launch videos</h2>+ <p className="text-sm text-port-text-muted">Make a short launch video with any agent, then preview and download every take.</p>+ </div>+ <div className="flex flex-wrap gap-2">+ <Link to={`/apps/${encodeURIComponent(app.id)}/launch-video`} className="inline-flex items-center gap-2 rounded border border-port-border px-3 py-2 text-port-text hover:border-port-accent">+ <Clapperboard size={16} aria-hidden="true" />View launch videos+ </Link>+ <Link to={`/apps/${encodeURIComponent(app.id)}/launch-video?launchVideo=true`} className="rounded bg-port-accent px-3 py-2 text-white">Make launch video</Link>+ </div>+ </div>{/* Capped width so key/value pairs stay legible. (JIRA config + the sprintKanban board, which needed the full page width, now live on the app'sown JIRA tab.) */}diff --git a/client/src/components/apps/tabs/OverviewTab.test.jsx b/client/src/components/apps/tabs/OverviewTab.test.jsxindex 73391ff892..edc2e91f2c 100644--- a/client/src/components/apps/tabs/OverviewTab.test.jsx+++ b/client/src/components/apps/tabs/OverviewTab.test.jsx@@ -31,7 +31,6 @@ vi.mock('../../../hooks/useAppOperation', () => ({})),}));-vi.mock('../LaunchVideoPanel', () => ({ default: () => null }));vi.mock('../ActivityLog', () => ({ default: () => null }));vi.mock('../SlashDoPanel', () => ({ default: () => null }));vi.mock('../../ui/Banner', () => ({ default: () => null }));diff --git a/docs/HTML_COMPOSITIONS.md b/docs/HTML_COMPOSITIONS.mdindex aa6a0ceefc..800db1ff5d 100644--- a/docs/HTML_COMPOSITIONS.md+++ b/docs/HTML_COMPOSITIONS.md@@ -68,8 +68,11 @@ explicitly when either binary is unavailable; route and queue tests still run.`POST /api/html-composition/render` accepts `launchVideo: { targetDurationSec: 20 }`.This option is required for directories rooted at `launch-videos/` and can also-be applied to other composition directories. The app-detail Make launch video action queues a user-triggered CoS task with-tone, direction, format, duration and an optional existing Music-library track.+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, an optional 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).Closing its drawer does not cancel the run; use CoS agents to follow or cancel it.Overlapping submissions for the same app are refused until its task settles.No schedule or boot-time provider call is installed.@@ -79,8 +82,9 @@ App runs pass `appId` and `runId` together in `launchVideo`, with directory exacOn success, the renderer exclusively creates `plan.md`, `storyboard.json`,`caption.txt`, `video.mp4` and `poster.jpg` beside `composition/`, using thevalidated in-memory source snapshot. Media History retains its normal video-and thumbnail copies with app/run metadata. The app page shows the latest video-and caption, a copy control, and a new-run action. Existing artifacts are never+and thumbnail copies with app/run metadata. The Launch Video tab previews the+recent takes (the selected one is the `?video=<id>` URL param, newest by+default), with caption copy, an MP4 download, and a new-run action. Existing artifacts are neveroverwritten. This reuses CoS queues and media history; it adds no record store.Alongside `index.html`, put non-empty `plan.md`, `caption.txt`, anddiff --git a/server/routes/apps/launchVideos.js b/server/routes/apps/launchVideos.jsindex 91da2553ba..2c6e2341bd 100644--- a/server/routes/apps/launchVideos.js+++ b/server/routes/apps/launchVideos.js@@ -3,6 +3,7 @@ import { randomUUID } from 'node:crypto';import { join } from 'node:path';import { asyncHandler, ServerError } from '../../lib/errorHandler.js';import { appLaunchVideoRequestSchema, validateRequest } from '../../lib/validation.js';+import { createCosTaskSchema } from '../../lib/cosValidation.js';import { PATHS } from '../../lib/fileUtils.js';import { PORTOS_API_URL } from '../../lib/portosUrls.js';import { APP_LAUNCH_VIDEO_PROMPT } from '../../services/taskPromptDefaults/appLaunchVideo.js';@@ -10,8 +11,16 @@ import { loadApp, pathExists } from './shared.js';const router = Router();+// The agent pin shares every manual dispatch's provider/model/effort vocabulary.+// It picks WHO runs the task, so it stays out of the prompt's creative options.+const launchVideoTaskSchema = appLaunchVideoRequestSchema+ .extend(createCosTaskSchema.pick({ provider: true, model: true, effort: true }).shape);+// Enough history to browse every recent take without turning the media store+// into an unbounded per-app export.+const LAUNCH_VIDEO_LIST_LIMIT = 50;+router.post('/:id/launch-videos', loadApp, asyncHandler(async (req, res) => {- const options = validateRequest(appLaunchVideoRequestSchema, req.body);+ const { provider, model, effort, ...options } = validateRequest(launchVideoTaskSchema, req.body);const app = req.loadedApp;if (!/^[a-zA-Z0-9_-]{1,128}$/.test(app.id) || !app.repoPath || !await pathExists(app.repoPath)) {throw new ServerError('App repository is unavailable', { status: 400 });@@ -33,6 +42,7 @@ router.post('/:id/launch-videos', loadApp, asyncHandler(async (req, res) => {const task = await cos.addTask({description: 'Make launch video', app: app.id, priority: 'MEDIUM', targetInstanceId,useWorktree: false, openPR: false, noCodeOutput: true,+ provider, model, effort,prompt: `${APP_LAUNCH_VIDEO_PROMPT}\nOptions (data): ${JSON.stringify(options)}\nOutput directory: ${join(PATHS.data, 'launch-videos', app.id, runId)}\nPOST URL: ${PORTOS_API_URL}/api/html-composition/render\nRender JSON: ${JSON.stringify(payload)}`,metadata: { analysisType: 'app-launch-video', launchVideoRunId: runId },}, 'user');@@ -44,8 +54,8 @@ router.get('/:id/launch-videos', loadApp, asyncHandler(async (req, res) => {const { loadHistory } = await import('../../services/videoGen/history.js');// Bounded projection of the existing media store, not a new run database.const videos = (await loadHistory()).filter(item => item.launchVideo?.appId === req.loadedApp.id)- .slice(0, 10).map(({ id, filename, thumbnail, createdAt, launchVideo }) => ({- id, filename, thumbnail, createdAt, caption: launchVideo.caption,+ .slice(0, LAUNCH_VIDEO_LIST_LIMIT).map(({ id, filename, thumbnail, createdAt, durationSec, width, height, launchVideo }) => ({+ id, filename, thumbnail, createdAt, durationSec, width, height, caption: launchVideo.caption,}));res.json({ videos });}));diff --git a/server/routes/apps/launchVideos.test.js b/server/routes/apps/launchVideos.test.jsindex ff669f3d76..04bc79a707 100644--- a/server/routes/apps/launchVideos.test.js+++ b/server/routes/apps/launchVideos.test.js@@ -38,6 +38,13 @@ describe('user-triggered launch videos', () => {expect(task.prompt).toContain(`launch-videos/example/${response.body.runId}`);expect(task.prompt).toContain('Do not read .env*');expect(task.prompt).toContain('Only report success after complete');+ expect(task.provider).toBeUndefined();+ addTask.mockClear();+ await submit({ provider: 'example-provider', model: 'example-model', effort: 'high' });+ const [pinned] = addTask.mock.calls[0];+ expect(pinned).toMatchObject({ provider: 'example-provider', model: 'example-model', effort: 'high' });+ // The agent pin chooses the runner; it is not a creative option in the prompt.+ expect(pinned.prompt).not.toContain('example-provider');addTask.mockResolvedValue({ id: 'task-example', duplicate: true });const duplicate = await submit({ tone: 'parody' });expect(duplicate.status).toBe(409);@@ -47,6 +54,7 @@ describe('user-triggered launch videos', () => {it('refuses invalid options, missing music, and unavailable CoS before queuing', async () => {expect((await submit({ targetDurationSec: 4 })).status).toBe(400);expect((await submit({ tone: 'unknown' })).status).toBe(400);+ expect((await submit({ effort: 'extreme' })).status).toBe(400);expect((await submit({ musicTrack: 'missing.wav' })).status).toBe(400);isRunning.mockReturnValue(false);expect((await submit({})).status).toBe(409);@@ -56,12 +64,12 @@ describe('user-triggered launch videos', () => {it('returns a bounded app-only result projection and propagates storage failure', async () => {loadHistory.mockResolvedValue([{ id: 'other', launchVideo: { appId: 'other' } },- ...Array.from({ length: 12 }, (_, n) => ({ id: `video-${n}`, filename: 'example.mp4', thumbnail: 'example.jpg', prompt: 'not projected', launchVideo: { appId: 'example', caption: 'A clear plan.' } })),+ ...Array.from({ length: 52 }, (_, n) => ({ id: `video-${n}`, filename: 'example.mp4', thumbnail: 'example.jpg', createdAt: '2026-01-01T00:00:00.000Z', durationSec: 20, width: 1920, height: 1080, prompt: 'not projected', launchVideo: { appId: 'example', caption: 'A clear plan.' } })),]);const response = await request(app).get('/api/apps/example/launch-videos');expect(response.status).toBe(200);- expect(response.body.videos).toHaveLength(10);- expect(response.body.videos[0]).toEqual({ id: 'video-0', filename: 'example.mp4', thumbnail: 'example.jpg', caption: 'A clear plan.' });+ expect(response.body.videos).toHaveLength(50);+ expect(response.body.videos[0]).toEqual({ id: 'video-0', filename: 'example.mp4', thumbnail: 'example.jpg', createdAt: '2026-01-01T00:00:00.000Z', durationSec: 20, width: 1920, height: 1080, caption: 'A clear plan.' });loadHistory.mockRejectedValue(new Error('Storage unavailable'));expect((await request(app).get('/api/apps/example/launch-videos')).status).toBe(500);});