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: guide creative commissions for model-aware video prompts
[._.]/ Adam Eivy4fc9a44d443e
diff --git a/server/services/creativeCommissions/abilityAdapters.js b/server/services/creativeCommissions/abilityAdapters.jsindex 3b5f28ca4e..efb55059b8 100644--- a/server/services/creativeCommissions/abilityAdapters.js+++ b/server/services/creativeCommissions/abilityAdapters.js@@ -35,6 +35,7 @@ import {ABILITY_GENERATION_SPEC, GENERATION_KEY_DEFS, CREATIVE_COMMISSION_ABILITIES,COMMISSION_RENDER_BACKEND_AUTO,} from '../../lib/creativeCommissionValidation.js';+import { buildVideoPromptGuidance } from './videoPromptGuidance.js';const isStr = (v) => typeof v === 'string';@@ -101,6 +102,11 @@ function genValue(commission, key) {return coerceGenerationValue(key, commission?.generation);}+function videoPromptGuidanceFor(commission) {+ const generation = commission?.generation;+ return buildVideoPromptGuidance(generation?.videoModelId || generation?.model);+}+/*** Translate a commission's backend pins (#3135) into the CD project's* `renderBackend` field — the durable carrier that gets the pin from the@@ -181,6 +187,7 @@ const videoAdapter = {const duration = commission?.generation?.durationMode === 'auto'? ' Choose an appropriate duration between 5 and 600 seconds for the brief.' : '';const { lines, digest, constraints } = briefContext(commission, `Create a short-form video piece.${duration}`);+ lines.unshift(videoPromptGuidanceFor(commission));return { goal: composeDirectiveGoal(lines, digest), deliverables: ['One rendered video matching the brief'], constraints };},};@@ -232,6 +239,7 @@ const musicVideoAdapter = {? ' Choose an appropriate video duration between 5 and 600 seconds for the brief.' : '';const lead = `Create a short-form music video:${duration} Generate an original music bed AND a matching video scored to it.`;const { lines, digest, constraints } = briefContext(commission, lead);+ lines.unshift(videoPromptGuidanceFor(commission));return {goal: composeDirectiveGoal(lines, digest),deliverables: ['One original music bed', 'One video matching the brief, scored to the music bed'],diff --git a/server/services/creativeCommissions/abilityAdapters.test.js b/server/services/creativeCommissions/abilityAdapters.test.jsindex 59d2199ddd..14bcbf1fee 100644--- a/server/services/creativeCommissions/abilityAdapters.test.js+++ b/server/services/creativeCommissions/abilityAdapters.test.js@@ -3,6 +3,7 @@ import {ABILITY_ADAPTERS, getAbilityAdapter, buildCommissionDirective, buildRenderBackendPin,} from './abilityAdapters.js';import { CREATIVE_COMMISSION_ABILITIES, ABILITY_GENERATION_SPEC } from '../../lib/creativeCommissionValidation.js';+import { buildVideoPromptGuidance, isMiniMaxVideoModel } from './videoPromptGuidance.js';describe('ability adapter registry', () => {it('has an adapter for every supported ability (and no extras)', () => {@@ -74,6 +75,32 @@ describe('buildCommissionDirective — video (unchanged brief/feedback fold)', (const directive = buildCommissionDirective({ targetAbility: 'hologram', brief: { intent: 'x' } });expect(directive.goal).toContain('Create a short-form video piece.');});++ it('adds the generic shot recipe and MiniMax guidance for the selected model', () => {+ const directive = buildCommissionDirective({+ targetAbility: 'video',+ brief: { intent: 'a courier crosses a rainy plaza' },+ generation: { videoModelId: 'minimax_h3_8bit' },+ });+ expect(directive.goal).toContain('beginning, middle, and end');+ expect(directive.goal).toContain('master timeline plus timestamped micro-beats');+ expect(directive.goal).toContain('7000 characters');+ });++ it('keeps model-specific guidance off the generic path while retaining the shot recipe', () => {+ expect(isMiniMaxVideoModel('ltx-2.5')).toBe(false);+ expect(buildVideoPromptGuidance('ltx-2.5')).toContain('production-ready prompt');+ expect(buildVideoPromptGuidance('ltx-2.5')).not.toContain('[Tracking shot]');+ });++ it('keeps the MiniMax recipe when the brief nearly fills the directive budget', () => {+ const directive = buildCommissionDirective({+ targetAbility: 'video',+ brief: { intent: 'x'.repeat(2000), styleSpec: 'y'.repeat(2000) },+ generation: { videoModelId: 'minimax_h3_cuda' },+ });+ expect(directive.goal).toContain('MiniMax H3 prompt template');+ });});describe('per-ability directives steer the planner to the right tools', () => {diff --git a/server/services/creativeCommissions/videoPromptGuidance.js b/server/services/creativeCommissions/videoPromptGuidance.jsnew file mode 100644index 0000000000..fc8bc2b0e1--- /dev/null+++ b/server/services/creativeCommissions/videoPromptGuidance.js@@ -0,0 +1,50 @@+/**+ * Prompt-writing guidance for video commissions.+ *+ * This is intentionally guidance for the Creative Director, not a prompt+ * rewriter. The director still owns the creative choices; this supplies the+ * production details that make those choices actionable to a renderer.+ */++const MINIMAX_H3_MODEL_PATTERN = /(?:^|[_-])minimax(?:[_-])?h3(?:[_-]|$)|minimax_h3/i;+const HAILUO_MODEL_PATTERN = /hailuo/i;++export const GENERIC_VIDEO_PROMPT_GUIDANCE = [+ 'Write a production-ready prompt for one continuous shot, not a vague mood board.',+ 'Specify the subject and distinctive appearance, environment, time of day, lighting, composition, and visual style.',+ 'Describe an observable beginning, middle, and end: what moves, how it moves, and what has changed by the final moment.',+ 'Choose one primary camera behavior and state its framing and speed; keep the action physically plausible and focused.',+ 'Prefer concrete nouns and visible verbs over adjectives such as beautiful, cinematic, or dynamic by themselves.',+ 'For image-to-video or continuation renders, describe motion and scene evolution from the source frame instead of re-describing a replacement image.',+].join(' ');++export const MINIMAX_H3_VIDEO_PROMPT_GUIDANCE = [+ 'MiniMax H3 prompt template: expand the brief in this order — output goal and duration, subjects/assets and reference mapping, chronological timeline, scene/environment, camera (shot size, angle, movement, focus, cuts), look (style, color, texture, mood, pacing), sound, and continuity/artifact constraints.',+ 'For image-to-video or continuation, treat the supplied image as the opening state and describe how the subject and camera move from it; do not replace it with a new still-image description.',+ 'Use one causal action beat per shot. Give it an exact beginning, preparation, core action, settle/hold, and locked end state; keep actions physically achievable in the selected 4–15 second duration.',+ 'When there are ordered references, name them in order and use a contiguous master timeline plus timestamped micro-beats with no gaps or overlaps. The next shot must inherit the prior shot’s locked pose, gaze, prop ownership, spatial relationship, and camera side.',+ 'Use explicit natural-language camera direction with movement type, amplitude, and speed. Do not silently add brands, dialogue, text overlays, or unrelated actions.',+ 'Keep the final MiniMax H3 render prompt under 7000 characters.',+].join(' ');++export const HAILUO_VIDEO_PROMPT_GUIDANCE = [+ 'MiniMax Hailuo prompt recipe: use a concise shot description with explicit temporal progression and a single clear subject action.',+ 'For image-to-video, treat the input image as the opening frame and describe only how the scene develops from it.',+ 'Use explicit camera commands when useful: [Static shot], [Tracking shot], [Pan left], [Pan right], [Push in], [Pull out], [Tilt up], [Tilt down], [Zoom in], or [Zoom out]. Sequence distinct movements in order, and combine no more than three commands in one bracket.',+ 'Include the subject action, camera movement, timing or progression, lighting/atmosphere, and intended final beat. Keep the final render prompt under MiniMax’s 2000-character prompt limit.',+].join(' ');++export function isMiniMaxVideoModel(modelId) {+ return typeof modelId === 'string'+ && (MINIMAX_H3_MODEL_PATTERN.test(modelId.trim()) || HAILUO_MODEL_PATTERN.test(modelId.trim()));+}++export function buildVideoPromptGuidance(modelId) {+ const normalized = typeof modelId === 'string' ? modelId.trim() : '';+ const modelLine = MINIMAX_H3_MODEL_PATTERN.test(normalized)+ ? MINIMAX_H3_VIDEO_PROMPT_GUIDANCE+ : (HAILUO_MODEL_PATTERN.test(normalized)+ ? HAILUO_VIDEO_PROMPT_GUIDANCE+ : 'If the selected model has a documented prompt grammar, follow that model grammar while preserving this shot structure.');+ return `Video prompt guidance: ${GENERIC_VIDEO_PROMPT_GUIDANCE} ${modelLine}`;+}