+ {pendingCameraPreset
+ ? t("editors.stage.ui.cameraPresetPlacementHint")
+ : t("editors.stage.ui.cameraHint")}
+
+ >
+ )}
+ {leftTab === "background" && (
+
+
+ {(["all", "panoramic", "flat"] as const).map((filter) => (
+ setBackgroundFilter(filter)}
+ >
+ {t(`editors.stage.ui.backgroundFilter.${filter}` as never)}
+
+ ))}
+
+
+ {t("editors.stage.ui.backgroundMine")}
+ backgroundInput.current?.click()}
+ >
+ +
+ {backgroundImporting
+ ? t("editors.stage.ui.backgroundImporting")
+ : t("editors.stage.ui.backgroundAdd")}
-
- {t("editors.stage.ui.shotHint")}
-
- {stage.shots.map((shot, index) => (
-
-
- {t("editors.stage.ui.shot", { number: index + 1 })}
-
- updateShot(shot.id, { cameraId: event.target.value })
+ {backgroundNotice && (
+
+ {backgroundNotice}
+
+ )}
+
+
+ {t("editors.stage.ui.backgroundCanvasImages")}
+ {visibleBackgroundAssets.length ? (
+
+ {visibleBackgroundAssets.map((asset) => (
+
+ edit((current) => ({
+ ...current,
+ environment: {
+ ...current.environment,
+ backgroundAsset: assetReference(asset),
+ },
+ }))
}
>
- {stage.cameras.map((camera) => (
-
- {camera.name}
-
- ))}
-
-
-
- {t("editors.stage.ui.startSeconds")}
+
+ {asset.name}
+
+ ))}
+
+ ) : (
+
+
+
+
+
+ {(backgroundAssets ?? []).length
+ ? t("editors.stage.ui.backgroundNoMatches")
+ : t("editors.stage.ui.backgroundEmpty")}
+
+
+ )}
+
+
+ )}
+
+ beginLayoutResize("left", event)}
+ onPointerMove={(event) => updateLayoutResize("left", event)}
+ onPointerUp={endLayoutResize}
+ onPointerCancel={endLayoutResize}
+ onKeyDown={(event) => nudgeLayoutResize("left", event)}
+ />
+
+ {sceneTree}
+
+
+ {t("editors.stage.ui.properties")}
+
+
+ {object && (
+
+
+
+
- updateShot(shot.id, {
- start: Number(event.target.value),
- })
+ editObject({ name: event.target.value })
}
/>
-
-
- {t("editors.stage.ui.durationSeconds")}
-
- updateShot(shot.id, {
- duration: Number(event.target.value),
+
+ {object.kind !== "gltf" && (
+ editObject({ color })} />
+ )}
+
+ {object.kind === "gltf" && (
+
+ {object.role === "character"
+ ? t("editors.stage.ui.assetCharacter")
+ : t("editors.stage.ui.assetScene")}
+ {" · "}
+ {object.hasAnimation
+ ? t("editors.stage.ui.assetImported", {
+ name: object.name,
+ animationCount: object.animationNames?.length ?? 0,
})
- }
- />
-
- {
- setPlaying(false);
- setTime(shot.start);
- edit((current) => ({
- ...current,
- cameraSource: "storyboard",
- }));
- }}
- >
- {t("editors.stage.ui.locate")}
-
-
- edit((current) => ({
- ...current,
- shots: current.shots.filter(
- (item) => item.id !== shot.id,
- ),
- }))
- }
+ : t("editors.stage.ui.assetImportedStatic", {
+ name: object.name,
+ })}
+
+ )}
+ {(object.kind === "person" ||
+ (object.kind === "gltf" &&
+ object.role === "character" &&
+ object.hasAnimation)) && (
+
- {t("editors.stage.ui.deleteShot", {
- number: index + 1,
- })}
-
-
- ))}
-
-
-
+
+
+ )}
+ {!object && !selectedCamera && (
+
+ )}
+
+
+
+
beginLayoutResize("right", event)}
+ onPointerMove={(event) => updateLayoutResize("right", event)}
+ onPointerUp={endLayoutResize}
+ onPointerCancel={endLayoutResize}
+ onKeyDown={(event) => nudgeLayoutResize("right", event)}
+ />
+ {previewMode === "dynamic" && (
+
+ beginLayoutResize("timeline", event)}
+ onPointerMove={(event) => updateLayoutResize("timeline", event)}
+ onPointerUp={endLayoutResize}
+ onPointerCancel={endLayoutResize}
+ onKeyDown={(event) => nudgeLayoutResize("timeline", event)}
+ />
+
+
+
+ ▦
+ {t("editors.stage.ui.timelineTitle")}
+
+ {
+ setView({ type: "setPreviewMode", mode: "dynamic" });
+ if (time >= stage.duration) setTime(0);
+ setPlaying((current) => !current);
+ }}
+ >
+ {playing ? "Ⅱ" : "▶"}
+
+
+ {t("editors.stage.ui.time", {
+ time: time.toFixed(2),
+ duration: stage.duration.toFixed(2),
+ })}
+
+
+
+ {t("timeline.player.fps")} {stage.fps}
+
+
+ {t("editors.stage.ui.totalDuration")}
+ setDurationInput(event.target.value)}
+ onBlur={(event) => {
+ const duration = event.currentTarget.valueAsNumber;
+ setDurationInput(null);
+ if (Number.isFinite(duration) && duration > 0 && duration !== stageRef.current.duration) {
+ void commitStoryboardEdit({ type: "setDuration", duration }, undefined, stageRef.current.shots);
+ }
+ }}
+ onKeyDown={(event) => {
+ if (event.key === "Enter") event.currentTarget.blur();
+ }}
+ />
+
+ {durationNotice && {durationNotice} }
+
+ ◆
+
-
- {t("editors.stage.ui.footerHint")}
-
+
{
+ setPlayhead(Number(event.target.value));
+ }}
+ />
+ {
+ if (event.target !== event.currentTarget) return;
+ const bounds = event.currentTarget.getBoundingClientRect();
+ setPlayhead(
+ ((event.clientX - bounds.left) / Math.max(bounds.width, 1)) *
+ timeline.duration,
+ );
+ }}
+ >
+
+
+ {t("editors.stage.ui.timelineCurrentTime")}
+
+
+ {timelineRuler.ticks.map((tick, index) => {
+ const isStart = index === 0;
+ const isEnd = index === timelineRuler.ticks.length - 1;
+ const precision =
+ timelineRuler.majorStep < 1 || tick.time % 1 !== 0 ? 1 : 0;
+ return (
+
+ {tick.kind === "major" && (
+
+ {t("editors.stage.ui.timelineTime", {
+ time: tick.time.toFixed(precision),
+ })}
+
+ )}
+
+ );
+ })}
+ {
+ event.preventDefault();
+ event.stopPropagation();
+ timelineRulerDrag.current = event.pointerId;
+ event.currentTarget.setPointerCapture(event.pointerId);
+ if (event.currentTarget.parentElement)
+ setPlayheadFromTimelineX(
+ event.clientX,
+ event.currentTarget.parentElement,
+ );
+ }}
+ onPointerMove={(event) => {
+ if (
+ timelineRulerDrag.current !== event.pointerId ||
+ !event.currentTarget.parentElement
+ ) return;
+ setPlayheadFromTimelineX(
+ event.clientX,
+ event.currentTarget.parentElement,
+ );
+ }}
+ onPointerUp={(event) => {
+ if (timelineRulerDrag.current === event.pointerId)
+ timelineRulerDrag.current = null;
+ event.currentTarget.releasePointerCapture(event.pointerId);
+ }}
+ onPointerCancel={(event) => {
+ if (timelineRulerDrag.current === event.pointerId)
+ timelineRulerDrag.current = null;
+ }}
+ />
+
+
+
+ {timelineRuler.ticks.map((tick) => (
+
+ ))}
+
+ {timelineGroups.map((group) => {
+ const expanded = isTimelineGroupExpanded(group.id);
+ const groupLabel = timelineTrackGroupLabel(group);
+ return (
+
+
+
toggleTimelineGroup(group.id)}
+ >
+
+
+ {group.kind === "camera" ? "◉" : group.kind === "object" ? "●" : "▤"}
+
+ {groupLabel}
+
+
+
+ {expanded && group.tracks.map((track) => {
+ const intervals = stageTimelineIntervals(track);
+ const hasKeyframeAtPlayhead = track.points.some(
+ (point) =>
+ point.kind === "keyframe" && point.time <= stage.duration &&
+ stageTimeToFrame(stage, point.time) ===
+ stageTimeToFrame(stage, time),
+ );
+ return (
+
+
+
+ {timelineTrackChildLabel(track)}
+
+ {track.kind === "shots" && (
+ <>
+ {
+ event.stopPropagation();
+ setStoryboardChooserOpen((open) => !open);
+ }}
+ >
+
+
+ {storyboardAddReason && (
+
+ {storyboardAddReason}
+
+ )}
+ >
+ )}
+ {track.kind !== "shots" && track.channel !== "motion" && (
+ {
+ event.stopPropagation();
+ addTimelineKeyframe(track);
+ }}
+ >
+
+
+ )}
+
+
{
+ const bounds = event.currentTarget.getBoundingClientRect();
+ setPlayhead(
+ ((event.clientX - bounds.left) /
+ Math.max(bounds.width, 1)) *
+ timeline.duration,
+ );
+ }}
+ >
+ {track.kind === "shots" && (
+
+ )}
+ {track.kind !== "shots" &&
+ intervals.filter((interval) => interval.start.time < stage.duration).map((interval) => (
+ {
+ event.stopPropagation();
+ const intervalBounds = event.currentTarget.getBoundingClientRect();
+ setSelectedTimelinePoint(null);
+ setSelectedTimelineInterval({
+ id: interval.id,
+ trackId: track.id,
+ startPointId: interval.start.id,
+ endPointId: interval.end.id,
+ anchorLeft: Math.max(
+ 164,
+ Math.min(window.innerWidth - 164, intervalBounds.left + intervalBounds.width / 2),
+ ),
+ anchorBottom: window.innerHeight - intervalBounds.top + 8,
+ });
+ }}
+ >
+ {selectedTimelineInterval?.id === interval.id && (
+ ⌁
+ )}
+
+ ))}
+ {/* A Storyboard block is one target across its whole box and
+ * the block on its own says where it ends. The track's boundary
+ * points are drawn on every other lane; here each would sit on
+ * a block's edge, over the playhead's ring, and take the clicks
+ * of the block it belongs to. */}
+ {track.kind !== "shots" &&
+ track.points.filter((point) => point.time <= stage.duration).map((point) => (
+
+ {
+ event.stopPropagation();
+ setSelectedTimelineInterval(null);
+ setSelectedTimelinePoint({ trackId: track.id, pointId: point.id });
+ setPlayhead(point.time);
+ }}
+ />
+ {selectedTimelinePoint?.trackId === track.id && selectedTimelinePoint?.pointId === point.id && (
+ {
+ event.stopPropagation();
+ removeTimelineKeyframe(track, point.id);
+ }}
+ >
+ ×
+
+ )}
+
+ ))}
+
+
+ );
+ })}
+
+ );
+ })}
+
+
+
+
+ {storyboardChooserOpen && (
+ setStoryboardChooserOpen(false)}
+ />
+ )}
+ {selectedTimelineInterval && selectedIntervalTarget && selectedIntervalTrack && selectedInterval && selectedTransition && (
+
+
+
+ {t("editors.stage.ui.transitionEditorTitle", {
+ label: timelineTrackLabel(selectedIntervalTrack),
+ start: stageTimeToFrame(stage, selectedInterval.start.time),
+ end: stageTimeToFrame(stage, selectedInterval.end.time),
+ })}
+ {t("editors.stage.ui.transitionFormula")}
+
+ setSelectedTimelineInterval(null)}
+ >
+ ×
+
+
+
+ {t("editors.stage.ui.transitionLabel")}
+ setSelectedTransition(
+ event.target.value === "bezier"
+ ? { kind: "bezier", controlPoints: [...DEFAULT_BEZIER_CONTROL_POINTS] }
+ : { kind: "linear" },
+ )}
+ >
+ {t("editors.stage.ui.transitionLinear")}
+ {t("editors.stage.ui.transitionBezier")}
+
+
+
+
+ {t("editors.stage.ui.transitionControlPoints")}
+ {(selectedTransition.kind === "bezier" ? selectedTransition.controlPoints : DEFAULT_BEZIER_CONTROL_POINTS)
+ .map((value, index) => (
+ {
+ if (selectedTransition.kind !== "bezier") return;
+ const controlPoints = [...selectedTransition.controlPoints] as [number, number, number, number];
+ controlPoints[index] = Math.max(0, Math.min(1, Number(event.target.value) || 0));
+ setSelectedTransition({ kind: "bezier", controlPoints });
+ }}
+ />
+ ))}
+
+
+ )}
+
+
+ )}
+
{
+ const file = event.target.files?.[0];
+ if (file) void importAsset(file);
+ event.target.value = "";
+ }}
+ />
+
{
+ const file = event.target.files?.[0];
+ if (file) void importBackground(file);
+ event.target.value = "";
+ }}
+ />
+ {helpOpen && (
+
+ trapNestedDialog(event, () => setHelpOpen(false))
+ }
+ >
+
+
+ {t("editors.stage.ui.helpTitle")}
+ setHelpOpen(false)}
+ >
+ ×
+
+
+ {t("editors.stage.ui.helpViewNav")}
+
+ {t("editors.stage.ui.helpOrbit")}
+ {t("editors.stage.ui.helpPan")}
+ {t("editors.stage.ui.helpZoom")}
+ {t("editors.stage.ui.helpMove")}
+
+ {t("editors.stage.ui.helpEditor")}
+
+ {t("editors.stage.ui.helpEscape")}
+ {t("editors.stage.ui.helpTab")}
+
+
+
+ )}
+ {exportOpen && (
+
+ trapNestedDialog(event, () => setView({ type: "closeExport" }))
+ }
+ >
+
+
+ )}
+ {previewStill && (
+
+ trapNestedDialog(event, () => setPreviewStillId(null))
+ }
+ >
+
+
+
+
+ {stillName(stills.indexOf(previewStill))} ·{" "}
+ {stage.aspectRatio}
+
+ setPreviewStillId(null)}
+ >
+ {t("editors.stage.ui.closePreview")}
+
+
+
+
+ )}
+ {confirmingClose && (
+
+ trapNestedDialog(event, () => setConfirmingClose(false))
+ }
+ >
+
+
{t("editors.stage.ui.unsavedTitle")}
+ setConfirmingClose(false)}
+ >
+ {t("editors.stage.ui.keepEditing")}
+
+
+ {t("editors.stage.ui.discardClose")}
+
+ {
+ setConfirmingClose(false);
+ commit.apply(applyEdits);
+ }}
+ >
+ {t("editors.stage.ui.saveClose")}
+
+
+
+ )}
-
+
);
}
export default DirectorStage;
diff --git a/src/canvas/DirectorStageChrome.tsx b/src/canvas/DirectorStageChrome.tsx
new file mode 100644
index 000000000..f18dd4438
--- /dev/null
+++ b/src/canvas/DirectorStageChrome.tsx
@@ -0,0 +1,45 @@
+import type { ReactNode } from "react";
+
+export function StagePanelHeading({
+ icon,
+ children,
+}: {
+ icon: ReactNode;
+ children: ReactNode;
+}) {
+ return (
+
+ );
+}
+
+export function StagePanelSearch({
+ className,
+ label,
+ placeholder,
+ value,
+ onChange,
+ type = "text",
+}: {
+ className: string;
+ type?: "text" | "search";
+ label: string;
+ placeholder: string;
+ value: string;
+ onChange: (value: string) => void;
+}) {
+ return (
+
+ {label}
+ onChange(event.target.value)}
+ />
+
+ );
+}
diff --git a/src/canvas/NodeFrame.tsx b/src/canvas/NodeFrame.tsx
index 7a219375f..4f39d9816 100644
--- a/src/canvas/NodeFrame.tsx
+++ b/src/canvas/NodeFrame.tsx
@@ -1,6 +1,7 @@
import { useContext, useLayoutEffect, useRef, type ReactNode } from "react";
import { Handle, Position } from "@xyflow/react";
import type { CanvasNodeKind } from "./model";
+import { UNANCHORED_KINDS } from "./connectionPolicy.ts";
import { CanvasActionsContext } from "./CanvasActionsContext";
import { CanvasIcon } from "./CanvasIcon";
import { useI18n } from "../i18n/I18nProvider.tsx";
@@ -155,7 +156,8 @@ export function NodeFrame({
)}
- {kind !== "group" && (
+ {/* Anchors only attach edges, so they follow UNANCHORED_KINDS, not nodePorts. */}
+ {!UNANCHORED_KINDS.includes(kind) && (
<>
> = {
tool: "canvas.selection.edit.tool",
external: "canvas.selection.edit.external",
};
+const NO_VIDEO_TOOL_EXCLUSIONS: ReadonlySet = new Set();
/** Selection actions stay distinct from generation controls. Empty media has no post-edit toolbar.
* Local editors and tool drafts keep their own capability constraints.
@@ -156,7 +161,7 @@ export function NodeSelectionToolbar({
options: MenuOption[],
glyph?: ToolGlyphName,
) => {
- if (options.some((option) => !option.disabled))
+ if (options.length && options.some((option) => !option.disabled))
editing.push({ id, label, icon, glyph, options, disabled: locked });
};
const addTool = (
@@ -269,47 +274,56 @@ export function NodeSelectionToolbar({
"tools",
);
} else if (node.type === "video") {
+ const captureFrameOptions = (): MenuOption[] => [
+ {
+ id: "capture-first",
+ label: t("canvas.selection.firstFrame"),
+ icon: "image",
+ run: () => onCaptureFrame?.("first"),
+ disabled: !onCaptureFrame,
+ },
+ {
+ id: "capture-last",
+ label: t("canvas.selection.lastFrame"),
+ icon: "image",
+ run: () => onCaptureFrame?.("last"),
+ disabled: !onCaptureFrame,
+ },
+ {
+ id: "capture-custom",
+ label: t("canvas.selection.customFrame"),
+ icon: "camera",
+ run: () => onEdit?.("frame"),
+ disabled: !onEdit,
+ },
+ ];
+ // Stage preview outputs drop generative and audio tools per the shared
+ // exclusion set; this component never re-decides which role loses what.
+ const excluded: ReadonlySet = isStagePreviewOutput(node)
+ ? STAGE_PREVIEW_EXCLUDED_VIDEO_TOOLS
+ : NO_VIDEO_TOOL_EXCLUSIONS;
+ const offered = (options: MenuOption[]) =>
+ options.filter((option) => !excluded.has(option.id));
for (const [tool, labelKey, icon] of videoTools)
- addTool(tool, t(labelKey), icon);
+ if (!excluded.has(tool)) addTool(tool, t(labelKey), icon);
addMenu(
"video-frame-capture",
t("canvas.selection.captureFrame"),
"image",
- [
- {
- id: "capture-first",
- label: t("canvas.selection.firstFrame"),
- icon: "image",
- run: () => onCaptureFrame?.("first"),
- disabled: !onCaptureFrame,
- },
- {
- id: "capture-last",
- label: t("canvas.selection.lastFrame"),
- icon: "image",
- run: () => onCaptureFrame?.("last"),
- disabled: !onCaptureFrame,
- },
- {
- id: "capture-custom",
- label: t("canvas.selection.customFrame"),
- icon: "camera",
- run: () => onEdit?.("frame"),
- disabled: !onEdit,
- },
- ],
- );
- addTool(
- "video-depth-capture",
- t("canvas.selection.depthCapture"),
- "subject",
+ captureFrameOptions(),
);
+ if (!excluded.has("video-depth-capture"))
+ addTool(
+ "video-depth-capture",
+ t("canvas.selection.depthCapture"),
+ "subject",
+ );
addEditor("video-trim", t("canvas.selection.trimVideo"), "trim", "trim");
addMenu(
"sound-separation",
t("canvas.selection.audioSeparation"),
"audio",
- [
+ offered([
{
id: "extract-audio",
label: t("canvas.selection.extractAudio"),
@@ -324,9 +338,9 @@ export function NodeSelectionToolbar({
"sliders",
t("canvas.selection.separateTrackHint"),
),
- ],
+ ]),
);
- addMenu("tools", t("canvas.selection.tools"), "tool", [
+ const utilities = offered([
toolOption(
"video-frame-interpolation",
t("canvas.selection.frameInterpolation"),
@@ -337,13 +351,21 @@ export function NodeSelectionToolbar({
t("canvas.selection.subtitleErase"),
"text",
),
- toolOption(
- "video-matting",
- t("canvas.selection.videoMatting"),
- "subject",
- ),
+ toolOption("video-matting", t("canvas.selection.videoMatting"), "subject"),
toolOption("video-crop", t("canvas.selection.videoCrop"), "crop"),
]);
+ if (utilities.length === 1) {
+ // A dropdown that lost every option but one is a plain button.
+ const only = utilities[0]!;
+ editing.push({
+ id: only.id,
+ label: only.label,
+ icon: only.icon,
+ run: only.run,
+ disabled: locked || only.disabled,
+ });
+ } else
+ addMenu("tools", t("canvas.selection.tools"), "tool", utilities);
} else if (node.type === "audio") {
addEditor("audio-trim", t("canvas.selection.trimAudio"), "trim", "trim");
addTool("audio-separation", t("canvas.selection.separateTrack"), "audio");
diff --git a/src/canvas/StagePreviewSourceSelect.tsx b/src/canvas/StagePreviewSourceSelect.tsx
new file mode 100644
index 000000000..01c3a0cb1
--- /dev/null
+++ b/src/canvas/StagePreviewSourceSelect.tsx
@@ -0,0 +1,68 @@
+import { useId } from "react";
+import { useI18n } from "../i18n/I18nProvider.tsx";
+import type { LocalStageDocument, StagePreviewSource } from "./stageDocument.ts";
+
+/** The option value of the Storyboard: a stable business value, never translated. */
+const STAGE_PREVIEW_STORYBOARD = "storyboard";
+const cameraOptionValue = (id: string) => `camera:${id}`;
+
+export interface StagePreviewSourceSelectProps {
+ /** What the selector shows: the source as it resolves for the stage as it is now, so
+ * a disabled option is never the selected one. */
+ value: StagePreviewSource;
+ /** Every existing camera in stored order. Each is one option, named as it is now. */
+ cameras: LocalStageDocument["cameras"];
+ /** Why the Storyboard cannot be previewed; null while it can. */
+ storyboardReason: string | null;
+ onSelect: (source: StagePreviewSource) => void;
+}
+
+/**
+ * The camera-preview source selector: the Storyboard first, then every camera.
+ *
+ * It is the preview source only; the export dialog owns export. A choice here is a
+ * view-state change and writes nothing. The Storyboard option is disabled while the
+ * Storyboard has no block, and the selector names the reason where a pointer and
+ * assistive technology read it.
+ */
+export function StagePreviewSourceSelect({
+ value,
+ cameras,
+ storyboardReason,
+ onSelect,
+}: StagePreviewSourceSelectProps) {
+ const { t } = useI18n();
+ const reasonId = useId();
+ // Keep camera option values in their own namespace because camera IDs are free text.
+ const sourceAt = (index: number): StagePreviewSource =>
+ index === 0
+ ? { kind: "storyboard" }
+ : { kind: "camera", cameraId: cameras[index - 1]!.id };
+ return (
+ <>
+ onSelect(sourceAt(event.target.selectedIndex))}
+ >
+
+ {t("editors.stage.ui.storyboardCut")}
+
+ {cameras.map((camera) => (
+
+ {camera.name}
+
+ ))}
+
+ {storyboardReason && (
+
+ {storyboardReason}
+
+ )}
+ >
+ );
+}
diff --git a/src/canvas/StageStoryboardChooser.tsx b/src/canvas/StageStoryboardChooser.tsx
new file mode 100644
index 000000000..64161b027
--- /dev/null
+++ b/src/canvas/StageStoryboardChooser.tsx
@@ -0,0 +1,162 @@
+import {
+ useEffect,
+ useLayoutEffect,
+ useRef,
+ useState,
+ type RefObject,
+} from "react";
+import { useI18n } from "../i18n/I18nProvider.tsx";
+import type { LocalStageDocument } from "./stageDocument.ts";
+
+/** Space between the chooser and the `+` it opens from. */
+const ANCHOR_GAP = 6;
+/** Longer camera lists scroll inside the chooser instead of covering the stage. */
+const MAX_HEIGHT = 260;
+/** The chooser never touches the viewport edge, however short the window is. */
+const VIEWPORT_MARGIN = 8;
+
+export interface StageStoryboardChooserProps {
+ /** The element id the `+` names through `aria-controls` while the chooser is open. */
+ id: string;
+ /** The `+` the chooser is anchored to. */
+ anchor: RefObject;
+ /** Every existing camera, in stored order. One selection reports one of them. */
+ cameras: LocalStageDocument["cameras"];
+ onSelect: (cameraId: string) => void;
+ onClose: () => void;
+}
+
+interface Placement {
+ left: number;
+ bottom: number;
+ maxHeight: number;
+}
+
+/**
+ * Single-selection list of the stage's cameras, opened above the timeline's `+`.
+ *
+ * It is view state only: choosing a camera reports it to the caller, which appends
+ * it through the shared command. The list closes after one choice, on Escape, on a
+ * pointer-down outside, or when the caller's `+` is pressed again. It sits in fixed
+ * viewport coordinates, so the scrolling track surface neither clips nor scrolls it.
+ */
+export function StageStoryboardChooser({
+ id,
+ anchor,
+ cameras,
+ onSelect,
+ onClose,
+}: StageStoryboardChooserProps) {
+ const { t } = useI18n();
+ const root = useRef(null);
+ const search = useRef(null);
+ const [query, setQuery] = useState("");
+ const [placement, setPlacement] = useState(null);
+ const close = useRef(onClose);
+ close.current = onClose;
+
+ // Above the anchor with the left edges aligned and a small gap. The timeline can
+ // be resized and scrolled while the chooser is open, so the anchor is measured again.
+ useLayoutEffect(() => {
+ const measure = () => {
+ const bounds = anchor.current?.getBoundingClientRect();
+ if (!bounds) return;
+ setPlacement({
+ left: bounds.left,
+ bottom: window.innerHeight - bounds.top + ANCHOR_GAP,
+ maxHeight: Math.min(
+ MAX_HEIGHT,
+ Math.max(ANCHOR_GAP, bounds.top - ANCHOR_GAP - VIEWPORT_MARGIN),
+ ),
+ });
+ };
+ measure();
+ window.addEventListener("resize", measure);
+ // Scroll events do not bubble; the capture phase still sees every scroll container.
+ window.addEventListener("scroll", measure, true);
+ return () => {
+ window.removeEventListener("resize", measure);
+ window.removeEventListener("scroll", measure, true);
+ };
+ }, [anchor]);
+
+ useEffect(() => {
+ const previous =
+ document.activeElement instanceof HTMLElement
+ ? document.activeElement
+ : null;
+ search.current?.focus();
+ const outside = (event: PointerEvent) => {
+ const target = event.target;
+ // A press on the anchor is the caller's toggle, not a dismissal.
+ if (
+ target instanceof Node &&
+ (root.current?.contains(target) || anchor.current?.contains(target))
+ )
+ return;
+ close.current();
+ };
+ document.addEventListener("pointerdown", outside);
+ return () => {
+ document.removeEventListener("pointerdown", outside);
+ if (previous?.isConnected) previous.focus();
+ };
+ }, [anchor]);
+
+ const needle = query.trim().toLocaleLowerCase();
+ const visible = cameras.filter(
+ (camera) => !needle || camera.name.toLocaleLowerCase().includes(needle),
+ );
+ return (
+ {
+ if (event.key !== "Escape") return;
+ event.preventDefault();
+ event.stopPropagation();
+ close.current();
+ }}
+ >
+
setQuery(event.target.value)}
+ />
+
+ {visible.map((camera) => (
+
onSelect(camera.id)}
+ >
+ {camera.name}
+
+ ))}
+ {!visible.length && (
+
+ {t("editors.stage.ui.storyboardSearchEmpty")}
+
+ )}
+
+
+ );
+}
diff --git a/src/canvas/StageStoryboardTrack.tsx b/src/canvas/StageStoryboardTrack.tsx
new file mode 100644
index 000000000..710705930
--- /dev/null
+++ b/src/canvas/StageStoryboardTrack.tsx
@@ -0,0 +1,519 @@
+import { useEffect, useMemo, useRef, useState, type PointerEvent as ReactPointerEvent } from "react";
+import { CanvasIcon } from "./CanvasIcon.tsx";
+import { useI18n } from "../i18n/I18nProvider.tsx";
+import type { LocalStageDocument, StageShot } from "./stageDocument.ts";
+import {
+ StageStoryboardThumbnailCache,
+ prepareStageStoryboardThumbnailKeys,
+ stageStoryboardThumbnailSize,
+} from "./stageStoryboardThumbnail.ts";
+import {
+ normalizeStoryboardTime,
+ packStageStoryboard,
+ stageStoryboardIssue,
+ type StageStoryboardEdit,
+} from "./stageStoryboard.ts";
+import type { StageTimelineStoryboardInterval } from "./stageTimeline.ts";
+
+/** What the viewport makes of one thumbnail: a picture; nothing possible for that
+ * frame, until what it pictures changes; or a request to come back later, while a
+ * gesture owns the scene. */
+export type StageStoryboardThumbnailShot =
+ | { kind: "image"; image: string }
+ | { kind: "failed" }
+ | { kind: "wait" };
+
+/** Idle time is asked for with a deadline, so a busy page still gets its thumbnails. */
+const IDLE_TIMEOUT_MS = 500;
+/** How soon to ask again while a gesture owns the scene. */
+const GESTURE_POLL_MS = 150;
+/** How far the line that says where a carried block would be let in is kept from the
+ * right edge of the track, in pixels: its chevrons reach 3.5px either side of it. */
+const MARKER_INSET = 4;
+
+export interface StageStoryboardTrackProps {
+ /** The stage as it is now. A block reads its camera's name from it on every
+ * render, and what its thumbnail must show is taken from it. */
+ stage: LocalStageDocument;
+ /** How many times the live scene gained something the document alone does not
+ * announce, such as a loaded model or an arrived background. Every picture made
+ * before a change is stale, and is made again. */
+ sceneRevision: number;
+ /** Every block of the Storyboard, in stored order. */
+ blocks: readonly StageTimelineStoryboardInterval[];
+ /** The main timeline's length: where a block starts and ends is a share of it. */
+ duration: number;
+ /** The block the user selected. It is view state, and the block shows it as a fill. */
+ selectedBlockId: string | null;
+ /** The block the playhead is on. The track derives it on every render and never
+ * stores it; the block shows it as a white outline. */
+ activeBlockId: string | null;
+ /** Pictures one block's camera at one time. It is asked in idle time, one block at
+ * a time, and never in a render or a pointer handler. */
+ thumbnail: (cameraId: string, start: number) => StageStoryboardThumbnailShot;
+ /** Whether the viewport that pictures thumbnails is up. Nothing is asked before it is. */
+ thumbnailReady: boolean;
+ onSelect: (blockId: string, cameraId: string) => void;
+ displayedShots: readonly StageShot[] | null;
+ editable: boolean;
+ /** Says when the press on a block has become a drag to another place, and again when
+ * that drag is over. While one is in progress nothing is written and nothing outside
+ * the track moves; the parent keeps what would change the Storyboard unusable. It is
+ * said once each way per drag, and never for a resize. */
+ onDraggingChange: (dragging: boolean) => void;
+ onPreview: (shots: StageShot[] | null) => void;
+ onCommit: (edit: StageStoryboardEdit, block: StageShot, before: readonly StageShot[]) => void;
+}
+
+/**
+ * The blocks of the Storyboard lane.
+ *
+ * The block body selects the block and its camera, moves no playhead
+ * and writes nothing. Moved past a small threshold, it carries the block to another
+ * place instead: the block alone follows the pointer, sideways and kept inside the
+ * track, while every other block, the playhead and what the viewport shows stay as they
+ * are. Wherever letting go would change the order, a line in the lane stands in the gap
+ * the block would be let into: before the block that would then follow it, or at the end
+ * of the Storyboard when it would be last. Flat against either edge of the track, the
+ * block is let in last or first, as far as the pointer could take it. Let go where the
+ * order would change, the track shows that order at once and one command saves it; let
+ * go anywhere else, or cancelled, the block is back in its place and nothing is written.
+ * Its name is read from the referenced camera on every render,
+ * so a rename reaches every block that shows that camera. The selected block shows
+ * it as a fill inside its own box; the block under the playhead as a white outline.
+ *
+ * A block also shows a picture of its camera at the block's start. The pictures live
+ * beside the document, never in it, and are made one at a time in idle time, so the
+ * timeline is drawn and the pointer is answered first. A block reports whether its
+ * picture is pending, ready or could not be made; while it waits it is a whole block.
+ */
+export function StageStoryboardTrack({
+ stage,
+ sceneRevision,
+ blocks,
+ duration,
+ selectedBlockId,
+ activeBlockId,
+ thumbnail,
+ thumbnailReady,
+ onSelect,
+ displayedShots,
+ editable,
+ onDraggingChange,
+ onPreview,
+ onCommit,
+}: StageStoryboardTrackProps) {
+ const { t } = useI18n();
+ const cache = useState(() => new StageStoryboardThumbnailCache())[0];
+ // A picture arriving is the one thing that changes a block while the stage stands still.
+ const [, setArrived] = useState(0);
+ const size = useMemo(
+ () => stageStoryboardThumbnailSize(stage.aspectRatio),
+ [stage.aspectRatio],
+ );
+ /** What each block's thumbnail must show now. */
+ const wanted = useMemo(() => {
+ if (!blocks.length) return [];
+ const keyFor = prepareStageStoryboardThumbnailKeys(stage, sceneRevision);
+ const shots = new Map(stage.shots.map((shot) => [shot.id, shot]));
+ return blocks.map((block) => {
+ const shot = shots.get(block.id);
+ return { block, key: shot ? keyFor(shot) : null };
+ });
+ }, [blocks, stage, sceneRevision]);
+ // The cache is told in the same render that reads it, so a block reports that it
+ // waits from the frame its picture goes stale, not from the frame after.
+ for (const { block, key } of wanted)
+ if (key !== null) cache.want(block.id, key);
+ const gesture = useRef<{
+ pointerId: number;
+ block: StageShot;
+ shots: readonly StageShot[];
+ mode: "body" | "reorder" | "resize";
+ x: number;
+ y: number;
+ secondsPerPixel: number;
+ /** How far the pressed block may be carried from its place, in pixels: up to the
+ * track's left edge and up to its right edge, and no further. */
+ limits: { min: number; max: number };
+ /** The track's width in pixels, for placing the line that says where the block would
+ * be let in. */
+ width: number;
+ } | null>(null);
+ /** What the track itself shows of the gesture in progress. It is the track's own view
+ * state, so a pointer move re-renders no parent, and nothing outside the track moves
+ * before the gesture ends: `mode` picks the cursor of the surface, which owns the
+ * pointer once it moves, and `carried` is the block that follows the pointer once the
+ * press has become a drag, how far it is from its own place in pixels, and, where a
+ * release would change the order, where in the track the block would be let in, in
+ * pixels from the track's left edge. */
+ const [shownGesture, setShownGesture] = useState<{
+ mode: "body" | "reorder" | "resize";
+ carried: { blockId: string; offset: number; insertAt: number | null } | null;
+ } | null>(null);
+ const shoot = useRef(thumbnail);
+ shoot.current = thumbnail;
+
+ useEffect(() => {
+ // Blocks that left the document are forgotten, with the pictures made for them.
+ cache.retain(
+ wanted.flatMap(({ block, key }) => (key === null ? [] : [block.id])),
+ );
+ if (!thumbnailReady) return;
+ let stopped = false;
+ let idle: number | null = null;
+ let timer: number | null = null;
+ const cancel = () => {
+ if (idle !== null) window.cancelIdleCallback(idle);
+ if (timer !== null) window.clearTimeout(timer);
+ idle = timer = null;
+ };
+ // One picture per task: the next asks for idle time of its own, so the pointer
+ // and the next frame come first.
+ const later = (task: () => void) => {
+ if (typeof window.requestIdleCallback === "function")
+ idle = window.requestIdleCallback(task, { timeout: IDLE_TIMEOUT_MS });
+ else timer = window.setTimeout(task, 0);
+ };
+ const run = () => {
+ idle = timer = null;
+ if (stopped) return;
+ const next = cache.pending()[0];
+ if (!next) return;
+ const block = wanted.find(({ block }) => block.id === next.blockId)?.block;
+ if (!block) return;
+ const shot: StageStoryboardThumbnailShot = gesture.current ? { kind: "wait" } : shoot.current(block.cameraId, block.start.time);
+ if (shot.kind === "wait") {
+ timer = window.setTimeout(run, GESTURE_POLL_MS);
+ return;
+ }
+ cache.store(
+ next.blockId,
+ next.key,
+ shot.kind === "failed" ? null : shot.image,
+ );
+ setArrived((count) => count + 1);
+ if (cache.pending().length) later(run);
+ };
+ if (cache.pending().length) later(run);
+ return () => {
+ stopped = true;
+ cancel();
+ };
+ }, [wanted, thumbnailReady]);
+
+ const track = useRef(null);
+ const pendingFrame = useRef(null);
+ const clearPreviewFrame = () => {
+ if (pendingFrame.current === null) return;
+ window.cancelAnimationFrame(pendingFrame.current);
+ pendingFrame.current = null;
+ };
+ const preview = useRef(onPreview);
+ preview.current = onPreview;
+ const draggingChange = useRef(onDraggingChange);
+ draggingChange.current = onDraggingChange;
+ /** Whether the parent now holds a drag as in progress, so it is told each way once. */
+ const reportedDrag = useRef(false);
+ const dragReportQueued = useRef(false);
+ const reportDrag = (dragging: boolean) => {
+ if (reportedDrag.current === dragging) return;
+ reportedDrag.current = dragging;
+ draggingChange.current(dragging);
+ };
+ const cancelGesture = () => {
+ const current = gesture.current;
+ if (!current) return;
+ gesture.current = null;
+ clearPreviewFrame();
+ setShownGesture(null);
+ reportDrag(false);
+ preview.current(null);
+ // The surface keeps the pointer it captured until the pointer is let go, and the
+ // browser lets go of it with that release. Released here instead, the release that
+ // follows would land on whatever lies under the pointer: over an empty stretch of
+ // the lane, a click on the lane, which moves the playhead although the drag was
+ // cancelled. Held, that release reaches this surface alone, and its click stops here.
+ };
+ useEffect(() => {
+ const cancelOnEscape = (event: KeyboardEvent) => {
+ if (event.key !== "Escape" || !gesture.current) return;
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ cancelGesture();
+ };
+ window.addEventListener("keydown", cancelOnEscape, true);
+ window.addEventListener("blur", cancelGesture);
+ return () => {
+ window.removeEventListener("keydown", cancelOnEscape, true);
+ window.removeEventListener("blur", cancelGesture);
+ cancelGesture();
+ };
+ }, []);
+ useEffect(() => {
+ if (!editable || (gesture.current && gesture.current.shots !== stage.shots))
+ cancelGesture();
+ }, [editable, stage.shots]);
+
+ const startGesture = (
+ event: ReactPointerEvent,
+ block: StageShot,
+ ownerId?: string,
+ ) => {
+ if (!editable || !event.isPrimary || event.button !== 0 || gesture.current)
+ return;
+ const surface = track.current;
+ if (!surface) return;
+ const owner = ownerId ? stage.shots.find((shot) => shot.id === ownerId) : block;
+ if (!owner) return;
+ const pressed = event.currentTarget.closest(".cw-stage-storyboard-block-shell");
+ const bounds = surface.getBoundingClientRect();
+ const box = pressed?.getBoundingClientRect();
+ gesture.current = {
+ pointerId: event.pointerId,
+ block: owner,
+ shots: stage.shots,
+ mode: ownerId ? "resize" : "body",
+ x: event.clientX,
+ y: event.clientY,
+ secondsPerPixel: duration / Math.max(1, bounds.width),
+ limits: !ownerId && box
+ ? { min: bounds.left - box.left, max: bounds.right - box.right }
+ : { min: 0, max: 0 },
+ width: bounds.width,
+ };
+ setShownGesture({ mode: gesture.current.mode, carried: null });
+ surface.setPointerCapture(event.pointerId);
+ event.stopPropagation();
+ };
+ const projectGesture = ({ pointerId, clientX, clientY }: Pick) => {
+ const current = gesture.current;
+ if (!current || current.pointerId !== pointerId) return;
+ const dx = clientX - current.x;
+ if (current.mode === "body") {
+ if (Math.hypot(dx, clientY - current.y) < 5) return;
+ current.mode = "reorder";
+ }
+ const { block, shots } = current;
+ // The offset is measured from pointerdown, so grabbing either side of a
+ // boundary starts at the original time.
+ const delta = dx * current.secondsPerPixel;
+ let edit: StageStoryboardEdit;
+ let ordered: readonly StageShot[];
+ /** Of a drag to another place: where in the track, as it lies now, the block would be
+ * let in, in seconds. */
+ let insertAt: number | undefined;
+ if (current.mode === "resize") {
+ const span = normalizeStoryboardTime(normalizeStoryboardTime(block.duration) + delta);
+ if (span === normalizeStoryboardTime(block.duration)) return;
+ edit = { type: "resize", blockId: block.id, duration: span };
+ ordered = shots.map((shot) => shot.id === block.id ? { ...shot, duration: span } : shot);
+ } else {
+ const remaining = shots.filter((shot) => shot.id !== block.id);
+ // Flat against an edge of the track the block can be carried no further, and the
+ // pointer may not go beyond the window either: there it is let in last, or first.
+ // Anywhere else it goes before the first block whose centre is to the right of its
+ // own, and last once its centre is past every centre.
+ const center = block.start + block.duration / 2 + delta;
+ const crossing = remaining.findIndex((shot) => center < shot.start + shot.duration / 2);
+ const index = dx >= current.limits.max
+ ? remaining.length
+ : dx <= current.limits.min
+ ? 0
+ : crossing === -1 ? remaining.length : crossing;
+ ordered = [...remaining.slice(0, index), block, ...remaining.slice(index)];
+ if (ordered.every((shot, position) => shot === shots[position])) return;
+ edit = { type: "reorder", blockIds: ordered.map((shot) => shot.id) };
+ // The gap the block would be let into, as the track lies now: before the block that
+ // would then follow it, or after the last one when it would be last.
+ const last = shots[shots.length - 1];
+ insertAt = index < ordered.length - 1
+ ? ordered[index + 1].start
+ : last.start + last.duration;
+ }
+ // The same laying-out the parent reads the playhead's landing from.
+ const packed = packStageStoryboard(ordered, ordered.map((shot) => shot.id));
+ if (stageStoryboardIssue({ ...stage, shots: packed })) return;
+ return { edit, packed, insertAt };
+ };
+ const finishGesture = (event: ReactPointerEvent) => {
+ const current = gesture.current;
+ if (!current || current.pointerId !== event.pointerId) return;
+ clearPreviewFrame();
+ const result = projectGesture(event);
+ gesture.current = null;
+ setShownGesture(null);
+ reportDrag(false);
+ if (result) {
+ onPreview(result.packed);
+ onCommit(result.edit, current.block, current.shots);
+ } else {
+ onPreview(null);
+ if (current.mode === "body") onSelect(current.block.id, current.block.cameraId);
+ }
+ };
+ const layout = displayedShots ?? stage.shots;
+ return (
+ {
+ const current = gesture.current;
+ if (!current || current.pointerId !== event.pointerId) return;
+ const result = projectGesture(event);
+ const { clientX } = event;
+ // One frame answers any number of pointer moves.
+ clearPreviewFrame();
+ pendingFrame.current = window.requestAnimationFrame(() => {
+ pendingFrame.current = null;
+ if (gesture.current !== current) return;
+ if (current.mode === "resize") {
+ // A resize shows the whole track as it would be saved, frame by frame.
+ preview.current(result?.packed ?? null);
+ return;
+ }
+ if (current.mode !== "reorder") return;
+ // A drag to another place carries the one block and nothing else: the order
+ // it would have is the gesture's own until the block is let go. A line stands
+ // in the gap the block would be let into, only where letting go would change
+ // the order.
+ setShownGesture({
+ mode: "reorder",
+ carried: {
+ blockId: current.block.id,
+ // The pointer's horizontal travel since the press, kept inside the
+ // track. The block shows that travel; where it would land is the
+ // gesture's own, and follows the pointer past either edge.
+ offset: Math.min(
+ Math.max(clientX - current.x, current.limits.min),
+ current.limits.max,
+ ),
+ // At the very end of the track the line is kept just inside it, so that
+ // neither of its chevrons is cut off.
+ insertAt: result?.insertAt === undefined
+ ? null
+ : Math.min(
+ (result.insertAt / duration) * current.width,
+ current.width - MARKER_INSET,
+ ),
+ },
+ });
+ // From here to the end of the gesture the parent keeps what would change the
+ // Storyboard unusable. Its answer is a render of its own, large enough to hold
+ // back the frame in which the block first moves, so it is told in the frame
+ // after that one, and not at all once the drag is over.
+ if (reportedDrag.current || dragReportQueued.current) return;
+ dragReportQueued.current = true;
+ window.requestAnimationFrame(() => {
+ dragReportQueued.current = false;
+ if (gesture.current === current) reportDrag(true);
+ });
+ });
+ }}
+ onPointerUp={finishGesture}
+ onPointerCancel={cancelGesture}
+ onLostPointerCapture={cancelGesture}
+ onClick={(event) => event.stopPropagation()}
+ >
+ {shownGesture?.carried?.insertAt != null && (
+
+ )}
+ {layout.map((block, index) => {
+ const name =
+ stage.cameras.find((camera) => camera.id === block.cameraId)?.name ??
+ block.cameraId;
+ const image = cache.image(block.id);
+ const carried = shownGesture?.carried;
+ const drag = carried && carried.blockId === block.id ? carried : null;
+ return (
+
+
{
+ const handle = (event.target as HTMLElement).closest("[data-boundary-owner]");
+ startGesture(event, block, handle?.dataset.boundaryOwner);
+ }}
+ onClick={(event) => {
+ event.stopPropagation();
+ // Pointer selection is handled by the gesture. Keyboard activation
+ // and activation from a disabled gesture still select the block.
+ if (event.detail === 0 || !editable) onSelect(block.id, block.cameraId);
+ }}
+ >
+
+ {/* The picture is part of the block. Left draggable, the browser
+ starts its own picture drag on the press and cancels the pointer
+ gesture that would have carried the block. */}
+ {image && }
+
+ {name}
+ {editable && (index === 0 ? ["right"] : ["left", "right"]).map((edge) => (
+
+ ))}
+
+ {editable && !displayedShots && shownGesture?.mode !== "reorder" && (
+
event.stopPropagation()}
+ onClick={(event) => {
+ event.stopPropagation();
+ if (!gesture.current) onCommit({ type: "delete", blockId: block.id }, block, stage.shots);
+ }}
+ >
+
+
+ )}
+
+ );
+ })}
+
+ );
+}
diff --git a/src/canvas/connectionPolicy.ts b/src/canvas/connectionPolicy.ts
index 4a2373b2b..d04c0bc77 100644
--- a/src/canvas/connectionPolicy.ts
+++ b/src/canvas/connectionPolicy.ts
@@ -15,10 +15,16 @@ import { assemblyIssue, isAssemblyTarget } from "./editorAssembly.ts";
/** Product port capabilities; model-specific input limits remain separate. */
export function nodePorts(kind: CanvasNodeKind) {
return {
- source: !["group", "stack", "timeline"].includes(kind),
+ source: !["group", "stack", "timeline", "external"].includes(kind),
target: !["group", "stack", "tool", "external"].includes(kind),
};
}
+
+/** Node kinds whose frame anchors no edge; every other kind renders both anchors.
+ * Deliberately not `nodePorts`: anchors only attach edges, and provenance edges start
+ * at a timeline while a folded stack carries its members' edges. A group frames, and
+ * the Director Stage node is no edge endpoint. */
+export const UNANCHORED_KINDS: readonly CanvasNodeKind[] = ["group", "external"];
/** Source → downstream matrix shared by menus, gestures and commands. */
export const downstreamKinds: Partial<
Record
@@ -217,8 +223,7 @@ export function referenceIssue(
return "target_type_unsupported";
return null;
}
- if (!nodePorts(a.type).source || a.type === "external")
- return "source_type_unsupported";
+ if (!nodePorts(a.type).source) return "source_type_unsupported";
if (!nodePorts(b.type).target) return "target_type_unsupported";
if (!referenceTypeAllowed(a, b.type)) return "source_type_unsupported";
if (!canSourceReference(a)) return "source_empty";
diff --git a/src/canvas/creationTools.ts b/src/canvas/creationTools.ts
index 8e46595cc..18a542417 100644
--- a/src/canvas/creationTools.ts
+++ b/src/canvas/creationTools.ts
@@ -24,6 +24,5 @@ export const CANVAS_CREATION_TOOLS: readonly {
kind: "external",
labelKey: "canvas.kind.external",
icon: "rail-stage",
- unavailable: true,
},
];
diff --git a/src/canvas/dataBoundary.ts b/src/canvas/dataBoundary.ts
index e679279c4..17047ac50 100644
--- a/src/canvas/dataBoundary.ts
+++ b/src/canvas/dataBoundary.ts
@@ -83,7 +83,9 @@ export function isGenerationProvenance(
optionalString(value.inputFingerprint) &&
optionalString(value.editorDocumentId) &&
(value.editorRevision === undefined ||
- Number.isSafeInteger(value.editorRevision))
+ Number.isSafeInteger(value.editorRevision)) &&
+ (value.stagePreview === undefined ||
+ typeof value.stagePreview === "boolean")
);
}
diff --git a/src/canvas/director-stage.css b/src/canvas/director-stage.css
index c7144c574..fd2a79666 100644
--- a/src/canvas/director-stage.css
+++ b/src/canvas/director-stage.css
@@ -1,269 +1,3873 @@
-.cw-stage-dialog {
- width: min(1500px, 98vw);
+@font-face {
+ font-family: "Nunito Sans";
+ src: url("/fonts/NunitoSans-Latin.woff2") format("woff2");
+ font-style: normal;
+ font-weight: 400 700;
+ font-display: swap;
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
-.cw-stage-layout {
- display: grid;
- grid-template-columns: 190px minmax(300px, 1fr) 240px;
- gap: 18px;
- min-height: 480px;
+
+@font-face {
+ font-family: "Director Stage CJK";
+ src: url("/fonts/NotoSansCJKsc-Regular.otf") format("opentype");
+ font-weight: 400;
+ font-display: swap;
+ unicode-range: U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
}
-.cw-stage-objects,
-.cw-stage-inspector {
+
+/* The director console: a full-bleed 3D base layer with floating panels. */
+.cw-domain-overlay:has(> .cw-stage-console) {
+ padding: 0;
+ background: #050509;
+ backdrop-filter: none;
+}
+.cw-stage-console {
+ position: absolute;
+ inset: 0;
+ display: block;
+ overflow: hidden;
+ color: #e9dff1;
+ background: #0d0a14;
+ outline: none;
+}
+.cw-stage-console button,
+.cw-stage-console input,
+.cw-stage-console select {
+ font: inherit;
+}
+.cw-stage-scene {
+ position: absolute;
+ inset: 0;
+}
+.cw-stage-scene canvas {
+ display: block;
+ /* The buffer scales with the device pixel ratio; the CSS box must stay
+ * pinned to the container or a HiDPI display shows a zoomed, blurry crop. */
+ width: 100%;
+ height: 100%;
+}
+.cw-stage-panels {
+ position: absolute;
+ inset: 0;
+ margin: 0;
+ padding: 0;
+ border: none;
+ pointer-events: none;
min-width: 0;
}
-.cw-stage-layout h3 {
- font-size: 13px;
- margin: 8px 0 14px;
- color: #dedee6;
+.cw-stage-panels > * {
+ pointer-events: auto;
}
-.cw-stage-add {
+.cw-stage-topbar {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 20;
display: flex;
+ align-items: center;
+ gap: 16px;
flex-wrap: wrap;
- gap: 6px;
+ padding: 8px 14px;
+ background: #120e19e6;
+ border-bottom: 1px solid #2c2440;
}
-.cw-stage-add button {
- padding: 7px;
- font-size: 11px;
+.cw-stage-identity h2 {
+ margin: 0;
+ font-size: 15px;
}
-.cw-stage-object-list {
+.cw-stage-toolbar {
display: flex;
- flex-direction: column;
+ flex-wrap: wrap;
gap: 6px;
- margin: 15px 0 24px;
-}
-.cw-stage-object-list button {
- justify-content: flex-start;
- text-align: left;
-}
-.cw-stage-object-list button[aria-pressed="true"] {
- background: #6554a83d;
- border-color: #8e76d1;
-}
-.cw-stage-object-list span {
- width: 10px;
- height: 10px;
- border-radius: 3px;
+ flex: 1;
+ justify-content: center;
}
-.cw-stage-center {
- min-width: 0;
+.cw-stage-topactions {
+ display: flex;
+ gap: 6px;
+ margin-left: auto;
}
-.cw-stage-viewport {
- width: 100%;
- aspect-ratio: 16/9;
- overflow: hidden;
- box-shadow: inset 0 0 0 1px #3b3d50;
- border-radius: 12px;
- background: #151923;
- touch-action: none;
+.cw-stage-topactions button,
+.cw-stage-toolbar button {
+ padding: 5px 10px;
+ font-size: 12px;
}
-.cw-stage-viewport canvas {
- display: block;
- width: 100%;
- height: 100%;
+.cw-stage-error {
+ position: absolute;
+ top: calc(var(--stage-topbar-height, 52px) + 6px);
+ left: 50%;
+ transform: translateX(-50%);
+ z-index: 30;
+ margin: 0;
+ padding: 8px 14px;
+ max-width: 70%;
+ --stage-feedback-border: #6d4949;
+ --stage-feedback-text: #f2cccc;
+ pointer-events: none;
}
-.cw-stage-transport {
+/* Render status sits outside the disabled panels fieldset so the cancel
+ * control stays live while a render is in flight. */
+.cw-stage-console .cw-render-status {
+ position: absolute;
+ top: calc(var(--stage-topbar-height, 52px) + 6px);
+ right: 14px;
+ z-index: 25;
display: flex;
gap: 10px;
align-items: center;
- flex-wrap: wrap;
- margin: 15px 0;
+ padding: 8px 12px;
}
-.cw-stage-transport output {
- font-size: 12px;
- font-variant-numeric: tabular-nums;
- color: #c5c5d5;
+.cw-stage-left,
+.cw-stage-right {
+ position: absolute;
+ top: 64px;
+ bottom: 200px;
+ z-index: 10;
+ overflow-y: auto;
+ padding: 12px;
+ border: 1px solid #2c2440;
+ border-radius: 10px;
+ background: #120e19e0;
}
-.cw-stage-transport label {
- font-size: 11px;
- display: flex;
- gap: 6px;
- align-items: center;
+.cw-stage-left {
+ left: 14px;
+ width: 230px;
}
-.cw-stage-transport input {
- width: 65px !important;
- padding: 5px !important;
+.cw-stage-right {
+ right: 14px;
+ width: 290px;
}
-.cw-stage-center > input[type="range"] {
- width: 100%;
- accent-color: #b493ec;
+.cw-stage-bottom {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 15;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ max-height: 190px;
+ overflow-y: auto;
+ padding: 10px 16px;
+ background: #120e19f0;
+ border-top: 1px solid #2c2440;
}
-.cw-stage-keyframes {
+.cw-stage-transport {
display: flex;
- gap: 7px;
flex-wrap: wrap;
- min-height: 58px;
- margin: 12px 0;
+ gap: 8px;
+ align-items: center;
}
-.cw-stage-keyframes > div {
+.cw-stage-track-surface {
+ position: relative;
display: flex;
- align-items: center;
+ flex: 0 0 auto;
+ flex-direction: column;
+ gap: 0;
+ min-height: 0;
+ max-height: none;
+ padding: 0 0 6px;
+ border-top: 1px solid #24232a;
+ background: #111114;
+ cursor: crosshair;
+ overflow-y: auto;
+ user-select: none;
}
-.cw-stage-keyframes button {
- border-radius: 6px 0 0 6px;
- padding: 7px;
- font-size: 11px;
+.cw-stage-track-ruler {
+ display: block;
+ position: sticky;
+ top: 0;
+ z-index: 2;
+ min-height: 24px;
+ padding: 0;
+ border-bottom: 1px solid #303036;
+ background: #1b1b1f;
+ color: #777486;
+ font-size: 10px;
}
-.cw-stage-keyframes button + button {
- border-radius: 0 6px 6px 0;
- border-left: 0;
+.cw-stage-track-ruler-scale {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 132px;
}
-.cw-stage-keyframes p {
- font-size: 12px;
- color: #9795a7;
+.cw-stage-track-ruler-tick {
+ position: absolute;
+ bottom: 0;
+ width: 1px;
+ height: 5px;
+ background: #3b3943;
}
-.cw-stage-vector {
- border: 0;
- padding: 0;
- margin: 13px 0;
+.cw-stage-track-ruler-tick.is-major {
+ height: 10px;
+ background: #706b7b;
+}
+.cw-stage-track-ruler-label {
+ position: absolute;
+ top: 2px;
+ left: 50%;
+ color: #a6a1ae;
+ font-size: 10px;
+ line-height: 1;
+ white-space: nowrap;
+ transform: translateX(-50%);
+}
+.cw-stage-track-ruler-tick.is-start .cw-stage-track-ruler-label {
+ left: 0;
+ transform: none;
+}
+.cw-stage-track-ruler-tick.is-end .cw-stage-track-ruler-label {
+ left: 0;
+ transform: translateX(-100%);
+}
+.cw-stage-track-row {
display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- gap: 6px;
+ grid-template-columns: 124px minmax(0, 1fr);
+ gap: 8px;
+ align-items: center;
+ min-height: 20px;
+ border-bottom: 1px solid #222127;
+ background: #151519;
}
-.cw-stage-vector legend {
+.cw-stage-track-group-row {
+ display: grid;
+ grid-template-columns: 124px minmax(0, 1fr);
+ gap: 8px;
+ align-items: center;
+ min-height: 23px;
+ border-top: 1px solid #3a3941;
+ border-bottom: 1px solid #303036;
+ background: #25252a;
+}
+.cw-stage-track-group-label {
+ overflow: hidden;
+ color: #eceaf0;
font-size: 11px;
- margin-bottom: 7px;
- color: #b9b7c7;
+ font-weight: 600;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
-.cw-stage-vector label {
+.cw-stage-track-group-toggle {
display: flex;
- flex-direction: column;
- gap: 4px;
- color: #9995ad;
+ width: 100%;
+ height: 22px;
+ min-width: 0;
+ align-items: center;
+ gap: 5px;
+ padding: 0 4px 0 1px;
+ border: 0;
+ background: transparent;
+ color: inherit;
+ font: inherit;
+ text-align: left;
+}
+.cw-stage-track-group-toggle:hover,
+.cw-stage-track-group-toggle:focus-visible {
+ color: #ffffff;
+}
+.cw-stage-track-group-chevron {
+ width: 10px;
+ color: #aaa5bb;
+ font-size: 12px;
+ line-height: 1;
+ text-align: center;
+}
+.cw-stage-track-group-icon {
+ width: 12px;
+ color: #bbb4d3;
font-size: 10px;
+ line-height: 1;
+ text-align: center;
}
-.cw-stage-vector input {
- width: 100% !important;
- padding: 7px !important;
- min-width: 0;
+.cw-stage-track-group-icon.is-object {
+ color: #c5b7ff;
}
-.cw-stage-inspector .cw-domain-field {
- margin: 11px 0;
+.cw-stage-track-group-icon.is-camera {
+ color: #a9d6ff;
}
-.cw-stage-inspector > h3:not(:first-child) {
- border-top: 1px solid #32303e;
- padding-top: 20px;
- margin-top: 20px;
+.cw-stage-track-group-lane {
+ height: 100%;
+ background: #202025;
}
-.cw-stage-dialog input[type="color"] {
- padding: 3px;
- height: 32px;
- width: 100%;
+.cw-stage-track-label {
+ position: relative;
+ overflow: hidden;
+ padding-left: 22px;
+ color: #aaa7b3;
+ font-size: 10px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
-.cw-stage-dialog .cw-domain-body {
- padding-bottom: 10px;
+.cw-stage-track-label::before {
+ position: absolute;
+ top: 50%;
+ left: 11px;
+ width: 6px;
+ height: 6px;
+ border: 1px solid #797582;
+ content: "";
+ transform: translateY(-50%);
}
-@media (max-width: 1100px) {
- .cw-stage-layout {
- grid-template-columns: 150px minmax(260px, 1fr);
- }
- .cw-stage-inspector {
- grid-column: 1/-1;
- max-height: none;
- display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- gap: 12px;
- }
- .cw-stage-inspector h3 {
- grid-column: 1/-1;
- }
- .cw-stage-inspector > button {
- align-self: end;
- }
+.cw-stage-track-lane {
+ position: relative;
+ height: 18px;
+ border-left: 1px solid #28272e;
+ background: #121216;
}
-@media (max-width: 650px) {
- .cw-stage-layout {
- grid-template-columns: 1fr;
- gap: 12px;
- }
- .cw-stage-objects {
- max-height: none;
- }
- .cw-stage-object-list {
- flex-direction: row;
- overflow: auto;
- margin: 10px 0;
- }
- .cw-stage-object-list button {
- white-space: nowrap;
- }
- .cw-stage-objects > .cw-domain-field,
- .cw-stage-objects > .cw-domain-checkbox {
- display: none;
- }
- .cw-stage-inspector {
- grid-template-columns: repeat(2, minmax(0, 1fr));
- }
- .cw-stage-transport {
- gap: 6px;
- }
- .cw-stage-dialog .cw-domain-footer {
- gap: 10px;
- }
- .cw-stage-dialog .cw-domain-footer > div {
- flex-wrap: wrap;
- }
+.cw-stage-track-interval {
+ position: absolute;
+ top: 5px;
+ height: 8px;
+ min-width: 2px;
+ border-radius: 3px;
+ background: #51427c;
}
-
-/* The camera and encoder share this exact frame; no min-height may change its aspect. */
-.cw-stage-viewport {
- min-height: 0;
- height: auto;
+.cw-stage-track-point {
+ position: absolute;
+ z-index: 1;
+ top: 3px;
+ width: 8px;
+ height: 8px;
+ padding: 0;
+ border: 0;
+ border-radius: 50%;
+ background: #d6c7ff;
+ transform: translateX(-50%);
}
-.cw-stage-clips,
-.cw-stage-storyboard {
- margin: 16px 0;
+.cw-stage-track-point.is-boundary {
+ border-radius: 2px;
+ background: #a590e8;
+ transform: translateX(-50%) rotate(45deg);
}
-.cw-stage-clip,
-.cw-stage-shot {
+.cw-stage-track-point:hover,
+.cw-stage-track-point:focus-visible {
+ outline: 2px solid #fff;
+ outline-offset: 2px;
+}
+.cw-stage-track-playhead {
+ position: absolute;
+ top: 18px;
+ bottom: 4px;
+ width: 1px;
+ background: #f5b85b;
+ pointer-events: none;
+}
+/* Unsaved-changes guard covering the fullscreen stage. */
+.cw-stage-confirm {
+ position: fixed;
+ z-index: 1200;
+ inset: 0;
display: grid;
- grid-template-columns: repeat(2, minmax(0, 1fr));
- gap: 7px;
- border: 1px solid #39374b;
- border-radius: 8px;
- padding: 10px;
- margin-top: 9px;
+ place-items: center;
+ background: #050509cc;
}
-.cw-stage-clip label,
-.cw-stage-shot label {
+.cw-stage-confirm > div {
display: flex;
flex-direction: column;
- gap: 5px;
- font-size: 11px;
- color: #aaa5bb;
- min-width: 0;
+ gap: 10px;
+ min-width: 280px;
+ padding: 18px;
+ border: 1px solid #494151;
+ border-radius: 10px;
+ background: #19141f;
}
-.cw-stage-clip input,
-.cw-stage-clip select,
-.cw-stage-shot input,
-.cw-stage-shot select {
- width: 100%;
- min-width: 0;
- padding: 6px;
+.cw-stage-confirm h3 {
+ margin: 0;
+ font-size: 15px;
}
-.cw-stage-clip input[type="range"] {
- padding: 0;
- border: 0;
- background: none;
+.cw-stage-dialog .cw-domain-body {
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ overflow: hidden;
}
-.cw-stage-clip button,
-.cw-stage-shot button {
- align-self: end;
- font-size: 11px;
- padding: 6px;
+.cw-stage-dialog .cw-domain-body > fieldset.cw-editor-work {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ min-height: 0;
+ border: none;
+ padding: 0 14px 10px;
}
-.cw-stage-shot {
- grid-template-columns:
- minmax(90px, 1fr) repeat(2, minmax(65px, 0.7fr))
- auto auto;
- align-items: end;
+.cw-stage-layout {
+ display: grid;
+ grid-template-columns: 210px minmax(0, 1fr) 270px;
+ gap: 14px;
+ flex: 1;
+ min-height: 0;
}
-.cw-stage-camera-actions {
+.cw-stage-objects,
+.cw-stage-inspector {
+ overflow-y: auto;
+ min-height: 0;
+}
+.cw-stage-center {
display: flex;
- gap: 8px;
- flex-wrap: wrap;
+ min-height: 0;
+ min-width: 0;
+ position: relative;
}
-@media (max-width: 650px) {
- .cw-stage-shot {
- grid-template-columns: repeat(2, minmax(0, 1fr));
- }
+.cw-stage-viewport {
+ position: absolute;
+ inset: 0;
+ border: 1px solid #2e2740;
+ border-radius: 8px;
+ overflow: hidden;
+ background: #0d0a14;
+}
+.cw-stage-viewport canvas {
+ display: block;
+}
+.cw-stage-objects,
+.cw-stage-inspector {
+ min-width: 0;
+}
+.cw-stage-layout h3 {
+ font-size: 13px;
+ margin: 8px 0 14px;
+ color: #dedee6;
+}
+.cw-stage-object-list {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ margin: 15px 0 24px;
+}
+.cw-stage-object-list button {
+ justify-content: flex-start;
+ text-align: left;
+}
+.cw-stage-object-list button[aria-pressed="true"] {
+ background: #6554a83d;
+ border-color: #8e76d1;
+}
+.cw-stage-center {
+ min-width: 0;
+ position: relative;
+}
+/* The shot-materials drawer floats over the viewport like the reference
+ * console's right-hand capture panel. */
+.cw-stage-drawer {
+ position: absolute;
+ top: 12px;
+ right: 12px;
+ z-index: 5;
+ width: min(280px, 70%);
+ max-height: calc(100% - 24px);
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ padding: 10px;
+ border-radius: 12px;
+ background: rgba(23, 24, 31, 0.92);
+ box-shadow:
+ inset 0 0 0 1px #3b3d50,
+ 0 8px 24px rgba(0, 0, 0, 0.45);
+}
+.cw-stage-drawer-head {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+.cw-stage-drawer-head h4 {
+ margin: 0;
+ font-size: 12px;
+}
+.cw-stage-drawer-count {
+ font-size: 11px;
+ padding: 1px 7px;
+ border-radius: 999px;
+ background: #2c2e40;
+ color: #c5c5d5;
+}
+.cw-stage-drawer-head button {
+ margin-left: auto;
+ padding: 2px 8px;
+ border: 0;
+ background: none;
+ color: #c5c5d5;
+ font-size: 14px;
+ cursor: pointer;
+}
+.cw-stage-drawer-toolbar {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+ font-size: 11px;
+ color: #c5c5d5;
+}
+.cw-stage-drawer-toolbar label {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+}
+.cw-stage-drawer-list {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ overflow-y: auto;
+ min-height: 44px;
+}
+.cw-stage-drawer-item {
+ display: flex;
+ gap: 8px;
+ align-items: flex-start;
+}
+.cw-stage-drawer-preview {
+ flex: 1;
+ min-width: 0;
+ padding: 0;
+ border: 0;
+ border-radius: 8px;
+ overflow: hidden;
+ background: #101219;
+ text-align: left;
+ cursor: pointer;
+ display: block;
+}
+.cw-stage-drawer-preview img {
+ display: block;
+ width: 100%;
+ aspect-ratio: 16/9;
+ object-fit: cover;
+}
+.cw-stage-drawer-missing {
+ display: grid;
+ place-items: center;
+ width: 100%;
+ aspect-ratio: 16/9;
+ font-size: 11px;
+ color: #8f8fa3;
+}
+.cw-stage-drawer-caption {
+ display: flex;
+ justify-content: space-between;
+ gap: 8px;
+ padding: 5px 8px;
+ font-size: 11px;
+ color: #c5c5d5;
+}
+.cw-stage-drawer-empty {
+ font-size: 11px;
+ color: #8f8fa3;
+ padding: 8px 2px;
+}
+.cw-stage-drawer-actions {
+ display: flex;
+ gap: 6px;
+ flex-wrap: wrap;
+}
+.cw-stage-drawer-actions button {
+ font-size: 11px;
+ padding: 6px 8px;
+}
+.cw-stage-drawer-actions .cw-stage-drawer-primary {
+ margin-left: auto;
+ border-color: #8e76d1;
+}
+.cw-stage-lightbox {
+ position: fixed;
+ inset: 0;
+ z-index: 60;
+ display: grid;
+ place-items: center;
+ background: rgba(10, 11, 15, 0.72);
+}
+.cw-stage-lightbox figure {
+ margin: 0;
+ max-width: min(92vw, 1100px);
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+}
+.cw-stage-lightbox img {
+ max-width: 100%;
+ max-height: 78vh;
+ border-radius: 10px;
+ box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
+}
+.cw-stage-lightbox figcaption {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 12px;
+ font-size: 12px;
+ color: #e7e7f0;
+}
+/* Export dialog: camera source, linked duration, quality and frame rate. */
+.cw-stage-export {
+ width: min(460px, 92vw);
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+ padding: 18px;
+ border-radius: 14px;
+ background: #17181f;
+ box-shadow:
+ inset 0 0 0 1px #3b3d50,
+ 0 12px 32px rgba(0, 0, 0, 0.5);
+}
+.cw-stage-export-head {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+.cw-stage-export-head h4 {
+ margin: 0;
+ font-size: 14px;
+}
+.cw-stage-export-head button {
+ margin-left: auto;
+ padding: 2px 8px;
+ border: 0;
+ background: none;
+ color: #c5c5d5;
+ font-size: 14px;
+ cursor: pointer;
+}
+.cw-stage-export-field {
+ display: flex;
+ flex-direction: column;
+ gap: 5px;
+ font-size: 12px;
+}
+.cw-stage-export-field select {
+ padding: 7px;
+}
+.cw-stage-export-grid {
+ display: flex;
+ justify-content: space-between;
+ gap: 10px;
+ flex-wrap: wrap;
+ font-size: 12px;
+ color: #c5c5d5;
+ font-variant-numeric: tabular-nums;
+}
+.cw-stage-export-actions {
+ display: flex;
+ justify-content: flex-end;
+ gap: 8px;
+}
+/* The timeline track, transport and storyboard align to the frame width. */
+.cw-stage-stack {
+ margin-inline: auto;
+ min-width: 0;
+}
+.cw-stage-gizmo {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ margin-bottom: 8px;
+}
+.cw-stage-gizmo .cw-domain-note {
+ margin: 0;
+}
+.cw-stage-viewport {
+ width: 100%;
+ aspect-ratio: 16/9;
+ overflow: hidden;
+ box-shadow: inset 0 0 0 1px #3b3d50;
+ border-radius: 12px;
+ background: #151923;
+ touch-action: none;
+}
+.cw-stage-viewport canvas {
+ display: block;
+ width: 100%;
+ height: 100%;
+}
+.cw-stage-transport {
+ display: flex;
+ gap: 10px;
+ align-items: center;
+ flex-wrap: wrap;
+ margin: 15px 0;
+}
+.cw-stage-transport output {
+ font-size: 12px;
+ font-variant-numeric: tabular-nums;
+ color: #c5c5d5;
+}
+.cw-stage-transport label {
+ font-size: 11px;
+ display: flex;
+ gap: 6px;
+ align-items: center;
+}
+.cw-stage-transport input {
+ width: 65px !important;
+ padding: 5px !important;
+}
+.cw-stage-center > input[type="range"] {
+ width: 100%;
+ accent-color: #b493ec;
+}
+.cw-stage-vector {
+ border: 0;
+ padding: 0;
+ margin: 13px 0;
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ gap: 6px;
+}
+.cw-stage-vector legend {
+ font-size: 11px;
+ margin-bottom: 7px;
+ color: #b9b7c7;
+}
+.cw-stage-axis {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ color: #9995ad;
+ font-size: 10px;
+}
+.cw-stage-axis input[type="number"] {
+ width: 100% !important;
+ padding: 5px !important;
+ min-width: 0;
+}
+.cw-stage-axis .cw-control-slider {
+ width: 100%;
+}
+.cw-stage-vector input {
+ width: 100% !important;
+ padding: 7px !important;
+ min-width: 0;
+}
+.cw-stage-inspector .cw-domain-field {
+ margin: 11px 0;
+}
+.cw-stage-inspector > h3:not(:first-child) {
+ border-top: 1px solid #32303e;
+ padding-top: 20px;
+ margin-top: 20px;
+}
+.cw-stage-dialog input[type="color"] {
+ padding: 3px;
+ height: 32px;
+ width: 100%;
+}
+.cw-stage-dialog .cw-domain-body {
+ padding-bottom: 10px;
+}
+@media (max-width: 1100px) {
+ .cw-stage-layout {
+ grid-template-columns: 150px minmax(260px, 1fr);
+ }
+ .cw-stage-inspector {
+ grid-column: 1/-1;
+ max-height: none;
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ gap: 12px;
+ }
+ .cw-stage-inspector h3 {
+ grid-column: 1/-1;
+ }
+ .cw-stage-inspector > button {
+ align-self: end;
+ }
+}
+@media (max-width: 650px) {
+ .cw-stage-layout {
+ grid-template-columns: 1fr;
+ gap: 12px;
+ }
+ .cw-stage-objects {
+ max-height: none;
+ }
+ .cw-stage-object-list {
+ flex-direction: row;
+ overflow: auto;
+ margin: 10px 0;
+ }
+ .cw-stage-object-list button {
+ white-space: nowrap;
+ }
+ .cw-stage-objects > .cw-domain-field,
+ .cw-stage-objects > .cw-domain-checkbox {
+ display: none;
+ }
+ .cw-stage-inspector {
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ }
+ .cw-stage-transport {
+ gap: 6px;
+ }
+ .cw-stage-dialog .cw-domain-footer {
+ gap: 10px;
+ }
+ .cw-stage-dialog .cw-domain-footer > div {
+ flex-wrap: wrap;
+ }
+}
+
+/* The camera and encoder share this exact frame; no min-height may change its aspect. */
+.cw-stage-viewport {
+ min-height: 0;
+ height: auto;
+}
+.cw-stage-clips {
+ margin: 16px 0;
+}
+.cw-stage-clip {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 7px;
+ border: 1px solid #39374b;
+ border-radius: 8px;
+ padding: 10px;
+ margin-top: 9px;
+}
+.cw-stage-clip label {
+ display: flex;
+ flex-direction: column;
+ gap: 5px;
+ font-size: 11px;
+ color: #aaa5bb;
+ min-width: 0;
+}
+.cw-stage-clip input,
+.cw-stage-clip select {
+ width: 100%;
+ min-width: 0;
+ padding: 6px;
+}
+.cw-stage-clip input[type="range"] {
+ padding: 0;
+ border: 0;
+ background: none;
+}
+.cw-stage-clip button {
+ align-self: end;
+ font-size: 11px;
+ padding: 6px;
+}
+.cw-stage-camera-actions {
+ display: flex;
+ gap: 8px;
+ flex-wrap: wrap;
+}
+/* Left panel tabs. */
+.cw-stage-tabs {
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+ gap: 4px;
+ margin-bottom: 10px;
+}
+.cw-stage-tabs button {
+ padding: 6px 4px;
+ border: 1px solid #352a4a;
+ border-radius: 6px;
+ font-size: 12px;
+ color: #b9a9c9;
+ background: #1b1526;
+}
+.cw-stage-tabs button[aria-selected="true"] {
+ color: #f0e8f8;
+ border-color: #6b4fa0;
+ background: #2a2040;
+}
+/* Save-state chip in the top bar. */
+.cw-stage-chip {
+ padding: 4px 10px;
+ border-radius: 999px;
+ font-size: 12px;
+ color: #9fd6a8;
+ background: #1d2a1f;
+ border: 1px solid #2f4a33;
+}
+.cw-stage-chip.is-unsaved {
+ color: #f0c2a0;
+ background: #33241a;
+ border-color: #5a3d28;
+}
+/* Aspect mask: letterbox the shot frame over the free-form preview. */
+.cw-stage-mask {
+ position: absolute;
+ inset: 0;
+ z-index: 5;
+ pointer-events: none;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.cw-stage-mask::after {
+ content: "";
+ width: 100%;
+ height: 100%;
+ max-width: calc((100vh - 260px) * var(--stage-aspect, 1.7778));
+ max-height: calc(100vh - 260px);
+ aspect-ratio: var(--stage-aspect, 1.7778);
+ outline: 9999px solid #050509b8;
+ border: 1px solid #6b4fa0;
+}
+/* Frame drawn around the scissored camera-preview pass. It has the shape of what the
+ * preview shows: the element carries --stage-pip-aspect, and falls back to the stage's
+ * aspect where that is not set. */
+.cw-stage-pipframe {
+ position: absolute;
+ right: 12px;
+ top: 64px;
+ width: min(320px, 25%);
+ aspect-ratio: var(--stage-pip-aspect, var(--stage-aspect, 1.7778));
+ z-index: 6;
+ pointer-events: none;
+ border: 1px solid #6b4fa0;
+ border-radius: 4px;
+}
+.cw-stage-pipcanvas {
+ position: absolute;
+ z-index: 6;
+ display: none;
+ box-sizing: border-box;
+ pointer-events: none;
+ border-radius: 8px;
+}
+/* Compact tool buttons: uniform height, quiet borders, clear pressed state. */
+.cw-stage-console .cw-stage-topbar button,
+.cw-stage-console .cw-stage-left button,
+.cw-stage-console .cw-stage-right button,
+.cw-stage-console .cw-stage-bottom button {
+ min-height: 28px;
+ padding: 4px 10px;
+ border: 1px solid #3a3346;
+ border-radius: 6px;
+ font-size: 12px;
+ line-height: 1.2;
+ color: #cbb9dc;
+ background: #221c2e;
+ transition:
+ border-color 120ms ease,
+ color 120ms ease,
+ background 120ms ease;
+}
+.cw-stage-console button:hover:not(:disabled) {
+ border-color: #6b4fa0;
+ color: #f0e8f8;
+}
+.cw-stage-console button:active:not(:disabled) {
+ background: #2e2540;
+}
+.cw-stage-console button[aria-pressed="true"] {
+ border-color: #6b4fa0;
+ color: #f0e8f8;
+ background: #322547;
+}
+.cw-stage-console button:disabled {
+ opacity: 0.45;
+}
+/* Camera preset and move grids in the Cameras tab. */
+.cw-stage-left h4 {
+ margin: 12px 0 6px;
+ font-size: 12px;
+ color: #9d8db2;
+}
+.cw-stage-preset-grid {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 4px;
+}
+.cw-stage-preset-grid button {
+ width: 100%;
+}
+/* Viewfinder FOV bar floating under the top bar. */
+.cw-stage-fovbar {
+ position: absolute;
+ top: calc(var(--stage-topbar-height, 52px) + 6px);
+ left: 50%;
+ transform: translateX(-50%);
+ z-index: 18;
+ padding: 6px 14px;
+ border: 1px solid #3a3346;
+ border-radius: 8px;
+ background: #120e19e6;
+ font-size: 12px;
+}
+.cw-stage-fovbar label {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
+.cw-stage-fovbar input[type="range"] {
+ width: 220px;
+}
+/* In the fullscreen console the drawer floats above the panels and sits
+ * left of the right inspector so nothing hides its list. */
+.cw-stage-console .cw-stage-drawer {
+ z-index: 16;
+ right: 318px;
+ top: 64px;
+}
+/* Console controls cheat-sheet, opened from the top bar or the first
+ * object add. */
+.cw-stage-help {
+ width: min(400px, 92vw);
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ padding: 18px;
+ border-radius: 14px;
+ background: #17181f;
+ box-shadow:
+ inset 0 0 0 1px #3b3d50,
+ 0 12px 32px rgba(0, 0, 0, 0.5);
+}
+.cw-stage-help h5 {
+ margin: 4px 0 0;
+ font-size: 12px;
+ color: #b9a9c9;
+}
+.cw-stage-help ul {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ font-size: 13px;
+}
+/* Split live preview: camera tabs over the right pane, a draggable
+ * divider at the split ratio. */
+.cw-stage-split-tabs {
+ position: absolute;
+ top: 104px;
+ right: 318px;
+ z-index: 7;
+ display: flex;
+ gap: 6px;
+ flex-wrap: wrap;
+ justify-content: flex-end;
+ pointer-events: none;
+}
+.cw-stage-split-tabs button {
+ pointer-events: auto;
+ min-height: 26px;
+ padding: 3px 9px;
+ border: 1px solid #3a3346;
+ border-radius: 6px;
+ font-size: 12px;
+ color: #cbb9dc;
+ background: #221c2ee6;
+}
+.cw-stage-split-tabs button[aria-selected="true"] {
+ border-color: #8e76d1;
+ color: #f0e9f8;
+}
+.cw-stage-split-divider {
+ position: absolute;
+ top: 100px;
+ bottom: 200px;
+ width: 10px;
+ margin-left: -5px;
+ z-index: 7;
+ cursor: col-resize;
+ background: linear-gradient(
+ to right,
+ transparent 4px,
+ #8e76d1 4px,
+ #8e76d1 6px,
+ transparent 6px
+ );
+ touch-action: none;
+}
+/* V1 visual alignment: match the native Director Stage workbench shell.
+ * Keep the viewport as the base layer, but make the workbench regions flush
+ * with the application bounds instead of looking like a nested dialog. */
+.cw-stage-console {
+ --stage-left-width: 196px;
+ --stage-right-width: 232px;
+ --stage-topbar-height: 38px;
+ --stage-bottom-height: 176px;
+ --stage-surface: #1a1a1a;
+ --stage-surface-raised: #202020;
+ --stage-surface-input: #292929;
+ --stage-border: #303030;
+ --stage-border-strong: #414141;
+ --stage-text: #f0f0f0;
+ --stage-text-muted: #9a9a9a;
+ --stage-accent: #ffffff;
+ --stage-focus: #8c8c8c;
+ --inspector-control: #1d1d1d;
+ --inspector-control-border: #3a3a3a;
+ --inspector-divider: var(--stage-border);
+ --inspector-focus: #6e6e6e;
+ --inspector-hover: #252525;
+ --inspector-muted: #a5a5a5;
+ --inspector-text: #eeeeee;
+ --inspector-toggle-active: #e5e5e5;
+ --stage-control-height: 26px;
+ --stage-icon-control-size: 24px;
+ --stage-heading-height: 30px;
+ --stage-type-title: 11.5px;
+ --stage-type-label: 10.5px;
+ --stage-type-control: 9.5px;
+ --stage-type-nesting-step: 0.5px;
+ --stage-control-focus: #a8adba;
+ --stage-control-active: #333439;
+ --inspector-toggle-thumb: #202020;
+ color: var(--stage-text);
+ background: #0b0b0b;
+ color-scheme: dark;
+ font-family:
+ "Nunito Sans",
+ "Director Stage CJK",
+ ui-sans-serif,
+ -apple-system,
+ BlinkMacSystemFont,
+ "Segoe UI",
+ "PingFang SC",
+ "Microsoft YaHei",
+ sans-serif;
+}
+.cw-stage-console,
+.cw-stage-console * {
+ box-sizing: border-box;
+}
+.cw-domain-overlay:has(> .cw-stage-console) {
+ padding: 0;
+ background: #0b0b0b;
+ backdrop-filter: none;
+}
+.cw-stage-topbar {
+ top: 0;
+ height: var(--stage-topbar-height);
+ min-height: var(--stage-topbar-height);
+ gap: 10px;
+ flex-wrap: nowrap;
+ overflow: hidden;
+ padding: 0 12px;
+ border-bottom: 1px solid var(--stage-border);
+ background: var(--stage-surface);
+}
+.cw-stage-identity {
+ min-width: 0;
+ flex: 0 1 auto;
+ overflow: hidden;
+}
+.cw-stage-identity h2 {
+ overflow: hidden;
+ margin: 0;
+ color: var(--stage-text);
+ font-size: 14px;
+ font-weight: 600;
+ line-height: 1.2;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cw-stage-toolbar {
+ min-width: 0;
+ flex: 1 1 auto;
+ flex-wrap: nowrap;
+ justify-content: flex-start;
+ gap: 4px;
+ overflow-x: auto;
+}
+.cw-stage-topactions {
+ flex: 0 0 auto;
+ gap: 4px;
+}
+.cw-stage-left,
+.cw-stage-right {
+ top: var(--stage-topbar-height);
+ bottom: 0;
+ width: var(--stage-left-width);
+ padding: 0 12px 16px;
+ border: 0;
+ border-radius: 0;
+ border-color: var(--stage-border);
+ background: var(--stage-surface);
+ box-shadow: none;
+}
+.cw-stage-left {
+ left: 0;
+ border-right: 1px solid var(--stage-border);
+}
+.cw-stage-right {
+ right: 0;
+ width: var(--stage-right-width);
+ border-left: 1px solid var(--stage-border);
+}
+.cw-stage-bottom {
+ left: 0;
+ right: 0;
+ bottom: 0;
+ height: var(--stage-bottom-height);
+ max-height: var(--stage-bottom-height);
+ gap: 8px;
+ overflow-y: auto;
+ padding: 10px 16px;
+ border-top: 1px solid var(--stage-border);
+ background: var(--stage-surface);
+}
+.cw-stage-layout-resizer {
+ position: absolute;
+ top: var(--stage-topbar-height);
+ bottom: 0;
+ z-index: 16;
+ width: 12px;
+ cursor: col-resize;
+ touch-action: none;
+}
+.cw-stage-console[data-preview-mode="dynamic"] .cw-stage-layout-resizer {
+ bottom: var(--stage-bottom-height);
+}
+.cw-stage-console[data-preview-mode="dynamic"] .cw-stage-left,
+.cw-stage-console[data-preview-mode="dynamic"] .cw-stage-right {
+ bottom: var(--stage-bottom-height);
+}
+.cw-stage-layout-resizer.is-left {
+ left: var(--stage-left-width);
+ transform: translateX(-50%);
+}
+.cw-stage-layout-resizer.is-right {
+ right: var(--stage-right-width);
+ transform: translateX(50%);
+}
+.cw-stage-layout-resizer::after {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 5px;
+ width: 2px;
+ background: transparent;
+ content: "";
+}
+.cw-stage-layout-resizer:hover::after,
+.cw-stage-layout-resizer:focus-visible::after {
+ background: var(--stage-focus);
+}
+.cw-stage-timeline-resizer {
+ position: absolute;
+ top: -6px;
+ right: 0;
+ left: 0;
+ z-index: 16;
+ height: 12px;
+ cursor: row-resize;
+ touch-action: none;
+}
+.cw-stage-timeline-resizer::after {
+ position: absolute;
+ top: 5px;
+ right: 0;
+ left: 0;
+ height: 2px;
+ background: transparent;
+ content: "";
+}
+.cw-stage-timeline-resizer:hover::after,
+.cw-stage-timeline-resizer:focus-visible::after {
+ background: var(--stage-focus);
+}
+.cw-stage-console .cw-stage-topbar button,
+.cw-stage-console .cw-stage-left button,
+.cw-stage-console .cw-stage-right button,
+.cw-stage-console .cw-stage-bottom button {
+ min-height: 28px;
+ padding: 4px 9px;
+ border: 1px solid var(--stage-border-strong);
+ border-radius: 4px;
+ color: #d7d7d7;
+ background: var(--stage-surface-raised);
+ font-size: 11px;
+ line-height: 1.2;
+}
+.cw-stage-console button:hover:not(:disabled) {
+ border-color: #5b5b5b;
+ color: #ffffff;
+ background: #2b2b2b;
+}
+.cw-stage-console button:active:not(:disabled),
+.cw-stage-console button[aria-pressed="true"] {
+ border-color: #686868;
+ color: #ffffff;
+ background: #343434;
+}
+.cw-stage-console button:focus-visible,
+.cw-stage-console input:focus-visible,
+.cw-stage-console select:focus-visible,
+.cw-stage-console textarea:focus-visible {
+ outline: 2px solid var(--stage-focus);
+ outline-offset: 2px;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-group-toggle {
+ min-height: 22px;
+ padding: 0 4px 0 1px;
+ border: 0;
+ border-radius: 0;
+ background: transparent;
+}
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-track-group-toggle:hover:not(:disabled),
+.cw-stage-console .cw-stage-bottom .cw-stage-track-group-toggle:focus-visible {
+ border: 0;
+ background: transparent;
+}
+.cw-stage-console
+ :where(
+ input:not(
+ [type="range"],
+ [type="checkbox"],
+ [type="radio"],
+ [type="color"],
+ [type="file"]
+ ),
+ select,
+ textarea
+ ) {
+ min-height: 30px;
+ border: 1px solid var(--stage-border-strong);
+ border-radius: 4px;
+ color: var(--stage-text);
+ background: var(--stage-surface-input);
+}
+.cw-stage-console input[type="range"] {
+ accent-color: var(--stage-accent);
+}
+.cw-stage-console input[type="color"] {
+ min-height: 30px;
+ border: 1px solid var(--stage-border-strong);
+ border-radius: 4px;
+ background: var(--stage-surface-input);
+}
+.cw-stage-tabs {
+ grid-template-columns: repeat(4, minmax(0, 1fr));
+ gap: 0;
+ margin: 0 -12px 12px;
+ padding: 0 8px;
+ border-bottom: 1px solid var(--stage-border);
+}
+.cw-stage-tabs button {
+ display: flex;
+ min-height: 42px;
+ align-items: center;
+ justify-content: center;
+ padding: 0 4px;
+ border: 0;
+ border-bottom: 2px solid transparent;
+ border-radius: 0;
+ color: var(--stage-text-muted);
+ background: transparent;
+ font-size: 11px;
+}
+.cw-stage-tab-icon {
+ display: inline-flex;
+ width: 16px;
+ height: 16px;
+ align-items: center;
+ justify-content: center;
+}
+.cw-stage-tab-icon svg {
+ width: 16px;
+ height: 16px;
+ fill: none;
+ stroke: currentColor;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ stroke-width: 1.25;
+}
+.cw-stage-tabs button[aria-selected="true"] {
+ border-color: var(--stage-accent);
+ color: var(--stage-text);
+ background: transparent;
+}
+.cw-stage-left h4 {
+ color: var(--stage-text-muted);
+ font-weight: 500;
+}
+.cw-stage-object-list {
+ gap: 2px;
+ margin: 12px 0 20px;
+}
+.cw-stage-object-list button {
+ min-height: 30px;
+ border-color: transparent;
+ background: transparent;
+}
+.cw-stage-object-list button:hover:not(:disabled),
+.cw-stage-object-list button[aria-pressed="true"] {
+ border-color: var(--stage-border-strong);
+ background: #292929;
+}
+.cw-stage-right > h3 {
+ margin: 0 -12px;
+ padding: 16px 12px 12px;
+ border-bottom: 1px solid var(--stage-border);
+ color: var(--stage-text);
+ font-size: 13px;
+ font-weight: 600;
+}
+.cw-stage-right > h3:not(:first-child) {
+ margin-top: 18px;
+ border-top: 1px solid var(--stage-border);
+}
+.cw-stage-right .cw-domain-field {
+ gap: 4px;
+ margin: 5px 0;
+ color: var(--stage-text-muted);
+}
+.cw-stage-right .cw-domain-note,
+.cw-stage-left .cw-domain-note,
+.cw-stage-bottom .cw-domain-note {
+ color: var(--stage-text-muted);
+}
+.cw-stage-chip {
+ flex: 0 0 auto;
+ padding: 4px 8px;
+ border: 1px solid #4a4a4a;
+ border-radius: 4px;
+ color: #d3d3d3;
+ background: #292929;
+ font-size: 11px;
+}
+.cw-stage-chip.is-unsaved {
+ border-color: #6b5234;
+ color: #e5bf91;
+ background: #33291f;
+}
+.cw-stage-viewport {
+ border: 0;
+ border-radius: 0;
+ box-shadow: none;
+}
+.cw-stage-drawer {
+ border-radius: 4px;
+ background: #242424;
+ box-shadow:
+ inset 0 0 0 1px var(--stage-border),
+ 0 8px 24px #00000073;
+}
+.cw-stage-confirm > div,
+.cw-stage-help,
+.cw-stage-export {
+ border: 1px solid var(--stage-border-strong);
+ border-radius: 6px;
+ background: #202020;
+ box-shadow: 0 16px 48px #00000080;
+}
+/* V2 visual alignment: asset-library rhythm and compact workbench chrome. */
+.cw-stage-console .cw-stage-panel-search {
+ position: relative;
+ display: block;
+ flex: 0 0 auto;
+ margin: 8px 0 6px;
+}
+.cw-stage-console .cw-stage-panel-search::before {
+ position: absolute;
+ top: calc(50% - 5px);
+ left: 11px;
+ z-index: 1;
+ width: 8px;
+ height: 8px;
+ border: 1px solid #858585;
+ border-radius: 50%;
+ content: "";
+ pointer-events: none;
+}
+.cw-stage-console .cw-stage-panel-search::after {
+ position: absolute;
+ top: calc(50% + 3px);
+ left: 19px;
+ z-index: 1;
+ width: 5px;
+ height: 1px;
+ background: #858585;
+ content: "";
+ pointer-events: none;
+ transform: rotate(45deg);
+ transform-origin: left center;
+}
+.cw-stage-console .cw-stage-panel-search input {
+ width: 100%;
+ height: var(--stage-control-height);
+ padding: 0 10px 0 30px;
+ border-radius: 6px;
+ background: var(--stage-surface-raised);
+}
+.cw-stage-console .cw-stage-panel-search input::placeholder {
+ color: #888888;
+}
+.cw-stage-visually-hidden {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ overflow: hidden;
+ clip: rect(0 0 0 0);
+ white-space: nowrap;
+}
+.cw-stage-left > .cw-stage-tabs {
+ margin: 0 -12px;
+}
+.cw-stage-background-library {
+ display: flex;
+ min-height: calc(100% - 142px);
+ flex-direction: column;
+}
+.cw-stage-background-filters {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ overflow-x: auto;
+ padding: 3px 0 10px;
+}
+.cw-stage-console .cw-stage-left .cw-stage-background-filters button {
+ min-height: 28px;
+ flex: 0 0 auto;
+ padding: 4px 9px;
+ border: 0;
+ border-radius: 14px;
+ color: #858585;
+ background: transparent;
+ white-space: nowrap;
+}
+.cw-stage-console
+ .cw-stage-left
+ .cw-stage-background-filters
+ button:hover:not(:disabled) {
+ border: 0;
+ color: #d8d8d8;
+ background: #242424;
+}
+.cw-stage-console
+ .cw-stage-left
+ .cw-stage-background-filters
+ button[aria-pressed="true"] {
+ border: 0;
+ color: #f0f0f0;
+ background: #343434;
+}
+.cw-stage-background-section {
+ margin-top: 7px;
+}
+.cw-stage-background-section > h4 {
+ margin: 0 0 10px;
+ color: #828282;
+ font-size: 10px;
+ font-weight: 500;
+}
+.cw-stage-console .cw-stage-left .cw-stage-background-add {
+ display: flex;
+ width: 100%;
+ min-height: 34px;
+ align-items: center;
+ justify-content: center;
+ gap: 6px;
+ border: 0;
+ border-radius: 9px;
+ color: #dedede;
+ background: #242424;
+ font-weight: 600;
+}
+.cw-stage-console .cw-stage-left .cw-stage-background-add:hover:not(:disabled) {
+ border: 0;
+ background: #2d2d2d;
+}
+.cw-stage-background-add > span {
+ color: #bdbdbd;
+ font-size: 15px;
+ font-weight: 400;
+ line-height: 1;
+}
+.cw-stage-background-notice {
+ margin: 8px 0 0;
+ color: #8f8f8f;
+ font-size: 10px;
+ line-height: 1.45;
+}
+.cw-stage-background-section.is-canvas-images {
+ display: flex;
+ min-height: 210px;
+ flex: 1 1 auto;
+ flex-direction: column;
+ margin-top: 22px;
+}
+.cw-stage-background-grid {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 8px;
+}
+.cw-stage-console .cw-stage-left .cw-stage-background-card {
+ display: flex;
+ min-width: 0;
+ min-height: 86px;
+ flex-direction: column;
+ align-items: stretch;
+ gap: 6px;
+ padding: 5px;
+ border: 1px solid transparent;
+ border-radius: 7px;
+ color: #bdbdbd;
+ background: transparent;
+ text-align: left;
+}
+.cw-stage-console
+ .cw-stage-left
+ .cw-stage-background-card:hover:not(:disabled) {
+ border-color: #4a4a4a;
+ background: #242424;
+}
+.cw-stage-console
+ .cw-stage-left
+ .cw-stage-background-card[aria-pressed="true"] {
+ border-color: #d0d0d0;
+ background: #292929;
+}
+.cw-stage-background-card-preview {
+ display: grid;
+ width: 100%;
+ height: 58px;
+ overflow: hidden;
+ place-items: center;
+ border-radius: 5px;
+ background: #202020;
+}
+.cw-stage-background-card-preview img {
+ display: block;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+.cw-stage-background-card-placeholder,
+.cw-stage-background-empty-icon {
+ display: grid;
+ color: #777777;
+ place-items: center;
+}
+.cw-stage-background-card-placeholder svg {
+ width: 20px;
+ height: 20px;
+}
+.cw-stage-background-card > span:last-child {
+ overflow: hidden;
+ font-size: 10px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cw-stage-background-empty {
+ display: flex;
+ min-height: 190px;
+ flex: 1 1 auto;
+ align-items: center;
+ flex-direction: column;
+ justify-content: flex-start;
+ padding-top: 42px;
+ color: #777777;
+ text-align: center;
+}
+.cw-stage-background-empty-icon {
+ width: 42px;
+ height: 42px;
+ border: 1px solid #353535;
+ border-radius: 13px;
+}
+.cw-stage-background-empty-icon svg {
+ width: 20px;
+ height: 20px;
+}
+.cw-stage-background-card-placeholder svg,
+.cw-stage-background-empty-icon svg {
+ fill: none;
+ stroke: currentColor;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ stroke-width: 1.15;
+}
+.cw-stage-background-empty p {
+ max-width: 174px;
+ margin: 14px 0 0;
+ font-size: 11px;
+ line-height: 1.75;
+}
+.cw-stage-object-grid {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 8px;
+ margin-top: 12px;
+}
+.cw-stage-object-grid button {
+ display: flex;
+ min-height: 108px;
+ align-items: stretch;
+ flex-direction: column;
+ gap: 7px;
+ justify-content: flex-start;
+ padding: 7px;
+ border: 1px solid var(--stage-border);
+ border-radius: 8px;
+ background: #171717;
+ font-size: 11px;
+}
+.cw-stage-object-grid button > .cw-stage-object-preview {
+ display: block;
+ width: 100%;
+ height: 58px;
+ flex: 0 0 58px;
+ border-radius: 5px;
+ overflow: hidden;
+ background: radial-gradient(
+ circle at 50% 34%,
+ #3b3b3b 0,
+ #222222 48%,
+ #151515 100%
+ );
+ box-shadow: inset 0 0 0 1px #ffffff22;
+ position: relative;
+}
+.cw-stage-object-preview img {
+ display: block;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+.cw-stage-object-preview[data-stage-object-kind="person"] img {
+ object-fit: contain;
+}
+.cw-stage-object-preview-empty {
+ position: absolute;
+ inset: 0;
+ background:
+ linear-gradient(
+ 135deg,
+ transparent 48%,
+ #ffffff1a 49%,
+ #ffffff1a 51%,
+ transparent 52%
+ ),
+ #202020;
+}
+.cw-stage-object-card-name {
+ display: flex;
+ width: 100%;
+ min-width: 0;
+ align-items: center;
+ gap: 6px;
+ overflow: hidden;
+ color: var(--stage-text);
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cw-stage-object-color {
+ display: block;
+ width: 8px;
+ height: 8px;
+ flex: 0 0 8px;
+ border-radius: 50%;
+ box-shadow: inset 0 0 0 1px #ffffff33;
+}
+.cw-stage-object-grid button[aria-pressed="true"] {
+ border-color: #707070;
+ background: #292929;
+}
+.cw-stage-import-button {
+ width: 100%;
+ margin-top: 2px;
+}
+.cw-stage-preview-mode {
+ position: absolute;
+ left: 50%;
+ display: flex;
+ flex: 0 0 auto;
+ gap: 2px;
+ padding: 2px;
+ border: 1px solid var(--stage-border);
+ border-radius: 7px;
+ background: #161616;
+ transform: translateX(-50%);
+}
+.cw-stage-preview-mode button {
+ min-width: 64px;
+ min-height: 28px;
+ padding: 3px 10px;
+ border: 0;
+ border-radius: 5px;
+ color: #929292;
+ background: transparent;
+ font-size: 11px;
+}
+.cw-stage-preview-mode button[aria-pressed="true"] {
+ color: #ffffff;
+ background: #2b2b2b;
+}
+/* In the console the gizmo mode bar floats over the scene, clear of the
+ * left library and the right inspector. */
+.cw-stage-console .cw-stage-gizmo {
+ position: absolute;
+ left: 16px;
+ top: 64px;
+ z-index: 6;
+ margin-bottom: 0;
+ padding: 4px 6px;
+ border-radius: 8px;
+ background: #120e19d9;
+ box-shadow: inset 0 0 0 1px #3a3346;
+}
+/* Live pitch/yaw/FOV readout over the viewport, with a reset button. */
+.cw-stage-viewinfo {
+ position: absolute;
+ left: 10px;
+ bottom: 8px;
+ z-index: 5;
+ display: flex;
+ gap: 8px;
+ align-items: center;
+ padding: 4px 8px;
+ border: 1px solid #494151;
+ border-radius: 6px;
+ color: #b9a9c9;
+ background: #19141fcc;
+ font-size: 12px;
+ pointer-events: none;
+}
+.cw-stage-viewinfo span {
+ font-variant-numeric: tabular-nums;
+}
+.cw-stage-viewinfo strong {
+ color: #e5e5e5;
+ font-weight: 600;
+}
+.cw-stage-viewinfo button {
+ pointer-events: auto;
+ padding: 2px 8px;
+ font-size: 12px;
+}
+/* View-settings popover anchored under the top bar. */
+.cw-stage-viewmenu {
+ position: absolute;
+ top: 56px;
+ right: 14px;
+ z-index: 12;
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ padding: 12px;
+ border-radius: 10px;
+ background: #17181ff2;
+ box-shadow:
+ inset 0 0 0 1px #3b3d50,
+ 0 10px 26px rgba(0, 0, 0, 0.45);
+ font-size: 12px;
+ color: #cbb9dc;
+}
+.cw-stage-viewmenu label {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+/* Object name labels float over the scene at projected positions. */
+.cw-stage-names {
+ position: absolute;
+ inset: 0;
+ z-index: 4;
+ pointer-events: none;
+ overflow: hidden;
+}
+.cw-stage-name {
+ position: absolute;
+ transform: translate(-50%, -100%);
+ padding: 1px 6px;
+ border-radius: 5px;
+ background: #120e19cc;
+ color: #d8cce8;
+ font-size: 11px;
+ white-space: nowrap;
+}
+/* How far a lifted subject stands above the ground: a line down to where it
+ * would land, a ring there and the value between. Like the names it is DOM
+ * over the orbit view, never a render. */
+.cw-stage-elevation {
+ position: absolute;
+ inset: 0;
+ z-index: 4;
+ overflow: hidden;
+ pointer-events: none;
+}
+.cw-stage-elevation svg {
+ display: block;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+}
+.cw-stage-elevation-line,
+.cw-stage-elevation-ring {
+ fill: none;
+ stroke: var(--stage-text);
+ stroke-linecap: round;
+}
+.cw-stage-elevation-line {
+ stroke-width: 1.25;
+}
+.cw-stage-elevation-ring {
+ stroke-width: 1.5;
+}
+.cw-stage-elevation-value {
+ position: absolute;
+ padding: 0 3px;
+ color: var(--stage-text);
+ font-size: 11px;
+ font-variant-numeric: tabular-nums;
+ line-height: 14px;
+ white-space: nowrap;
+ text-shadow:
+ 0 0 2px #000,
+ 0 1px 3px #000;
+}
+/* Scene tree: grouped heads collapse, rows select and act. */
+.cw-stage-tree {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ margin-top: 10px;
+}
+.cw-stage-right-tree {
+ margin: 0 -12px 14px;
+ padding: 0 12px 10px;
+ border-bottom: 1px solid var(--stage-border);
+}
+.cw-stage-tree-title {
+ margin: 0 -12px 8px;
+ padding: 12px;
+ border-bottom: 1px solid var(--stage-border);
+ color: var(--stage-text);
+ font-size: 13px;
+ font-weight: 600;
+}
+.cw-stage-tree-head {
+ text-align: left;
+ font-size: 12px;
+ color: #b9a9c9;
+ background: none;
+ border: 0;
+ padding: 4px 2px;
+}
+.cw-stage-tree-row {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+}
+.cw-stage-tree-row > button:first-child {
+ flex: 1;
+ min-width: 0;
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ text-align: left;
+ font-size: 12px;
+}
+.cw-stage-tree-row > button:first-child span {
+ width: 10px;
+ height: 10px;
+ border-radius: 3px;
+ flex: none;
+}
+.cw-stage-tree-row > button:first-child[aria-selected="true"] {
+ border-color: #8e76d1;
+}
+/* Armed-placement hint bar over the scene. */
+.cw-stage-placehint {
+ position: absolute;
+ left: 50%;
+ top: calc(var(--stage-topbar-height, 52px) + 20px);
+ transform: translateX(-50%);
+ z-index: 8;
+ width: max-content;
+ max-width: min(32rem, calc(100% - 24px));
+ padding: 6px 12px;
+ text-align: center;
+ pointer-events: none;
+}
+/* Anchored per-object action bar, projected above the selection. */
+.cw-stage-actionbar {
+ position: absolute;
+ transform: translate(-50%, -100%);
+ z-index: 6;
+ display: flex;
+ gap: 4px;
+ padding: 3px;
+ border-radius: 8px;
+ background: var(--stage-feedback-surface);
+ box-shadow: inset 0 0 0 1px var(--stage-border-strong);
+}
+.cw-stage-actionbar button {
+ padding: 3px 8px;
+ font-size: 11px;
+}
+
+/* Console-scoped form chrome keeps the neutral grey system even though
+ * the shared domain styles carry a violet tint elsewhere. */
+.cw-stage-console input,
+.cw-stage-console select,
+.cw-stage-console textarea {
+ background: #1e1e1e;
+ border-color: #333333;
+ color: #e5e5e5;
+}
+.cw-stage-console input:focus,
+.cw-stage-console select:focus,
+.cw-stage-console textarea:focus {
+ border-color: #6e6e6e;
+}
+.cw-stage-console .cw-control-slider {
+ accent-color: #8a8a8a;
+}
+/* Higher-specificity neutral overrides for the shared domain form
+ * chrome inside the console. */
+.cw-stage-console .cw-domain-field input:not([type="range"]),
+.cw-stage-console .cw-domain-field select,
+.cw-stage-console .cw-domain-field textarea {
+ border: 1px solid #3a3a3a;
+ color: #e5e5e5;
+ background: #1e1e1e;
+}
+.cw-stage-console .cw-domain-field input:focus-visible,
+.cw-stage-console .cw-domain-field select:focus-visible {
+ border-color: #6e6e6e;
+}
+.cw-stage-console .cw-control-slider {
+ --cw-control-accent: #8a8a8a;
+ --cw-control-track: #3a3a3a;
+ --cw-control-thumb: #e5e5e5;
+}
+
+/* Shared note text stays neutral inside the console. */
+.cw-stage-console .cw-domain-note {
+ color: #8a8a8a;
+}
+.cw-stage-console .cw-stage-row-action {
+ color: #9e9e9e;
+}
+
+/* V5 viewport overlays follow the native anchors: the tool rail begins just
+ * inside the viewport, the settings popover opens beside it, and camera PiP
+ * stays clear of the right inspector. */
+.cw-stage-console .cw-stage-gizmo {
+ position: absolute;
+ top: calc(var(--stage-topbar-height) + 12px);
+ left: calc(var(--stage-left-width) + 12px);
+ z-index: 6;
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ width: calc(var(--stage-icon-control-size) + 10px);
+ margin: 0;
+ padding: 4px;
+ border: 1px solid #333333;
+ border-radius: 8px;
+ background: #141414e8;
+ box-shadow: 0 8px 18px #00000055;
+}
+.cw-stage-console .cw-stage-view-settings-anchor {
+ position: relative;
+ flex: 0 0 var(--stage-icon-control-size);
+ width: var(--stage-icon-control-size);
+ height: var(--stage-icon-control-size);
+}
+/* Keep icon-only controls the same size in the top bar and viewport. */
+.cw-stage-console :is(.cw-stage-toolbar button, .cw-stage-topbar > button, .cw-stage-gizmo button)[data-icon] {
+ width: var(--stage-icon-control-size);
+ min-width: var(--stage-icon-control-size);
+ min-height: var(--stage-icon-control-size);
+ padding: 4px;
+ font-size: 0;
+ text-align: center;
+}
+.cw-stage-console :is(.cw-stage-toolbar button, .cw-stage-topbar > button, .cw-stage-gizmo button)[data-icon]::before {
+ content: attr(data-icon);
+ color: currentColor;
+ font-size: 14px;
+ line-height: 1;
+}
+.cw-stage-console .cw-stage-gizmo .cw-domain-note {
+ display: none;
+}
+.cw-stage-console .cw-stage-viewmenu {
+ top: 50%;
+ right: auto;
+ left: calc(100% + 8px);
+ transform: translateY(-50%);
+ width: 208px;
+ gap: 0;
+ padding: 8px;
+ border: 1px solid var(--stage-border-strong);
+ border-radius: 8px;
+ background: #202020f5;
+ box-shadow: 0 12px 28px #00000080;
+}
+.cw-stage-console .cw-stage-viewmenu label {
+ min-height: 40px;
+ flex-direction: row-reverse;
+ justify-content: space-between;
+ padding: 0 8px;
+ border-radius: 4px;
+ color: var(--stage-text);
+}
+.cw-stage-console .cw-stage-viewmenu label:hover {
+ background: #2a2a2a;
+}
+.cw-stage-console .cw-stage-viewmenu input[type="checkbox"] {
+ appearance: none;
+ width: 18px;
+ height: 18px;
+ margin: 0;
+ border: 0;
+ background: transparent;
+}
+.cw-stage-console .cw-stage-viewmenu input[type="checkbox"]::after {
+ display: block;
+ color: transparent;
+ content: "✓";
+ font-size: 16px;
+ line-height: 18px;
+ text-align: center;
+}
+.cw-stage-console .cw-stage-viewmenu input[type="checkbox"]:checked::after {
+ color: var(--stage-text);
+}
+.cw-stage-console[data-preview-mode="dynamic"] {
+ --stage-pip-bottom: var(--stage-bottom-height);
+}
+.cw-stage-console .cw-stage-pipframe {
+ --stage-pip-min-x: calc(var(--stage-left-width) + 12px);
+ --stage-pip-min-y: calc(var(--stage-topbar-height) + 12px);
+ /* The frame is sized by the aspect of what it shows, so a tall camera stays inside
+ * the viewport's height just as a wide one does. */
+ --stage-pip-width: min(
+ 264px,
+ calc(100vw - var(--stage-left-width) - var(--stage-right-width) - 28px),
+ calc((100dvh - var(--stage-pip-min-y) - var(--stage-pip-bottom, 0px) - 12px) * var(--stage-pip-aspect, var(--stage-aspect)))
+ );
+ --stage-pip-max-x: calc(100% - var(--stage-right-width) - 16px - var(--stage-pip-width));
+ --stage-pip-max-y: calc(100% - var(--stage-pip-bottom, 0px) - 12px - var(--stage-pip-width) / var(--stage-pip-aspect, var(--stage-aspect)));
+ left: clamp(var(--stage-pip-min-x), var(--stage-pip-x, var(--stage-pip-max-x)), var(--stage-pip-max-x));
+ right: auto;
+ top: clamp(var(--stage-pip-min-y), var(--stage-pip-y, calc(var(--stage-topbar-height) + 16px)), var(--stage-pip-max-y));
+ width: var(--stage-pip-width);
+ border-color: #4a4a4a;
+ border-radius: 8px;
+ box-shadow: 0 8px 20px #00000066;
+ z-index: 7;
+}
+.cw-stage-console .cw-stage-pipframe.is-collapsed {
+ height: 28px;
+ border-color: transparent;
+ box-shadow: none;
+ aspect-ratio: auto;
+}
+.cw-stage-pip-controls {
+ position: absolute;
+ inset: 2px 2px auto;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.cw-stage-pipframe.is-collapsed .cw-stage-pip-controls {
+ left: auto;
+ max-width: calc(100% - 4px);
+ gap: 5px;
+ border-radius: 6px;
+ background: var(--stage-feedback-surface);
+ box-shadow: inset 0 0 0 1px var(--stage-border), 0 4px 14px #0005;
+}
+.cw-stage-pip-label {
+ min-width: 0;
+ overflow: hidden;
+ color: var(--stage-text);
+ font-size: var(--stage-type-control);
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cw-stage-console :is(.cw-stage-pip-toggle, .cw-stage-pip-drag) {
+ display: grid;
+ width: 22px;
+ height: 22px;
+ flex: 0 0 22px;
+ place-items: center;
+ padding: 0;
+ border: 1px solid var(--stage-border);
+ border-radius: 5px;
+ background: var(--stage-feedback-surface);
+ color: var(--stage-text);
+ pointer-events: auto;
+}
+.cw-stage-pipframe.is-collapsed :is(.cw-stage-pip-drag, .cw-stage-pip-toggle) {
+ border-color: transparent;
+}
+.cw-stage-pip-drag {
+ cursor: grab;
+ touch-action: none;
+}
+.cw-stage-pip-drag:active {
+ cursor: grabbing;
+}
+.cw-stage-pip-drag span {
+ width: 12px;
+ height: 8px;
+ background: radial-gradient(circle, currentColor 0.75px, transparent 1px) 0 0 / 4px 4px;
+}
+.cw-stage-pip-toggle span {
+ width: 6px;
+ height: 6px;
+ border-top: 1px solid currentColor;
+ border-left: 1px solid currentColor;
+ transform: translateY(1px) rotate(45deg);
+}
+.cw-stage-pip-toggle[aria-expanded="false"] span {
+ transform: translateY(-1px) rotate(225deg);
+}
+/* The preview-source selector sits in the open frame's control bar, beside the handle
+ * and before the toggle. It is sized by its options but gives way before it could reach
+ * either button, and a long camera name is cut instead of widening the frame. Like the
+ * buttons it takes the pointer itself; the frame around it does not. */
+.cw-stage-console .cw-stage-pip-controls select {
+ min-width: 0;
+ max-width: calc(100% - 22px - 22px - 12px);
+ /* As high as the buttons beside it: the console gives every select a taller
+ * minimum, and a higher bar would move the toggle when the frame collapses. */
+ height: 22px;
+ min-height: 22px;
+ margin-right: auto;
+ margin-left: 5px;
+ padding: 0 18px 0 6px;
+ border: 1px solid var(--stage-border);
+ border-radius: 5px;
+ background-color: var(--stage-feedback-surface);
+ color: var(--stage-text);
+ font-size: var(--stage-type-control);
+ text-overflow: ellipsis;
+ pointer-events: auto;
+}
+.cw-stage-console .cw-stage-pip-controls select:focus {
+ border-color: var(--stage-border-strong);
+}
+.cw-stage-console .cw-stage-viewinfo {
+ right: calc(var(--stage-right-width) + 12px);
+ bottom: 12px;
+ left: auto;
+ border-color: #3a3a3a;
+ background: #1a1a1acc;
+}
+.cw-stage-console[data-preview-mode="dynamic"] .cw-stage-viewinfo {
+ bottom: calc(var(--stage-bottom-height) + 12px);
+}
+
+/* Shoot/viewfinder mode clears the workbench panels and leaves a camera
+ * frame below the persistent top bar, matching the native capture state. */
+.cw-stage-console.is-viewfinder .cw-stage-left,
+.cw-stage-console.is-viewfinder .cw-stage-right,
+.cw-stage-console.is-viewfinder .cw-stage-bottom,
+.cw-stage-console.is-viewfinder .cw-stage-layout-resizer,
+.cw-stage-console.is-viewfinder .cw-stage-timeline-resizer,
+.cw-stage-console.is-viewfinder .cw-stage-gizmo,
+.cw-stage-console.is-viewfinder .cw-stage-actionbar,
+.cw-stage-console.is-viewfinder .cw-stage-pipcanvas,
+.cw-stage-console.is-viewfinder .cw-stage-pipframe,
+.cw-stage-console.is-viewfinder .cw-stage-viewinfo,
+.cw-stage-console.is-viewfinder .cw-stage-names,
+.cw-stage-console.is-viewfinder .cw-stage-elevation,
+.cw-stage-console.is-viewfinder .cw-stage-mask {
+ display: none;
+}
+.cw-stage-console.is-viewfinder .cw-stage-scene::after {
+ position: absolute;
+ top: 104px;
+ left: 50%;
+ width: calc(100% - 276px);
+ max-height: calc(100% - 156px);
+ aspect-ratio: var(--stage-aspect, 1.7778);
+ border: 1px solid #8a8a8a;
+ content: "";
+ transform: translateX(-50%);
+ pointer-events: none;
+ z-index: 5;
+}
+.cw-stage-console.is-viewfinder .cw-stage-fovbar {
+ top: 80px;
+ left: calc(var(--stage-left-width) - 110px);
+ transform: none;
+ padding: 0;
+ border: 0;
+ background: transparent;
+ box-shadow: none;
+ color: var(--stage-text-muted);
+ font-size: 10px;
+}
+.cw-stage-console.is-viewfinder .cw-stage-fovbar input[type="range"] {
+ width: 90px;
+ height: 12px;
+}
+
+/* F3 right rail: keep the object tree visible while properties get their own
+ * scroll context, matching the two-level inspector in the reference stage. */
+.cw-stage-console .cw-stage-right {
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ overflow: hidden;
+ padding: 0;
+}
+.cw-stage-console .cw-stage-right-tree-panel {
+ display: flex;
+ flex: 0 1 auto;
+ max-height: 42%;
+ min-height: 0;
+ flex-direction: column;
+ margin: 0;
+ padding: 0 12px 10px;
+ overflow: hidden;
+ border: 0;
+ border-bottom: 1px solid var(--stage-border);
+}
+.cw-stage-console .cw-stage-panel-heading {
+ display: flex;
+ flex: 0 0 var(--stage-heading-height);
+ min-height: var(--stage-heading-height);
+ align-items: center;
+ gap: 8px;
+ margin: 0 -12px;
+ padding: 0 12px;
+ border-bottom: 1px solid var(--stage-border);
+}
+.cw-stage-console .cw-stage-panel-heading h3 {
+ margin: 0;
+ color: var(--stage-text);
+ font-size: 12px;
+ font-weight: 600;
+}
+.cw-stage-console .cw-stage-panel-icon {
+ display: inline-flex;
+ width: 16px;
+ height: 16px;
+ align-items: center;
+ justify-content: center;
+ color: var(--stage-text-muted);
+ font-size: 15px;
+ line-height: 1;
+}
+.cw-stage-console .cw-stage-inspector > .cw-stage-panel-heading {
+ margin: 0;
+ padding: 0 12px;
+}
+.cw-stage-console .cw-stage-tree-scroll {
+ flex: 1 1 auto;
+ min-height: 0;
+ overflow-y: auto;
+ margin-right: -12px;
+ padding-right: 12px;
+ scrollbar-gutter: stable;
+}
+.cw-stage-console .cw-stage-tree {
+ gap: 2px;
+ margin: 0;
+}
+.cw-stage-console .cw-stage-tree-head {
+ display: flex;
+ width: 100%;
+ min-height: 26px;
+ align-items: center;
+ gap: 6px;
+ padding: 2px 8px;
+ border: 0;
+ color: var(--stage-text-muted);
+ background: transparent;
+ font-size: 11px;
+ font-weight: 600;
+}
+.cw-stage-console .cw-stage-tree-head:hover:not(:disabled) {
+ border: 0;
+ color: var(--stage-text);
+ background: #242424;
+}
+.cw-stage-tree-chevron {
+ display: inline-flex;
+ width: 12px;
+ height: 12px;
+ justify-content: center;
+ align-items: center;
+ flex: none;
+ color: #a8a8a8;
+}
+.cw-stage-tree-chevron::before,
+.cw-stage-track-group-chevron::before {
+ width: 6px;
+ height: 6px;
+ border-right: 1.5px solid currentColor;
+ border-bottom: 1.5px solid currentColor;
+ content: "";
+ transform: rotate(-45deg);
+}
+.cw-stage-tree-chevron[data-expanded="true"]::before,
+.cw-stage-track-group-chevron[data-expanded="true"]::before {
+ transform: rotate(45deg);
+}
+.cw-stage-console .cw-stage-tree-row {
+ min-height: 28px;
+ padding-left: 18px;
+}
+.cw-stage-console .cw-stage-tree-row-child {
+ padding-left: 34px;
+}
+.cw-stage-console .cw-stage-camera-tree-row {
+ padding-left: 18px;
+}
+.cw-stage-console .cw-stage-camera-tree-row-child {
+ margin-left: 16px;
+ padding-left: 18px;
+ border-left: 1px solid #343434;
+}
+.cw-stage-console .cw-stage-tree-row > button:first-child .cw-stage-tree-icon {
+ display: inline-flex;
+ width: 16px;
+ height: 16px;
+ align-items: center;
+ justify-content: center;
+ border-radius: 0;
+ color: #8ea6ff;
+ font-size: 13px;
+ line-height: 1;
+}
+.cw-stage-console .cw-stage-camera-tree-row-child > button:first-child {
+ color: var(--stage-text-muted);
+ font-size: 11px;
+}
+.cw-stage-console .cw-stage-tree-row > button:first-child {
+ min-height: 26px;
+ padding: 2px 8px;
+ border: 1px solid transparent;
+ border-radius: 4px;
+ color: var(--stage-text);
+ background: transparent;
+}
+.cw-stage-console .cw-stage-tree-row > button:first-child:hover:not(:disabled),
+.cw-stage-console
+ .cw-stage-tree-row
+ > button:first-child[aria-selected="true"] {
+ border-color: #3d3d3d;
+ background: #292929;
+}
+.cw-stage-console .cw-stage-tree-row > button:first-child span {
+ width: 8px;
+ height: 8px;
+ border-radius: 2px;
+}
+.cw-stage-console .cw-stage-row-action {
+ width: 26px;
+ min-width: 26px;
+ min-height: 26px;
+ padding: 3px;
+ border-color: transparent;
+ color: var(--stage-text-muted);
+ background: transparent;
+}
+.cw-stage-console .cw-stage-row-action:hover:not(:disabled) {
+ border-color: #3d3d3d;
+ background: #292929;
+}
+.cw-stage-console .cw-stage-inspector {
+ display: flex;
+ flex: 1 1 auto;
+ min-height: 0;
+ flex-direction: column;
+ overflow: hidden;
+ padding: 0;
+}
+.cw-stage-console .cw-stage-inspector-scroll {
+ flex: 1 1 auto;
+ min-height: 0;
+ overflow-y: auto;
+ padding: 4px 12px 12px;
+ scrollbar-gutter: stable;
+}
+.cw-stage-console .cw-stage-inspector-section {
+ min-width: 0;
+}
+.cw-stage-console .cw-stage-inspector-section + .cw-stage-inspector-section {
+ margin-top: 8px;
+ padding-top: 6px;
+ border-top: 1px solid var(--stage-border);
+}
+.cw-stage-console .cw-stage-inspector-section > h4,
+.cw-stage-console .cw-stage-clips > h3 {
+ margin: 0 0 12px;
+ color: var(--stage-text);
+ font-size: 12px;
+ font-weight: 600;
+}
+.cw-stage-console .cw-stage-inspector-section .cw-domain-field {
+ gap: 4px;
+ margin: 5px 0;
+}
+.cw-stage-console .cw-stage-vector {
+ gap: 4px;
+ margin: 2px 0 4px;
+}
+.cw-stage-drag-value {
+ position: relative;
+ display: flex;
+ width: 100%;
+ min-width: 0;
+ height: 26px;
+ min-height: 26px;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+ box-sizing: border-box;
+ padding: 0 5px;
+ border: 1px solid #303030;
+ border-radius: 5px;
+ color: #bdbdbd;
+ background: #1d1d1d;
+ cursor: ew-resize;
+ touch-action: none;
+ user-select: none;
+}
+.cw-stage-drag-value:hover,
+.cw-stage-drag-value:focus-visible,
+.cw-stage-drag-value:focus-within {
+ border-color: #575757;
+ color: #eeeeee;
+ background: #252525;
+ outline: none;
+}
+.cw-stage-drag-value-label {
+ position: relative;
+ z-index: 1;
+ flex: 0 0 auto;
+ min-width: max-content;
+ overflow: visible;
+ color: #a5a5a5;
+ font-size: 10px;
+ pointer-events: none;
+ white-space: nowrap;
+}
+.cw-stage-drag-value-number {
+ position: absolute;
+ inset: 0;
+ z-index: 2;
+ display: block;
+ width: auto;
+ min-width: 0;
+ min-height: 0;
+ pointer-events: none;
+}
+.cw-stage-console .cw-stage-drag-value input[type="number"] {
+ position: absolute;
+ inset: -1px;
+ width: 100% !important;
+ min-width: 0;
+ /* The drag row owns the height; the shared text-input minimum is taller. */
+ min-height: 0;
+ height: 100%;
+ box-sizing: border-box;
+ margin: 0;
+ padding: 0 5px !important;
+ border: 0 !important;
+ outline: none !important;
+ outline-offset: 0;
+ box-shadow: none !important;
+ color: #e2e2e2;
+ background: transparent !important;
+ font-size: 11px;
+ font-variant-numeric: tabular-nums;
+ text-align: right;
+ cursor: ew-resize;
+ pointer-events: auto;
+}
+.cw-stage-console .cw-stage-drag-value input[type="number"]:focus,
+.cw-stage-console .cw-stage-drag-value input[type="number"]:focus-visible {
+ border: 0 !important;
+ outline: none !important;
+ outline-offset: 0;
+ box-shadow: none !important;
+}
+.cw-stage-drag-value input[type="number"]::-webkit-inner-spin-button,
+.cw-stage-drag-value input[type="number"]::-webkit-outer-spin-button {
+ margin: 0;
+ appearance: none;
+}
+.cw-stage-drag-value input[type="number"] {
+ appearance: textfield;
+}
+
+/* Director Stage timeline: compact neutral hierarchy shared by the ruler,
+ * tree rows and grid. Geometry here mirrors the row constants in
+ * DirectorStage.tsx; the ruler/grid/playhead all use the same 144px lane. */
+.cw-stage-console .cw-stage-bottom {
+ gap: 0;
+ padding: 0;
+ background: #151515;
+}
+.cw-stage-timeline-shell {
+ position: relative;
+ flex: 0 0 auto;
+ min-width: 0;
+ border-bottom: 1px solid #303030;
+ background: #171717;
+}
+.cw-stage-console .cw-stage-transport {
+ min-height: 26px;
+ flex-wrap: nowrap;
+ gap: 4px;
+ margin: 0;
+ padding: 0 8px;
+ border-bottom: 1px solid #292929;
+ background: #191919;
+ color: #a9a9a9;
+}
+.cw-stage-timeline-title {
+ display: inline-flex;
+ min-width: 76px;
+ align-items: center;
+ gap: 5px;
+ color: #e2e2e2;
+ font-size: 11px;
+ font-weight: 600;
+ white-space: nowrap;
+}
+.cw-stage-timeline-title > span {
+ color: #bdbdbd;
+ font-size: 12px;
+}
+.cw-stage-console .cw-stage-transport .cw-stage-transport-play,
+.cw-stage-console .cw-stage-transport .cw-stage-record-keyframe {
+ display: inline-grid;
+ width: 26px;
+ min-width: 26px;
+ min-height: 26px;
+ place-items: center;
+ padding: 0;
+ border: 0;
+ border-radius: 2px;
+ color: #a9a9a9;
+ background: transparent;
+ font-size: 12px;
+}
+.cw-stage-console
+ .cw-stage-transport
+ .cw-stage-transport-play:hover:not(:disabled),
+.cw-stage-console
+ .cw-stage-transport
+ .cw-stage-record-keyframe:hover:not(:disabled) {
+ border: 0;
+ color: #ffffff;
+ background: #2a2a2a;
+}
+.cw-stage-console .cw-stage-transport output {
+ min-width: 98px;
+ color: #a7a7a7;
+ font-size: 10px;
+ font-variant-numeric: tabular-nums;
+ white-space: nowrap;
+}
+.cw-stage-transport-spacer {
+ flex: 1 1 auto;
+}
+.cw-stage-transport-meta,
+.cw-stage-console .cw-stage-transport .cw-stage-duration-control {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ color: #909090;
+ font-size: 10px;
+ white-space: nowrap;
+}
+.cw-stage-transport-meta b {
+ color: #dedede;
+ font-weight: 600;
+}
+.cw-stage-console .cw-stage-transport .cw-stage-duration-control input {
+ width: 46px !important;
+ min-height: 22px;
+ padding: 2px 4px !important;
+ border-color: transparent;
+ border-radius: 2px;
+ color: #dedede;
+ background: #202020;
+ font-size: 10px;
+ font-variant-numeric: tabular-nums;
+}
+.cw-stage-console .cw-stage-transport .cw-stage-record-keyframe {
+ color: #8d8d8d;
+ font-size: 8px;
+}
+.cw-stage-console .cw-stage-playhead-slider {
+ position: absolute;
+ top: 32px;
+ right: 0;
+ left: 144px;
+ z-index: 10;
+ width: calc(100% - 144px);
+ height: 27px;
+ margin: 0;
+ opacity: 0;
+ cursor: ew-resize;
+}
+.cw-stage-console .cw-stage-playhead-slider:focus-visible {
+ opacity: 0.14;
+ outline: 1px solid #bdbdbd;
+ outline-offset: -1px;
+}
+.cw-stage-console .cw-stage-track-surface {
+ padding: 0;
+ border: 0;
+ background: #161616;
+ cursor: default;
+ overflow-x: hidden;
+}
+.cw-stage-console .cw-stage-track-ruler {
+ z-index: 6;
+ min-height: 27px;
+ border-bottom: 1px solid #303030;
+ background: #1b1b1b;
+ color: #777777;
+}
+.cw-stage-console .cw-stage-track-ruler::before {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ width: 143px;
+ border-right: 1px solid #3b3b3b;
+ background: #191919;
+ content: "";
+}
+.cw-stage-track-ruler-caption {
+ position: absolute;
+ top: 7px;
+ left: 8px;
+ z-index: 1;
+ color: #777777;
+ font-size: 9px;
+ line-height: 1;
+}
+.cw-stage-console .cw-stage-track-ruler-scale {
+ cursor: default;
+ left: 144px;
+}
+.cw-stage-console .cw-stage-track-ruler-tick {
+ height: 6px;
+ background: #393939;
+}
+.cw-stage-console .cw-stage-track-ruler-tick.is-major {
+ height: 11px;
+ background: #555555;
+}
+.cw-stage-console .cw-stage-track-ruler-label {
+ top: -8px;
+ color: #8f8f8f;
+ font-size: 9px;
+ font-variant-numeric: tabular-nums;
+}
+.cw-stage-track-grid {
+ position: absolute;
+ top: 27px;
+ right: 0;
+ bottom: 0;
+ left: 144px;
+ z-index: 2;
+ overflow: hidden;
+ pointer-events: none;
+}
+.cw-stage-track-grid-line {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 1px;
+ background: #242424;
+}
+.cw-stage-track-grid-line.is-major {
+ background: #303030;
+}
+.cw-stage-console .cw-stage-track-group-row,
+.cw-stage-console .cw-stage-track-row {
+ position: relative;
+ z-index: 1;
+ grid-template-columns: 144px minmax(0, 1fr);
+ gap: 0;
+ align-items: stretch;
+ background: transparent;
+}
+.cw-stage-console .cw-stage-track-group-row {
+ min-height: 22px;
+ border-top: 0;
+ border-bottom: 1px solid #303030;
+}
+.cw-stage-console .cw-stage-track-row {
+ min-height: 20px;
+ border-bottom: 1px solid #292929;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-group-toggle {
+ z-index: 3;
+ height: 21px;
+ min-height: 21px;
+ gap: 4px;
+ padding: 0 8px;
+ border-right: 1px solid #3b3b3b;
+ color: #d2d2d2;
+ background: #242424;
+}
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-track-group-toggle:hover:not(:disabled),
+.cw-stage-console .cw-stage-bottom .cw-stage-track-group-toggle:focus-visible {
+ color: #ffffff;
+ background: #2b2b2b;
+}
+.cw-stage-console .cw-stage-track-group-label {
+ color: inherit;
+ font-size: 10px;
+ font-weight: 600;
+}
+.cw-stage-console .cw-stage-track-group-chevron {
+ display: inline-flex;
+ height: 12px;
+ align-items: center;
+ justify-content: center;
+ width: 9px;
+ color: #929292;
+ flex: none;
+}
+.cw-stage-console .cw-stage-track-group-icon,
+.cw-stage-console .cw-stage-track-group-icon.is-camera,
+.cw-stage-console .cw-stage-track-group-icon.is-object {
+ width: 11px;
+ color: #9a9a9a;
+ font-size: 8px;
+}
+.cw-stage-console .cw-stage-track-group-lane {
+ background: #232323d9;
+}
+.cw-stage-console .cw-stage-track-label {
+ z-index: 3;
+ display: flex;
+ height: 19px;
+ align-items: center;
+ padding: 0 8px 0 14px;
+ border-right: 1px solid #353535;
+ color: #a5a5a5;
+ background: #181818;
+ font-size: 10px;
+}
+.cw-stage-console .cw-stage-track-label::before {
+ display: none;
+}
+.cw-stage-track-label-text {
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-add {
+ box-sizing: border-box;
+ display: inline-grid;
+ flex: 0 0 auto;
+ width: 18px;
+ min-width: 18px;
+ max-width: 18px;
+ height: 18px;
+ min-height: 18px;
+ max-height: 18px;
+ place-items: center;
+ align-self: center;
+ justify-self: end;
+ margin-left: auto;
+ padding: 0;
+ border: 0;
+ border-radius: 0;
+ outline: 0;
+ box-shadow: none;
+ color: transparent;
+ background: transparent;
+ appearance: none;
+ line-height: 0;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-add-glyph {
+ display: block;
+ width: 7px;
+ height: 7px;
+ margin: 0;
+ border: 1px solid #777777;
+ background: #181818;
+ transform-origin: center;
+ transform: rotate(45deg);
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-add-glyph.is-set {
+ border-color: #d9d9d9;
+ background: #d9d9d9;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-add:hover:not(:disabled),
+.cw-stage-console .cw-stage-bottom .cw-stage-track-add:focus-visible {
+ border: 0;
+ color: #ededed;
+ background: #303030;
+}
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-track-add:hover:not(:disabled)
+ .cw-stage-track-add-glyph,
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-track-add:focus-visible
+ .cw-stage-track-add-glyph {
+ border-color: #ffffff;
+}
+.cw-stage-console .cw-stage-track-lane {
+ z-index: 3;
+ height: 19px;
+ border-left: 0;
+ background: transparent;
+ cursor: crosshair;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-interval {
+ position: absolute;
+ top: 8px;
+ height: 3px;
+ min-width: 2px;
+ min-height: 0;
+ margin: 0;
+ padding: 0;
+ border: 0;
+ border-radius: 1px;
+ background: #4a4a4a;
+ appearance: none;
+ cursor: pointer;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-interval:hover,
+.cw-stage-console .cw-stage-bottom .cw-stage-track-interval:focus-visible {
+ background: #777777;
+ outline: 1px solid #cfcfcf;
+ outline-offset: 1px;
+}
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-track-interval[aria-pressed="true"] {
+ background: #d9d9d9;
+}
+.cw-stage-track-interval-curve {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ display: grid;
+ width: 17px;
+ height: 15px;
+ place-items: center;
+ border: 1px solid #6c6c6c;
+ border-radius: 4px;
+ color: #d8d8d8;
+ background: #202020;
+ font-size: 11px;
+ line-height: 1;
+ transform: translate(-50%, -50%);
+}
+.cw-stage-transition-editor {
+ position: fixed;
+ z-index: 80;
+ box-sizing: border-box;
+ width: 304px;
+ padding: 12px;
+ border: 1px solid #474747;
+ border-radius: 12px;
+ color: #d9d9d9;
+ background: #292929;
+ box-shadow: 0 14px 38px #00000080;
+ transform: translateX(-50%);
+}
+.cw-stage-transition-editor::after {
+ position: absolute;
+ bottom: -7px;
+ left: 50%;
+ width: 12px;
+ height: 12px;
+ border-right: 1px solid #474747;
+ border-bottom: 1px solid #474747;
+ background: #292929;
+ content: "";
+ transform: translateX(-50%) rotate(45deg);
+}
+.cw-stage-transition-editor > header {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 8px;
+ margin-bottom: 10px;
+}
+.cw-stage-transition-editor > header > div {
+ display: grid;
+ min-width: 0;
+ gap: 4px;
+}
+.cw-stage-transition-editor > header strong {
+ overflow: hidden;
+ color: #f0f0f0;
+ font-size: 11px;
+ font-weight: 650;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cw-stage-transition-editor > header small {
+ color: #858585;
+ font-size: 9px;
+}
+.cw-stage-console .cw-stage-transition-editor > header button {
+ width: 22px;
+ min-width: 22px;
+ height: 22px;
+ min-height: 22px;
+ padding: 0;
+ border: 0;
+ color: #909090;
+ background: transparent;
+ font-size: 16px;
+}
+.cw-stage-console .cw-stage-transition-editor > header button:hover,
+.cw-stage-console .cw-stage-transition-editor > header button:focus-visible {
+ color: #ffffff;
+ background: #373737;
+}
+.cw-stage-transition-select {
+ display: grid;
+ grid-template-columns: 42px minmax(0, 1fr);
+ align-items: center;
+ min-height: 32px;
+ margin-bottom: 8px;
+ padding: 0 8px;
+ border: 1px solid #343434;
+ border-radius: 7px;
+ color: #8e8e8e;
+ background: #181818;
+ font-size: 10px;
+}
+.cw-stage-transition-select select {
+ min-height: 30px;
+ padding: 0 6px;
+ border: 0;
+ color: #dedede;
+ background: transparent;
+ font-size: 10px;
+}
+.cw-stage-transition-graph {
+ display: block;
+ width: 100%;
+ height: 248px;
+ border: 1px solid #353535;
+ border-radius: 7px;
+ background: #191919;
+}
+.cw-stage-transition-graph > line {
+ stroke: #252525;
+ stroke-width: 1;
+}
+.cw-stage-transition-curve {
+ fill: none;
+ stroke: #dedede;
+ stroke-width: 1.5;
+}
+.cw-stage-transition-handles line {
+ stroke: #686868;
+ stroke-width: 1;
+}
+.cw-stage-transition-handles circle {
+ fill: #191919;
+ stroke: #bdbdbd;
+ stroke-width: 1;
+}
+.cw-stage-transition-endpoint {
+ fill: #f0f0f0;
+}
+.cw-stage-transition-graph text {
+ fill: #777777;
+ font-size: 7px;
+}
+.cw-stage-transition-controls {
+ display: grid;
+ grid-template-columns: repeat(4, minmax(0, 1fr));
+ gap: 4px;
+ margin: 9px 0 0;
+ padding: 0;
+ border: 0;
+}
+.cw-stage-transition-controls legend {
+ grid-column: 1 / -1;
+ margin-bottom: 5px;
+ padding: 0;
+ color: #8c8c8c;
+ font-size: 9px;
+}
+.cw-stage-transition-controls input {
+ box-sizing: border-box;
+ width: 100%;
+ min-width: 0;
+ min-height: 28px;
+ padding: 4px 5px;
+ border: 1px solid #353535;
+ border-radius: 6px;
+ color: #d8d8d8;
+ background: #181818;
+ font-size: 10px;
+ font-variant-numeric: tabular-nums;
+}
+.cw-stage-transition-controls:disabled input {
+ color: #747474;
+ opacity: 1;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-point {
+ position: absolute;
+ z-index: 5;
+ top: 6px;
+ width: 7px;
+ min-width: 7px;
+ height: 7px;
+ min-height: 7px;
+ padding: 0;
+ border: 0;
+ border-radius: 1px;
+ background: #747474;
+ transform: translateX(-50%) rotate(45deg);
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-point.is-boundary {
+ border-radius: 1px;
+ background: #858585;
+ transform: translateX(-50%) rotate(45deg);
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-point[aria-pressed="true"] {
+ background: #e5e5e5;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-point:hover,
+.cw-stage-console .cw-stage-bottom .cw-stage-track-point:focus-visible {
+ outline: 1px solid #ffffff;
+ outline-offset: 2px;
+}
+.cw-stage-track-playhead-lane {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 144px;
+ z-index: 7;
+ overflow: hidden;
+ pointer-events: none;
+}
+.cw-stage-console .cw-stage-track-playhead {
+ top: 0;
+ bottom: 0;
+ width: 2px;
+ background: #d9d9d9;
+ transform: translateX(-1px);
+}
+.cw-stage-console .cw-stage-track-ruler-hit {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ z-index: 8;
+ width: 12px;
+ background: transparent;
+ cursor: ew-resize;
+ transform: translateX(-50%);
+}
+.cw-stage-console .cw-stage-track-playhead::before {
+ position: absolute;
+ top: 19px;
+ left: -2px;
+ width: 6px;
+ height: 5px;
+ background: #d9d9d9;
+ clip-path: polygon(0 0, 100% 0, 50% 100%);
+ content: "";
+}
+.cw-stage-track-point-delete {
+ position: absolute;
+ top: 50%;
+ z-index: 3;
+ transform: translateY(-50%);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 14px;
+ height: 14px;
+ padding: 0;
+ border: 1px solid #6b5b8a;
+ border-radius: 50%;
+ background: #1c1626;
+ color: #d9cdf0;
+ font-size: 10px;
+ line-height: 1;
+ cursor: pointer;
+}
+.cw-stage-track-point-delete:hover,
+.cw-stage-track-point-delete:focus-visible {
+ background: #3a2440;
+ color: #ffffff;
+}
+
+/* Storyboard track: the `+` in its label, the camera chooser above it, and the
+ * blocks. The chooser is fixed to the viewport like the transition editor, so the
+ * scrolling track surface can neither clip nor scroll it. A block shows its
+ * camera's name and stays selectable. */
+.cw-stage-console .cw-stage-bottom .cw-stage-storyboard-add {
+ box-sizing: border-box;
+ display: inline-grid;
+ flex: 0 0 auto;
+ width: 18px;
+ min-width: 18px;
+ max-width: 18px;
+ height: 18px;
+ min-height: 18px;
+ max-height: 18px;
+ place-items: center;
+ margin-left: auto;
+ padding: 0;
+ border: 0;
+ border-radius: 0;
+ box-shadow: none;
+ color: #a5a5a5;
+ background: transparent;
+ appearance: none;
+ line-height: 0;
+}
+.cw-stage-storyboard-add-glyph {
+ position: relative;
+ display: block;
+ width: 9px;
+ height: 9px;
+}
+.cw-stage-storyboard-add-glyph::before,
+.cw-stage-storyboard-add-glyph::after {
+ position: absolute;
+ top: 50%;
+ left: 0;
+ width: 9px;
+ height: 1px;
+ background: currentColor;
+ content: "";
+ transform: translateY(-50%);
+}
+.cw-stage-storyboard-add-glyph::after {
+ transform: translateY(-50%) rotate(90deg);
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-storyboard-add:hover:not(:disabled),
+.cw-stage-console .cw-stage-bottom .cw-stage-storyboard-add:focus-visible,
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-storyboard-add[aria-expanded="true"] {
+ border: 0;
+ color: #ffffff;
+ background: #303030;
+}
+.cw-stage-storyboard-block-shell {
+ position: absolute;
+ /* Leave four pixels of the lane above and below the block. */
+ top: 4px;
+ height: calc(var(--stage-storyboard-row-height) - 9px);
+ min-width: 2px;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-storyboard-block {
+ position: absolute;
+ display: flex;
+ gap: 6px;
+ align-items: center;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ min-width: 0;
+ min-height: 0;
+ margin: 0;
+ padding: 0 5px 0 4px;
+ /* One pixel of the lane between neighbours, so two blocks of one camera stay two blocks. */
+ border: 0;
+ border-right: 1px solid #161616;
+ border-radius: 2px;
+ color: #e2e2e2;
+ background: #3f3f3f;
+ font-size: 10px;
+ line-height: 12px;
+ text-align: left;
+ appearance: none;
+ cursor: pointer;
+ /* What a block shows depends on how wide the block itself is, so its own width is
+ * queried as a container and never follows what it holds. */
+ container-type: inline-size;
+}
+/* The picture of the block's camera, in the output frame. The box is there before the
+ * picture is and when none could be made, so the block never moves when it arrives. */
+.cw-stage-storyboard-block-thumbnail {
+ box-sizing: border-box;
+ flex: 0 1 auto;
+ height: 24px;
+ min-width: 0;
+ max-width: 100%;
+ aspect-ratio: var(--stage-thumbnail-ratio);
+ border-radius: 2px;
+ overflow: hidden;
+ background: #242424;
+}
+.cw-stage-storyboard-block-thumbnail img {
+ display: block;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-storyboard-block:hover,
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-storyboard-block:focus-visible:where(:not([data-dragging="true"] *)) {
+ border-color: #161616;
+ color: #ffffff;
+ background: #565656;
+}
+/* The selected block: a fill inside its own box. It is shown without a hover and
+ * takes no space, so the block's edges stay where the track put them. */
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-storyboard-block[aria-pressed="true"] {
+ background: #5b4b9b;
+}
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-storyboard-block[aria-pressed="true"]:hover,
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-storyboard-block[aria-pressed="true"]:focus-visible:where(:not([data-dragging="true"] *)) {
+ background: #6b5bb0;
+}
+/* The block under the playhead: a white ring outside its box. An outline takes no
+ * space, and the block is lifted above its neighbours, so the ring is painted over
+ * them instead of being covered by the block on its right. */
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-storyboard-block[aria-current="time"] {
+ z-index: 1;
+ outline: 2px solid #ffffff;
+ outline-offset: 0;
+}
+/* Keyboard focus keeps a ring of its own. The ring above covers the focus outline
+ * every stage button has, so focus shows as a shadow under it, one ring further out. */
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-storyboard-block[aria-current="time"]:focus-visible:where(:not([data-dragging="true"] *)) {
+ box-shadow: 0 0 0 4px var(--stage-focus);
+}
+/* Above the grid layer, so a grid line does not run through a block's name; the
+ * transparent lane still shows the grid where no block is, and the playhead stays on top.
+ * Taller than an ordinary row by the one constant the track surface carries: the
+ * label, the lane and the surface's computed height agree on it. */
+.cw-stage-console .cw-stage-track-row[data-track-kind="shots"] {
+ z-index: 3;
+ min-height: var(--stage-storyboard-row-height);
+}
+.cw-stage-console
+ .cw-stage-track-row[data-track-kind="shots"]
+ .cw-stage-track-label {
+ height: var(--stage-storyboard-row-height);
+}
+.cw-stage-console
+ .cw-stage-track-row[data-track-kind="shots"]
+ .cw-stage-track-lane {
+ height: calc(var(--stage-storyboard-row-height) - 1px);
+}
+.cw-stage-storyboard-block-name {
+ display: block;
+ flex: 1 1 auto;
+ min-width: 0;
+ /* Room for the full glyph box of Latin and Chinese names alike. */
+ line-height: 12px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+/* A block gives up its name before its picture, by the width of the block itself, and
+ * keeps its box to the last: a narrow block stays one whole target and names its
+ * camera in `title`. The widths are those of the block's content box. The rules
+ * follow the name's own, which they otherwise tie with and lose to. */
+@container (max-width: 119px) {
+ .cw-stage-storyboard-block-name {
+ display: none;
+ }
+}
+@container (max-width: 65px) {
+ .cw-stage-storyboard-block-thumbnail {
+ display: none;
+ }
+}
+.cw-stage-storyboard-chooser {
+ position: fixed;
+ z-index: 80;
+ display: flex;
+ flex-direction: column;
+ box-sizing: border-box;
+ width: 220px;
+ padding: 6px;
+ border: 1px solid var(--stage-border-strong);
+ border-radius: 8px;
+ color: var(--stage-text);
+ background: #292929;
+ box-shadow: 0 14px 38px #00000080;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-storyboard-search {
+ flex: 0 0 auto;
+ width: 100%;
+ min-height: 26px;
+ margin: 0 0 4px;
+ padding: 3px 8px;
+ border: 1px solid #343434;
+ border-radius: 5px;
+ color: var(--stage-text);
+ background: #181818;
+ font-size: 11px;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-storyboard-search::placeholder {
+ color: #777777;
+}
+.cw-stage-storyboard-options {
+ display: flex;
+ min-height: 0;
+ flex-direction: column;
+ gap: 2px;
+ overflow-y: auto;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-storyboard-option {
+ min-height: 26px;
+ padding: 4px 8px;
+ border: 0;
+ border-radius: 4px;
+ color: #d9d9d9;
+ background: transparent;
+ font-size: 11px;
+ line-height: 1.2;
+ text-align: left;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-storyboard-option:hover,
+.cw-stage-console .cw-stage-bottom .cw-stage-storyboard-option:focus-visible {
+ border: 0;
+ color: #ffffff;
+ background: #373737;
+}
+.cw-stage-storyboard-empty {
+ margin: 0;
+ padding: 6px 8px;
+ color: #858585;
+ font-size: 10px;
+}
+
+.cw-stage-storyboard-blocks {
+ position: absolute;
+ inset: 0;
+ pointer-events: none;
+}
+.cw-stage-storyboard-blocks .cw-stage-storyboard-block {
+ pointer-events: auto;
+ touch-action: none;
+}
+/* The body of a block the user may edit is where a drag to another place begins, and
+ offers an open hand. A block that may not be edited still selects, so it keeps the
+ pointer it has. */
+.cw-stage-storyboard-blocks[data-editable="true"] .cw-stage-storyboard-block {
+ cursor: grab;
+}
+/* From the press on, the hand is closed: in the pressed block, and in the surface,
+ which owns the pointer once it moves, wherever the pointer goes. A boundary being
+ resized keeps its own cursor from the surface as well. */
+.cw-stage-storyboard-blocks[data-editable="true"] .cw-stage-storyboard-block:active {
+ cursor: grabbing;
+}
+.cw-stage-storyboard-blocks:is([data-gesture="body"], [data-gesture="reorder"]) {
+ cursor: grabbing;
+}
+.cw-stage-storyboard-blocks[data-gesture="resize"] {
+ cursor: ew-resize;
+}
+/* A block carried to another place is lifted: over every other block, with a shadow
+ under it and a little see-through. The lift is the shell's, around the block, so it
+ neither scales the block nor competes with the ring keyboard focus gives the block
+ under the playhead. The block is moved by a transform: nothing is laid out again
+ while it follows the pointer. */
+.cw-stage-storyboard-block-shell[data-dragging="true"] {
+ z-index: 2;
+ border-radius: 2px;
+ opacity: 0.9;
+ box-shadow: 0 4px 12px #00000080;
+}
+.cw-stage-storyboard-block-shell[data-dragging="true"] .cw-stage-storyboard-block {
+ cursor: grabbing;
+}
+/* While it is carried, a block shows how it is carried and nothing of keyboard
+ focus: not the fill focus gives a block, which the rules above leave out under a
+ dragged shell, and not the outline every stage button has. The block under the
+ playhead keeps its own white ring, and the selected block its fill. A keyboard user
+ is never in a drag, so no focus is hidden from anyone; once the block is let go,
+ the ring of keyboard focus is shown again as before. */
+.cw-stage-console
+ .cw-stage-bottom
+ .cw-stage-storyboard-block-shell[data-dragging="true"]
+ .cw-stage-storyboard-block:not([aria-current="time"]) {
+ outline: none;
+}
+/* Where a carried block would be let in: a line in that gap, where the blocks lay the
+ * time out. Its centre is the place, so half of it is on either side.
+ * Over every block, the carried one included, and drawn in the Storyboard row: the row
+ * stacks below the playhead lane, so the playhead stays over it. It is a hint: it takes
+ * no pointer. */
+.cw-stage-storyboard-insert-marker {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ z-index: 3;
+ width: 3px;
+ margin-left: -1.5px;
+ background: var(--stage-accent);
+ pointer-events: none;
+}
+.cw-stage-storyboard-insert-marker::before,
+.cw-stage-storyboard-insert-marker::after {
+ position: absolute;
+ left: 50%;
+ width: 7px;
+ height: 7px;
+ /* Two sides of a square: a corner, which once turned is a small chevron. */
+ border: 0 solid var(--stage-accent);
+ border-width: 0 2px 2px 0;
+ content: "";
+}
+/* A chevron at either end of the line, each centred on it and turned to point at the
+ * line's centre: down from the top end, up from the bottom one. */
+.cw-stage-storyboard-insert-marker::before {
+ top: 0;
+ transform: translateX(-50%) rotate(45deg);
+}
+.cw-stage-storyboard-insert-marker::after {
+ bottom: 0;
+ transform: translateX(-50%) rotate(-135deg);
+}
+.cw-stage-storyboard-resize-handle {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: min(5px, 25%);
+ cursor: ew-resize;
+}
+.cw-stage-storyboard-resize-handle.is-left {
+ left: 0;
+}
+.cw-stage-storyboard-resize-handle.is-right {
+ right: 0;
+}
+
+.cw-stage-console .cw-stage-bottom .cw-stage-storyboard-delete {
+ position: absolute;
+ z-index: 2;
+ top: 1px;
+ right: min(6px, 25%);
+ display: grid;
+ place-items: center;
+ width: min(16px, 50%);
+ height: 14px;
+ min-width: 0;
+ min-height: 0;
+ padding: 0;
+ border: 0;
+ border-radius: 2px;
+ overflow: hidden;
+ color: #ffffff;
+ background: #303030;
+ opacity: 0;
+ pointer-events: none;
+}
+.cw-stage-storyboard-block-shell:hover .cw-stage-storyboard-delete,
+.cw-stage-storyboard-block-shell:has(.cw-stage-storyboard-block:focus-visible) .cw-stage-storyboard-delete,
+.cw-stage-storyboard-block-shell .cw-stage-storyboard-delete:focus-visible {
+ opacity: 1;
+ pointer-events: auto;
+}
+@media (hover: none) {
+ .cw-stage-storyboard-block-shell:has([aria-pressed="true"]) .cw-stage-storyboard-delete {
+ opacity: 1;
+ pointer-events: auto;
+ }
+}
+
+/* Shared control states across the Director Stage work area. */
+.cw-stage-console :is(.cw-stage-topbar, .cw-stage-left, .cw-stage-right, .cw-stage-gizmo, .cw-stage-transport) :is(button, input, select):focus-visible {
+ outline: 2px solid var(--stage-control-focus);
+ outline-offset: -2px;
+}
+.cw-stage-console :is(.cw-stage-preview-mode, .cw-stage-gizmo) button[aria-pressed="true"] {
+ background: var(--stage-control-active);
+ color: var(--stage-text);
+}
+.cw-stage-console :is(.cw-stage-topbar, .cw-stage-transport) {
+ background: var(--stage-surface);
+ border-bottom-color: var(--stage-border);
+}
+.cw-stage-console .cw-stage-gizmo {
+ border-color: var(--stage-border);
+}
+.cw-stage-console .cw-stage-transport output {
+ font-variant-numeric: tabular-nums;
+}
+
+@media (max-width: 1000px) {
+ .cw-stage-console .cw-stage-preview-mode {
+ position: static;
+ transform: none;
+ }
+}
+
+.cw-stage-console .cw-stage-topbar .cw-stage-render-action {
+ flex: 0 0 auto;
+ min-height: var(--stage-control-height);
+ padding-inline: 12px;
+ border-color: #52545b;
+ background: #373940;
+ color: #fff;
+ font-weight: 600;
+ white-space: nowrap;
+}
+.cw-stage-console .cw-stage-topbar .cw-stage-render-action:hover:not(:disabled) {
+ background: #464952;
+}
+.cw-stage-console .cw-stage-panel-heading h3 {
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cw-stage-console .cw-stage-panel-icon {
+ flex: none;
+}
+
+/* Workbench chrome is quiet until a control becomes active. */
+.cw-stage-console {
+ --stage-scroll-thumb: #a0a0a0;
+ --stage-feedback-surface: #202020f5;
+ --stage-chrome-line: #282828;
+ --stage-chrome-hover: #272727;
+ --stage-chrome-selected: #303030;
+ --inspector-control-border: transparent;
+}
+.cw-stage-console :is(.cw-stage-topbar, .cw-stage-panel-heading, .cw-stage-transport) {
+ border-bottom-color: var(--stage-chrome-line);
+}
+.cw-stage-console .cw-stage-topbar {
+ gap: 8px;
+}
+.cw-stage-console .cw-stage-topbar button {
+ min-height: 26px;
+ padding-block: 3px;
+}
+.cw-stage-console .cw-stage-topbar button:is([data-icon], .cw-stage-topbar-icon) {
+ width: 26px;
+ min-width: 26px;
+ min-height: 26px;
+ padding-inline: 3px;
+}
+.cw-stage-console .cw-stage-topbar .cw-stage-preview-mode button {
+ min-width: 56px;
+ padding-inline: 8px;
+}
+.cw-stage-console .cw-stage-left .cw-stage-object-grid {
+ gap: 6px;
+ margin-top: 8px;
+}
+.cw-stage-console .cw-stage-right .cw-inspector-property-list {
+ gap: 4px;
+}
+.cw-stage-console .cw-stage-right :is(
+ .cw-inspector-property-row,
+ .cw-inspector-color-control,
+ .cw-inspector-property-control > :is(input:not([type="checkbox"], [type="color"]), select, textarea)
+) {
+ min-height: 28px;
+}
+.cw-stage-console .cw-stage-right .cw-inspector-section {
+ margin-block: 4px;
+}
+.cw-stage-console .cw-stage-topbar button:is([data-icon], .cw-stage-topbar-icon),
+.cw-stage-console .cw-stage-topbar .cw-stage-preview-mode button {
+ border-color: transparent;
+ background: transparent;
+}
+.cw-stage-console .cw-stage-topbar .cw-stage-preview-mode {
+ background: #171717;
+ border-color: var(--stage-chrome-line);
+}
+.cw-stage-console .cw-stage-topbar .cw-stage-chip:not(.is-unsaved) {
+ border-color: transparent;
+ background: transparent;
+}
+.cw-stage-console .cw-stage-left .cw-stage-tabs button {
+ min-height: 32px;
+ border: 0;
+ border-bottom: 2px solid transparent;
+ border-radius: 0;
+ color: var(--stage-text-muted);
+ background: transparent;
+}
+.cw-stage-console .cw-stage-left .cw-stage-tabs button[aria-selected="true"] {
+ border-bottom-color: var(--stage-text);
+ color: var(--stage-text);
+}
+.cw-stage-console .cw-stage-panel-search input {
+ border-color: transparent;
+ border-radius: 8px;
+ background: var(--stage-surface-input);
+}
+.cw-stage-console .cw-stage-left .cw-stage-object-grid button {
+ border-color: transparent;
+ border-radius: 10px;
+ background: #141414;
+}
+.cw-stage-console .cw-stage-left .cw-stage-object-grid button[aria-pressed="true"] {
+ border-color: #666;
+ background: var(--stage-chrome-selected);
+}
+.cw-stage-console .cw-stage-right .cw-stage-tree-head,
+.cw-stage-console .cw-stage-right .cw-inspector-section-toggle {
+ border-color: transparent;
+ background: transparent;
+}
+.cw-stage-console .cw-stage-right .cw-inspector-section-toggle {
+ border-radius: 0;
+ border-bottom-color: var(--stage-chrome-line);
+}
+.cw-stage-console .cw-stage-gizmo button[data-icon] {
+ border-color: transparent;
+ border-radius: 6px;
+ background: transparent;
+}
+.cw-stage-console .cw-stage-topbar button:is([data-icon], .cw-stage-topbar-icon):hover:not(:disabled),
+.cw-stage-console .cw-stage-topbar .cw-stage-preview-mode button:hover:not(:disabled),
+.cw-stage-console .cw-stage-left .cw-stage-tabs button:hover:not(:disabled),
+.cw-stage-console .cw-stage-left .cw-stage-object-grid button:hover:not(:disabled),
+.cw-stage-console .cw-stage-right .cw-stage-tree-head:hover:not(:disabled),
+.cw-stage-console .cw-stage-right .cw-inspector-section-toggle:hover:not(:disabled),
+.cw-stage-console .cw-stage-gizmo button[data-icon]:hover:not(:disabled) {
+ background: var(--stage-chrome-hover);
+}
+.cw-stage-console .cw-stage-topbar button[aria-pressed="true"],
+.cw-stage-console .cw-stage-topbar button[aria-expanded="true"],
+.cw-stage-console .cw-stage-gizmo button[data-icon][aria-pressed="true"],
+.cw-stage-console .cw-stage-gizmo button[data-icon][aria-expanded="true"] {
+ color: var(--stage-text);
+ background: var(--stage-chrome-selected);
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-group-toggle {
+ background: var(--stage-surface);
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-group-toggle:hover:not(:disabled) {
+ background: var(--stage-chrome-hover);
+}
+.cw-stage-console .cw-stage-transport output {
+ color: var(--stage-text);
+ font-family: ui-monospace, monospace;
+}
+
+.cw-stage-console,
+.cw-stage-console * {
+ scrollbar-width: thin;
+ scrollbar-color: var(--stage-scroll-thumb) transparent;
+}
+
+.cw-stage-console :is(.cw-stage-placehint, .cw-stage-error, .cw-render-status) {
+ border: 1px solid var(--stage-feedback-border, var(--stage-border-strong));
+ border-radius: 8px;
+ background: var(--stage-feedback-surface);
+ box-shadow: 0 4px 14px #0005;
+ color: var(--stage-feedback-text, var(--stage-text));
+ font-size: 12px;
+ line-height: 1.45;
+ overflow-wrap: anywhere;
+}
+
+
+/* Keep workbench type proportional to the compact control geometry. */
+.cw-stage-console .cw-stage-identity h2 {
+ font-size: var(--stage-type-title);
+}
+.cw-stage-console :is(.cw-stage-panel-heading h3, .cw-stage-timeline-title) {
+ font-size: var(--stage-type-label);
+}
+.cw-stage-console .cw-stage-panel-icon {
+ font-size: 13px;
+}
+.cw-stage-console .cw-stage-topbar button,
+.cw-stage-console .cw-stage-panel-search input,
+.cw-stage-console .cw-stage-left :is(.cw-stage-import-button, .cw-stage-object-grid button),
+.cw-stage-console .cw-stage-right :is(.cw-stage-tree-head, .cw-stage-tree-row > button),
+.cw-stage-console .cw-stage-right :is(.cw-inspector-property-label, .cw-inspector-section-toggle, .cw-inspector-property-control > select),
+.cw-stage-console .cw-stage-viewmenu label,
+.cw-stage-console .cw-stage-transport,
+.cw-stage-console .cw-stage-transport output,
+.cw-stage-console .cw-stage-drag-value input[type="number"] {
+ font-size: var(--stage-type-control);
+}
+.cw-stage-console .cw-stage-topbar button[data-icon]::before,
+.cw-stage-console .cw-stage-gizmo button[data-icon]::before {
+ font-size: 12px;
+}
+.cw-stage-console .cw-stage-left .cw-stage-tabs button {
+ min-height: 28px;
+}
+.cw-stage-console .cw-stage-tab-icon svg {
+ width: 14px;
+ height: 14px;
+}
+.cw-stage-console .cw-stage-left .cw-stage-object-grid button {
+ min-height: 68px;
+ gap: 3px;
+ padding: 4px;
+}
+.cw-stage-console .cw-stage-left .cw-stage-object-grid .cw-stage-object-preview {
+ height: 42px;
+ flex-basis: 42px;
+}
+
+
+.cw-stage-console .cw-stage-right .cw-inspector-section-toggle {
+ min-height: 22px;
+ gap: 6px;
+}
+
+
+.cw-stage-topbar-icon {
+ display: inline-grid;
+ place-items: center;
+}
+.cw-stage-topbar-icon svg {
+ width: 14px;
+ height: 14px;
+ fill: none;
+ stroke: currentColor;
+ stroke-width: 1.25;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+}
+
+
+/* Preserve a visible type hierarchy at each expanded stage control. */
+.cw-stage-console :is(.cw-stage-track-group-label, .cw-stage-export-field) {
+ font-size: var(--stage-type-label);
+}
+.cw-stage-console .cw-stage-right :is(.cw-stage-tree-head, .cw-inspector-section-toggle) {
+ font-size: var(--stage-type-label);
+}
+.cw-stage-console .cw-stage-bottom .cw-stage-track-label,
+.cw-stage-console .cw-stage-export-field select,
+.cw-stage-console .cw-stage-right .cw-inspector-property-control > :is(input, select, textarea),
+.cw-stage-console .cw-stage-right .cw-inspector-color-value {
+ font-size: var(--stage-type-control);
+}
+.cw-stage-console select :is(option, optgroup) {
+ font-size: calc(1em - var(--stage-type-nesting-step));
+}
+.cw-stage-console select optgroup > option {
+ font-size: 1em;
}
diff --git a/src/canvas/directorStageViewState.ts b/src/canvas/directorStageViewState.ts
new file mode 100644
index 000000000..58e0179ed
--- /dev/null
+++ b/src/canvas/directorStageViewState.ts
@@ -0,0 +1,529 @@
+import type {
+ StageAssetRole,
+ StageCameraEndpointKind,
+ StageObject,
+ StagePreviewSource,
+} from "./stageDocument.ts";
+
+export type DirectorStageLeftTab =
+ | "characters"
+ | "objects"
+ | "cameras"
+ | "background";
+
+export type DirectorStageTreeGroup = "characters" | "objects" | "cameras";
+
+export type DirectorStageViewFlag =
+ | "ground"
+ | "grid"
+ | "motionPaths"
+ | "objectNames"
+ | "heightGuides"
+ | "aspectMask"
+ | "viewIndicator";
+
+export type DirectorStageGizmo = "select" | "translate" | "rotate" | "scale";
+
+export type DirectorStageCameraPreset =
+ | "frontMedium"
+ | "frontClose"
+ | "frontWide"
+ | "sideTrack"
+ | "sideClose"
+ | "backMedium"
+ | "overheadWide"
+ | "highAngle"
+ | "lowAngle"
+ | "lowWide"
+ | "overShoulder"
+ | "bird"
+ | "dutch";
+
+export type DirectorStageSelection =
+ | { kind: "object"; objectId: string }
+ | { kind: "camera"; cameraId: string }
+ | null;
+
+export type DirectorStagePreviewMode = "static" | "dynamic";
+
+export type DirectorStageResizeTarget = "left" | "right" | "timeline";
+
+export interface DirectorStageLayout {
+ leftWidth: number;
+ rightWidth: number;
+ timelineHeight: number;
+}
+
+export type DirectorStageFocusedSurface =
+ | "console"
+ | "viewport"
+ | "library"
+ | "tree"
+ | "inspector"
+ | "timeline"
+ | "drawer"
+ | "dialog";
+
+/** Mutually exclusive interaction modes. Display options live separately so
+ * camera preview and split view can retain their current independent behavior. */
+export type DirectorStageInteractionMode =
+ | { kind: "edit" }
+ | { kind: "viewfinder" }
+ | {
+ kind: "placement";
+ objectKind: StageObject["kind"];
+ sourceObjectId: string | null;
+ }
+ | { kind: "cameraPreset"; preset: DirectorStageCameraPreset };
+
+export interface DirectorStageViewFlags {
+ ground: boolean;
+ grid: boolean;
+ motionPaths: boolean;
+ objectNames: boolean;
+ heightGuides: boolean;
+ aspectMask: boolean;
+ viewIndicator: boolean;
+}
+
+export type DirectorStageSplitView =
+ | { kind: "closed"; ratio: number }
+ | { kind: "open"; ratio: number; cameraId: string | null };
+
+export type DirectorStageExportDialog =
+ | {
+ kind: "closed";
+ source: string;
+ clarity: number;
+ fps: number;
+ }
+ | {
+ kind: "open";
+ source: string;
+ clarity: number;
+ fps: number;
+ };
+
+export interface DirectorStageViewState {
+ selection: DirectorStageSelection;
+ /** The explicitly selected Storyboard block. View state only: it is never saved with the
+ * stage, and it is neither the block under the playhead nor the camera preview source. */
+ selectedStoryboardBlockId: string | null;
+ /** What the camera surfaces show. View state only: switching it is not an edit, and it
+ * names a camera by identity without holding anything of the camera or the stage. */
+ previewSource: StagePreviewSource;
+ /** Which end of the selected camera is being edited: its body or its viewpoint. It
+ * qualifies a camera selection and is read only while the selection is a camera. */
+ cameraEndpoint: StageCameraEndpointKind;
+ focusedSurface: DirectorStageFocusedSurface;
+ interactionMode: DirectorStageInteractionMode;
+ cameraPreview: boolean;
+ /** Ephemeral sampling preference; never part of LocalStageDocument. */
+ previewMode: DirectorStagePreviewMode;
+ splitView: DirectorStageSplitView;
+ viewFlags: DirectorStageViewFlags;
+ viewMenuOpen: boolean;
+ leftTab: DirectorStageLeftTab;
+ assetRole: StageAssetRole;
+ treeGroups: Record;
+ helpOpen: boolean;
+ drawerOpen: boolean;
+ selectedStillIds: ReadonlySet;
+ previewStillId: string | null;
+ lastExportFps: number | null;
+ exportDialog: DirectorStageExportDialog;
+ activeGizmo: DirectorStageGizmo;
+ layout: DirectorStageLayout;
+}
+
+export type DirectorStageViewAction =
+ | { type: "selectObject"; objectId: string | null }
+ | { type: "selectCamera"; cameraId: string | null }
+ | { type: "selectStoryboardBlock"; blockId: string | null }
+ | { type: "setPreviewSource"; source: StagePreviewSource }
+ /** Selects a camera and the end of it being edited, body or viewpoint. */
+ | {
+ type: "selectCameraEndpoint";
+ cameraId: string;
+ endpoint: StageCameraEndpointKind;
+ }
+ | { type: "focusSurface"; surface: DirectorStageFocusedSurface }
+ | { type: "toggleCameraPreview" }
+ | { type: "setCameraPreview"; enabled: boolean }
+ | { type: "setPreviewMode"; mode: DirectorStagePreviewMode }
+ | { type: "toggleViewfinder" }
+ | {
+ type: "armPlacement";
+ objectKind: StageObject["kind"];
+ sourceObjectId: string | null;
+ }
+ | { type: "cancelPlacement" }
+ | { type: "armCameraPreset"; preset: DirectorStageCameraPreset }
+ | { type: "cancelCameraPreset" }
+ | { type: "openSplit"; cameraId: string | null; ratio?: number }
+ | { type: "closeSplit" }
+ | { type: "setSplitRatio"; ratio: number }
+ | { type: "setSplitCamera"; cameraId: string | null }
+ | { type: "toggleViewFlag"; flag: DirectorStageViewFlag }
+ | {
+ type: "setViewFlag";
+ flag: DirectorStageViewFlag;
+ enabled: boolean;
+ }
+ | { type: "toggleViewMenu" }
+ | { type: "setViewMenu"; open: boolean }
+ | { type: "setLeftTab"; tab: DirectorStageLeftTab }
+ | { type: "setAssetRole"; role: StageAssetRole }
+ | { type: "toggleTreeGroup"; group: DirectorStageTreeGroup }
+ | {
+ type: "setTreeGroup";
+ group: DirectorStageTreeGroup;
+ expanded: boolean;
+ }
+ | { type: "toggleHelp" }
+ | { type: "setHelp"; open: boolean }
+ | { type: "toggleDrawer" }
+ | { type: "setDrawer"; open: boolean }
+ | { type: "toggleStillSelection"; stillId: string }
+ | { type: "setStillSelection"; stillIds: readonly string[] }
+ | { type: "clearStillSelection" }
+ | { type: "setPreviewStill"; stillId: string | null }
+ | {
+ type: "openExport";
+ source: string;
+ clarity: number;
+ fps: number;
+ }
+ | { type: "closeExport" }
+ | { type: "setExportSource"; source: string }
+ | { type: "setExportClarity"; clarity: number }
+ | { type: "setExportFps"; fps: number }
+ | { type: "setGizmo"; gizmo: DirectorStageGizmo }
+ | {
+ type: "setLayoutSize";
+ target: DirectorStageResizeTarget;
+ value: number;
+ };
+
+const DEFAULT_VIEW_FLAGS: DirectorStageViewFlags = {
+ ground: true,
+ grid: true,
+ motionPaths: false,
+ objectNames: true,
+ heightGuides: false,
+ aspectMask: false,
+ viewIndicator: true,
+};
+
+const DEFAULT_TREE_GROUPS: Record = {
+ characters: true,
+ objects: true,
+ cameras: true,
+};
+
+export const LAYOUT_LIMITS: Record<
+ DirectorStageResizeTarget,
+ { readonly min: number; readonly max: number; readonly fallback: number }
+> = {
+ left: { min: 180, max: 420, fallback: 196 },
+ right: { min: 220, max: 460, fallback: 232 },
+ timeline: { min: 140, max: 460, fallback: 176 },
+};
+
+const LAYOUT_KEYS: Record<
+ DirectorStageResizeTarget,
+ keyof DirectorStageLayout
+> = {
+ left: "leftWidth",
+ right: "rightWidth",
+ timeline: "timelineHeight",
+};
+
+function clampLayoutSize(
+ target: DirectorStageResizeTarget,
+ value: number,
+ fallback = LAYOUT_LIMITS[target].fallback,
+): number {
+ const limits = LAYOUT_LIMITS[target];
+ if (!Number.isFinite(value)) return fallback;
+ return Math.min(limits.max, Math.max(limits.min, value));
+}
+
+/** The second parameter is the preview source the stage opens with, which the caller
+ * reads from the stored document once. It is required on purpose: view state has no
+ * sensible default for what a preview shows. */
+export function createDirectorStageViewState(
+ selectedObjectId: string | null,
+ previewSource: StagePreviewSource,
+): DirectorStageViewState {
+ return {
+ selection: selectedObjectId
+ ? { kind: "object", objectId: selectedObjectId }
+ : null,
+ selectedStoryboardBlockId: null,
+ previewSource,
+ cameraEndpoint: "camera",
+ focusedSurface: "console",
+ interactionMode: { kind: "edit" },
+ cameraPreview: true,
+ previewMode: "static",
+ splitView: { kind: "closed", ratio: 0.5 },
+ viewFlags: { ...DEFAULT_VIEW_FLAGS },
+ viewMenuOpen: false,
+ leftTab: "characters",
+ assetRole: "character",
+ treeGroups: { ...DEFAULT_TREE_GROUPS },
+ helpOpen: false,
+ drawerOpen: false,
+ selectedStillIds: new Set(),
+ previewStillId: null,
+ lastExportFps: null,
+ exportDialog: { kind: "closed", source: "", clarity: 1280, fps: 30 },
+ activeGizmo: "translate",
+ layout: {
+ leftWidth: LAYOUT_LIMITS.left.fallback,
+ rightWidth: LAYOUT_LIMITS.right.fallback,
+ timelineHeight: LAYOUT_LIMITS.timeline.fallback,
+ },
+ };
+}
+
+function clampSplitRatio(ratio: number, fallback: number): number {
+ if (!Number.isFinite(ratio)) return fallback;
+ return Math.min(0.8, Math.max(0.2, ratio));
+}
+
+export function directorStageViewReducer(
+ state: DirectorStageViewState,
+ action: DirectorStageViewAction,
+): DirectorStageViewState {
+ switch (action.type) {
+ case "selectObject":
+ return {
+ ...state,
+ selection: action.objectId
+ ? { kind: "object", objectId: action.objectId }
+ : null,
+ };
+ case "selectCamera":
+ // A camera offers translation only, and is first edited through its body.
+ return {
+ ...state,
+ selection: action.cameraId
+ ? { kind: "camera", cameraId: action.cameraId }
+ : null,
+ cameraEndpoint: "camera",
+ activeGizmo: "translate",
+ };
+ case "selectCameraEndpoint":
+ // Selecting writes neither the document nor the preview source: the camera
+ // stays as it is, and only the edited end and the gizmo follow.
+ return {
+ ...state,
+ selection: { kind: "camera", cameraId: action.cameraId },
+ cameraEndpoint: action.endpoint,
+ activeGizmo: "translate",
+ };
+ case "selectStoryboardBlock":
+ return { ...state, selectedStoryboardBlockId: action.blockId };
+ case "setPreviewSource":
+ return { ...state, previewSource: action.source };
+ case "focusSurface":
+ return { ...state, focusedSurface: action.surface };
+ case "toggleCameraPreview":
+ return { ...state, cameraPreview: !state.cameraPreview };
+ case "setCameraPreview":
+ return { ...state, cameraPreview: action.enabled };
+ case "setPreviewMode":
+ return { ...state, previewMode: action.mode };
+ case "toggleViewfinder":
+ if (state.interactionMode.kind === "viewfinder") {
+ return {
+ ...state,
+ interactionMode: { kind: "edit" },
+ };
+ }
+ return {
+ ...state,
+ interactionMode: { kind: "viewfinder" },
+ viewFlags: { ...state.viewFlags, aspectMask: true },
+ };
+ case "armPlacement":
+ return {
+ ...state,
+ interactionMode: {
+ kind: "placement",
+ objectKind: action.objectKind,
+ sourceObjectId: action.sourceObjectId,
+ },
+ };
+ case "cancelPlacement":
+ if (state.interactionMode.kind !== "placement") return state;
+ return { ...state, interactionMode: { kind: "edit" } };
+ case "armCameraPreset":
+ if (
+ state.interactionMode.kind === "cameraPreset" &&
+ state.interactionMode.preset === action.preset
+ )
+ return { ...state, interactionMode: { kind: "edit" } };
+ return {
+ ...state,
+ interactionMode: { kind: "cameraPreset", preset: action.preset },
+ };
+ case "cancelCameraPreset":
+ if (state.interactionMode.kind !== "cameraPreset") return state;
+ return { ...state, interactionMode: { kind: "edit" } };
+ case "openSplit":
+ return {
+ ...state,
+ splitView: {
+ kind: "open",
+ cameraId: action.cameraId,
+ ratio: clampSplitRatio(
+ action.ratio ?? state.splitView.ratio,
+ state.splitView.ratio,
+ ),
+ },
+ };
+ case "closeSplit":
+ return {
+ ...state,
+ splitView: { kind: "closed", ratio: state.splitView.ratio },
+ };
+ case "setSplitRatio":
+ return {
+ ...state,
+ splitView: {
+ ...state.splitView,
+ ratio: clampSplitRatio(action.ratio, state.splitView.ratio),
+ },
+ };
+ case "setSplitCamera":
+ if (state.splitView.kind === "closed") return state;
+ return {
+ ...state,
+ splitView: { ...state.splitView, cameraId: action.cameraId },
+ };
+ case "toggleViewFlag":
+ return {
+ ...state,
+ viewFlags: {
+ ...state.viewFlags,
+ [action.flag]: !state.viewFlags[action.flag],
+ },
+ };
+ case "setViewFlag":
+ return {
+ ...state,
+ viewFlags: { ...state.viewFlags, [action.flag]: action.enabled },
+ };
+ case "toggleViewMenu":
+ return { ...state, viewMenuOpen: !state.viewMenuOpen };
+ case "setViewMenu":
+ return { ...state, viewMenuOpen: action.open };
+ case "setLeftTab":
+ return { ...state, leftTab: action.tab };
+ case "setAssetRole":
+ return { ...state, assetRole: action.role };
+ case "toggleTreeGroup":
+ return {
+ ...state,
+ treeGroups: {
+ ...state.treeGroups,
+ [action.group]: !state.treeGroups[action.group],
+ },
+ };
+ case "setTreeGroup":
+ return {
+ ...state,
+ treeGroups: { ...state.treeGroups, [action.group]: action.expanded },
+ };
+ case "toggleHelp":
+ return { ...state, helpOpen: !state.helpOpen };
+ case "setHelp":
+ return { ...state, helpOpen: action.open };
+ case "toggleDrawer":
+ return { ...state, drawerOpen: !state.drawerOpen };
+ case "setDrawer":
+ return { ...state, drawerOpen: action.open };
+ case "toggleStillSelection": {
+ const selectedStillIds = new Set(state.selectedStillIds);
+ if (selectedStillIds.has(action.stillId))
+ selectedStillIds.delete(action.stillId);
+ else selectedStillIds.add(action.stillId);
+ return { ...state, selectedStillIds };
+ }
+ case "setStillSelection":
+ return { ...state, selectedStillIds: new Set(action.stillIds) };
+ case "clearStillSelection":
+ return {
+ ...state,
+ selectedStillIds: new Set(),
+ previewStillId:
+ state.previewStillId && state.selectedStillIds.has(state.previewStillId)
+ ? null
+ : state.previewStillId,
+ };
+ case "setPreviewStill":
+ return { ...state, previewStillId: action.stillId };
+ case "openExport": {
+ // The dialog reopens at the frame rate the director last exported with.
+ const fps = state.lastExportFps ?? action.fps;
+ return {
+ ...state,
+ lastExportFps: fps,
+ exportDialog: {
+ kind: "open",
+ source: action.source,
+ clarity: action.clarity,
+ fps,
+ },
+ };
+ }
+ case "closeExport":
+ if (state.exportDialog.kind === "closed") return state;
+ return {
+ ...state,
+ exportDialog: { ...state.exportDialog, kind: "closed" },
+ };
+ case "setExportSource":
+ if (state.exportDialog.kind === "closed") return state;
+ return {
+ ...state,
+ exportDialog: { ...state.exportDialog, source: action.source },
+ };
+ case "setExportClarity":
+ if (state.exportDialog.kind === "closed") return state;
+ return {
+ ...state,
+ exportDialog: { ...state.exportDialog, clarity: action.clarity },
+ };
+ case "setExportFps":
+ if (state.exportDialog.kind === "closed") return state;
+ return {
+ ...state,
+ lastExportFps: action.fps,
+ exportDialog: { ...state.exportDialog, fps: action.fps },
+ };
+ case "setGizmo":
+ // A selected camera is edited through its body or viewpoint by translation
+ // only; the other modes stay available for subjects.
+ if (state.selection?.kind === "camera" && action.gizmo !== "translate")
+ return { ...state, activeGizmo: "translate" };
+ return { ...state, activeGizmo: action.gizmo };
+ case "setLayoutSize": {
+ const key = LAYOUT_KEYS[action.target];
+ return {
+ ...state,
+ layout: {
+ ...state.layout,
+ [key]: clampLayoutSize(action.target, action.value),
+ },
+ };
+ }
+ default: {
+ const exhaustive: never = action;
+ return exhaustive;
+ }
+ }
+}
diff --git a/src/canvas/inspector/InspectorPrimitives.tsx b/src/canvas/inspector/InspectorPrimitives.tsx
new file mode 100644
index 000000000..d3795ded2
--- /dev/null
+++ b/src/canvas/inspector/InspectorPrimitives.tsx
@@ -0,0 +1,144 @@
+import { useId, useState, type ChangeEvent, type ReactNode } from "react";
+import "./inspector-primitives.css";
+
+export function InspectorSection({
+ title,
+ children,
+ defaultExpanded = true,
+}: {
+ title: string;
+ children: ReactNode;
+ defaultExpanded?: boolean;
+}) {
+ const [expanded, setExpanded] = useState(defaultExpanded);
+ const contentId = useId();
+
+ return (
+
+ setExpanded((current) => !current)}
+ >
+
+ {title}
+
+ {expanded && (
+
+ {children}
+
+ )}
+
+ );
+}
+
+export function InspectorPropertyList({
+ children,
+ className = "",
+}: {
+ children: ReactNode;
+ className?: string;
+}) {
+ return (
+
+ {children}
+
+ );
+}
+
+export function InspectorPropertyRow({
+ label,
+ children,
+ className = "",
+}: {
+ label: string;
+ children: ReactNode;
+ className?: string;
+}) {
+ return (
+
+
+ {label}
+
+ {children}
+
+ );
+}
+
+export function InspectorColorProperty({
+ label,
+ value,
+ onChange,
+ disabled = false,
+}: {
+ label: string;
+ value: string;
+ onChange: (value: string) => void;
+ disabled?: boolean;
+}) {
+ const handleChange = (event: ChangeEvent) =>
+ onChange(event.target.value);
+
+ return (
+
+
+
+
+ {value.toUpperCase()}
+
+
+
+ );
+}
+
+export function InspectorToggleProperty({
+ label,
+ checked,
+ onChange,
+ disabled = false,
+}: {
+ label: string;
+ checked: boolean;
+ onChange: (checked: boolean) => void;
+ disabled?: boolean;
+}) {
+ return (
+
+ onChange(event.target.checked)}
+ />
+
+ );
+}
+
+export function InspectorCompoundProperty({
+ label,
+ children,
+}: {
+ label: string;
+ children: ReactNode;
+}) {
+ return (
+
+ {label}
+ {children}
+
+ );
+}
diff --git a/src/canvas/inspector/inspector-primitives.css b/src/canvas/inspector/inspector-primitives.css
new file mode 100644
index 000000000..d426715d3
--- /dev/null
+++ b/src/canvas/inspector/inspector-primitives.css
@@ -0,0 +1,196 @@
+.cw-inspector-section {
+ min-width: 0;
+ margin: 12px 0;
+}
+.cw-inspector-section .cw-inspector-section-toggle {
+ display: flex;
+ width: 100%;
+ min-height: 28px;
+ align-items: center;
+ gap: 8px;
+ padding: 0 2px;
+ border: 0;
+ border-radius: 3px;
+ color: var(--inspector-text, #eeeeee);
+ background: transparent;
+ font-size: 11px;
+ font-weight: 600;
+ text-align: left;
+ cursor: pointer;
+}
+.cw-inspector-section .cw-inspector-section-toggle:hover,
+.cw-inspector-section .cw-inspector-section-toggle:focus-visible {
+ background: var(--inspector-hover, #252525);
+}
+.cw-inspector-section-chevron {
+ width: 7px;
+ height: 7px;
+ flex: none;
+ border-right: 1px solid var(--inspector-muted, #a9a9a9);
+ border-bottom: 1px solid var(--inspector-muted, #a9a9a9);
+ transform: rotate(-45deg) translate(-1px, 1px);
+ transition: transform 120ms ease;
+}
+.cw-inspector-section-chevron[data-expanded="true"] {
+ transform: rotate(45deg) translate(-1px, -1px);
+}
+.cw-inspector-section-content {
+ min-width: 0;
+}
+.cw-inspector-property-list {
+ display: grid;
+ min-width: 0;
+ gap: 6px;
+ container-type: inline-size;
+}
+.cw-inspector-property-row {
+ display: grid;
+ min-width: 0;
+ min-height: 32px;
+ grid-template-columns: minmax(0, 1fr) minmax(112px, 46%);
+ align-items: center;
+ gap: 10px;
+ margin: 0;
+ color: var(--inspector-muted, #a5a5a5);
+ font-size: 11px;
+}
+.cw-inspector-property-label {
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cw-inspector-property-control {
+ display: flex;
+ min-width: 0;
+ align-items: center;
+ justify-content: flex-end;
+}
+.cw-inspector-property-control
+ > :is(input:not([type="checkbox"], [type="color"]), select, textarea) {
+ width: 100%;
+ min-width: 0;
+ min-height: 30px;
+ padding: 0 8px;
+ border: 1px solid var(--inspector-control-border, #3a3a3a);
+ border-radius: 5px;
+ color: var(--inspector-text, #e5e5e5);
+ background: var(--inspector-control, #1d1d1d);
+ font-size: 11px;
+}
+.cw-inspector-color-control {
+ display: grid;
+ width: 100%;
+ min-width: 0;
+ min-height: 30px;
+ grid-template-columns: 22px minmax(0, 1fr);
+ align-items: center;
+ gap: 7px;
+ padding: 3px 7px;
+ border: 1px solid var(--inspector-control-border, #3a3a3a);
+ border-radius: 5px;
+ color: var(--inspector-text, #e5e5e5);
+ background: var(--inspector-control, #1d1d1d);
+}
+.cw-inspector-color-control:focus-within,
+.cw-inspector-property-control > :is(input, select, textarea):focus-visible {
+ border-color: var(--inspector-focus, #6e6e6e);
+ outline: 2px solid var(--inspector-focus, #6e6e6e);
+ outline-offset: 1px;
+}
+.cw-inspector-property-row .cw-inspector-color-control input[type="color"] {
+ width: 22px;
+ min-width: 22px;
+ height: 22px;
+ min-height: 22px;
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+ border: 0;
+ border-radius: 4px;
+ background: transparent;
+ cursor: pointer;
+}
+.cw-inspector-property-row
+ .cw-inspector-color-control
+ input[type="color"]:focus-visible {
+ outline: none;
+}
+.cw-inspector-color-value {
+ min-width: 0;
+ overflow: hidden;
+ font-size: 10px;
+ font-variant-numeric: tabular-nums;
+ text-align: right;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cw-inspector-property-row .cw-inspector-toggle {
+ appearance: none;
+ position: relative;
+ width: 28px;
+ min-width: 28px;
+ height: 16px;
+ margin: 0;
+ border: 1px solid var(--inspector-control-border, #4a4a4a);
+ border-radius: 999px;
+ background: var(--inspector-control, #292929);
+ cursor: pointer;
+ transition:
+ border-color 120ms ease,
+ background 120ms ease;
+}
+.cw-inspector-property-row .cw-inspector-toggle::after {
+ position: absolute;
+ top: 2px;
+ left: 2px;
+ width: 10px;
+ height: 10px;
+ border-radius: 50%;
+ background: var(--inspector-muted, #a9a9a9);
+ content: "";
+ transition:
+ background 120ms ease,
+ transform 120ms ease;
+}
+.cw-inspector-property-row .cw-inspector-toggle:checked {
+ border-color: var(--inspector-toggle-active, #d8d8d8);
+ background: var(--inspector-toggle-active, #d8d8d8);
+}
+.cw-inspector-property-row .cw-inspector-toggle:checked::after {
+ background: var(--inspector-toggle-thumb, #202020);
+ transform: translateX(12px);
+}
+.cw-inspector-property-row .cw-inspector-toggle:focus-visible {
+ outline: 2px solid var(--inspector-focus, #8c8c8c);
+ outline-offset: 2px;
+}
+.cw-inspector-property-row .cw-inspector-toggle:disabled,
+.cw-inspector-property-row:has(:disabled) {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
+.cw-inspector-compound-property {
+ display: grid;
+ min-width: 0;
+ gap: 6px;
+ margin-top: 4px;
+}
+.cw-inspector-compound-label {
+ color: var(--inspector-muted, #a5a5a5);
+ font-size: 10px;
+}
+
+@container (max-width: 190px) {
+ .cw-inspector-property-row {
+ grid-template-columns: minmax(0, 1fr);
+ gap: 4px;
+ padding: 2px 0;
+ }
+ .cw-inspector-property-control {
+ justify-content: stretch;
+ }
+ .cw-inspector-property-control > .cw-inspector-toggle {
+ margin-left: auto;
+ }
+}
diff --git a/src/canvas/model.ts b/src/canvas/model.ts
index e5a0594c5..fe7429e4d 100644
--- a/src/canvas/model.ts
+++ b/src/canvas/model.ts
@@ -192,6 +192,17 @@ export interface ExternalData {
current?: { versionId: string };
}
+/** One captured stage still. A saved item pins the registered project asset
+ * and reconstructs its preview from a view-only media URL; an unsaved item
+ * carries capture bytes the next save imports. */
+export interface StageStillItem {
+ /** Drawer-local identity used to select, preview, and publish one capture. */
+ id: string;
+ asset?: AssetRef;
+ src?: string;
+ capture?: string;
+}
+
export interface AgentNodeSettings {
modelConfigId?: string;
thinking: "auto" | "low" | "medium" | "high";
@@ -230,6 +241,8 @@ export interface CanvasNodeData extends Record {
inputFingerprint?: string;
editorDocumentId?: string;
editorRevision?: number;
+ /** Derived at projection from the director execution document; drives presentation filtering. */
+ stagePreview?: boolean;
};
settings?: GenerationSettings;
agentSettings?: AgentNodeSettings;
@@ -242,6 +255,10 @@ export interface CanvasNodeData extends Record {
layers?: LayerDocument;
imageCrop?: import("./imageCrop.ts").ImageCropState;
localStage?: LocalStageDocument;
+ /** Captured stage stills, oldest first. Pinned items carry the registered
+ * project asset and a view-only media URL; fresh captures carry dataURL
+ * bytes that the next save imports and registers as project assets. */
+ stills?: StageStillItem[];
taskDraft?: CanvasToolTask;
media?: { width?: number; height?: number; durationSeconds?: number };
}
diff --git a/src/canvas/mp4Export.ts b/src/canvas/mp4Export.ts
index 927a3b64d..5c73ea34d 100644
--- a/src/canvas/mp4Export.ts
+++ b/src/canvas/mp4Export.ts
@@ -5,13 +5,14 @@ export interface Mp4Options {
canvas: HTMLCanvasElement;
duration: number;
fps: number;
+ millisecondEndpoint?: boolean;
signal: AbortSignal;
draw: (time: number, frame: number) => Promise | void;
audio?: (start: number, end: number) => Promise;
progress: (fraction: number) => void;
}
export async function encodeMp4(options: Mp4Options): Promise {
- const { canvas, duration, fps, signal, draw, audio, progress } = options;
+ const { canvas, duration, fps, signal, draw, audio, progress, millisecondEndpoint } = options;
signal.throwIfAborted();
if (!(duration > 0) || !Number.isFinite(duration) || !(fps > 0))
throw new Error(tNow("errors.render.mp4Invalid"));
@@ -62,7 +63,9 @@ export async function encodeMp4(options: Mp4Options): Promise {
quality: new Quality({ bitrate: 128000 }),
})
: null;
- output.addVideoTrack(video, { frameRate: fps });
+ // Explicit frame-rate metadata makes the MP4 muxer round packet lengths to
+ // whole frames. Use its finer timebase when the final frame can be partial.
+ output.addVideoTrack(video, millisecondEndpoint ? undefined : { frameRate: fps });
if (sound) output.addAudioTrack(sound);
let cancellation: Promise | undefined;
const cancel = () => {
@@ -72,7 +75,9 @@ export async function encodeMp4(options: Mp4Options): Promise {
signal.addEventListener("abort", cancel, { once: true });
try {
await output.start();
- const frames = Math.ceil(duration * fps);
+ const frames = millisecondEndpoint
+ ? Math.ceil(Math.round(duration * 1000) * fps / 1000)
+ : Math.ceil(duration * fps);
let audioEnd = 0;
for (let frame = 0; frame < frames; frame++) {
signal.throwIfAborted();
diff --git a/src/canvas/stageDocument.ts b/src/canvas/stageDocument.ts
index b8aefa29e..08c22f218 100644
--- a/src/canvas/stageDocument.ts
+++ b/src/canvas/stageDocument.ts
@@ -1,6 +1,14 @@
+import {
+ normalizeStoryboardTime, storyboardBlockEnd, stageStoryboardIssue,
+ stageStoryboardIssueMessageKey, STORYBOARD_TIME_TOLERANCE,
+} from "./stageStoryboardRules.ts";
+
+export { normalizeStoryboardTime } from "./stageStoryboardRules.ts";
+
import type { Translate } from "../i18n/I18nProvider.tsx";
import { defaultTranslate } from "./assistantTranslate.ts";
import { parseStageMotion, type StageMotion } from "./stageMotion.ts";
+import type { AssetRef } from "../contracts/generated.ts";
/** Local previsualization format. V1 is migrated here, never in consumers. */
export interface Vector3Value {
@@ -13,10 +21,21 @@ export interface StageTransform {
rotation: Vector3Value;
scale: Vector3Value;
}
+export interface StageBezierTransition {
+ kind: "bezier";
+ controlPoints: [number, number, number, number];
+}
+export type StageTransition = { kind: "linear" } | StageBezierTransition;
+export type StageTransformTransitions = Partial<
+ Record<"position" | "rotation" | "scale", StageBezierTransition>
+>;
+export type StageTransformChannel = "position" | "rotation" | "scale";
export interface StageTransformFrame {
id: string;
time: number;
value: StageTransform;
+ keyedChannels?: StageTransformChannel[];
+ transitions?: StageTransformTransitions;
}
export interface StageMotionClip {
id: string;
@@ -24,23 +43,86 @@ export interface StageMotionClip {
duration: number;
motion: StageMotion;
}
+export type StageAssetRole = "character" | "scene";
+export type StageAssetFormat = "glb" | "gltf";
export interface StageObject extends StageTransform {
id: string;
- kind: "person" | "box" | "sphere";
+ kind:
+ | "person"
+ | "box"
+ | "sphere"
+ | "gltf"
+ | "cylinder"
+ | "cone"
+ | "pyramid"
+ | "torus"
+ | "plane"
+ | "capsule"
+ | "disk"
+ | "arc"
+ | "halfCylinder";
name: string;
color: string;
+ visible: boolean;
+ locked: boolean;
+ opacity: number;
keyframes: StageTransformFrame[];
motionClips: StageMotionClip[];
+ /** Registered asset identity. Omitted only while a local import is unsaved. */
+ asset?: AssetRef;
+ /** Browser URL used to reconstruct a preview; never sent to the backend. */
+ source?: string;
+ /** Registered PNG asset for the object-card thumbnail. */
+ thumbnailAsset?: AssetRef;
+ /** Unsaved PNG bytes; the backend turns these into thumbnailAsset on apply. */
+ thumbnailCapture?: string;
+ /** Browser URL projected from thumbnailAsset; never sent to the backend. */
+ thumbnailSource?: string;
+ role?: StageAssetRole;
+ format?: StageAssetFormat;
+ animationNames?: string[];
+ hasAnimation?: boolean;
}
export interface StageCamera {
position: Vector3Value;
target: Vector3Value;
fov: number;
+ /** Roll around the view axis in radians; 0 is level. */
+ roll?: number;
+}
+export type StageCameraEndpointKind = "camera" | "viewpoint";
+export interface StageCameraEndpoint {
+ /** Stable presentation identity derived from the owning camera rig. */
+ id: string;
+ cameraId: string;
+ kind: StageCameraEndpointKind;
+ position: Vector3Value;
+}
+export interface StageCameraVectorFrame {
+ id: string;
+ time: number;
+ value: Vector3Value;
+ transition?: StageBezierTransition;
+}
+export interface StageCameraNumberFrame {
+ id: string;
+ time: number;
+ value: number;
+ transition?: StageBezierTransition;
+}
+export interface StageCameraChannels {
+ position: StageCameraVectorFrame[];
+ target: StageCameraVectorFrame[];
+ up: StageCameraVectorFrame[];
+ focalLength: StageCameraNumberFrame[];
}
export interface StageCameraRig {
id: string;
name: string;
+ aspectRatio?: (typeof STAGE_RATIOS)[number];
pose: StageCamera;
+ /** Independent authoritative channels; keyframes remains a compatibility projection. */
+ channels?: StageCameraChannels;
keyframes: { id: string; time: number; value: StageCamera }[];
}
export interface StageShot {
@@ -49,19 +131,143 @@ export interface StageShot {
start: number;
duration: number;
}
-export const STAGE_RATIOS = ["16:9", "9:16", "1:1", "4:3", "3:4"] as const;
+export type StageEnvironmentPreset = "studio" | "warm-sunset" | "moonlit";
+export interface StageEnvironment {
+ preset: StageEnvironmentPreset;
+ groundColor: string;
+ groundVisible: boolean;
+ exposure: number;
+ backgroundAsset: AssetRef | null;
+}
+export type StageLightId = "hemisphere" | "key" | "fill";
+export interface StageLight {
+ id: StageLightId;
+ color: string;
+ intensity: number;
+ position: Vector3Value;
+ castShadow: boolean;
+}
+export const STAGE_RATIOS = [
+ "16:9",
+ "2.39:1",
+ "9:16",
+ "1:1",
+ "4:3",
+ "3:4",
+] as const;
+export const STAGE_FPS = [24, 25, 30, 50, 60] as const;
+const isStageFps = (value: unknown): value is LocalStageDocument["fps"] =>
+ STAGE_FPS.some((fps) => fps === value);
+function hasExternalGltfResources(value: unknown) {
+ if (!value || typeof value !== "object") return true;
+ const document = value as {
+ buffers?: unknown;
+ images?: unknown;
+ };
+ return [document.buffers, document.images].some(
+ (resources) =>
+ Array.isArray(resources) &&
+ resources.some(
+ (resource) =>
+ resource &&
+ typeof resource === "object" &&
+ "uri" in resource &&
+ typeof resource.uri === "string" &&
+ !resource.uri.startsWith("data:"),
+ ),
+ );
+}
+const isGltfDocument = (value: unknown) => {
+ const asset = (value as { asset?: unknown })?.asset;
+ return (
+ !!value &&
+ typeof value === "object" &&
+ !!asset &&
+ typeof asset === "object" &&
+ "version" in asset
+ );
+};
+export interface StageAssetProbe {
+ format: StageAssetFormat;
+ /** Whether the parsed document references external buffers or images. */
+ external: boolean;
+}
+/**
+ * Container and self-containment come from the actual bytes, matching the
+ * backend probe. Returns "corrupt" when a GLB header is valid but its
+ * embedded JSON chunk is missing, unparsable, or not a glTF document, and
+ * undefined when the bytes are no stage model at all.
+ */
+export function probeStageAsset(
+ buffer: ArrayBuffer,
+): StageAssetProbe | "corrupt" | undefined {
+ const bytes = new Uint8Array(buffer);
+ const view = new DataView(buffer);
+ const glbVersion = () => view.getUint32(4, true);
+ const declaredLength = () => view.getUint32(8, true);
+ const isGlbMagic =
+ bytes.length >= 4 &&
+ bytes[0] === 0x67 &&
+ bytes[1] === 0x6c &&
+ bytes[2] === 0x54 &&
+ bytes[3] === 0x46;
+ const isGlb =
+ bytes.length >= 12 &&
+ isGlbMagic &&
+ glbVersion() === 2 &&
+ declaredLength() >= 12 &&
+ declaredLength() <= bytes.length;
+ if (isGlbMagic && !isGlb) return undefined;
+ if (isGlb) {
+ let offset = 12;
+ while (offset + 8 <= bytes.length) {
+ const length = view.getUint32(offset, true);
+ if (view.getUint32(offset + 4, true) === 0x4e4f534a) {
+ try {
+ const document: unknown = JSON.parse(
+ new TextDecoder().decode(
+ bytes.subarray(offset + 8, offset + 8 + length),
+ ),
+ );
+ if (!isGltfDocument(document)) return "corrupt";
+ return {
+ format: "glb",
+ external: hasExternalGltfResources(document),
+ };
+ } catch {
+ return "corrupt";
+ }
+ }
+ offset += 8 + length;
+ }
+ return "corrupt";
+ }
+ try {
+ const document: unknown = JSON.parse(new TextDecoder().decode(bytes));
+ if (!isGltfDocument(document)) return undefined;
+ return {
+ format: "gltf",
+ external: hasExternalGltfResources(document),
+ };
+ } catch {
+ return undefined;
+ }
+}
export interface LocalStageDocument {
format: "opendirector-local-stage";
version: 2;
background: string;
grid: boolean;
duration: number;
+ fps: (typeof STAGE_FPS)[number];
aspectRatio: (typeof STAGE_RATIOS)[number];
cameras: StageCameraRig[];
activeCameraId: string;
cameraSource: "camera" | "storyboard";
shots: StageShot[];
objects: StageObject[];
+ environment: StageEnvironment;
+ lights: StageLight[];
}
export interface StageSampleObject extends StageObject {
motion?: StageMotion;
@@ -72,6 +278,7 @@ export interface StageSample {
cameraId: string;
objects: StageSampleObject[];
}
+export const STAGE_ASSET_MAX_BYTES = 100 * 1024 * 1024;
const record = (v: unknown): v is Record =>
typeof v === "object" && v !== null && !Array.isArray(v);
const finite = (v: unknown): v is number =>
@@ -82,8 +289,78 @@ const nonempty = (v: unknown): v is string =>
typeof v === "string" && !!v.trim();
const color = (v: unknown): v is string =>
typeof v === "string" && /^#[0-9a-f]{6}$/i.test(v);
+const stageLightIds = ["hemisphere", "key", "fill"] as const;
+const defaultStageEnvironment = (): StageEnvironment => ({
+ preset: "studio",
+ groundColor: "#181818",
+ groundVisible: true,
+ exposure: 1,
+ backgroundAsset: null,
+});
+const defaultStageLights = (): StageLight[] => [
+ { id: "hemisphere", color: "#ffffff", intensity: 2.4, position: { x: 0, y: 1, z: 0 }, castShadow: false },
+ { id: "key", color: "#ffffff", intensity: 3.5, position: { x: 5, y: 10, z: 6 }, castShadow: true },
+ { id: "fill", color: "#ffffff", intensity: 1.6, position: { x: -6, y: 5, z: -5 }, castShadow: false },
+];
+const assetRef = (v: unknown): v is AssetRef =>
+ record(v) &&
+ nonempty(v.assetId) &&
+ typeof v.revision === "number" &&
+ Number.isInteger(v.revision) &&
+ v.revision >= 1 &&
+ typeof v.fingerprint === "string" &&
+ /^sha256:[0-9a-f]{64}$/.test(v.fingerprint) &&
+ v.kind === "file";
+const imageAssetRef = (v: unknown): v is AssetRef =>
+ record(v) &&
+ nonempty(v.assetId) &&
+ typeof v.revision === "number" &&
+ Number.isInteger(v.revision) &&
+ v.revision >= 1 &&
+ typeof v.fingerprint === "string" &&
+ /^sha256:[0-9a-f]{64}$/.test(v.fingerprint) &&
+ v.kind === "image";
+const imageDataUrl = (v: unknown): v is string =>
+ typeof v === "string" && /^data:image\/png;base64,[A-Za-z0-9+/]+=*$/.test(v);
const sameVector = (a: Vector3Value, b: Vector3Value) =>
a.x === b.x && a.y === b.y && a.z === b.z;
+const LINEAR_TRANSITION: StageTransition = { kind: "linear" };
+const transition = (v: unknown): StageBezierTransition | undefined => {
+ if (v == null) return undefined;
+ if (
+ !record(v) ||
+ v.kind !== "bezier" ||
+ !Array.isArray(v.controlPoints) ||
+ v.controlPoints.length !== 4 ||
+ !v.controlPoints.every((point) => finite(point) && point >= 0 && point <= 1)
+ )
+ throw new Error(defaultTranslate("editors.stage.error.invalidKeyframes"));
+ return {
+ kind: "bezier",
+ controlPoints: [...v.controlPoints] as [number, number, number, number],
+ };
+};
+const transformTransitions = (v: unknown): StageTransformTransitions | undefined => {
+ if (v == null) return undefined;
+ if (!record(v))
+ throw new Error(defaultTranslate("editors.stage.error.invalidKeyframes"));
+ const parsed = Object.fromEntries(
+ (["position", "rotation", "scale"] as const).flatMap((channel) => {
+ const value = transition(v[channel]);
+ return value ? [[channel, value]] : [];
+ }),
+ ) as StageTransformTransitions;
+ return Object.keys(parsed).length ? parsed : undefined;
+};
+const keyedChannels = (v: unknown): StageTransformChannel[] | undefined => {
+ if (v == null) return undefined;
+ if (
+ !Array.isArray(v) ||
+ !v.every((channel) => channel === "position" || channel === "rotation" || channel === "scale")
+ )
+ throw new Error(defaultTranslate("editors.stage.error.invalidKeyframes"));
+ return [...new Set(v)];
+};
function parseTransform(
v: unknown,
t: Translate = defaultTranslate,
@@ -115,10 +392,96 @@ function parseCamera(
!finite(v.fov) ||
v.fov <= 0 ||
v.fov >= 180 ||
- sameVector(v.position, v.target)
+ sameVector(v.position, v.target) ||
+ (v.roll !== undefined &&
+ (!finite(v.roll) || Math.abs(v.roll) > Math.PI))
)
throw new Error(t("editors.stage.error.invalidCamera"));
- return { position: { ...v.position }, target: { ...v.target }, fov: v.fov };
+ return {
+ position: { ...v.position },
+ target: { ...v.target },
+ fov: v.fov,
+ ...(v.roll !== undefined && v.roll !== 0 ? { roll: v.roll } : {}),
+ };
+}
+const defaultCameraUp = (): Vector3Value => ({ x: 0, y: 1, z: 0 });
+const cameraFocalLength = (camera: StageCamera) => camera.fov;
+function cameraChannelsFromKeyframes(
+ keyframes: { id: string; time: number; value: StageCamera }[],
+): StageCameraChannels {
+ return {
+ position: keyframes.map(({ id, time, value }) => ({ id, time, value: { ...value.position } })),
+ target: keyframes.map(({ id, time, value }) => ({ id, time, value: { ...value.target } })),
+ up: keyframes.map(({ id, time }) => ({ id, time, value: defaultCameraUp() })),
+ focalLength: keyframes.map(({ id, time, value }) => ({ id, time, value: cameraFocalLength(value) })),
+ };
+}
+function cameraChannelsOf(camera: StageCameraRig): StageCameraChannels {
+ return camera.channels ?? cameraChannelsFromKeyframes(camera.keyframes);
+}
+function parseCameraChannels(
+ raw: unknown,
+ legacy: { id: string; time: number; value: StageCamera }[],
+ t: Translate,
+): StageCameraChannels {
+ if (raw === undefined) return cameraChannelsFromKeyframes(legacy);
+ if (!record(raw)) throw new Error(t("editors.stage.error.invalidCamera"));
+ const position = frames(raw.position, undefined, (v) => {
+ if (!vector(v)) throw new Error(t("editors.stage.error.invalidCamera"));
+ return { ...v };
+ }, t, (frame) => {
+ const value = transition(frame.transition);
+ return value ? { transition: value } : {};
+ });
+ const target = frames(raw.target, undefined, (v) => {
+ if (!vector(v)) throw new Error(t("editors.stage.error.invalidCamera"));
+ return { ...v };
+ }, t, (frame) => {
+ const value = transition(frame.transition);
+ return value ? { transition: value } : {};
+ });
+ const up = frames(raw.up, undefined, (v) => {
+ if (!vector(v)) throw new Error(t("editors.stage.error.invalidCamera"));
+ return { ...v };
+ }, t, (frame) => {
+ const value = transition(frame.transition);
+ return value ? { transition: value } : {};
+ });
+ const focalLength = frames(raw.focalLength, undefined, (v) => {
+ if (!finite(v) || v <= 0) throw new Error(t("editors.stage.error.invalidCamera"));
+ return v;
+ }, t, (frame) => {
+ const value = transition(frame.transition);
+ return value ? { transition: value } : {};
+ });
+ return { position, target, up, focalLength };
+}
+function channelAt(base: T, frames: { time: number; value: T; transition?: StageBezierTransition }[], time: number, mix: (a: T, b: T, amount: number) => T): T {
+ if (!frames.length) return base;
+ const left = [...frames].reverse().find((f) => f.time <= time) ?? frames[0]!;
+ const right = frames.find((f) => f.time >= time) ?? frames.at(-1)!;
+ return mix(left.value, right.value, left.time === right.time ? 0 : transitionProgress(left.transition ?? LINEAR_TRANSITION, (time - left.time) / (right.time - left.time)));
+}
+function cameraKeyframesFromChannels(
+ pose: StageCamera,
+ channels: StageCameraChannels,
+): { id: string; time: number; value: StageCamera }[] {
+ const times = [...new Set([
+ ...channels.position.map((f) => f.time),
+ ...channels.target.map((f) => f.time),
+ ...channels.up.map((f) => f.time),
+ ...channels.focalLength.map((f) => f.time),
+ ])].sort((a, b) => a - b);
+ return times.map((time, index) => ({
+ id: channels.position.find((f) => f.time === time)?.id ?? `camera-channel-${index}`,
+ time,
+ value: {
+ position: channelAt(pose.position, channels.position, time, mixVector),
+ target: channelAt(pose.target, channels.target, time, mixVector),
+ fov: channelAt(pose.fov, channels.focalLength, time, lerp),
+ ...(pose.roll ? { roll: pose.roll } : {}),
+ },
+ }));
}
export function defaultStageCamera(): StageCamera {
return {
@@ -127,6 +490,46 @@ export function defaultStageCamera(): StageCamera {
fov: 45,
};
}
+
+const LEGACY_DEFAULT_PERSON_NAMES = new Set([
+ "\u4eba\u7269 1",
+ "\u4eba\u72691",
+ "Person 1",
+]);
+
+/** The built-in default person's color before stages started empty; a person
+ * freshly placed from the generic template carries the template color
+ * instead, so the label migration can leave new placements alone. */
+const LEGACY_DEFAULT_PERSON_COLOR = "#a09af9";
+
+/**
+ * Keep stages created before the default-person label change readable in the
+ * editor without rewriting arbitrary user-renamed characters. Only the first
+ * person with one of the generated legacy names and the legacy default color
+ * is eligible for normalization; a subject the user placed and named
+ * themselves keeps its name across reopens.
+ */
+export function normalizeLegacyDefaultPersonName(
+ stage: LocalStageDocument,
+ defaultName: string,
+): LocalStageDocument {
+ const index = stage.objects.findIndex((object) => object.kind === "person");
+ const person = index >= 0 ? stage.objects[index] : undefined;
+ if (
+ !person ||
+ person.name === defaultName ||
+ person.color !== LEGACY_DEFAULT_PERSON_COLOR ||
+ !LEGACY_DEFAULT_PERSON_NAMES.has(person.name)
+ )
+ return stage;
+ return {
+ ...stage,
+ objects: stage.objects.map((object, objectIndex) =>
+ objectIndex === index ? { ...object, name: defaultName } : object,
+ ),
+ };
+}
+
export function createLocalStage(
t: Translate = defaultTranslate,
): LocalStageDocument {
@@ -136,39 +539,34 @@ export function createLocalStage(
background: "#151923",
grid: true,
duration: 6,
+ fps: 30,
aspectRatio: "16:9",
cameras: [
{
id: "camera-1",
name: t("editors.stage.defaultCameraName"),
+ aspectRatio: "16:9",
pose: defaultStageCamera(),
+ channels: cameraChannelsFromKeyframes([]),
keyframes: [],
},
],
activeCameraId: "camera-1",
cameraSource: "camera",
shots: [],
- objects: [
- {
- id: crypto.randomUUID(),
- kind: "person",
- name: t("editors.stage.defaultPersonName"),
- color: "#a09af9",
- position: { x: 0, y: 0, z: 0 },
- rotation: { x: 0, y: 0, z: 0 },
- scale: { x: 1, y: 1, z: 1 },
- keyframes: [],
- motionClips: [],
- },
- ],
+ // Stages start empty; subjects appear through explicit placement.
+ objects: [],
+ environment: defaultStageEnvironment(),
+ lights: defaultStageLights(),
};
}
-function frames(
+function frames>(
raw: unknown,
- duration: number,
+ duration: number | undefined,
parse: (v: unknown) => T,
t: Translate = defaultTranslate,
-): { id: string; time: number; value: T }[] {
+ extras: (frame: Record) => E = (() => ({} as E)),
+): ({ id: string; time: number; value: T } & E)[] {
if (!Array.isArray(raw))
throw new Error(t("editors.stage.error.invalidKeyframes"));
const ids = new Set(),
@@ -181,19 +579,19 @@ function frames(
ids.has(v.id) ||
!finite(v.time) ||
v.time < 0 ||
- v.time > duration ||
+ (duration !== undefined && v.time > duration) ||
times.has(v.time)
)
throw new Error(t("editors.stage.error.invalidKeyframeTime"));
ids.add(v.id);
times.add(v.time);
- return { id: v.id, time: v.time, value: parse(v.value) };
+ return { id: v.id, time: v.time, value: parse(v.value), ...extras(v) };
})
.sort((a, b) => a.time - b.time);
}
function intervals(
items: T[],
- duration: number,
+ duration: number | undefined,
label: string,
t: Translate = defaultTranslate,
): T[] {
@@ -207,7 +605,7 @@ function intervals(
!finite(v.duration) ||
v.start < 0 ||
v.duration <= 0 ||
- v.start + v.duration > duration + 1e-8
+ (duration !== undefined && v.start + v.duration > duration + 1e-8)
)
throw new Error(t("editors.stage.error.intervalInvalid", { label }));
if (i && sorted[i - 1]!.start + sorted[i - 1]!.duration > v.start + 1e-8)
@@ -252,9 +650,12 @@ function migrateV1(
...v,
version: 2,
aspectRatio: "16:9",
+ fps: 30,
activeCameraId: "camera-1",
cameraSource: "camera",
shots: [],
+ environment: defaultStageEnvironment(),
+ lights: defaultStageLights(),
cameras: [
{
id: "camera-1",
@@ -296,13 +697,40 @@ function migrateV1(
}),
};
}
+export function parseImportedStageValue(
+ input: unknown,
+ t: Translate = defaultTranslate,
+): LocalStageDocument {
+ return parseStageValue(input, t, "import");
+}
+
export function parseLocalStageValue(
input: unknown,
t: Translate = defaultTranslate,
): LocalStageDocument {
+ return parseStageValue(input, t, "stored");
+}
+
+function parseStageValue(input: unknown, t: Translate, source: "stored" | "import"): LocalStageDocument {
let v = input;
if (record(v) && v.format === "opendirector-local-stage" && v.version === 1)
v = migrateV1(v, t);
+ if (
+ record(v) &&
+ v.format === "opendirector-local-stage" &&
+ v.version === 2 &&
+ v.fps === undefined
+ )
+ v = { ...v, fps: 30 };
+ if (record(v) && v.format === "opendirector-local-stage" && v.version === 2) {
+ v = {
+ ...v,
+ environment: record(v.environment)
+ ? { ...defaultStageEnvironment(), ...v.environment }
+ : defaultStageEnvironment(),
+ lights: v.lights ?? defaultStageLights(),
+ };
+ }
if (
!record(v) ||
v.format !== "opendirector-local-stage" ||
@@ -311,6 +739,7 @@ export function parseLocalStageValue(
typeof v.grid !== "boolean" ||
!finite(v.duration) ||
v.duration <= 0 ||
+ !isStageFps(v.fps) ||
!Array.isArray(v.objects) ||
!Array.isArray(v.cameras) ||
!Array.isArray(v.shots) ||
@@ -320,30 +749,134 @@ export function parseLocalStageValue(
!["camera", "storyboard"].includes(String(v.cameraSource))
)
throw new Error(t("editors.stage.error.invalidDocument"));
+ const environment = record(v.environment) &&
+ ["studio", "warm-sunset", "moonlit"].includes(String(v.environment.preset)) &&
+ color(v.environment.groundColor) &&
+ typeof v.environment.groundVisible === "boolean" &&
+ finite(v.environment.exposure) &&
+ v.environment.exposure >= 0 && v.environment.exposure <= 4 &&
+ (v.environment.backgroundAsset === null || imageAssetRef(v.environment.backgroundAsset))
+ ? {
+ preset: v.environment.preset as StageEnvironmentPreset,
+ groundColor: v.environment.groundColor,
+ groundVisible: v.environment.groundVisible,
+ exposure: v.environment.exposure,
+ backgroundAsset: v.environment.backgroundAsset as AssetRef | null,
+ }
+ : (() => { throw new Error(t("editors.stage.error.invalidDocument")); })();
+ if (!Array.isArray(v.lights) || v.lights.length !== 3)
+ throw new Error(t("editors.stage.error.invalidDocument"));
+ const lightIds = new Set();
+ const lights: StageLight[] = v.lights.map((raw) => {
+ if (!record(raw) || !stageLightIds.includes(raw.id as StageLightId) || lightIds.has(String(raw.id)) ||
+ !color(raw.color) || !finite(raw.intensity) || raw.intensity < 0 || raw.intensity > 10 ||
+ !vector(raw.position) || typeof raw.castShadow !== "boolean" ||
+ (raw.id === "hemisphere" && raw.castShadow))
+ throw new Error(t("editors.stage.error.invalidDocument"));
+ lightIds.add(String(raw.id));
+ return {
+ id: raw.id as StageLightId,
+ color: raw.color,
+ intensity: raw.intensity,
+ position: { ...raw.position },
+ castShadow: raw.castShadow,
+ };
+ });
+ if (lightIds.size !== 3) throw new Error(t("editors.stage.error.invalidDocument"));
const duration = v.duration,
ids = new Set(),
cameraIds = new Set();
const objects: StageObject[] = v.objects.map((o) => {
+ const rawObject = record(o) ? o : undefined;
+ const imported = rawObject?.kind === "gltf";
+ const importedAsset =
+ imported && assetRef(rawObject?.asset) ? rawObject.asset : undefined;
+ const importedSource =
+ imported && typeof rawObject?.source === "string" && rawObject.source.trim()
+ ? rawObject.source
+ : undefined;
+ const thumbnailAsset =
+ rawObject && imageAssetRef(rawObject.thumbnailAsset)
+ ? rawObject.thumbnailAsset
+ : undefined;
+ const thumbnailCapture = imageDataUrl(rawObject?.thumbnailCapture)
+ ? rawObject.thumbnailCapture
+ : undefined;
+ const thumbnailSource = nonempty(rawObject?.thumbnailSource)
+ ? rawObject.thumbnailSource
+ : undefined;
+ const animationNames =
+ imported && Array.isArray(rawObject?.animationNames)
+ ? rawObject.animationNames.filter((name): name is string => nonempty(name))
+ : [];
if (
!record(o) ||
!nonempty(o.id) ||
ids.has(o.id) ||
- !["person", "box", "sphere"].includes(String(o.kind)) ||
+ ![
+ "person",
+ "box",
+ "sphere",
+ "gltf",
+ "cylinder",
+ "cone",
+ "pyramid",
+ "torus",
+ "plane",
+ "capsule",
+ "disk",
+ "arc",
+ "halfCylinder",
+ ].includes(String(o.kind)) ||
typeof o.name !== "string" ||
!color(o.color) ||
- !Array.isArray(o.motionClips)
+ (o.visible !== undefined && typeof o.visible !== "boolean") ||
+ (o.locked !== undefined && typeof o.locked !== "boolean") ||
+ (o.opacity !== undefined && (!finite(o.opacity) || o.opacity < 0 || o.opacity > 1)) ||
+ !Array.isArray(o.motionClips) ||
+ (rawObject?.thumbnailAsset != null && !thumbnailAsset) ||
+ (rawObject?.thumbnailCapture != null && !thumbnailCapture) ||
+ (rawObject?.thumbnailSource != null && !thumbnailSource) ||
+ (imported &&
+ ((!importedAsset && !importedSource) ||
+ !["character", "scene"].includes(String(rawObject?.role)) ||
+ !["glb", "gltf"].includes(String(rawObject?.format)) ||
+ !Array.isArray(rawObject?.animationNames) ||
+ animationNames.length !== rawObject?.animationNames.length ||
+ typeof rawObject?.hasAnimation !== "boolean" ||
+ rawObject.hasAnimation !== Boolean(animationNames.length)))
)
throw new Error(t("editors.stage.error.invalidObject"));
ids.add(o.id);
- if (o.kind !== "person" && o.motionClips.length)
+ if (o.kind !== "person" && o.kind !== "gltf" && o.motionClips.length)
throw new Error(t("editors.stage.error.jointMotionPerson"));
+ if (imported && o.role === "scene" && o.motionClips.length)
+ throw new Error(t("editors.stage.error.importedSceneMotion"));
+ if (imported && !o.hasAnimation && o.motionClips.length)
+ throw new Error(t("editors.stage.error.importedMotionUnavailable"));
return {
id: o.id,
kind: o.kind as StageObject["kind"],
name: o.name,
color: o.color,
+ visible: o.visible ?? true,
+ locked: o.locked ?? false,
+ opacity: o.opacity ?? 1,
...parseTransform(o, t),
- keyframes: frames(o.keyframes, duration, (v) => parseTransform(v, t), t),
+ keyframes: frames(
+ o.keyframes,
+ undefined,
+ (v) => parseTransform(v, t),
+ t,
+ (frame) => {
+ const channels = keyedChannels(frame.keyedChannels);
+ const transitions = transformTransitions(frame.transitions);
+ return {
+ ...(channels ? { keyedChannels: channels } : {}),
+ ...(transitions ? { transitions } : {}),
+ };
+ },
+ ),
motionClips: intervals(
o.motionClips.map((c) => {
if (!record(c))
@@ -355,10 +888,23 @@ export function parseLocalStageValue(
motion: parseStageMotion(c.motion),
};
}),
- duration,
+ undefined,
t("editors.stage.label.motionClip"),
t,
),
+ ...(importedAsset ? { asset: { ...importedAsset } } : {}),
+ ...(importedSource ? { source: importedSource } : {}),
+ ...(thumbnailAsset ? { thumbnailAsset: { ...thumbnailAsset } } : {}),
+ ...(thumbnailCapture ? { thumbnailCapture } : {}),
+ ...(thumbnailSource ? { thumbnailSource } : {}),
+ ...(imported
+ ? {
+ role: o.role as StageAssetRole,
+ format: o.format as StageAssetFormat,
+ animationNames: [...animationNames],
+ hasAnimation: o.hasAnimation as boolean,
+ }
+ : {}),
};
});
const cameras: StageCameraRig[] = v.cameras.map((c) => {
@@ -370,61 +916,97 @@ export function parseLocalStageValue(
)
throw new Error(t("editors.stage.error.invalidCameraId"));
cameraIds.add(c.id);
+ const pose = parseCamera(c.pose, t);
+ const keyframes = frames(c.keyframes, undefined, (v) => parseCamera(v, t), t);
+ const channels = parseCameraChannels(c.channels, keyframes, t);
+ const aspectRatio = c.aspectRatio ?? v.aspectRatio;
+ if (!STAGE_RATIOS.includes(aspectRatio as LocalStageDocument["aspectRatio"]))
+ throw new Error(t("editors.stage.error.invalidCamera"));
return {
id: c.id,
name: c.name,
- pose: parseCamera(c.pose, t),
- keyframes: frames(c.keyframes, duration, (v) => parseCamera(v, t), t),
+ aspectRatio: aspectRatio as LocalStageDocument["aspectRatio"],
+ pose,
+ channels,
+ keyframes: c.channels === undefined ? keyframes : cameraKeyframesFromChannels(pose, channels),
};
});
if (!cameras.length || !cameraIds.has(v.activeCameraId as string))
throw new Error(t("editors.stage.error.cameraRequired"));
- const shots = intervals(
- v.shots.map((s) => {
- if (!record(s) || !cameraIds.has(s.cameraId as string))
- throw new Error(t("editors.stage.error.shotCamera"));
- return {
- id: s.id as string,
- cameraId: s.cameraId as string,
- start: s.start as number,
- duration: s.duration as number,
- };
- }),
- duration,
- t("editors.stage.label.shot"),
- t,
- );
+ const shots: StageShot[] = v.shots.map((shot) => {
+ if (!record(shot) || !nonempty(shot.id) || !finite(shot.start) || shot.start < 0)
+ throw new Error(t(stageStoryboardIssueMessageKey("storyboard_block_invalid")));
+ if (!finite(shot.duration) || shot.duration <= 0)
+ throw new Error(t(stageStoryboardIssueMessageKey("storyboard_duration_invalid")));
+ if (typeof shot.cameraId !== "string" || !cameraIds.has(shot.cameraId))
+ throw new Error(t(stageStoryboardIssueMessageKey("storyboard_camera_unknown")));
+ return { id: shot.id, cameraId: shot.cameraId, start: shot.start, duration: shot.duration };
+ });
+ const issue = stageStoryboardIssue({ shots, duration, cameras });
+ if (issue && source === "import")
+ throw new Error(t(stageStoryboardIssueMessageKey(issue)));
+ if (issue)
+ intervals([...shots], duration, t("editors.stage.label.shot"), t);
+ if (shots.some((shot) => shot.start + shot.duration > duration + STORYBOARD_TIME_TOLERANCE))
+ throw new Error(t(stageStoryboardIssueMessageKey("storyboard_exceeds_duration")));
return {
format: "opendirector-local-stage",
version: 2,
background: v.background,
grid: v.grid,
duration,
+ fps: v.fps,
aspectRatio: v.aspectRatio as LocalStageDocument["aspectRatio"],
activeCameraId: v.activeCameraId as string,
cameraSource: v.cameraSource as LocalStageDocument["cameraSource"],
objects,
cameras,
shots,
+ environment,
+ lights,
};
}
+/** Gesture values round-trip through the renderer's spherical camera math,
+ * so an unchanged pose can still differ by float noise; an edit comparison
+ * must treat that as unchanged while parseCamera keeps exact validation. */
+const closeVector = (a: Vector3Value, b: Vector3Value) =>
+ Math.abs(a.x - b.x) < 1e-9 &&
+ Math.abs(a.y - b.y) < 1e-9 &&
+ Math.abs(a.z - b.z) < 1e-9;
const sameTransform = (a: StageTransform, b: StageTransform) =>
- sameVector(a.position, b.position) &&
- sameVector(a.rotation, b.rotation) &&
- sameVector(a.scale, b.scale);
+ closeVector(a.position, b.position) &&
+ closeVector(a.rotation, b.rotation) &&
+ closeVector(a.scale, b.scale);
const sameCamera = (a: StageCamera, b: StageCamera) =>
- sameVector(a.position, b.position) &&
- sameVector(a.target, b.target) &&
- a.fov === b.fov;
+ closeVector(a.position, b.position) &&
+ closeVector(a.target, b.target) &&
+ Math.abs(a.fov - b.fov) < 1e-9 &&
+ (a.roll ?? 0) === (b.roll ?? 0);
+const sameCameraChannels = (a: StageCameraChannels, b: StageCameraChannels) =>
+ sameFrames(a.position, b.position, sameVector) &&
+ sameFrames(a.target, b.target, sameVector) &&
+ sameFrames(a.up, b.up, sameVector) &&
+ sameFrames(a.focalLength, b.focalLength, (x, y) => Math.abs(x - y) < 1e-9);
+const sameAsset = (a: AssetRef | undefined, b: AssetRef | undefined) =>
+ a === b ||
+ (!!a &&
+ !!b &&
+ a.assetId === b.assetId &&
+ a.revision === b.revision &&
+ a.fingerprint === b.fingerprint &&
+ a.kind === b.kind);
const sameFrames = (
- a: { id: string; time: number; value: T }[],
- b: { id: string; time: number; value: T }[],
+ a: ({ id: string; time: number; value: T; keyedChannels?: StageTransformChannel[]; transition?: StageBezierTransition; transitions?: StageTransformTransitions })[],
+ b: ({ id: string; time: number; value: T; keyedChannels?: StageTransformChannel[]; transition?: StageBezierTransition; transitions?: StageTransformTransitions })[],
same: (a: T, b: T) => boolean,
) =>
a.length === b.length &&
a.every(
(f, i) =>
- f.id === b[i]!.id && f.time === b[i]!.time && same(f.value, b[i]!.value),
+ f.id === b[i]!.id && f.time === b[i]!.time && same(f.value, b[i]!.value) &&
+ (f.keyedChannels ?? []).join("\u0000") === (b[i]!.keyedChannels ?? []).join("\u0000") &&
+ sameTransition(f.transition, b[i]!.transition) &&
+ sameTransformTransitions(f.transitions, b[i]!.transitions),
);
export function sameLocalStage(
a: LocalStageDocument | undefined,
@@ -437,9 +1019,22 @@ export function sameLocalStage(
a.background === b.background &&
a.grid === b.grid &&
a.duration === b.duration &&
+ a.fps === b.fps &&
a.aspectRatio === b.aspectRatio &&
a.activeCameraId === b.activeCameraId &&
a.cameraSource === b.cameraSource &&
+ a.environment.preset === b.environment.preset &&
+ a.environment.groundColor === b.environment.groundColor &&
+ a.environment.groundVisible === b.environment.groundVisible &&
+ a.environment.exposure === b.environment.exposure &&
+ sameAsset(a.environment.backgroundAsset ?? undefined, b.environment.backgroundAsset ?? undefined) &&
+ a.lights.length === b.lights.length &&
+ a.lights.every((light, i) => {
+ const other = b.lights[i]!;
+ return light.id === other.id && light.color === other.color &&
+ light.intensity === other.intensity && light.castShadow === other.castShadow &&
+ sameVector(light.position, other.position);
+ }) &&
a.objects.length === b.objects.length &&
a.objects.every((o, i) => {
const p = b.objects[i]!;
@@ -448,6 +1043,15 @@ export function sameLocalStage(
o.name === p.name &&
o.kind === p.kind &&
o.color === p.color &&
+ o.visible === p.visible &&
+ o.locked === p.locked &&
+ o.opacity === p.opacity &&
+ sameAsset(o.asset, p.asset) &&
+ o.role === p.role &&
+ o.format === p.format &&
+ o.hasAnimation === p.hasAnimation &&
+ (o.animationNames ?? []).join("\u0000") ===
+ (p.animationNames ?? []).join("\u0000") &&
sameTransform(o, p) &&
sameFrames(o.keyframes, p.keyframes, sameTransform) &&
o.motionClips.length === p.motionClips.length &&
@@ -470,7 +1074,9 @@ export function sameLocalStage(
return (
c.id === d.id &&
c.name === d.name &&
+ (c.aspectRatio ?? a.aspectRatio) === (d.aspectRatio ?? b.aspectRatio) &&
sameCamera(c.pose, d.pose) &&
+ sameCameraChannels(cameraChannelsOf(c), cameraChannelsOf(d)) &&
sameFrames(c.keyframes, d.keyframes, sameCamera)
);
}) &&
@@ -487,6 +1093,27 @@ export function sameLocalStage(
);
}
const lerp = (a: number, b: number, t: number) => a + (b - a) * t;
+const sameTransition = (a: StageBezierTransition | undefined, b: StageBezierTransition | undefined) =>
+ a === b || (!!a && !!b && a.controlPoints.every((value, index) => value === b.controlPoints[index]));
+const sameTransformTransitions = (a: StageTransformTransitions | undefined, b: StageTransformTransitions | undefined) =>
+ (["position", "rotation", "scale"] as const).every((channel) => sameTransition(a?.[channel], b?.[channel]));
+const cubic = (a: number, b: number, t: number) => {
+ const inverse = 1 - t;
+ return 3 * inverse * inverse * t * a + 3 * inverse * t * t * b + t * t * t;
+};
+export function transitionProgress(transition: StageTransition, progress: number): number {
+ const target = Math.max(0, Math.min(1, progress));
+ if (transition.kind === "linear") return target;
+ const [x1, y1, x2, y2] = transition.controlPoints;
+ let low = 0;
+ let high = 1;
+ for (let index = 0; index < 20; index += 1) {
+ const midpoint = (low + high) / 2;
+ if (cubic(x1, x2, midpoint) < target) low = midpoint;
+ else high = midpoint;
+ }
+ return cubic(y1, y2, (low + high) / 2);
+}
const mixVector = (
a: Vector3Value,
b: Vector3Value,
@@ -498,7 +1125,7 @@ const mixVector = (
});
function sample(
base: T,
- frames: { time: number; value: T }[],
+ frames: { time: number; value: T; transition?: StageBezierTransition }[],
time: number,
mix: (a: T, b: T, t: number) => T,
): T {
@@ -510,7 +1137,7 @@ function sample(
right.value,
left.time === right.time
? 0
- : (time - left.time) / (right.time - left.time),
+ : transitionProgress(left.transition ?? LINEAR_TRANSITION, (time - left.time) / (right.time - left.time)),
);
}
export function sampleStageCamera(
@@ -521,69 +1148,264 @@ export function sampleStageCamera(
): StageCamera {
const c = stage.cameras.find((c) => c.id === id);
if (!c) throw new Error(t("editors.stage.error.cameraMissing"));
- return sample(c.pose, c.keyframes, time, (a, b, t) => ({
- position: mixVector(a.position, b.position, t),
- target: mixVector(a.target, b.target, t),
- fov: lerp(a.fov, b.fov, t),
- }));
+ const channels = cameraChannelsOf(c);
+ return {
+ position: channelAt(c.pose.position, channels.position, time, mixVector),
+ target: channelAt(c.pose.target, channels.target, time, mixVector),
+ fov: channelAt(c.pose.fov, channels.focalLength, time, lerp),
+ ...(c.pose.roll ? { roll: c.pose.roll } : {}),
+ };
+}
+export function stageCameraEndpointId(
+ cameraId: string,
+ kind: StageCameraEndpointKind,
+): string {
+ return `${cameraId}:${kind}`;
+}
+export function sampleStageCameraEndpoint(
+ stage: LocalStageDocument,
+ cameraId: string,
+ kind: StageCameraEndpointKind,
+ time: number,
+ t: Translate = defaultTranslate,
+): StageCameraEndpoint {
+ const pose = sampleStageCamera(stage, cameraId, time, t);
+ return {
+ id: stageCameraEndpointId(cameraId, kind),
+ cameraId,
+ kind,
+ position: kind === "camera" ? { ...pose.position } : { ...pose.target },
+ };
+}
+export function editStageCameraEndpointAt(
+ stage: LocalStageDocument,
+ cameraId: string,
+ kind: StageCameraEndpointKind,
+ time: number,
+ position: Vector3Value,
+ t: Translate = defaultTranslate,
+): LocalStageDocument {
+ return editStageCameraAt(
+ stage,
+ cameraId,
+ time,
+ kind === "camera" ? { position } : { target: position },
+ t,
+ );
+}
+/**
+ * Sample the authored up channel for a camera at a time. The up channel is
+ * the editable camera orientation input alongside roll; renderers apply it
+ * as the camera up vector before lookAt.
+ */
+export function sampleStageCameraUp(
+ stage: LocalStageDocument,
+ id: string,
+ time: number,
+): Vector3Value {
+ const c = stage.cameras.find((c) => c.id === id);
+ if (!c) return defaultCameraUp();
+ return channelAt(
+ defaultCameraUp(),
+ cameraChannelsOf(c).up,
+ time,
+ mixVector,
+ );
}
+/**
+ * The Storyboard block that owns `time`, or null when none does.
+ *
+ * A block owns the half-open interval from its start to its end, so a time that is
+ * exactly a shared boundary belongs to the block on its right. The exact final endpoint
+ * belongs to the last block. Saved boundaries are millisecond-normalized.
+ */
+export function stageStoryboardBlockAt(
+ stage: LocalStageDocument,
+ time: number,
+): StageShot | null {
+ const owning = stage.shots.find((shot) => {
+ const [start, end] = blockRange(shot);
+ return time >= start && time < end;
+ });
+ if (owning) return owning;
+ const last = stage.shots.at(-1);
+ return last && time === blockRange(last)[1] ? last : null;
+}
+/** A stored block's start and end in millisecond-normalized seconds. */
+const blockRange = (shot: StageShot): readonly [number, number] => {
+ const start = normalizeStoryboardTime(shot.start);
+ return [start, storyboardBlockEnd(shot)];
+};
+/**
+ * What a preview shows: the Storyboard, whose camera is the one of the block under the
+ * playhead, or one camera held for the whole timeline. It is view state and is never
+ * saved with the stage.
+ */
+export type StagePreviewSource =
+ | { kind: "storyboard" }
+ | { kind: "camera"; cameraId: string };
+/**
+ * The camera a preview source shows at `time`, or null when it names none.
+ *
+ * The Storyboard names the camera of the block that owns the time, and after its end it
+ * stays on the last block's camera: no further cut and no other camera, exactly like the
+ * terminal time of the main timeline. A concrete camera names itself while it exists.
+ * The chosen source uses the same fallback as the selector.
+ */
+export function stagePreviewCameraId(
+ stage: LocalStageDocument,
+ source: StagePreviewSource,
+ time: number,
+): string | null {
+ const resolved = resolveStagePreviewSource(stage, source);
+ const exists = (cameraId: string) =>
+ stage.cameras.some((camera) => camera.id === cameraId);
+ if (resolved.kind === "camera") return exists(resolved.cameraId) ? resolved.cameraId : null;
+ const last = stage.shots.at(-1);
+ const held =
+ last && time > blockRange(last)[1] ? last : null;
+ const block = stageStoryboardBlockAt(stage, time) ?? held;
+ return block && exists(block.cameraId) ? block.cameraId : null;
+}
+/**
+ * The one fallback rule for a preview source. A Storyboard with no blocks and a camera
+ * that no longer exists resolve to the first existing camera; a source that names
+ * something is returned as it was chosen.
+ *
+ * It only derives. The chosen source is kept as it is, so it applies again by itself
+ * once it names something again, for example after an undo.
+ */
+export function resolveStagePreviewSource(
+ stage: LocalStageDocument,
+ source: StagePreviewSource,
+): StagePreviewSource {
+ const usable =
+ source.kind === "storyboard"
+ ? stage.shots.length > 0
+ : stage.cameras.some((camera) => camera.id === source.cameraId);
+ if (usable) return source;
+ // Nothing can be shown without a camera; a stage that holds none has none to offer.
+ const first = stage.cameras[0];
+ return first ? { kind: "camera", cameraId: first.id } : source;
+}
+/**
+ * The preview source a stored document opens with: its Storyboard when the document
+ * stores that as its source, otherwise the camera it stores as the active one.
+ *
+ * A document becomes the draft when the editor opens and when one is imported, and these
+ * are the only moments the preview reads what it stores. The result is kept as chosen;
+ * `resolveStagePreviewSource` settles whatever it fails to name.
+ */
+export function storedStagePreviewSource(
+ stage: LocalStageDocument,
+): StagePreviewSource {
+ return stage.cameraSource === "storyboard"
+ ? { kind: "storyboard" }
+ : { kind: "camera", cameraId: stage.activeCameraId };
+}
+/** The scene at a time: every object as its keyframes and motion clips have it there. */
+const sampleStageObjects = (
+ stage: LocalStageDocument,
+ at: number,
+): StageSampleObject[] =>
+ stage.objects.map((o) => {
+ const channel = (name: StageTransformChannel) =>
+ sample(
+ o[name],
+ o.keyframes
+ .filter((frame) =>
+ !o.keyframes.some((candidate) => candidate.keyedChannels) || frame.keyedChannels?.includes(name),
+ )
+ .map((frame) => ({
+ time: frame.time,
+ value: frame.value[name],
+ transition: frame.transitions?.[name],
+ })),
+ at,
+ mixVector,
+ );
+ const transform: StageTransform = {
+ position: channel("position"),
+ rotation: channel("rotation"),
+ scale: channel("scale"),
+ };
+ const clip = o.motionClips.find(
+ (c) =>
+ at >= c.start &&
+ (at < c.start + c.duration ||
+ (at === stage.duration && at === c.start + c.duration)),
+ );
+ return {
+ ...o,
+ ...transform,
+ motion: clip?.motion,
+ motionTime: clip ? at - clip.start : 0,
+ };
+ });
/** Same global timeline and half-open cut boundaries for editor, screenshots and MP4. */
export function sampleStage(
stage: LocalStageDocument,
time: number,
): StageSample {
const at = Math.max(0, Math.min(stage.duration, time));
- const shot =
- stage.cameraSource === "storyboard"
- ? stage.shots.find(
- (s) =>
- at >= s.start &&
- (at < s.start + s.duration ||
- (at === stage.duration && at === s.start + s.duration)),
- )
- : undefined;
+ const shot = stage.cameraSource === "storyboard" ? stageStoryboardBlockAt(stage, at) : null;
const cameraId = shot?.cameraId ?? stage.activeCameraId;
return {
cameraId,
camera: sampleStageCamera(stage, cameraId, at),
- objects: stage.objects.map((o) => {
- const transform = sample(
- o,
- o.keyframes,
- at,
- (a, b, t) => ({
- position: mixVector(a.position, b.position, t),
- rotation: mixVector(a.rotation, b.rotation, t),
- scale: mixVector(a.scale, b.scale, t),
- }),
- );
- const clip = o.motionClips.find(
- (c) =>
- at >= c.start &&
- (at < c.start + c.duration ||
- (at === stage.duration && at === c.start + c.duration)),
- );
- return {
- ...o,
- ...transform,
- motion: clip?.motion,
- motionTime: clip ? at - clip.start : 0,
- };
- }),
+ objects: sampleStageObjects(stage, at),
};
}
-const putFrame = (
- frames: { id: string; time: number; value: T }[],
+/** The transport time a picture uses, with a Storyboard's final frame held. */
+export function stagePreviewFrameTime(
+ stage: LocalStageDocument,
+ source: StagePreviewSource,
time: number,
- value: T,
-) =>
+): number {
+ const at = Math.max(0, Math.min(stage.duration, time));
+ const last = source.kind === "storyboard" ? stage.shots.at(-1) : undefined;
+ return last ? Math.min(at, blockRange(last)[1]) : at;
+}
+
+/** The frame shown in a preview pane or captured as a still. */
+export function sampleStagePreview(
+ stage: LocalStageDocument,
+ source: StagePreviewSource,
+ time: number,
+ t: Translate = defaultTranslate,
+): StageSample {
+ return sampleStageEditingViewport(stage, source, stagePreviewFrameTime(stage, source, time), t);
+}
+
+/** Keep the viewport editable at the playhead through the preview's chosen camera. */
+export function sampleStageEditingViewport(
+ stage: LocalStageDocument,
+ source: StagePreviewSource,
+ time: number,
+ t: Translate = defaultTranslate,
+): StageSample {
+ const at = Math.max(0, Math.min(stage.duration, time));
+ const cameraId = stagePreviewCameraId(stage, source, at);
+ if (cameraId === null) throw new Error(t("editors.stage.error.cameraMissing"));
+ return {
+ cameraId,
+ camera: sampleStageCamera(stage, cameraId, at, t),
+ objects: sampleStageObjects(stage, at),
+ };
+}
+const putFrame = (
+ frames: F[],
+ time: number,
+ value: F["value"],
+): F[] =>
[
...frames.filter((f) => f.time !== time),
{
+ ...frames.find((f) => f.time === time),
id: frames.find((f) => f.time === time)?.id ?? crypto.randomUUID(),
time,
value,
- },
+ } as F,
].sort((a, b) => a.time - b.time);
function authorFrame(
frames: { id: string; time: number; value: T }[],
@@ -593,11 +1415,34 @@ function authorFrame(
) {
// The first edit later in time must not retroactively replace the opening pose.
return putFrame(
- !frames.length && time > 0 ? putFrame([], 0, base) : frames,
+ !frames.length && time > 0
+ ? putFrame<{ id: string; time: number; value: T }>([], 0, base)
+ : frames,
time,
value,
);
}
+function authorTransformFrame(
+ frames: StageTransformFrame[],
+ time: number,
+ value: StageTransform,
+ base: StageTransform,
+ channels: StageTransformChannel[],
+): StageTransformFrame[] {
+ const normalized = frames.some((frame) => frame.keyedChannels)
+ ? frames
+ : frames.map((frame) => ({
+ ...frame,
+ keyedChannels: ["position", "rotation", "scale"] as StageTransformChannel[],
+ }));
+ const opening = !normalized.length && time > 0
+ ? putFrame([], 0, base).map((frame) => ({ ...frame, keyedChannels: [...channels] }))
+ : normalized;
+ const next = putFrame(opening, time, value);
+ return next.map((frame) => frame.time === time
+ ? { ...frame, keyedChannels: [...new Set([...(frame.keyedChannels ?? []), ...channels])] }
+ : frame);
+}
export function editStageObjectAt(
stage: LocalStageDocument,
id: string,
@@ -606,7 +1451,7 @@ export function editStageObjectAt(
t: Translate = defaultTranslate,
): LocalStageDocument {
const pose = sampleStage(stage, time).objects.find((o) => o.id === id);
- if (!pose) return stage;
+ if (!pose || pose.locked) return stage;
const transform = parseTransform({ ...pose, ...patch }, t);
const {
position: _position,
@@ -617,6 +1462,9 @@ export function editStageObjectAt(
const changesTransform =
!!(patch.position || patch.rotation || patch.scale) &&
!sameTransform(pose, transform);
+ const changedChannels = (["position", "rotation", "scale"] as const).filter(
+ (channel) => patch[channel] && !sameVector(pose[channel], transform[channel]),
+ );
return parseLocalStageValue(
{
...stage,
@@ -628,7 +1476,7 @@ export function editStageObjectAt(
...metadata,
...(changesTransform ? transform : {}),
keyframes: changesTransform
- ? authorFrame(o.keyframes, time, transform, parseTransform(o, t))
+ ? authorTransformFrame(o.keyframes, time, transform, parseTransform(o, t), changedChannels)
: o.keyframes,
},
),
@@ -636,6 +1484,24 @@ export function editStageObjectAt(
t,
);
}
+/** Placement writes the base transform only and never authors keyframes:
+ * dragging repositions a static subject instead of animating it. */
+export function editStageObjectPlacement(
+ stage: LocalStageDocument,
+ id: string,
+ transform: StageTransform,
+ t: Translate = defaultTranslate,
+): LocalStageDocument {
+ const value = parseTransform(transform, t);
+ if (!stage.objects.some((o) => o.id === id && !o.locked)) return stage;
+ return parseLocalStageValue(
+ {
+ ...stage,
+ objects: stage.objects.map((o) => (o.id === id ? { ...o, ...value } : o)),
+ },
+ t,
+ );
+}
export function editStageCameraAt(
stage: LocalStageDocument,
id: string,
@@ -655,47 +1521,87 @@ export function editStageCameraAt(
: {
...c,
pose,
- keyframes: authorFrame(c.keyframes, time, pose, c.pose),
+ channels: {
+ position: sameVector(current.position, pose.position)
+ ? cameraChannelsOf(c).position
+ : authorFrame(cameraChannelsOf(c).position, time, pose.position, c.pose.position),
+ target: sameVector(current.target, pose.target)
+ ? cameraChannelsOf(c).target
+ : authorFrame(cameraChannelsOf(c).target, time, pose.target, c.pose.target),
+ up: cameraChannelsOf(c).up,
+ focalLength: current.fov === pose.fov
+ ? cameraChannelsOf(c).focalLength
+ : authorFrame(cameraChannelsOf(c).focalLength, time, pose.fov, c.pose.fov),
+ },
},
),
},
t,
);
}
-export function captureStageFrame(
+/** Key the editable scene and the selected preview camera at the transport time. */
+export function captureStagePreviewFrame(
stage: LocalStageDocument,
+ source: StagePreviewSource,
time: number,
t: Translate = defaultTranslate,
): LocalStageDocument {
- const pose = sampleStage(stage, time);
+ return captureFrameFor(
+ stage,
+ stagePreviewCameraId(stage, source, time),
+ time,
+ t,
+ );
+}
+/** Key every unlocked object, and one named camera, where they are at `time`. */
+function captureFrameFor(
+ stage: LocalStageDocument,
+ cameraId: string | null,
+ time: number,
+ t: Translate,
+): LocalStageDocument {
+ const at = Math.max(0, Math.min(stage.duration, time));
+ const pose = sampleStageObjects(stage, at);
+ const camera =
+ cameraId === null ? undefined : sampleStageCamera(stage, cameraId, at, t);
return parseLocalStageValue(
{
...stage,
objects: stage.objects.map((o) => ({
...o,
- keyframes: putFrame(
- o.keyframes,
- time,
- parseTransform(pose.objects.find((p) => p.id === o.id)!, t),
- ),
+ keyframes: o.locked
+ ? o.keyframes
+ : putFrame(
+ o.keyframes,
+ time,
+ parseTransform(pose.find((p) => p.id === o.id)!, t),
+ ).map((frame) =>
+ // The captured frame keys every channel; pre-channel frames
+ // also keyed every channel, so once per-channel keying enters
+ // the list they must carry the full set or the sampler drops
+ // them as unkeyed.
+ frame.time === time || !frame.keyedChannels
+ ? { ...frame, keyedChannels: ["position", "rotation", "scale"] }
+ : frame,
+ ),
})),
cameras: stage.cameras.map((c) =>
- c.id === pose.cameraId
- ? { ...c, keyframes: putFrame(c.keyframes, time, pose.camera) }
+ c.id === cameraId && camera
+ ? {
+ ...c,
+ channels: {
+ position: putFrame(cameraChannelsOf(c).position, time, camera.position),
+ target: putFrame(cameraChannelsOf(c).target, time, camera.target),
+ up: putFrame(cameraChannelsOf(c).up, time, defaultCameraUp()),
+ focalLength: putFrame(cameraChannelsOf(c).focalLength, time, camera.fov),
+ },
+ }
: c,
),
},
t,
);
}
-export function stageFrameTimes(stage: LocalStageDocument): number[] {
- return [
- ...new Set([
- ...stage.objects.flatMap((o) => o.keyframes.map((f) => f.time)),
- ...stage.cameras.flatMap((c) => c.keyframes.map((f) => f.time)),
- ]),
- ].sort((a, b) => a - b);
-}
export function removeStageFrame(
stage: LocalStageDocument,
time: number,
@@ -708,17 +1614,43 @@ export function removeStageFrame(
})),
cameras: stage.cameras.map((c) => ({
...c,
- keyframes: c.keyframes.filter((f) => f.time !== time),
+ channels: {
+ position: cameraChannelsOf(c).position.filter((f) => f.time !== time),
+ target: cameraChannelsOf(c).target.filter((f) => f.time !== time),
+ up: cameraChannelsOf(c).up.filter((f) => f.time !== time),
+ focalLength: cameraChannelsOf(c).focalLength.filter((f) => f.time !== time),
+ },
})),
};
}
-export function stageOutputSize(ratio: LocalStageDocument["aspectRatio"]): {
+/** Encoder resolution for a stage ratio. The default long edge matches the
+ * standard export quality; high quality doubles nothing but the long edge. */
+export function stageOutputSize(
+ ratio: LocalStageDocument["aspectRatio"],
+ longEdge = 1280,
+): {
width: number;
height: number;
} {
const [w, h] = ratio.split(":").map(Number);
return {
- width: Math.round((1280 * w!) / Math.max(w!, h!) / 2) * 2,
- height: Math.round((1280 * h!) / Math.max(w!, h!) / 2) * 2,
+ width: Math.round((longEdge * w!) / Math.max(w!, h!) / 2) * 2,
+ height: Math.round((longEdge * h!) / Math.max(w!, h!) / 2) * 2,
};
}
+/** Imported objects pinning assets the current project has not registered.
+ * Stage JSON exports carry no model bytes, so such objects can neither
+ * preview nor apply; importers reject them explicitly instead of failing
+ * at save time. */
+export function unregisteredStageAssets(
+ stage: LocalStageDocument,
+ isRegistered: (asset: AssetRef) => boolean,
+): StageObject[] {
+ return stage.objects.filter((object) => {
+ const modelMissing =
+ object.kind === "gltf" && object.asset && !isRegistered(object.asset);
+ const thumbnailMissing =
+ object.thumbnailAsset && !isRegistered(object.thumbnailAsset);
+ return Boolean(modelMissing || thumbnailMissing);
+ });
+}
diff --git a/src/canvas/stageElevation.ts b/src/canvas/stageElevation.ts
new file mode 100644
index 000000000..34827aab7
--- /dev/null
+++ b/src/canvas/stageElevation.ts
@@ -0,0 +1,169 @@
+import * as THREE from "three";
+import { STAGE_GROUND_LEVEL } from "./stageGrounding.ts";
+
+/** The smallest height the readout shows. A subject placed or dropped by its
+ * rendered bottom lands within floating-point noise of the ground, and below
+ * this the value would round to zero. */
+export const STAGE_ELEVATION_MIN = 0.005;
+/** Diameter of the ring at the landing point, in CSS pixels however far the
+ * camera stands from it. */
+export const STAGE_ELEVATION_RING_DIAMETER = 12;
+
+const RING_SEGMENTS = 40;
+/** Room the line leaves above and below a value it frames. */
+const LABEL_PADDING = 3;
+/** The least line left beyond a framed value. A shorter one stands the value
+ * beside it instead. */
+const LABEL_MIN_LINE = 12;
+/** Space between the line and a value that stands beside it. */
+const LABEL_SIDE_GAP = 6;
+
+export interface StageElevationPoint {
+ x: number;
+ y: number;
+}
+export interface StageElevationSize {
+ width: number;
+ height: number;
+}
+export interface StageElevationLayout {
+ /** The line from the subject to the ground, whole or in two pieces around
+ * the value. */
+ segments: readonly (readonly [StageElevationPoint, StageElevationPoint])[];
+ /** The value's top-left corner. */
+ label: StageElevationPoint;
+}
+
+/**
+ * How far a subject's lowest rendered point stands above the business ground,
+ * or null when the subject stands on the ground or reaches below it. It is
+ * the distance drop-to-ground moves the subject, so the two agree on what
+ * counts as lifted.
+ */
+export function stageElevationHeight(
+ bottomY: number,
+ groundY = STAGE_GROUND_LEVEL,
+): number | null {
+ const height = bottomY - groundY;
+ return Number.isFinite(height) && height >= STAGE_ELEVATION_MIN
+ ? height
+ : null;
+}
+
+/** The value in metres, to the two decimals the position fields keep. */
+export const formatStageElevation = (height: number) => height.toFixed(2);
+
+/**
+ * Where the line and its value go, from the landing point and the subject's
+ * lowest point as already projected into the viewport. A line long enough
+ * frames its value in a gap. A short one, or one whose value would cross the
+ * viewport's edge, stands the value beside it on the side that has room.
+ */
+export function layoutStageElevation(
+ foot: StageElevationPoint,
+ bottom: StageElevationPoint,
+ label: StageElevationSize,
+ viewport: StageElevationSize,
+): StageElevationLayout {
+ const dx = bottom.x - foot.x;
+ const dy = bottom.y - foot.y;
+ const length = Math.hypot(dx, dy);
+ const ux = length > 1e-6 ? dx / length : 0;
+ const uy = length > 1e-6 ? dy / length : -1;
+ const middle = { x: (foot.x + bottom.x) / 2, y: (foot.y + bottom.y) / 2 };
+ const framed = label.height + LABEL_PADDING * 2;
+ const fitsAcross =
+ middle.x - label.width / 2 >= 0 &&
+ middle.x + label.width / 2 <= viewport.width;
+ if (length >= framed + LABEL_MIN_LINE * 2 && fitsAcross) {
+ const half = framed / 2;
+ return {
+ segments: [
+ [foot, { x: middle.x - ux * half, y: middle.y - uy * half }],
+ [{ x: middle.x + ux * half, y: middle.y + uy * half }, bottom],
+ ],
+ label: {
+ x: middle.x - label.width / 2,
+ y: middle.y - label.height / 2,
+ },
+ };
+ }
+ const right = middle.x + LABEL_SIDE_GAP;
+ const left = middle.x - LABEL_SIDE_GAP - label.width;
+ // The right side unless it has no room and the left has.
+ const labelX =
+ right + label.width <= viewport.width || left < 0 ? right : left;
+ return {
+ segments: [[foot, bottom]],
+ label: { x: labelX, y: middle.y - label.height / 2 },
+ };
+}
+
+/** The world radius that keeps the ring at its screen diameter at a view depth. */
+export function stageElevationRingRadius(
+ depth: number,
+ fovDegrees: number,
+ viewportHeight: number,
+): number {
+ if (!(depth > 0) || !(viewportHeight > 0)) return 0;
+ const visibleHeight =
+ 2 * depth * Math.tan(THREE.MathUtils.degToRad(fovDegrees) / 2);
+ return (STAGE_ELEVATION_RING_DIAMETER / 2) * (visibleHeight / viewportHeight);
+}
+
+const ringScratch = new THREE.Vector3();
+/**
+ * The ring where the ground meets the camera: a circle on the ground plane,
+ * projected point by point, so it lies flat on that plane from any angle.
+ * `project` is the same projection the line's endpoints go through. An empty
+ * path means part of the circle is behind the camera.
+ */
+export function stageElevationRingPath(
+ center: THREE.Vector3,
+ radius: number,
+ project: (point: THREE.Vector3) => StageElevationPoint | null,
+): string {
+ let path = "";
+ for (let step = 0; step < RING_SEGMENTS; step += 1) {
+ const angle = (Math.PI * 2 * step) / RING_SEGMENTS;
+ const screen = project(
+ ringScratch.set(
+ center.x + Math.cos(angle) * radius,
+ center.y,
+ center.z + Math.sin(angle) * radius,
+ ),
+ );
+ // A circle the camera stands inside has no honest shape on screen.
+ if (!screen) return "";
+ path += `${step === 0 ? "M" : "L"}${screen.x.toFixed(1)} ${screen.y.toFixed(1)}`;
+ }
+ return path + "Z";
+}
+
+export interface StageElevationScreenPoint extends StageElevationPoint {
+ /** Distance along the camera's view axis. */
+ depth: number;
+}
+
+const viewScratch = new THREE.Vector3();
+/**
+ * Where a world point lands in the viewport for a camera, or null when the
+ * point is behind it: a projection of such a point mirrors across the frame
+ * instead of falling outside it. `toViewport` receives the point in normalised
+ * device coordinates. The camera's world matrix must be current;
+ * `camera.updateMatrixWorld()` makes it so. Neither argument is changed.
+ */
+export function stageElevationScreenPoint(
+ world: THREE.Vector3,
+ camera: THREE.PerspectiveCamera,
+ toViewport: (ndc: StageElevationPoint) => StageElevationPoint,
+): StageElevationScreenPoint | null {
+ // The camera looks down its negative Z, so a point at or behind the near
+ // plane has no place on screen.
+ viewScratch.copy(world).applyMatrix4(camera.matrixWorldInverse);
+ if (!(viewScratch.z < -camera.near)) return null;
+ const depth = -viewScratch.z;
+ viewScratch.applyMatrix4(camera.projectionMatrix);
+ const screen = toViewport({ x: viewScratch.x, y: viewScratch.y });
+ return { x: screen.x, y: screen.y, depth };
+}
diff --git a/src/canvas/stageEnvironment.ts b/src/canvas/stageEnvironment.ts
new file mode 100644
index 000000000..91fc18485
--- /dev/null
+++ b/src/canvas/stageEnvironment.ts
@@ -0,0 +1,108 @@
+import type {
+ LocalStageDocument,
+ StageLight,
+ StageLightId,
+ StageEnvironmentPreset,
+ Vector3Value,
+} from "./stageDocument.ts";
+import type { AssetRef } from "../contracts/generated.ts";
+
+export const STAGE_GROUND_NAME = "stage-ground";
+export const STAGE_GRID_NAME = "stage-grid";
+export const STAGE_LIGHT_NAMES: Readonly> = {
+ hemisphere: "stage-light-hemisphere",
+ key: "stage-light-key",
+ fill: "stage-light-fill",
+};
+
+export interface StageEnvironmentPresetValues {
+ readonly preset: StageEnvironmentPreset;
+ readonly background: string;
+ readonly groundColor: string;
+ readonly groundVisible: boolean;
+ readonly exposure: number;
+ readonly lights: Readonly>>;
+}
+
+/** Stable values materialized by the background-tab selector through the normal edit path. */
+export const STAGE_ENVIRONMENT_PRESETS: readonly StageEnvironmentPresetValues[] = [
+ {
+ preset: "studio", background: "#0d0d0d", groundColor: "#181818", groundVisible: true, exposure: 1,
+ lights: {
+ hemisphere: { color: "#ffffff", intensity: 2.4, position: { x: 0, y: 1, z: 0 }, castShadow: false },
+ key: { color: "#ffffff", intensity: 3.5, position: { x: 5, y: 10, z: 6 }, castShadow: true },
+ fill: { color: "#ffffff", intensity: 1.6, position: { x: -6, y: 5, z: -5 }, castShadow: false },
+ },
+ },
+ {
+ preset: "warm-sunset", background: "#2a1b24", groundColor: "#33231f", groundVisible: true, exposure: 1.15,
+ lights: {
+ hemisphere: { color: "#ffd6b0", intensity: 2.8, position: { x: 0, y: 1, z: 0 }, castShadow: false },
+ key: { color: "#ffb36b", intensity: 4, position: { x: 5, y: 10, z: 6 }, castShadow: true },
+ fill: { color: "#8ab4ff", intensity: 1.2, position: { x: -6, y: 5, z: -5 }, castShadow: false },
+ },
+ },
+ {
+ preset: "moonlit", background: "#0b1426", groundColor: "#111827", groundVisible: true, exposure: 0.8,
+ lights: {
+ hemisphere: { color: "#9fb8ff", intensity: 1.8, position: { x: 0, y: 1, z: 0 }, castShadow: false },
+ key: { color: "#b7d0ff", intensity: 2.4, position: { x: -4, y: 8, z: 4 }, castShadow: true },
+ fill: { color: "#5570b8", intensity: 1, position: { x: 5, y: 4, z: -5 }, castShadow: false },
+ },
+ },
+];
+
+export interface StageEnvironmentLightDescriptor {
+ readonly id: StageLightId;
+ readonly color: string;
+ readonly intensity: number;
+ readonly position: Vector3Value;
+ readonly castShadow: boolean;
+}
+
+export interface StageEnvironmentDescriptor {
+ readonly backgroundColor: string;
+ readonly backgroundAsset: AssetRef | null;
+ readonly exposure: number;
+ readonly ground: {
+ readonly color: string;
+ readonly visible: boolean;
+ };
+ readonly lights: Readonly>;
+}
+
+/** Projects persisted environment facts into the one scene description used by all render adapters. */
+export function projectStageEnvironment(
+ stage: Pick,
+): StageEnvironmentDescriptor {
+ return {
+ backgroundColor: stage.background,
+ backgroundAsset: stage.environment.backgroundAsset,
+ exposure: stage.environment.exposure,
+ ground: {
+ color: stage.environment.groundColor,
+ visible: stage.environment.groundVisible,
+ },
+ lights: {
+ hemisphere: projectLight(findLight(stage.lights, "hemisphere")),
+ key: projectLight(findLight(stage.lights, "key")),
+ fill: projectLight(findLight(stage.lights, "fill")),
+ },
+ };
+}
+
+function findLight(lights: readonly StageLight[], id: StageLightId): StageLight {
+ const light = lights.find((candidate) => candidate.id === id);
+ if (!light) throw new Error(`Missing stage light role: ${id}`);
+ return light;
+}
+
+function projectLight(light: StageLight): StageEnvironmentLightDescriptor {
+ return {
+ id: light.id,
+ color: light.color,
+ intensity: light.intensity,
+ position: { ...light.position },
+ castShadow: light.castShadow,
+ };
+}
diff --git a/src/canvas/stageGroundFade.ts b/src/canvas/stageGroundFade.ts
new file mode 100644
index 000000000..a02bc9637
--- /dev/null
+++ b/src/canvas/stageGroundFade.ts
@@ -0,0 +1,90 @@
+import * as THREE from "three";
+
+export const STAGE_GROUND_FADE_START = 18;
+export const STAGE_GROUND_FADE_END = 72;
+
+const STAGE_GROUND_FADE_SHADER_KEY = "stage-ground-background-fade-v1";
+const TONEMAPPING_CHUNK = "#include ";
+
+interface StageGroundFadeState {
+ readonly background: THREE.Color;
+ readonly enabled: { value: number };
+ readonly range: { value: THREE.Vector2 };
+}
+
+const fadeStates = new WeakMap();
+
+/**
+ * Blends only the distant ground into the solid scene background. The color
+ * mix happens before tone mapping so the ground and background follow the
+ * same output transform and the horizon does not leave a visible seam.
+ */
+export function patchStageGroundFragmentShader(source: string): string {
+ if (!source.includes(TONEMAPPING_CHUNK))
+ throw new Error(
+ "Three.js ground shader no longer exposes the tone-mapping chunk",
+ );
+ return source.replace(
+ TONEMAPPING_CHUNK,
+ `
+ float stageGroundDistance = length( vViewPosition );
+ float stageGroundFade = smoothstep(
+ stageGroundFadeRange.x,
+ stageGroundFadeRange.y,
+ stageGroundDistance
+ ) * stageGroundFadeEnabled;
+ gl_FragColor.rgb = mix(
+ gl_FragColor.rgb,
+ stageGroundFadeBackground,
+ stageGroundFade
+ );
+ ${TONEMAPPING_CHUNK}
+ `,
+ );
+}
+
+function installStageGroundFade(material: THREE.MeshStandardMaterial) {
+ const existing = fadeStates.get(material);
+ if (existing) return existing;
+
+ const state: StageGroundFadeState = {
+ background: new THREE.Color(),
+ enabled: { value: 1 },
+ range: {
+ value: new THREE.Vector2(
+ STAGE_GROUND_FADE_START,
+ STAGE_GROUND_FADE_END,
+ ),
+ },
+ };
+ const previousCompile = material.onBeforeCompile;
+ const previousProgramKey = material.customProgramCacheKey.bind(material);
+ material.onBeforeCompile = (shader, renderer) => {
+ previousCompile(shader, renderer);
+ shader.uniforms.stageGroundFadeBackground = { value: state.background };
+ shader.uniforms.stageGroundFadeEnabled = state.enabled;
+ shader.uniforms.stageGroundFadeRange = state.range;
+ shader.fragmentShader = `
+ uniform vec3 stageGroundFadeBackground;
+ uniform float stageGroundFadeEnabled;
+ uniform vec2 stageGroundFadeRange;
+ ${patchStageGroundFragmentShader(shader.fragmentShader)}
+ `;
+ };
+ material.customProgramCacheKey = () =>
+ `${previousProgramKey()}:${STAGE_GROUND_FADE_SHADER_KEY}`;
+ material.needsUpdate = true;
+ fadeStates.set(material, state);
+ return state;
+}
+
+/** Updates the shared preview/export ground material without recompiling it. */
+export function updateStageGroundFade(
+ material: THREE.MeshStandardMaterial,
+ backgroundColor: string,
+ enabled: boolean,
+) {
+ const state = installStageGroundFade(material);
+ state.background.set(backgroundColor);
+ state.enabled.value = enabled ? 1 : 0;
+}
diff --git a/src/canvas/stageGrounding.ts b/src/canvas/stageGrounding.ts
new file mode 100644
index 000000000..9dfe1aacf
--- /dev/null
+++ b/src/canvas/stageGrounding.ts
@@ -0,0 +1,39 @@
+import * as THREE from "three";
+
+/** Business ground height. The visible ground mesh sits a small amount below
+ * this plane to avoid depth fighting with objects that are exactly grounded. */
+export const STAGE_GROUND_LEVEL = 0;
+
+/**
+ * Return the root Y that puts an object with its current local shape on the
+ * requested ground plane. The object is measured at its current transform so
+ * rotation and scale are included, while the returned value can use a new X/Z
+ * placement without mutating the measured object.
+ */
+export function groundedPositionY(
+ object: THREE.Object3D,
+ desiredPositionY: number,
+ groundY = STAGE_GROUND_LEVEL,
+): number {
+ object.updateMatrixWorld(true);
+ const bounds = new THREE.Box3().setFromObject(object);
+ if (bounds.isEmpty() || !Number.isFinite(bounds.min.y))
+ return desiredPositionY;
+ const localBottom = bounds.min.y - object.position.y;
+ return desiredPositionY + groundY - localBottom;
+}
+
+/** Snap the object in place and return the applied local Y delta. */
+export function groundObject(
+ object: THREE.Object3D,
+ groundY = STAGE_GROUND_LEVEL,
+): number {
+ object.updateMatrixWorld(true);
+ const bounds = new THREE.Box3().setFromObject(object);
+ if (bounds.isEmpty() || !Number.isFinite(bounds.min.y)) return 0;
+ const previousY = object.position.y;
+ const nextY = previousY + groundY - bounds.min.y;
+ object.position.y = nextY;
+ object.updateMatrixWorld(true);
+ return nextY - previousY;
+}
diff --git a/src/canvas/stageInfiniteGrid.ts b/src/canvas/stageInfiniteGrid.ts
new file mode 100644
index 000000000..e3f6f1d3b
--- /dev/null
+++ b/src/canvas/stageInfiniteGrid.ts
@@ -0,0 +1,273 @@
+import * as THREE from "three";
+
+export const STAGE_GRID_MINOR_SPACING = 1;
+export const STAGE_GRID_MAJOR_SPACING = 5;
+export const STAGE_GRID_FADE_START = 24;
+export const STAGE_GRID_FADE_END = 72;
+export const STAGE_GRID_FOCUS_MIN_RADIUS = 8;
+export const STAGE_GRID_FOCUS_MAX_RADIUS = 48;
+export const STAGE_GRID_FOCUS_FEATHER = 20;
+
+const STAGE_GRID_EXTENT = 180;
+const STAGE_GROUND_LEVEL = 0;
+const STAGE_GRID_FOCUS_FALLBACK_DISTANCE = 18;
+const STAGE_GRID_FOCUS_MAX_DISTANCE = 40;
+
+interface StageInfiniteGridState {
+ readonly cameraPosition: { value: THREE.Vector3 };
+ readonly focusCenter: { value: THREE.Vector2 };
+ readonly focusRange: { value: THREE.Vector2 };
+ readonly viewProjection: THREE.Matrix4;
+ readonly frustum: THREE.Frustum;
+ readonly objectBounds: THREE.Box3[];
+ objectBoundsCount: number;
+ objectBoundsReady: boolean;
+ readonly focusBounds: THREE.Box3;
+ readonly viewDirection: THREE.Vector3;
+ readonly viewFocus: THREE.Vector3;
+ readonly focusSize: THREE.Vector3;
+}
+
+export type StageInfiniteGrid = THREE.Mesh<
+ THREE.PlaneGeometry,
+ THREE.ShaderMaterial
+>;
+
+const gridStates = new WeakMap();
+
+const vertexShader = /* glsl */ `
+ varying vec3 stageGridWorldPosition;
+
+ void main() {
+ vec4 worldPosition = modelMatrix * vec4(position, 1.0);
+ stageGridWorldPosition = worldPosition.xyz;
+ gl_Position = projectionMatrix * viewMatrix * worldPosition;
+ }
+`;
+
+const fragmentShader = /* glsl */ `
+ uniform vec3 stageGridCameraPosition;
+ uniform vec3 stageGridMinorColor;
+ uniform vec3 stageGridMajorColor;
+ uniform vec3 stageGridAxisColor;
+ uniform vec2 stageGridFocusCenter;
+ uniform vec2 stageGridFocusRange;
+ varying vec3 stageGridWorldPosition;
+
+ float stageGridLine(vec2 worldCoordinate, float spacing, float width) {
+ vec2 coordinate = worldCoordinate / spacing;
+ vec2 derivative = max(fwidth(coordinate), vec2(0.0001));
+ vec2 distanceToLine =
+ abs(fract(coordinate - 0.5) - 0.5) / derivative;
+ float nearestLine = min(distanceToLine.x, distanceToLine.y);
+ return 1.0 - smoothstep(width, width + 1.0, nearestLine);
+ }
+
+ float stageGridAxis(float coordinate) {
+ float derivative = max(fwidth(coordinate), 0.0001);
+ return 1.0 - smoothstep(derivative, derivative * 2.5, abs(coordinate));
+ }
+
+ void main() {
+ vec2 worldCoordinate = stageGridWorldPosition.xz;
+ float minorLine = stageGridLine(
+ worldCoordinate,
+ ${STAGE_GRID_MINOR_SPACING.toFixed(1)},
+ 0.35
+ );
+ float majorLine = stageGridLine(
+ worldCoordinate,
+ ${STAGE_GRID_MAJOR_SPACING.toFixed(1)},
+ 0.65
+ );
+
+ // Suppress sub-pixel minor cells before they shimmer or form moire.
+ vec2 minorDerivative = fwidth(
+ worldCoordinate / ${STAGE_GRID_MINOR_SPACING.toFixed(1)}
+ );
+ float minorVisibility = 1.0 - smoothstep(
+ 0.35,
+ 0.8,
+ max(minorDerivative.x, minorDerivative.y)
+ );
+ minorLine *= minorVisibility;
+
+ float xAxis = stageGridAxis(stageGridWorldPosition.z);
+ float zAxis = stageGridAxis(stageGridWorldPosition.x);
+ float axisLine = max(xAxis, zAxis);
+ float distanceFromCamera = distance(
+ worldCoordinate,
+ stageGridCameraPosition.xz
+ );
+ float distanceFade = 1.0 - smoothstep(
+ ${STAGE_GRID_FADE_START.toFixed(1)},
+ ${STAGE_GRID_FADE_END.toFixed(1)},
+ distanceFromCamera
+ );
+ float distanceFromFocus = distance(
+ worldCoordinate,
+ stageGridFocusCenter
+ );
+ float focusFade = 1.0 - smoothstep(
+ stageGridFocusRange.x,
+ stageGridFocusRange.y,
+ distanceFromFocus
+ );
+ float clarityFade = max(focusFade, distanceFade * 0.28);
+
+ float minorAlpha = minorLine * 0.24;
+ float majorAlpha = majorLine * 0.48;
+ float axisAlpha = axisLine * 0.68;
+ float alpha = max(max(minorAlpha, majorAlpha), axisAlpha) * clarityFade;
+ if (alpha < 0.002) discard;
+
+ vec3 color = mix(stageGridMinorColor, stageGridMajorColor, majorLine);
+ color = mix(color, stageGridAxisColor, axisLine);
+ gl_FragColor = vec4(color, alpha);
+ }
+`;
+
+/**
+ * Creates a viewport-only world-space grid. The plane is moved with each
+ * rendering camera while the shader samples world coordinates, so cells and
+ * axes remain fixed in the scene and the finite carrier plane is never seen.
+ */
+export function createStageInfiniteGrid(): StageInfiniteGrid {
+ const state: StageInfiniteGridState = {
+ cameraPosition: { value: new THREE.Vector3() },
+ focusCenter: { value: new THREE.Vector2() },
+ focusRange: {
+ value: new THREE.Vector2(
+ STAGE_GRID_FOCUS_MIN_RADIUS,
+ STAGE_GRID_FOCUS_MIN_RADIUS + STAGE_GRID_FOCUS_FEATHER,
+ ),
+ },
+ viewProjection: new THREE.Matrix4(),
+ frustum: new THREE.Frustum(),
+ objectBounds: [],
+ objectBoundsCount: 0,
+ objectBoundsReady: false,
+ focusBounds: new THREE.Box3(),
+ viewDirection: new THREE.Vector3(),
+ viewFocus: new THREE.Vector3(),
+ focusSize: new THREE.Vector3(),
+ };
+ const material = new THREE.ShaderMaterial({
+ uniforms: {
+ stageGridCameraPosition: state.cameraPosition,
+ stageGridMinorColor: { value: new THREE.Color(0x3a3a3a) },
+ stageGridMajorColor: { value: new THREE.Color(0x5a5a5a) },
+ stageGridAxisColor: { value: new THREE.Color(0x7a7a7a) },
+ stageGridFocusCenter: state.focusCenter,
+ stageGridFocusRange: state.focusRange,
+ },
+ vertexShader,
+ fragmentShader,
+ transparent: true,
+ depthTest: true,
+ depthWrite: false,
+ side: THREE.DoubleSide,
+ });
+ material.toneMapped = false;
+ const grid: StageInfiniteGrid = new THREE.Mesh(
+ new THREE.PlaneGeometry(STAGE_GRID_EXTENT, STAGE_GRID_EXTENT),
+ material,
+ );
+ grid.rotation.x = -Math.PI / 2;
+ // Draw before other transparent scene content so transparent subjects can
+ // still blend over the helper grid after the opaque depth pass.
+ grid.renderOrder = -10;
+ gridStates.set(grid, state);
+ return grid;
+}
+
+/** Collects animated object bounds once for all camera passes in this frame. */
+export function updateStageInfiniteGridObjects(
+ grid: StageInfiniteGrid,
+ objects: THREE.Object3D,
+) {
+ const state = gridStates.get(grid);
+ if (!state) throw new Error("Unknown Director Stage infinite grid");
+ let count = 0;
+ for (const child of objects.children) {
+ if (!child.visible) continue;
+ const bounds = state.objectBounds[count] ?? new THREE.Box3();
+ bounds.setFromObject(child);
+ if (bounds.isEmpty()) continue;
+ state.objectBounds[count] = bounds;
+ count += 1;
+ }
+ state.objectBoundsCount = count;
+ state.objectBoundsReady = true;
+}
+
+/** Updates live uniforms and recenters the carrier plane without React work. */
+export function updateStageInfiniteGrid(
+ grid: StageInfiniteGrid,
+ camera: THREE.Camera,
+) {
+ const state = gridStates.get(grid);
+ if (!state) throw new Error("Unknown Director Stage infinite grid");
+ camera.getWorldPosition(state.cameraPosition.value);
+ state.focusCenter.value.set(
+ state.cameraPosition.value.x,
+ state.cameraPosition.value.z,
+ );
+ state.focusRange.value.set(
+ STAGE_GRID_FOCUS_MIN_RADIUS,
+ STAGE_GRID_FOCUS_MIN_RADIUS + STAGE_GRID_FOCUS_FEATHER,
+ );
+
+ if (state.objectBoundsReady) {
+ camera.updateWorldMatrix(true, false);
+ state.viewProjection.multiplyMatrices(
+ camera.projectionMatrix,
+ camera.matrixWorldInverse,
+ );
+ state.frustum.setFromProjectionMatrix(state.viewProjection);
+ camera.getWorldDirection(state.viewDirection);
+ const groundDistance =
+ Math.abs(state.viewDirection.y) > 0.0001
+ ? -state.cameraPosition.value.y / state.viewDirection.y
+ : STAGE_GRID_FOCUS_FALLBACK_DISTANCE;
+ const focusDistance = THREE.MathUtils.clamp(
+ Number.isFinite(groundDistance) && groundDistance > 0
+ ? groundDistance
+ : STAGE_GRID_FOCUS_FALLBACK_DISTANCE,
+ 0,
+ STAGE_GRID_FOCUS_MAX_DISTANCE,
+ );
+ state.viewFocus
+ .copy(state.cameraPosition.value)
+ .addScaledVector(state.viewDirection, focusDistance);
+ state.viewFocus.y = STAGE_GROUND_LEVEL;
+ state.focusBounds.makeEmpty();
+ state.focusBounds.expandByPoint(state.viewFocus);
+ for (let index = 0; index < state.objectBoundsCount; index += 1) {
+ const bounds = state.objectBounds[index]!;
+ if (state.frustum.intersectsBox(bounds)) state.focusBounds.union(bounds);
+ }
+ state.focusBounds.getCenter(state.viewFocus);
+ state.focusBounds.getSize(state.focusSize);
+ state.focusCenter.value.set(state.viewFocus.x, state.viewFocus.z);
+ const focusRadius = THREE.MathUtils.clamp(
+ Math.hypot(state.focusSize.x, state.focusSize.z) * 0.5 + 3,
+ STAGE_GRID_FOCUS_MIN_RADIUS,
+ STAGE_GRID_FOCUS_MAX_RADIUS,
+ );
+ state.focusRange.value.set(
+ focusRadius,
+ focusRadius + STAGE_GRID_FOCUS_FEATHER,
+ );
+ }
+
+ const carrierX =
+ (state.cameraPosition.value.x + state.focusCenter.value.x) * 0.5;
+ const carrierZ =
+ (state.cameraPosition.value.z + state.focusCenter.value.y) * 0.5;
+ grid.position.set(
+ Math.round(carrierX / STAGE_GRID_MAJOR_SPACING) * STAGE_GRID_MAJOR_SPACING,
+ 0,
+ Math.round(carrierZ / STAGE_GRID_MAJOR_SPACING) * STAGE_GRID_MAJOR_SPACING,
+ );
+}
diff --git a/src/canvas/stageMotion.ts b/src/canvas/stageMotion.ts
index 1e29e28a7..e175bc7c9 100644
--- a/src/canvas/stageMotion.ts
+++ b/src/canvas/stageMotion.ts
@@ -13,6 +13,28 @@ export interface StageMotion {
speed: number;
amount: number;
}
+/** Name hints that map a procedural motion preset onto imported animation clips. */
+export const STAGE_ANIMATION_HINTS: Record<
+ StageMotion["preset"],
+ readonly string[]
+> = {
+ idle: ["idle", "rest", "stand", "default"],
+ walk: ["walk", "walking"],
+ run: ["run", "running"],
+ wave: ["wave", "waving"],
+};
+/** Clip choice for a preset: first clip whose name contains a hint, else the first clip. */
+export function selectStageAnimation(
+ clips: readonly T[],
+ preset: StageMotion["preset"],
+): T | undefined {
+ const hints = STAGE_ANIMATION_HINTS[preset];
+ return (
+ clips.find((clip) =>
+ hints.some((hint) => clip.name.toLowerCase().includes(hint)),
+ ) ?? clips[0]
+ );
+}
export interface JointPose {
hipsY: number;
leftHip: number;
diff --git a/src/canvas/stageStoryboard.ts b/src/canvas/stageStoryboard.ts
new file mode 100644
index 000000000..1bc44a0ad
--- /dev/null
+++ b/src/canvas/stageStoryboard.ts
@@ -0,0 +1,197 @@
+/**
+ * The continuous Director Stage Storyboard: a read model and one explicit validator.
+ *
+ * The append rule lives in the backend application service. The UI sends
+ * `director.storyboard.append` and merges the block the server acknowledged; nothing here
+ * builds a block to persist. This module only projects what a stage already stores, for
+ * presentation and for prechecks the backend validates again.
+ *
+ * Every time is judged after millisecond normalization with the rule the Python service
+ * uses, so both sides reach the same verdict on the same input. The stored parser
+ * (`parseLocalStageValue`) deliberately stays lenient: a stage saved before the continuity
+ * rule still loads, and only a frontend write boundary calls {@link assertStageStoryboard}.
+ */
+import type { Translate } from "../i18n/I18nProvider.tsx";
+import type { DirectorDurationResult } from "../contracts/generated.ts";
+import { defaultTranslate } from "./assistantTranslate.ts";
+import {
+ parseLocalStageValue,
+ sampleStagePreview,
+ type LocalStageDocument,
+ type StageShot,
+} from "./stageDocument.ts";
+
+import {
+ assertStageStoryboard,
+ normalizeStoryboardTime,
+ stageStoryboardIssue,
+ storyboardBlockEnd,
+ STORYBOARD_TIME_TOLERANCE,
+ type StageStoryboardIssue,
+ type StageStoryboardSource,
+} from "./stageStoryboardRules.ts";
+
+export type StageStoryboardEdit =
+ | { type: "reorder"; blockIds: string[] }
+ | { type: "resize"; blockId: string; duration: number }
+ | { type: "delete"; blockId: string };
+
+export type StageCutEdit = StageStoryboardEdit
+ | { type: "deleteCamera"; cameraId: string }
+ | { type: "setDuration"; duration: number };
+
+export type StageCutReceipt = Pick & {
+ durationChange?: DirectorDurationResult;
+};
+
+/**
+ * The Storyboard laid out in a given order: its blocks in the order their ids are
+ * listed, the first from zero and each later one where the one before it ends. A
+ * block keeps everything it is handed but its start, its camera and its length.
+ *
+ * A drag to another place reads it for the line that says where the block would
+ * start from, the track for the order it shows once the block is let go, and the
+ * parent for where the playhead then goes: all three come from here, so none can
+ * stand for a start the others do not. The server computes the times it stores
+ * its own way when it accepts the command.
+ */
+export function packStageStoryboard(
+ shots: readonly StageShot[],
+ blockIds: readonly string[],
+): StageShot[] {
+ const stored = new Map(shots.map((shot) => [shot.id, shot]));
+ let start = 0;
+ return blockIds.flatMap((blockId) => {
+ const shot = stored.get(blockId);
+ if (!shot) return [];
+ const placed = { ...shot, start };
+ start = normalizeStoryboardTime(start + normalizeStoryboardTime(shot.duration));
+ return [placed];
+ });
+}
+
+export function sameStageStoryboard(
+ left: readonly StageShot[],
+ right: readonly StageShot[],
+): boolean {
+ return left.length === right.length && left.every((shot, index) => {
+ const other = right[index];
+ return shot.id === other.id && shot.cameraId === other.cameraId &&
+ shot.start === other.start && shot.duration === other.duration;
+ });
+}
+
+/** Mirrors the backend default. Only the precheck reads it; the server computes the block. */
+const DEFAULT_BLOCK_SECONDS = 2;
+
+export {
+ normalizeStoryboardTime, stageStoryboardIssue, stageStoryboardIssueMessageKey,
+ assertStageStoryboard, STAGE_STORYBOARD_ISSUES,
+} from "./stageStoryboardRules.ts";
+export type { StageStoryboardIssue } from "./stageStoryboardRules.ts";
+
+export interface StageStoryboardBlock {
+ readonly id: string;
+ readonly cameraId: string;
+ /** Position in the stored Storyboard, starting at zero. */
+ readonly order: number;
+ /** As stored, in seconds. */
+ readonly start: number;
+ /** As stored, in seconds. */
+ readonly duration: number;
+}
+
+export interface StageStoryboardView {
+ /** The stored blocks in stored order, reported as stored. */
+ readonly blocks: readonly StageStoryboardBlock[];
+ /** End of the last block in millisecond-normalized seconds; zero when there is none. */
+ readonly end: number;
+ readonly canAppend: boolean;
+ /** Why no block can be appended; null when one can. */
+ readonly cannotAppendReason: StageStoryboardIssue | null;
+}
+
+/**
+ * Whether positive main-timeline time remains after `start` for another block.
+ *
+ * The remainder is normalized first because the block is stored in milliseconds. When
+ * rounding it up would run past a main duration that itself has sub-millisecond precision,
+ * a millisecond is given back; if nothing positive remains there is no usable time.
+ */
+function hasUsableTime(stage: StageStoryboardSource, start: number): boolean {
+ const remaining = stage.duration - start;
+ const span = normalizeStoryboardTime(remaining);
+ if (remaining <= 0 || span <= 0) return false;
+ const capped = Math.min(DEFAULT_BLOCK_SECONDS, span);
+ if (capped - remaining <= STORYBOARD_TIME_TOLERANCE) return true;
+ return normalizeStoryboardTime(capped - 0.001) > 0;
+}
+
+/**
+ * The Storyboard of a stage for presentation and prechecks. Nothing is sorted, compacted,
+ * repaired or normalized in what it reports: the blocks are the stored blocks.
+ */
+export function readStageStoryboard(
+ stage: StageStoryboardSource,
+): StageStoryboardView {
+ const issue = stageStoryboardIssue(stage);
+ const last = stage.shots.at(-1);
+ const end = last ? storyboardBlockEnd(last) : 0;
+ const cannotAppendReason =
+ issue ?? (hasUsableTime(stage, end) ? null : "storyboard_exhausted");
+ return {
+ blocks: stage.shots.map((shot, order) => ({
+ id: shot.id,
+ cameraId: shot.cameraId,
+ order,
+ start: shot.start,
+ duration: shot.duration,
+ })),
+ end,
+ canAppend: cannotAppendReason === null,
+ cannotAppendReason,
+ };
+}
+
+/**
+ * Put a block the server already stored at the end of the latest draft.
+ *
+ * Nothing about the block is computed here: its identity, camera, start and duration
+ * are the server's, read from its immutable command receipt. The draft is judged
+ * as it is now, because the user may have kept editing while the command was in
+ * flight. When the result would not be a continuous Storyboard, nothing is merged and
+ * the error carries the localized reason.
+ */
+export function mergeStageStoryboardBlock(
+ stage: LocalStageDocument,
+ block: StageShot,
+ t: Translate = defaultTranslate,
+): LocalStageDocument {
+ const shots = [...stage.shots, { ...block }];
+ // The stable reason first: the stored parser would only say the interval is invalid.
+ assertStageStoryboard({ ...stage, shots }, t);
+ return parseLocalStageValue({ ...stage, shots }, t);
+}
+
+
+/** Freeze the scene and camera source for one export at absolute stage time. */
+export function stageExportPlan(
+ stage: LocalStageDocument,
+ source: string,
+ t: Translate = defaultTranslate,
+) {
+ const frozen = parseLocalStageValue(stage, t);
+ const storyboard = source === "storyboard";
+ if (storyboard) {
+ if (!frozen.shots.length)
+ throw new Error(t("editors.stage.error.exportStoryboardEmpty"));
+ assertStageStoryboard(frozen, t);
+ } else if (!frozen.cameras.some((camera) => camera.id === source)) {
+ throw new Error(t("editors.stage.error.cameraMissing"));
+ }
+ return {
+ duration: storyboard ? readStageStoryboard(frozen).end : frozen.duration,
+ sampleAt: (at: number) => sampleStagePreview(frozen,
+ storyboard ? { kind: "storyboard" } : { kind: "camera", cameraId: source }, at, t),
+ };
+}
diff --git a/src/canvas/stageStoryboardRules.ts b/src/canvas/stageStoryboardRules.ts
new file mode 100644
index 000000000..93f7d8248
--- /dev/null
+++ b/src/canvas/stageStoryboardRules.ts
@@ -0,0 +1,140 @@
+import type { ContractIssue } from "../contracts/generated.ts";
+import type { Translate } from "../i18n/I18nProvider.tsx";
+import type { MessageKey } from "../i18n/types.ts";
+import { defaultTranslate } from "./assistantTranslate.ts";
+import type { StageShot } from "./stageDocument.ts";
+
+export const STORYBOARD_TIME_TOLERANCE = 1e-8;
+
+/**
+ * Seconds rounded to milliseconds: half toward positive infinity, which is what
+ * `Math.round` does. The Python service reproduces this exact rule on the same double
+ * `value * 1000`, because its own `round` would send 1000.5 down where this sends it up.
+ */
+export function normalizeStoryboardTime(value: number): number {
+ const scaled = value * 1000;
+ return Number.isFinite(scaled) ? Math.round(scaled) / 1000 : value;
+}
+
+export function storyboardBlockEnd(shot: Pick): number {
+ return normalizeStoryboardTime(
+ normalizeStoryboardTime(shot.start) + normalizeStoryboardTime(shot.duration),
+ );
+}
+
+/**
+ * Stable reasons a Storyboard is not continuous or cannot take another block. They are
+ * business values shared with the backend catalog and are never translated; only the text
+ * {@link stageStoryboardIssueMessageKey} selects changes with the interface language.
+ */
+export const STAGE_STORYBOARD_ISSUES = [
+ "storyboard_leading_gap",
+ "storyboard_internal_gap",
+ "storyboard_overlap",
+ "storyboard_exceeds_duration",
+ "storyboard_duration_invalid",
+ "storyboard_camera_unknown",
+ "storyboard_block_invalid",
+ "storyboard_block_exists",
+ "storyboard_exhausted",
+ "storyboard_order_invalid",
+ "storyboard_block_unknown",
+] as const;
+
+export type StageStoryboardIssue = (typeof STAGE_STORYBOARD_ISSUES)[number];
+
+/**
+ * What the Storyboard rules read. A local stage satisfies it, and so does the Director
+ * Stage document a command carries, so one validator serves both write boundaries.
+ */
+export interface StageStoryboardSource {
+ readonly duration: number;
+ readonly shots: readonly StageShot[];
+ readonly cameras: readonly { readonly id: string }[];
+}
+
+/**
+ * The generated contract is the source of truth. A backend code without an entry here, or
+ * an entry the backend does not know, makes this type `never`.
+ */
+type BackendStoryboardIssue = Extract;
+export type StoryboardIssuesMatchTheBackend = [
+ Exclude,
+ Exclude,
+] extends [never, never]
+ ? true
+ : never;
+
+/**
+ * Keeps the promise above: the build fails on this line when the two lists disagree.
+ * `never` accepts no value, so one code that either side has alone is a compile error.
+ */
+export const STORYBOARD_ISSUES_MATCH_BACKEND: StoryboardIssuesMatchTheBackend = true;
+
+/**
+ * The first continuity violation of a stage's Storyboard, or null when it is continuous.
+ *
+ * Blocks are read in stored order and never changed: the first starts at zero, each later
+ * one starts where the previous one ends, every duration is positive, every camera exists
+ * and every identity is used once. Times are judged after normalization, so float noise is
+ * neither a gap nor an overlap and a duration that rounds to nothing is not positive.
+ */
+export function stageStoryboardIssue(
+ stage: StageStoryboardSource,
+): StageStoryboardIssue | null {
+ const cameras = new Set(stage.cameras.map((camera) => camera.id));
+ const identities = new Set();
+ let previousEnd = 0;
+ for (const [index, shot] of stage.shots.entries()) {
+ if (identities.has(shot.id)) return "storyboard_block_exists";
+ identities.add(shot.id);
+ if (!cameras.has(shot.cameraId)) return "storyboard_camera_unknown";
+ const start = normalizeStoryboardTime(shot.start);
+ const duration = normalizeStoryboardTime(shot.duration);
+ if (duration <= 0) return "storyboard_duration_invalid";
+ if (index === 0 && start !== 0) return "storyboard_leading_gap";
+ if (start > previousEnd) return "storyboard_internal_gap";
+ if (start < previousEnd) return "storyboard_overlap";
+ const end = storyboardBlockEnd(shot);
+ if (end - stage.duration > STORYBOARD_TIME_TOLERANCE) {
+ return "storyboard_exceeds_duration";
+ }
+ previousEnd = end;
+ }
+ return null;
+}
+
+const ISSUE_MESSAGE_KEYS = {
+ storyboard_leading_gap: "editors.stage.storyboard.reason.leadingGap",
+ storyboard_internal_gap: "editors.stage.storyboard.reason.internalGap",
+ storyboard_overlap: "editors.stage.storyboard.reason.overlap",
+ storyboard_exceeds_duration: "editors.stage.storyboard.reason.exceedsDuration",
+ storyboard_duration_invalid: "editors.stage.storyboard.reason.durationInvalid",
+ storyboard_camera_unknown: "editors.stage.storyboard.reason.cameraUnknown",
+ storyboard_block_invalid: "editors.stage.storyboard.reason.blockInvalid",
+ storyboard_block_exists: "editors.stage.storyboard.reason.blockExists",
+ storyboard_order_invalid: "editors.stage.storyboard.reason.orderInvalid",
+ storyboard_block_unknown: "editors.stage.storyboard.reason.blockUnknown",
+ storyboard_exhausted: "editors.stage.storyboard.reason.exhausted",
+} as const satisfies Record;
+
+/** The catalog entry that explains one stable reason. */
+export function stageStoryboardIssueMessageKey(
+ issue: StageStoryboardIssue,
+): MessageKey {
+ return ISSUE_MESSAGE_KEYS[issue];
+}
+
+/**
+ * Reject a discontinuous Storyboard at a frontend write boundary, with the localized
+ * reason. The backend validates the same rule again when the document is saved.
+ */
+export function assertStageStoryboard(
+ stage: StageStoryboardSource,
+ t: Translate = defaultTranslate,
+): void {
+ const issue = stageStoryboardIssue(stage);
+ if (issue !== null) {
+ throw new Error(t(stageStoryboardIssueMessageKey(issue)));
+ }
+}
diff --git a/src/canvas/stageStoryboardThumbnail.ts b/src/canvas/stageStoryboardThumbnail.ts
new file mode 100644
index 000000000..7b84bf043
--- /dev/null
+++ b/src/canvas/stageStoryboardThumbnail.ts
@@ -0,0 +1,116 @@
+import {
+ normalizeStoryboardTime,
+ type LocalStageDocument,
+ type StageObject,
+ type StageShot,
+} from "./stageDocument.ts";
+
+/**
+ * A subject as the cameras see it. Its name, its lock, the card thumbnail the
+ * editor shows for it and the browser URL its model is served from are editor
+ * business: the model is pinned by its asset, and the picture follows that.
+ */
+const picturedSubject = ({
+ name: _name,
+ locked: _locked,
+ thumbnailCapture: _capture,
+ thumbnailSource: _thumbnailSource,
+ thumbnailAsset: _thumbnailAsset,
+ source: _source,
+ ...pictured
+}: StageObject) => pictured;
+
+/**
+ * What one Storyboard block's thumbnail pictures, as a comparable value.
+ *
+ * `sceneRevision` counts what the live scene gained that the document alone does not
+ * announce, such as a model that finished loading or a background that arrived. A
+ * picture made before such a change would otherwise stand until the document changed.
+ * It is view state and never a field of the stage.
+ */
+export function prepareStageStoryboardThumbnailKeys(
+ stage: LocalStageDocument,
+ sceneRevision: number,
+): (block: StageShot) => string {
+ const scene = JSON.stringify({
+ aspectRatio: stage.aspectRatio,
+ background: stage.background,
+ environment: stage.environment,
+ lights: stage.lights,
+ objects: stage.objects.map(picturedSubject),
+ sceneRevision,
+ });
+ const cameras = new Map(stage.cameras.map(({ name: _name, ...camera }) => [
+ camera.id,
+ JSON.stringify(camera),
+ ]));
+ return (block) => {
+ const interval = JSON.stringify([block.id, block.cameraId, normalizeStoryboardTime(block.start)]);
+ // JSON escapes newlines in values, so the three segments remain unambiguous.
+ return `${interval}\n${cameras.get(block.cameraId) ?? "null"}\n${scene}`;
+ };
+}
+
+/** Whether a block's thumbnail is a picture, nothing yet, or nothing possible. */
+export type StageStoryboardThumbnailState = "pending" | "ready" | "failed";
+
+/** How tall a thumbnail's picture is, in pixels. It is shown at a third of this or
+ * smaller, so it stays sharp on a high-density screen and still costs little to make. */
+const THUMBNAIL_HEIGHT = 72;
+
+/** A thumbnail's picture in the stage's output frame: the output aspect ratio, small. */
+export function stageStoryboardThumbnailSize(
+ aspectRatio: LocalStageDocument["aspectRatio"],
+): { width: number; height: number } {
+ const [wide, tall] = aspectRatio.split(":").map(Number) as [number, number];
+ return {
+ width: Math.round((THUMBNAIL_HEIGHT * wide) / tall),
+ height: THUMBNAIL_HEIGHT,
+ };
+}
+
+/** The thumbnails of one open editor. It lives beside the document, never in it. */
+export class StageStoryboardThumbnailCache {
+ private wanted = new Map();
+ private entries = new Map();
+
+ /** The key a block's thumbnail must show now. */
+ want(blockId: string, key: string): void {
+ this.wanted.set(blockId, key);
+ }
+
+ /** Forget every block that is not named, and with it what was made for it. */
+ retain(blockIds: readonly string[]): void {
+ for (const blockId of [...this.wanted.keys()])
+ if (!blockIds.includes(blockId)) {
+ this.wanted.delete(blockId);
+ this.entries.delete(blockId);
+ }
+ }
+
+ /** Keep what was made for one key. A result whose key the block has already
+ * left is dropped, so a late picture never stands in for a newer one. */
+ store(blockId: string, key: string, image: string | null): boolean {
+ if (this.wanted.get(blockId) !== key) return false;
+ this.entries.set(blockId, { key, image });
+ return true;
+ }
+
+ state(blockId: string): StageStoryboardThumbnailState {
+ const entry = this.entries.get(blockId);
+ if (!entry || entry.key !== this.wanted.get(blockId)) return "pending";
+ return entry.image === null ? "failed" : "ready";
+ }
+
+ image(blockId: string): string | null {
+ const entry = this.entries.get(blockId);
+ return entry && entry.key === this.wanted.get(blockId) ? entry.image : null;
+ }
+
+ /** The blocks still waiting for the key they show. */
+ pending(): { blockId: string; key: string }[] {
+ return [...this.wanted]
+ .filter(([blockId, key]) => this.entries.get(blockId)?.key !== key)
+ .map(([blockId, key]) => ({ blockId, key }));
+ }
+}
diff --git a/src/canvas/stageStoryboardThumbnailRender.ts b/src/canvas/stageStoryboardThumbnailRender.ts
new file mode 100644
index 000000000..1ea980ca6
--- /dev/null
+++ b/src/canvas/stageStoryboardThumbnailRender.ts
@@ -0,0 +1,103 @@
+import * as THREE from "three";
+import type { StageCamera, StageSample, Vector3Value } from "./stageDocument.ts";
+
+/** The live viewport a thumbnail is pictured from. The pass borrows its canvas for
+ * one frame and leaves everything as it found it. */
+export interface StageStoryboardThumbnailViewport {
+ renderer: THREE.WebGLRenderer;
+ scene: THREE.Scene;
+ /** Hide what only the viewport shows, and return how to put it back. */
+ hideViewport: () => () => void;
+ /** Pose the scene's objects as a sample has them at its time. */
+ pose: (sample: StageSample) => void;
+ /** Put the scene back as the viewport shows it now, and draw that frame. */
+ show: () => void;
+}
+
+/** As far as the viewport's cameras see. */
+const NEAR = 0.05;
+const FAR = 1000;
+
+/** Pose a camera as a sample has it, the way the viewport's preview cameras are
+ * posed: the authored up vector first, then the look at its target, the roll on top. */
+export function poseStagePreviewCamera(
+ camera: THREE.PerspectiveCamera,
+ pose: StageCamera,
+ up: Vector3Value,
+ aspect: number,
+ fov = pose.fov,
+) {
+ camera.aspect = aspect;
+ camera.fov = fov;
+ camera.position.set(pose.position.x, pose.position.y, pose.position.z);
+ camera.up.set(up.x, up.y, up.z);
+ camera.lookAt(pose.target.x, pose.target.y, pose.target.z);
+ camera.rotateZ(pose.roll ?? 0);
+ camera.updateProjectionMatrix();
+ camera.updateMatrixWorld(true);
+}
+
+/** Copy a WebGL viewport rectangle in device pixels into a 2D canvas. */
+export function copyStageViewportPixels(
+ source: HTMLCanvasElement,
+ context: CanvasRenderingContext2D,
+ rect: { x: number; y: number; width: number; height: number },
+) {
+ const { x, y, width, height } = rect;
+ context.drawImage(source, x, source.height - y - height, width, height, 0, 0, width, height);
+}
+
+/**
+ * Picture one frame of the live scene, through a camera of its own.
+ *
+ * The frame is drawn into a corner of the canvas the viewport owns, at exactly the
+ * size it is read back at, and copied out from there. Drawing to that canvas is what
+ * the viewport itself does, so the picture has the viewport's tone mapping and
+ * colour; a render target would give it neither. The canvas is not resized, and
+ * nothing of this frame stays on it: whatever happens, the viewport's own frame is
+ * drawn again before this returns, in the same task, so no other frame is ever seen.
+ */
+export function captureStageStoryboardThumbnail(
+ viewport: StageStoryboardThumbnailViewport,
+ sample: StageSample,
+ up: Vector3Value,
+ size: { width: number; height: number },
+): string {
+ const { renderer, scene } = viewport;
+ const camera = new THREE.PerspectiveCamera(
+ sample.camera.fov,
+ size.width / size.height,
+ NEAR,
+ FAR,
+ );
+ poseStagePreviewCamera(camera, sample.camera, up, size.width / size.height);
+ const previous = {
+ viewport: renderer.getViewport(new THREE.Vector4()),
+ scissor: renderer.getScissor(new THREE.Vector4()),
+ scissorTest: renderer.getScissorTest(),
+ };
+ const restoreViewport = viewport.hideViewport();
+ try {
+ viewport.pose(sample);
+ // The corner in the canvas's own units. The drawing buffer is that times the
+ // pixel ratio, so the picture comes out at `size` device pixels exactly.
+ const ratio = renderer.getPixelRatio();
+ renderer.setScissorTest(true);
+ renderer.setViewport(0, 0, size.width / ratio, size.height / ratio);
+ renderer.setScissor(0, 0, size.width / ratio, size.height / ratio);
+ renderer.render(scene, camera);
+ const picture = document.createElement("canvas");
+ picture.width = size.width;
+ picture.height = size.height;
+ const context = picture.getContext("2d");
+ if (!context) throw new Error("Stage thumbnail canvas is unavailable");
+ copyStageViewportPixels(renderer.domElement, context, { x: 0, y: 0, ...size });
+ return picture.toDataURL("image/png");
+ } finally {
+ renderer.setViewport(previous.viewport);
+ renderer.setScissor(previous.scissor);
+ renderer.setScissorTest(previous.scissorTest);
+ restoreViewport();
+ viewport.show();
+ }
+}
diff --git a/src/canvas/stageTimeline.ts b/src/canvas/stageTimeline.ts
new file mode 100644
index 000000000..75abecfcb
--- /dev/null
+++ b/src/canvas/stageTimeline.ts
@@ -0,0 +1,724 @@
+import {
+ editStageCameraAt,
+ editStageObjectAt,
+ parseLocalStageValue,
+ sampleStage,
+ sampleStageCamera,
+ type LocalStageDocument,
+ type StageBezierTransition,
+ type StageCameraChannels,
+ type StageMotionClip,
+ type StageTransform,
+ type StageTransition,
+ type Vector3Value,
+} from "./stageDocument.ts";
+import type { StageMotion } from "./stageMotion.ts";
+
+export type StageTimelineTrackKind =
+ | "shots"
+ | "camera-channel"
+ | "object-channel";
+export type StageTimelineChannel =
+ | keyof StageCameraChannels
+ | "position"
+ | "rotation"
+ | "scale"
+ | "motion";
+export type StageTimelinePointKind = "boundary" | "keyframe";
+
+/** Structural label data; the Director Stage UI resolves it through i18n. */
+export type StageTimelineTrackLabel =
+ | { readonly kind: "shots" }
+ | {
+ readonly kind: "source";
+ readonly name: string;
+ readonly channel: StageTimelineChannel;
+ };
+
+export interface StageTimelinePoint {
+ readonly id: string;
+ readonly time: number;
+ readonly kind: StageTimelinePointKind;
+ readonly value?: unknown;
+}
+
+export interface StageTimelineTrack {
+ readonly id: string;
+ readonly kind: StageTimelineTrackKind;
+ readonly label: StageTimelineTrackLabel;
+ readonly sourceId?: string;
+ readonly channel?: StageTimelineChannel;
+ readonly points: readonly StageTimelinePoint[];
+ readonly intervals?: readonly StageTimelineStoryboardInterval[];
+}
+
+export interface StageTimelineInterval {
+ readonly id: string;
+ readonly start: StageTimelinePoint;
+ readonly end: StageTimelinePoint;
+ readonly cameraId?: string;
+ readonly duration?: number;
+}
+
+export interface StageTimelineStoryboardInterval extends StageTimelineInterval {
+ /** The interval id is the persisted Storyboard block id. */
+ readonly cameraId: string;
+ readonly duration: number;
+}
+
+export interface StageTimelineProjection {
+ readonly duration: number;
+ readonly fps: LocalStageDocument["fps"];
+ readonly tracks: readonly StageTimelineTrack[];
+}
+
+export type StageTimelineRulerTickKind = "major" | "minor";
+
+export interface StageTimelineRulerTick {
+ readonly time: number;
+ readonly kind: StageTimelineRulerTickKind;
+}
+
+export interface StageTimelineRuler {
+ readonly majorStep: number;
+ readonly minorStep: number;
+ readonly ticks: readonly StageTimelineRulerTick[];
+}
+
+export type StageTimelineTrackGroup =
+ | {
+ readonly id: "shots";
+ readonly kind: "shots";
+ readonly label: { readonly kind: "shots" };
+ readonly tracks: readonly StageTimelineTrack[];
+ }
+ | {
+ readonly id: string;
+ readonly kind: "camera" | "object";
+ readonly label: {
+ readonly kind: "source";
+ readonly sourceId: string;
+ readonly name: string;
+ };
+ readonly sourceId: string;
+ readonly tracks: readonly StageTimelineTrack[];
+ };
+
+export interface StageTimelineSnapOptions {
+ readonly tolerance?: number;
+ readonly includeFrames?: boolean;
+ readonly includeKeyframes?: boolean;
+ readonly includeShotBoundaries?: boolean;
+}
+
+export type StageTimelineKeyframeTarget =
+ | {
+ readonly kind: "camera";
+ readonly sourceId: string;
+ readonly channel: keyof StageCameraChannels;
+ readonly pointId: string;
+ }
+ | {
+ readonly kind: "object";
+ readonly sourceId: string;
+ readonly channel: "position" | "rotation" | "scale";
+ readonly pointId: string;
+ };
+
+export type StageTimelineIntervalTarget =
+ | {
+ readonly kind: "camera";
+ readonly sourceId: string;
+ readonly channel: keyof StageCameraChannels;
+ readonly startPointId: string;
+ readonly endPointId: string;
+ }
+ | {
+ readonly kind: "object";
+ readonly sourceId: string;
+ readonly channel: "position" | "rotation" | "scale";
+ readonly startPointId: string;
+ readonly endPointId: string;
+ };
+
+const clone = (value: T): T => structuredClone(value);
+const sameVector = (left: Vector3Value, right: Vector3Value) =>
+ left.x === right.x && left.y === right.y && left.z === right.z;
+const clampTime = (stage: LocalStageDocument, time: number) =>
+ Math.max(0, Math.min(stage.duration, Number.isFinite(time) ? time : 0));
+
+const point = (
+ id: string,
+ time: number,
+ kind: StageTimelinePointKind,
+ value?: unknown,
+): StageTimelinePoint => ({
+ id,
+ time,
+ kind,
+ ...(value === undefined ? {} : { value: clone(value) }),
+});
+
+function ordered(points: StageTimelinePoint[]): readonly StageTimelinePoint[] {
+ return points.sort((a, b) => a.time - b.time || a.id.localeCompare(b.id));
+}
+
+function cameraChannels(camera: LocalStageDocument["cameras"][number]): StageCameraChannels {
+ if (camera.channels) return camera.channels;
+ return {
+ position: camera.keyframes.map((frame) => ({ id: frame.id, time: frame.time, value: clone(frame.value.position) })),
+ target: camera.keyframes.map((frame) => ({ id: frame.id, time: frame.time, value: clone(frame.value.target) })),
+ up: [],
+ focalLength: camera.keyframes.map((frame) => ({ id: frame.id, time: frame.time, value: frame.value.fov })),
+ };
+}
+
+export type StageTimelineKeyframeAddTarget =
+ | {
+ readonly kind: "camera";
+ readonly sourceId: string;
+ readonly channel: keyof StageCameraChannels;
+ }
+ | {
+ readonly kind: "object";
+ readonly sourceId: string;
+ readonly channel: "position" | "rotation" | "scale";
+ };
+
+function framePoints(
+ frames: readonly { id: string; time: number; value: unknown }[],
+): StageTimelinePoint[] {
+ return frames.map((frame) => point(frame.id, frame.time, "keyframe", frame.value));
+}
+
+function cameraTracks(stage: LocalStageDocument): StageTimelineTrack[] {
+ return stage.cameras.flatMap((camera) => {
+ const channels = cameraChannels(camera);
+ return (Object.keys(channels) as (keyof StageCameraChannels)[]).map((channel) => ({
+ id: `camera:${camera.id}:${channel}`,
+ kind: "camera-channel" as const,
+ label: { kind: "source" as const, name: camera.name, channel },
+ sourceId: camera.id,
+ channel,
+ points: ordered(framePoints(channels[channel] as readonly { id: string; time: number; value: unknown }[])),
+ }));
+ });
+}
+
+function objectTracks(stage: LocalStageDocument): StageTimelineTrack[] {
+ return stage.objects.flatMap((object) => {
+ const transformChannels = (["position", "rotation", "scale"] as const).map((channel) => {
+ const explicitChannels = object.keyframes.some((frame) => frame.keyedChannels);
+ const frames = object.keyframes
+ .filter((frame) => explicitChannels ? frame.keyedChannels?.includes(channel) : true)
+ .map((frame) => ({ id: frame.id, time: frame.time, value: frame.value[channel] }));
+ return {
+ id: `object:${object.id}:${channel}`,
+ kind: "object-channel" as const,
+ label: { kind: "source" as const, name: object.name, channel },
+ sourceId: object.id,
+ channel,
+ points: ordered(framePoints(
+ explicitChannels || frames.some((frame) => !sameVector(frame.value, object[channel]))
+ ? frames
+ : [],
+ )),
+ };
+ });
+ const motionPoints = object.motionClips.flatMap((clip) => [
+ point(`${clip.id}:start`, clip.start, "boundary", clip.motion),
+ point(`${clip.id}:end`, clip.start + clip.duration, "boundary"),
+ ]);
+ return [...transformChannels, {
+ id: `object:${object.id}:motion`,
+ kind: "object-channel" as const,
+ label: { kind: "source" as const, name: object.name, channel: "motion" as const },
+ sourceId: object.id,
+ channel: "motion" as const,
+ points: ordered(motionPoints),
+ }];
+ });
+}
+
+export function groupStageTimelineTracks(
+ projection: StageTimelineProjection,
+): readonly StageTimelineTrackGroup[] {
+ const groups: StageTimelineTrackGroup[] = [];
+ const sourceTracks = new Map();
+ const sourceMeta = new Map<
+ string,
+ { kind: "camera" | "object"; sourceId: string; name: string }
+ >();
+
+ for (const track of projection.tracks) {
+ if (track.kind === "shots") {
+ if (!groups.some((group) => group.kind === "shots")) {
+ groups.push({
+ id: "shots",
+ kind: "shots",
+ label: { kind: "shots" },
+ tracks: [track],
+ });
+ }
+ continue;
+ }
+ if (!track.sourceId || track.label.kind === "shots") continue;
+ const sourceId = track.sourceId;
+ const key = `${track.kind}:${sourceId}`;
+ const tracks = sourceTracks.get(key) ?? [];
+ tracks.push(track);
+ sourceTracks.set(key, tracks);
+ sourceMeta.set(key, {
+ kind: track.kind === "camera-channel" ? "camera" : "object",
+ sourceId,
+ name: track.label.name,
+ });
+ }
+
+ for (const [key, tracks] of sourceTracks) {
+ const meta = sourceMeta.get(key);
+ if (!meta) continue;
+ groups.push({
+ id: `${meta.kind}:${meta.sourceId}`,
+ kind: meta.kind,
+ label: {
+ kind: "source",
+ sourceId: meta.sourceId,
+ name: meta.name,
+ },
+ sourceId: meta.sourceId,
+ tracks,
+ });
+ }
+ return groups;
+}
+
+/**
+ * Projects the directly interpolated spans in a track. Keyframe tracks use
+ * adjacent keyframes, motion tracks use boundary pairs, and Storyboard tracks
+ * expose the identity-bearing intervals projected from their persisted blocks.
+ */
+export function stageTimelineIntervals(
+ track: StageTimelineTrack,
+): readonly StageTimelineInterval[] {
+ if (track.kind === "shots") return track.intervals ?? [];
+ const keyframes = track.points.filter((point) => point.kind === "keyframe");
+ if (keyframes.length >= 2) {
+ return keyframes.flatMap((start, index) => {
+ const end = keyframes[index + 1];
+ return end
+ ? [{
+ id: `${track.id}:interval:${start.id}:${end.id}`,
+ start,
+ end,
+ }]
+ : [];
+ });
+ }
+ const boundaries = track.points.filter((point) => point.kind === "boundary");
+ return boundaries.flatMap((start, index) => {
+ if (index % 2 !== 0) return [];
+ const end = boundaries[index + 1];
+ return end
+ ? [{
+ id: `${track.id}:interval:${start.id}:${end.id}`,
+ start,
+ end,
+ }]
+ : [];
+ });
+}
+
+const RULER_MAJOR_STEPS = [0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 30, 60] as const;
+
+export function stageTimelineRuler(duration: number): StageTimelineRuler {
+ const boundedDuration = Math.max(
+ 0,
+ Number.isFinite(duration) ? duration : 0,
+ );
+ const targetMajorStep = boundedDuration / 24;
+ const majorStep =
+ RULER_MAJOR_STEPS.find((step) => step >= targetMajorStep) ??
+ RULER_MAJOR_STEPS.at(-1)!;
+ const minorStep = majorStep / 5;
+ const tickCount = Math.ceil(boundedDuration / minorStep);
+ const ticks: StageTimelineRulerTick[] = [];
+
+ for (let index = 0; index <= tickCount; index += 1) {
+ const time = Number(
+ Math.min(index * minorStep, boundedDuration).toFixed(6),
+ );
+ if (ticks.at(-1)?.time === time) continue;
+ const isMajor =
+ Math.abs(time / majorStep - Math.round(time / majorStep)) < 0.000001;
+ ticks.push({
+ time,
+ kind: isMajor || time === boundedDuration ? "major" : "minor",
+ });
+ }
+
+ return { majorStep, minorStep, ticks };
+}
+
+export function projectStageTimeline(stage: LocalStageDocument): StageTimelineProjection {
+ const shotIntervals = [...stage.shots]
+ .sort((left, right) => left.start - right.start || left.id.localeCompare(right.id))
+ .map((shot) => ({
+ id: shot.id,
+ cameraId: shot.cameraId,
+ duration: shot.duration,
+ start: point(`${shot.id}:start`, shot.start, "boundary", shot.id),
+ end: point(
+ `${shot.id}:end`,
+ shot.start + shot.duration,
+ "boundary",
+ shot.id,
+ ),
+ }));
+ const shotPoints = shotIntervals.flatMap((interval) => [
+ interval.start,
+ interval.end,
+ ]);
+ return {
+ duration: stage.duration,
+ fps: stage.fps,
+ tracks: [
+ {
+ id: "shots",
+ kind: "shots",
+ label: { kind: "shots" },
+ points: ordered(shotPoints),
+ intervals: shotIntervals,
+ },
+ ...cameraTracks(stage),
+ ...objectTracks(stage),
+ ],
+ };
+}
+
+export function stageFrameToTime(stage: LocalStageDocument, frame: number): number {
+ const lastFrame = Math.max(0, Math.round(stage.duration * stage.fps));
+ const requested = Number.isFinite(frame) ? Math.round(frame) : 0;
+ const bounded = Math.max(0, Math.min(lastFrame, requested));
+ return Math.min(stage.duration, bounded / stage.fps);
+}
+
+export function stageTimeToFrame(stage: LocalStageDocument, time: number): number {
+ return Math.round(clampTime(stage, time) * stage.fps);
+}
+
+export function snapStageTimelineTime(
+ stage: LocalStageDocument,
+ time: number,
+ options: StageTimelineSnapOptions = {},
+): number {
+ const at = clampTime(stage, time);
+ const candidates: number[] = [];
+ if (options.includeFrames !== false) candidates.push(stageFrameToTime(stage, stageTimeToFrame(stage, at)));
+ if (options.includeKeyframes !== false || options.includeShotBoundaries !== false) {
+ if (options.includeShotBoundaries !== false) {
+ candidates.push(...stage.shots.flatMap((shot) => [shot.start, shot.start + shot.duration]));
+ }
+ if (options.includeKeyframes !== false) {
+ for (const camera of stage.cameras) {
+ const channels = cameraChannels(camera);
+ const channelFrames = [
+ channels.position,
+ channels.target,
+ channels.up,
+ channels.focalLength,
+ ];
+ candidates.push(...channelFrames.flatMap((frames) => frames.map((frame) => frame.time)));
+ }
+ for (const object of stage.objects) {
+ candidates.push(...object.keyframes.map((frame) => frame.time));
+ candidates.push(...object.motionClips.flatMap((clip) => [clip.start, clip.start + clip.duration]));
+ }
+ }
+ }
+ const tolerance = options.tolerance ?? 0.5 / stage.fps;
+ const nearest = candidates
+ .map((candidate) => ({ candidate, distance: Math.abs(candidate - at) }))
+ .filter((item) => item.distance <= tolerance)
+ .sort((a, b) => a.distance - b.distance || a.candidate - b.candidate)[0];
+ return nearest?.candidate ?? at;
+}
+
+function putFrame(
+ frames: readonly T[],
+ time: number,
+ value: T["value"],
+): T[] {
+ const existing = frames.find((frame) => frame.time === time);
+ return [...frames.filter((frame) => frame.time !== time), {
+ ...existing,
+ id: existing?.id ?? crypto.randomUUID(),
+ time,
+ value: clone(value),
+ } as T].sort((a, b) => a.time - b.time);
+}
+
+const linearTransition = (): StageTransition => ({ kind: "linear" });
+
+function intervalTrack(stage: LocalStageDocument, target: StageTimelineIntervalTarget): StageTimelineTrack | undefined {
+ const trackId = `${target.kind}:${target.sourceId}:${target.channel}`;
+ const track = projectStageTimeline(stage).tracks.find((item) => item.id === trackId);
+ const interval = track && stageTimelineIntervals(track).find(
+ (item) => item.start.id === target.startPointId && item.end.id === target.endPointId,
+ );
+ return interval ? track : undefined;
+}
+
+export function stageTimelineIntervalTransition(
+ stage: LocalStageDocument,
+ target: StageTimelineIntervalTarget,
+): StageTransition {
+ if (!intervalTrack(stage, target)) return linearTransition();
+ if (target.kind === "camera") {
+ const camera = stage.cameras.find((item) => item.id === target.sourceId);
+ const frame = camera && cameraChannels(camera)[target.channel].find(
+ (item) => item.id === target.startPointId,
+ );
+ return frame?.transition ? clone(frame.transition) : linearTransition();
+ }
+ const object = stage.objects.find((item) => item.id === target.sourceId);
+ const frame = object?.keyframes.find((item) => item.id === target.startPointId);
+ const transition = frame?.transitions?.[target.channel];
+ return transition ? clone(transition) : linearTransition();
+}
+
+export function setStageTimelineIntervalTransition(
+ stage: LocalStageDocument,
+ target: StageTimelineIntervalTarget,
+ value: StageTransition,
+): LocalStageDocument {
+ if (!intervalTrack(stage, target)) return stage;
+ const transition: StageBezierTransition | undefined = value.kind === "bezier" ? clone(value) : undefined;
+ if (target.kind === "camera") {
+ return parseLocalStageValue({
+ ...stage,
+ cameras: stage.cameras.map((camera) => {
+ if (camera.id !== target.sourceId) return camera;
+ const channels = cameraChannels(camera);
+ return {
+ ...camera,
+ channels: {
+ ...channels,
+ [target.channel]: channels[target.channel].map((frame) =>
+ frame.id === target.startPointId ? { ...frame, transition } : frame,
+ ),
+ },
+ };
+ }),
+ });
+ }
+ return parseLocalStageValue({
+ ...stage,
+ objects: stage.objects.map((object) => {
+ if (object.id !== target.sourceId) return object;
+ return {
+ ...object,
+ keyframes: object.keyframes.map((frame) => {
+ if (frame.id !== target.startPointId) return frame;
+ const transitions = { ...frame.transitions, [target.channel]: transition };
+ if (!transition) delete transitions[target.channel];
+ return { ...frame, transitions: Object.keys(transitions).length ? transitions : undefined };
+ }),
+ };
+ }),
+ });
+}
+
+function authorChannel(
+ frames: readonly T[],
+ time: number,
+ value: T["value"],
+ base: T["value"],
+): T[] {
+ return putFrame(frames.length || time === 0 ? frames : putFrame([], 0, base), time, value);
+}
+
+export function editStageCameraChannelAt(
+ stage: LocalStageDocument,
+ cameraId: string,
+ channel: keyof StageCameraChannels,
+ time: number,
+ value: Vector3Value | number,
+): LocalStageDocument {
+ const at = clampTime(stage, time);
+ if (channel !== "up") {
+ return editStageCameraAt(stage, cameraId, at, {
+ ...(channel === "position" ? { position: value as Vector3Value } : {}),
+ ...(channel === "target" ? { target: value as Vector3Value } : {}),
+ ...(channel === "focalLength" ? { fov: value as number } : {}),
+ });
+ }
+ const camera = stage.cameras.find((item) => item.id === cameraId);
+ if (!camera) return stage;
+ const channels = cameraChannels(camera);
+ const nextChannels = {
+ ...channels,
+ up: authorChannel(channels.up, at, value as Vector3Value, { x: 0, y: 1, z: 0 }),
+ };
+ return parseLocalStageValue({
+ ...stage,
+ cameras: stage.cameras.map((item) => item.id === cameraId ? { ...item, channels: nextChannels } : item),
+ });
+}
+
+/** Add one explicit channel keyframe without changing sibling channels. */
+export function addStageTimelineKeyframeAt(
+ stage: LocalStageDocument,
+ target: StageTimelineKeyframeAddTarget,
+ time: number,
+): LocalStageDocument {
+ const at = clampTime(stage, time);
+ if (target.kind === "camera") {
+ const camera = stage.cameras.find((item) => item.id === target.sourceId);
+ if (!camera) return stage;
+ const channels = cameraChannels(camera);
+ const sampled = sampleStageCamera(stage, target.sourceId, at);
+ const nextChannels =
+ target.channel === "position"
+ ? { ...channels, position: putFrame(channels.position, at, sampled.position) }
+ : target.channel === "target"
+ ? { ...channels, target: putFrame(channels.target, at, sampled.target) }
+ : target.channel === "up"
+ ? { ...channels, up: putFrame(channels.up, at, { x: 0, y: 1, z: 0 }) }
+ : { ...channels, focalLength: putFrame(channels.focalLength, at, sampled.fov) };
+ return parseLocalStageValue({
+ ...stage,
+ cameras: stage.cameras.map((item) =>
+ item.id === target.sourceId ? { ...item, channels: nextChannels } : item,
+ ),
+ });
+ }
+
+ const object = stage.objects.find((item) => item.id === target.sourceId);
+ if (!object || object.locked) return stage;
+ const sampled = sampleStage(stage, at).objects.find((item) => item.id === target.sourceId);
+ if (!sampled) return stage;
+ const keyedFrames = object.keyframes.some((frame) => frame.keyedChannels)
+ ? object.keyframes
+ : object.keyframes.map((frame) => ({
+ ...frame,
+ keyedChannels: ["position", "rotation", "scale"] as ("position" | "rotation" | "scale")[],
+ }));
+ return parseLocalStageValue({
+ ...stage,
+ objects: stage.objects.map((item) =>
+ item.id === target.sourceId
+ ? { ...item, keyframes: putFrame(keyedFrames, at, {
+ position: clone(sampled.position),
+ rotation: clone(sampled.rotation),
+ scale: clone(sampled.scale),
+ }).map((frame) => frame.time === at
+ ? { ...frame, keyedChannels: [...new Set([...(frame.keyedChannels ?? []), target.channel])] }
+ : frame) }
+ : item,
+ ),
+ });
+}
+
+export function editStageObjectTransformChannelAt(
+ stage: LocalStageDocument,
+ objectId: string,
+ channel: "position" | "rotation" | "scale",
+ time: number,
+ value: Vector3Value,
+): LocalStageDocument {
+ return editStageObjectAt(stage, objectId, clampTime(stage, time), { [channel]: value } as Partial);
+}
+
+export function editStageObjectMotionAt(
+ stage: LocalStageDocument,
+ objectId: string,
+ time: number,
+ motion: StageMotion,
+): LocalStageDocument {
+ const object = stage.objects.find((item) => item.id === objectId);
+ if (
+ !object ||
+ object.locked ||
+ !(object.kind === "person" ||
+ (object.kind === "gltf" && object.role === "character" && object.hasAnimation))
+ )
+ return stage;
+ const at = clampTime(stage, time);
+ if (at >= stage.duration) return stage;
+ const existing = object.motionClips.find((clip) => at >= clip.start && at < clip.start + clip.duration);
+ const nextStart = object.motionClips
+ .filter((clip) => clip.start > at)
+ .map((clip) => clip.start)
+ .sort((a, b) => a - b)[0] ?? stage.duration;
+ const duration = Math.min(2, nextStart - at);
+ if (!existing && duration <= 0) return stage;
+ const next: StageMotionClip = existing
+ ? { ...existing, motion: clone(motion) }
+ : { id: crypto.randomUUID(), start: at, duration, motion: clone(motion) };
+ return parseLocalStageValue({
+ ...stage,
+ objects: stage.objects.map((item) => item.id !== objectId ? item : {
+ ...item,
+ motionClips: existing
+ ? item.motionClips.map((clip) => clip.id === existing.id ? next : clip)
+ : [...item.motionClips, next],
+ }),
+ });
+}
+
+/** Remove one projected channel point while retaining sibling channels. */
+export function removeStageTimelineKeyframe(
+ stage: LocalStageDocument,
+ target: StageTimelineKeyframeTarget,
+): LocalStageDocument {
+ if (target.kind === "camera") {
+ return parseLocalStageValue({
+ ...stage,
+ cameras: stage.cameras.map((camera) => {
+ if (camera.id !== target.sourceId) return camera;
+ const channels = cameraChannels(camera);
+ return {
+ ...camera,
+ channels: {
+ ...channels,
+ [target.channel]: channels[target.channel].filter(
+ (frame) => frame.id !== target.pointId,
+ ),
+ },
+ };
+ }),
+ });
+ }
+ return parseLocalStageValue({
+ ...stage,
+ objects: stage.objects.map((object) => {
+ if (object.id !== target.sourceId) return object;
+ // Locked subjects refuse keyframe edits on every other authoring path;
+ // removing a channel keyframe is the same class of mutation.
+ if (object.locked) return object;
+ const base = object[target.channel];
+ const keyedFrames = object.keyframes.some((frame) => frame.keyedChannels)
+ ? object.keyframes
+ : object.keyframes.map((frame) => ({
+ ...frame,
+ keyedChannels: ["position", "rotation", "scale"] as ("position" | "rotation" | "scale")[],
+ }));
+ return {
+ ...object,
+ keyframes: keyedFrames.map((frame) =>
+ frame.id !== target.pointId
+ ? frame
+ : {
+ ...frame,
+ value: { ...frame.value, [target.channel]: clone(base) },
+ keyedChannels: frame.keyedChannels?.filter((channel) => channel !== target.channel),
+ transitions: frame.transitions
+ ? Object.fromEntries(Object.entries(frame.transitions).filter(([channel]) => channel !== target.channel))
+ : undefined,
+ },
+ ),
+ };
+ }),
+ });
+}
diff --git a/src/canvas/toolCatalog.ts b/src/canvas/toolCatalog.ts
index 7d66769f2..1391d46d1 100644
--- a/src/canvas/toolCatalog.ts
+++ b/src/canvas/toolCatalog.ts
@@ -560,6 +560,31 @@ export const CANVAS_TOOLS: readonly CanvasToolDefinition[] = [
},
),
];
+/** Stage preview outputs are projections of an editable director stage;
+ * generative and audio transforms target the stage, not the render, and the
+ * render has no audio track. */
+export const STAGE_PREVIEW_EXCLUDED_VIDEO_TOOLS: ReadonlySet =
+ new Set([
+ "video-partial-reshoot",
+ "video-upscale",
+ "video-edit",
+ "video-extend",
+ "video-depth-capture",
+ "extract-audio",
+ "audio-separation",
+ "video-frame-interpolation",
+ "video-subtitle-erasure",
+ "video-matting",
+ ]);
+export function isStagePreviewOutput(node: {
+ type: string;
+ data: { generationProvenance?: { stagePreview?: boolean } };
+}): boolean {
+ return (
+ node.type === "video" &&
+ node.data.generationProvenance?.stagePreview === true
+ );
+}
export function toolFields(
tool: CanvasToolDefinition,
capability?: ToolCapability,
diff --git a/src/canvas/workspace/WorkspaceView.tsx b/src/canvas/workspace/WorkspaceView.tsx
index 73ca99a34..1a77589a2 100644
--- a/src/canvas/workspace/WorkspaceView.tsx
+++ b/src/canvas/workspace/WorkspaceView.tsx
@@ -123,6 +123,8 @@ export function WorkspaceView({ rt }: { rt: WorkspaceRuntime }) {
closeEditor,
command,
commitEditorData,
+ appendStageStoryboard,
+ editStageStoryboard,
composerElement,
composerExpanded,
composerIncoming,
@@ -2597,31 +2599,50 @@ export function WorkspaceView({ rt }: { rt: WorkspaceRuntime }) {
}
>
{
- await commitEditorData({ localStage });
+ backgroundAssets={creationClient(doc.id).snapshot.assets.filter((asset) => asset.kind === "image")}
+ resolveAssetUrl={(ref) => creationClient(doc.id).mediaUrl(ref.assetId)}
+ onImportBackground={(file) =>
+ creationClient(doc.id).importBlob(file, file.name, "image")
+ }
+ isRegisteredAsset={(ref) => {
+ // Same consistency the backend snapshot check demands.
+ const assets = creationClient(doc.id).snapshot.assets;
+ return assets.some(
+ (asset) =>
+ asset.id === ref.assetId &&
+ asset.fingerprint === ref.fingerprint &&
+ asset.kind === ref.kind &&
+ ref.revision <= asset.revision,
+ );
+ }}
+ onPrepareRender={async (localStage, stills, directorPlan) => {
+ await commitEditorData({
+ localStage,
+ // The stills draft commits with the stage so publications
+ // pin the very stills the drawer sends.
+ ...(stills ? { stills } : {}),
+ });
const origin = editorOrigin.current!;
const client = creationClient(doc.id);
mediaPublications.current.set(
origin,
new MediaPublication(client, client.snapshot, origin.nodeId),
);
- return async (result) => addLinkedOutputs(origin, [result]);
+ return async (result) =>
+ addLinkedOutputs(origin, [result], undefined, directorPlan);
}}
onRender={(result) => editorOutputs([result])}
node={editing}
- onApply={(localStage, screenshot) =>
+ onApply={(localStage, stills) =>
commitEditorData({
localStage,
- ...(screenshot
- ? {
- src: screenshot,
- mimeType: "image/png",
- assetState: "ready",
- media: undefined,
- }
- : {}),
+ // The save projection imports capture bytes and pins the
+ // resulting project assets on the director document.
+ ...(stills ? { stills } : {}),
})
}
+ onAppendStoryboard={appendStageStoryboard}
+ onEditStoryboard={editStageStoryboard}
onClose={closeEditor}
/>
diff --git a/src/canvas/workspace/useWorkspaceEditor.ts b/src/canvas/workspace/useWorkspaceEditor.ts
index 53b9f1281..402b815f5 100644
--- a/src/canvas/workspace/useWorkspaceEditor.ts
+++ b/src/canvas/workspace/useWorkspaceEditor.ts
@@ -1,7 +1,8 @@
import { useEffect, useMemo } from "react";
-import { currentAsset } from "../../backend/creationClient";
+import { currentAsset, objectVersion } from "../../backend/creationClient";
import { creationClient } from "../../backend/creationClient.ts";
+import { errorMessage } from "../../backend/api.ts";
import { CreationEditorSession } from "../../backend/creationEditorSession";
import { MediaPublication } from "../../backend/mediaPublication";
@@ -9,8 +10,11 @@ import { backendModel } from "../../backend/rules.ts";
import { workspaceProjection } from "../../backend/workspace";
import { lockedNodeIds } from "../hierarchy";
+import { assertStageStoryboard, sameStageStoryboard, type StageCutEdit, type StageCutReceipt } from "../stageStoryboard";
+import type { StageShot } from "../stageDocument";
import { captureEditorSource, validateNodeActionSource, type LinkedMediaResult, type ResultSource } from "../linkedResults";
import { type CanvasDocument, type CanvasNode, type CanvasNodeData } from "../model";
+import type { DirectorOutputPlanInput } from "../../contracts/generated.ts";
import { createVideoExtensionDraft } from "../nodeActionWorkflow";
import { getNodeGenerationSettings } from "../NodeComposer";
import { resourceFromNode } from "../operations";
@@ -98,6 +102,18 @@ export function useWorkspaceEditor(rt: WorkspaceRuntime) {
if (current.id !== projectId) return;
node = current.nodes.find((item) => item.id === node.id)!;
if (!node || lockedNodeIds(current.nodes).has(node.id)) return;
+ // A Director Stage whose stored Storyboard is not continuous cannot be edited.
+ // It is refused here, with the reason, before the editor mounts: the editor
+ // builds its draft while rendering, and the canvas and the rest of the project
+ // stay usable.
+ if (node.type === "external" && node.data.localStage) {
+ try {
+ assertStageStoryboard(node.data.localStage, t);
+ } catch (reason) {
+ notify(errorMessage(reason));
+ return;
+ }
+ }
editorSession.current = new CreationEditorSession(
creationClient(projectId),
current,
@@ -161,10 +177,151 @@ export function useWorkspaceEditor(rt: WorkspaceRuntime) {
session.projection.client.install(session.projection.client.snapshot);
}
};
+ /** Run one shared Storyboard command within the open editor's transaction.
+ * A just-saved draft already flushed the canvas. Flushing again before React
+ * installs that save would compare the previous draft against the new basis. */
+ const applyStageStoryboard = async (input: (
+ | { type: "append"; cameraId: string; blockId: string }
+ | (StageCutEdit & {
+ before: readonly StageShot[];
+ draft?: Pick;
+ })
+ ) & { savedDraft?: boolean }): Promise => {
+ const session: CreationEditorSession | null = editorSession.current;
+ if (!session || editorSaving.current)
+ throw new Error(t("canvas.workspace.error.editorUnavailable"));
+ const client = session.projection.client,
+ projection = session.projection;
+ const projectId = client.id;
+ if (historyRef.current.present.id !== projectId)
+ throw new Error(t("canvas.workspace.error.editNotCommitted"));
+ /** The Director Stage document bound to the edited item, at the session's basis. */
+ const boundDocument = () => {
+ const binding = projection.basis.canvasItems.find(
+ (item) => item.id === session.itemId,
+ )?.binding;
+ const boundId =
+ binding?.role === "editor" ? binding.objectRef.id : undefined;
+ return projection.basis.editorDocuments.find((doc) => doc.id === boundId);
+ };
+ const initial = boundDocument();
+ if (initial?.kind !== "director")
+ throw new Error(t("canvas.workspace.error.editorUnavailable"));
+ invalidateScheduledAutosave();
+ editorSaving.current = true;
+ try {
+ if (!input.savedDraft) {
+ await saveQueue.current!.wait();
+ if (historyRef.current.present.id !== projectId)
+ throw new Error(t("canvas.workspace.error.editNotCommitted"));
+ if (!(await persist(historyRef.current.present)))
+ throw new Error(t("canvas.workspace.error.editorDraftSaveFailed"));
+ }
+ const document = boundDocument();
+ if (document?.kind !== "director" || document.revision !== initial.revision ||
+ (input.type !== "append" && !input.draft &&
+ !sameStageStoryboard(document.data.shots ?? [], input.before)))
+ throw new Error(t("canvas.workspace.error.editNotCommitted"));
+ const documentId = document.id;
+ const versions = [objectVersion("editor_document", document)];
+ let durationChange: StageCutReceipt["durationChange"];
+ let appendedBlock: StageShot | undefined;
+ if (input.type === "append") {
+ const receipt = await client.command("director.storyboard.append",
+ { documentId, cameraId: input.cameraId, blockId: input.blockId }, versions);
+ const operation = receipt.directorStoryboard?.find((result) =>
+ result.operation === "director.storyboard.append" && result.documentId === documentId &&
+ result.blockId === input.blockId);
+ const accepted = operation?.blocks.find((block) => block.id === input.blockId);
+ if (!accepted) throw new Error(t("canvas.workspace.error.editorRefreshFailed"));
+ const { id, cameraId, start, duration } = accepted;
+ appendedBlock = { id, cameraId, start, duration };
+ } else {
+ const operation = input.type === "reorder" ? {
+ type: "director.storyboard.reorder",
+ payload: { documentId, blockIds: input.blockIds },
+ } as const : input.type === "resize" ? {
+ type: "director.storyboard.resize",
+ payload: { documentId, blockId: input.blockId, duration: input.duration },
+ } as const : input.type === "delete" ? {
+ type: "director.storyboard.delete",
+ payload: { documentId, blockId: input.blockId },
+ } as const : input.type === "setDuration" ? {
+ type: "director.duration.set",
+ payload: { documentId, duration: input.duration },
+ } as const : {
+ type: "director.camera.delete",
+ payload: { documentId, cameraId: input.cameraId },
+ } as const;
+ const receipt = input.draft
+ // The gesture was based on locally edited times. Apply that draft and
+ // its Storyboard edit together or leave both uncommitted.
+ ? await session.apply(input.draft, operation)
+ : await client.command(operation.type, operation.payload, versions);
+ if (input.type === "setDuration") {
+ durationChange = receipt.directorDurations?.find((result) => result.documentId === documentId);
+ if (!durationChange)
+ throw new Error(t("canvas.workspace.error.editorRefreshFailed"));
+ }
+ }
+ const snapshot = client.snapshot;
+ // Follow the acknowledged version before any subsequent editor save.
+ projection.basis = snapshot;
+ const stored = snapshot.editorDocuments.find((doc) => doc.id === documentId);
+ if (stored?.kind !== "director")
+ throw new Error(t("canvas.workspace.error.editorRefreshFailed"));
+ // The canvas is re-read from the refreshed snapshot, as after any editor save.
+ const workspace = workspaceProjection(projectId);
+ let next: CanvasDocument;
+ try {
+ next = await workspace.read(snapshot);
+ } catch {
+ throw new Error(t("canvas.workspace.error.editorRefreshFailed"));
+ }
+ if (historyRef.current.present.id === projectId) {
+ const current = historyRef.current.present;
+ const merged = {
+ ...next,
+ viewport: current.viewport,
+ settings: current.settings,
+ };
+ workspace.baseline = merged;
+ workspace.basis = snapshot;
+ projection.baseline = merged;
+ setHistory((history) => ({ ...history, present: merged }));
+ const node = merged.nodes.find((item) => item.id === session.itemId);
+ if (node) editorOrigin.current = captureEditorSource(projectId, node);
+ }
+ return {
+ shots: [...(stored.data.shots ?? [])],
+ activeCameraId: stored.data.activeCameraId,
+ cameraSource: stored.data.cameraSource ?? "camera",
+ durationChange,
+ appendedBlock,
+ };
+ } finally {
+ editorSaving.current = false;
+ client.install(client.snapshot);
+ }
+ };
+ const appendStageStoryboard = async (input: {
+ cameraId: string;
+ blockId: string;
+ savedDraft?: boolean;
+ }): Promise => {
+ const { appendedBlock } = await applyStageStoryboard({ ...input, type: "append" });
+ if (!appendedBlock) throw new Error(t("canvas.workspace.error.editorRefreshFailed"));
+ return appendedBlock;
+ };
+ const editStageStoryboard = (input: StageCutEdit & {
+ before: readonly StageShot[];
+ draft?: Pick;
+ }) => applyStageStoryboard(input);
const addLinkedOutputs = async (
source: ResultSource,
outputs: readonly LinkedMediaResult[],
sourceTask?: CanvasToolTask,
+ directorPlan?: DirectorOutputPlanInput,
) => {
if (editorSaving.current) throw Error(t("canvas.workspace.error.editorSaving"));
if (historyRef.current.present.id !== source.documentId)
@@ -200,7 +357,7 @@ export function useWorkspaceEditor(rt: WorkspaceRuntime) {
mediaPublications.current.set(source, publication);
}
const task = sourceTask;
- const ids = await publication.publish(outputs, task);
+ const ids = await publication.publish(outputs, task, directorPlan);
const projection = workspaceProjection(current.id);
const snapshot = client.snapshot;
const next = await projection.read(snapshot);
@@ -369,6 +526,8 @@ export function useWorkspaceEditor(rt: WorkspaceRuntime) {
rt.openEditor = openEditor;
rt.closeEditor = closeEditor;
rt.commitEditorData = commitEditorData;
+ rt.appendStageStoryboard = appendStageStoryboard;
+ rt.editStageStoryboard = editStageStoryboard;
rt.addLinkedOutputs = addLinkedOutputs;
rt.editorOutputs = editorOutputs;
rt.sourceFor = sourceFor;
diff --git a/src/canvas/workspace/useWorkspaceInteraction.tsx b/src/canvas/workspace/useWorkspaceInteraction.tsx
index 01662b618..a4fa5aac8 100644
--- a/src/canvas/workspace/useWorkspaceInteraction.tsx
+++ b/src/canvas/workspace/useWorkspaceInteraction.tsx
@@ -12,6 +12,7 @@ import { absolutePosition, boundsOfNodes } from "../geometry";
import { executeCommand } from "../history";
import { createNode, nextNodeTitle, type CanvasCommand, type CanvasNode, type CanvasNodeData, type CanvasNodeKind, type Point } from "../model";
import { orderNodesForCanvas, stackSelection, updateStack } from "../operations";
+import { createLocalStage } from "../stageDocument";
import { persistCurrentDocument } from "../projectManagement";
import { referencePresentation } from "../referenceEvidence";
@@ -222,6 +223,7 @@ export function useWorkspaceInteraction(rt: WorkspaceRuntime) {
const where = position ?? center();
const node = createNode(kind, where, {
...snapshotModel(kind),
+ ...(kind === "external" ? { localStage: createLocalStage(t) } : {}),
title: nextNodeTitle(current, kind, t(nodeKindKeys[kind])),
...(sourceIds.length > 1 && kind === "video"
? { settings: { videoMode: "reference" as const } }
@@ -287,6 +289,15 @@ export function useWorkspaceInteraction(rt: WorkspaceRuntime) {
referenceTarget.current = null;
setMenu(null);
setPanel(null);
+ if (kind === "external") {
+ requestAnimationFrame(() => {
+ if (historyRef.current.present.id !== current.id) return;
+ const created = historyRef.current.present.nodes.find(
+ (candidate) => candidate.id === node.id,
+ );
+ if (created) void openEditor(created);
+ });
+ }
return node;
};
const fit = (selection = false) => {
@@ -785,7 +796,7 @@ export function useWorkspaceInteraction(rt: WorkspaceRuntime) {
// These components own their keyboard shortcuts and cancellation lifecycle.
if (
el.closest(
- ".cw-composer-dock,.cw-composer-popover,.cw-text-window-backdrop,.cw-node-toolbar-anchor,.cw-domain-dialog,.cw-selection-menu,.cw-action-media-host,.cw-project-selector,.cw-project-dialog,.cw-settings-dialog,.cw-assistant-panel,.cw-context-menu,.cw-node-title-input,.cw-subject-description",
+ ".cw-composer-dock,.cw-composer-popover,.cw-text-window-backdrop,.cw-node-toolbar-anchor,.cw-domain-dialog,.cw-stage-console,.cw-selection-menu,.cw-action-media-host,.cw-project-selector,.cw-project-dialog,.cw-settings-dialog,.cw-assistant-panel,.cw-context-menu,.cw-node-title-input,.cw-subject-description",
)
)
return;
diff --git a/src/contracts/creation.schema.json b/src/contracts/creation.schema.json
index aa9856710..c6ebafbee 100644
--- a/src/contracts/creation.schema.json
+++ b/src/contracts/creation.schema.json
@@ -588,6 +588,18 @@
"description": "Expected editable document revision.",
"title": "Editorrevision"
},
+ "directorRender": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/DirectorRenderEvidence"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Frozen Director video output evidence and source version."
+ },
"sources": {
"default": [],
"description": "Ordered source asset versions.",
@@ -1506,6 +1518,12 @@
"canvas.move": "#/$defs/CanvasMoveCommandOperation",
"canvas.show": "#/$defs/CanvasShowCommandOperation",
"canvas.update": "#/$defs/CanvasUpdateCommandOperation",
+ "director.apply": "#/$defs/DirectorApplyCommandOperation",
+ "director.camera.delete": "#/$defs/DirectorCameraDeleteCommandOperation",
+ "director.duration.set": "#/$defs/DirectorSetDurationCommandOperation",
+ "director.storyboard.delete": "#/$defs/DirectorStoryboardDeleteCommandOperation",
+ "director.storyboard.reorder": "#/$defs/DirectorStoryboardReorderCommandOperation",
+ "director.storyboard.resize": "#/$defs/DirectorStoryboardResizeCommandOperation",
"editor.create": "#/$defs/EditorCreateCommandOperation",
"editor.save": "#/$defs/EditorSaveCommandOperation",
"generationSpec.create": "#/$defs/SpecCreateCommandOperation",
@@ -1576,6 +1594,24 @@
},
{
"$ref": "#/$defs/EditorSaveCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/DirectorApplyCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardReorderCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardResizeCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardDeleteCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/DirectorSetDurationCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/DirectorCameraDeleteCommandOperation"
}
]
},
@@ -1591,6 +1627,49 @@
"title": "BatchPayload",
"type": "object"
},
+ "CameraChannels": {
+ "additionalProperties": false,
+ "properties": {
+ "position": {
+ "default": [],
+ "description": "Independent camera position channel.",
+ "items": {
+ "$ref": "#/$defs/CameraVectorFrame"
+ },
+ "title": "Position",
+ "type": "array"
+ },
+ "target": {
+ "default": [],
+ "description": "Independent camera target channel.",
+ "items": {
+ "$ref": "#/$defs/CameraVectorFrame"
+ },
+ "title": "Target",
+ "type": "array"
+ },
+ "up": {
+ "default": [],
+ "description": "Independent camera up-vector channel.",
+ "items": {
+ "$ref": "#/$defs/CameraVectorFrame"
+ },
+ "title": "Up",
+ "type": "array"
+ },
+ "focalLength": {
+ "default": [],
+ "description": "Independent camera focal-length channel.",
+ "items": {
+ "$ref": "#/$defs/CameraNumberFrame"
+ },
+ "title": "Focallength",
+ "type": "array"
+ }
+ },
+ "title": "CameraChannels",
+ "type": "object"
+ },
"CameraFrame": {
"additionalProperties": false,
"properties": {
@@ -1621,6 +1700,50 @@
"title": "CameraFrame",
"type": "object"
},
+ "CameraNumberFrame": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable channel keyframe ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
+ "type": "string"
+ },
+ "time": {
+ "description": "Keyframe time in seconds.",
+ "minimum": 0,
+ "title": "Time",
+ "type": "number"
+ },
+ "value": {
+ "description": "Keyframed camera focal length.",
+ "exclusiveMinimum": 0,
+ "title": "Value",
+ "type": "number"
+ },
+ "transition": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/StageBezierTransition"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Interpolation for the outgoing segment."
+ }
+ },
+ "required": [
+ "id",
+ "time",
+ "value"
+ ],
+ "title": "CameraNumberFrame",
+ "type": "object"
+ },
"CameraRig": {
"additionalProperties": false,
"properties": {
@@ -1638,6 +1761,20 @@
"title": "Name",
"type": "string"
},
+ "aspectRatio": {
+ "default": "16:9",
+ "description": "Camera output aspect ratio.",
+ "enum": [
+ "16:9",
+ "2.39:1",
+ "9:16",
+ "1:1",
+ "4:3",
+ "3:4"
+ ],
+ "title": "Aspectratio",
+ "type": "string"
+ },
"pose": {
"$ref": "#/$defs/StageCamera",
"description": "Camera position and look-at target."
@@ -1650,6 +1787,10 @@
},
"title": "Keyframes",
"type": "array"
+ },
+ "channels": {
+ "$ref": "#/$defs/CameraChannels",
+ "description": "Independent authoritative camera channels."
}
},
"required": [
@@ -1660,6 +1801,48 @@
"title": "CameraRig",
"type": "object"
},
+ "CameraVectorFrame": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable channel keyframe ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
+ "type": "string"
+ },
+ "time": {
+ "description": "Keyframe time in seconds.",
+ "minimum": 0,
+ "title": "Time",
+ "type": "number"
+ },
+ "value": {
+ "$ref": "#/$defs/Vector3",
+ "description": "Keyframed camera vector."
+ },
+ "transition": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/StageBezierTransition"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Interpolation for the outgoing segment."
+ }
+ },
+ "required": [
+ "id",
+ "time",
+ "value"
+ ],
+ "title": "CameraVectorFrame",
+ "type": "object"
+ },
"CanvasApplyEdit": {
"additionalProperties": false,
"properties": {
@@ -2896,6 +3079,32 @@
],
"title": "Document"
},
+ "directorPlan": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/DirectorOutputPlan"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Frozen Director video output plan, when publishing a stage video."
+ },
+ "directorAcceptedAt": {
+ "anyOf": [
+ {
+ "minimum": 1,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Project event cursor fixed when the browser accepted a Director video render.",
+ "title": "Directoracceptedat"
+ },
"outputs": {
"description": "Ordered published media outputs.",
"items": {
@@ -3403,6 +3612,24 @@
"title": "Issues",
"type": "array"
},
+ "directorDurations": {
+ "default": [],
+ "description": "Director main timeline results in operation order.",
+ "items": {
+ "$ref": "#/$defs/DirectorDurationResult"
+ },
+ "title": "Directordurations",
+ "type": "array"
+ },
+ "directorStoryboard": {
+ "default": [],
+ "description": "Storyboard outcomes in command operation order.",
+ "items": {
+ "$ref": "#/$defs/DirectorStoryboardResult"
+ },
+ "title": "Directorstoryboard",
+ "type": "array"
+ },
"eventCursor": {
"anyOf": [
{
@@ -3472,6 +3699,19 @@
"timeline_font_mime",
"timeline_bundled_font_fingerprint",
"timeline_bundled_font_unavailable",
+ "storyboard_leading_gap",
+ "storyboard_internal_gap",
+ "storyboard_overlap",
+ "storyboard_exceeds_duration",
+ "storyboard_duration_invalid",
+ "storyboard_camera_unknown",
+ "storyboard_block_invalid",
+ "storyboard_block_exists",
+ "storyboard_exhausted",
+ "storyboard_order_invalid",
+ "storyboard_block_unknown",
+ "director_camera_unknown",
+ "director_camera_required",
"invalid_input",
"revision_conflict",
"role_restricted",
@@ -3757,6 +3997,13 @@
"canvas.show": "#/$defs/CanvasShowCommand",
"canvas.update": "#/$defs/CanvasUpdateCommand",
"creation.batch": "#/$defs/BatchCommand",
+ "director.apply": "#/$defs/DirectorApplyCommand",
+ "director.camera.delete": "#/$defs/DirectorCameraDeleteCommand",
+ "director.duration.set": "#/$defs/DirectorSetDurationCommand",
+ "director.storyboard.append": "#/$defs/DirectorStoryboardAppendCommand",
+ "director.storyboard.delete": "#/$defs/DirectorStoryboardDeleteCommand",
+ "director.storyboard.reorder": "#/$defs/DirectorStoryboardReorderCommand",
+ "director.storyboard.resize": "#/$defs/DirectorStoryboardResizeCommand",
"editor.create": "#/$defs/EditorCreateCommand",
"editor.save": "#/$defs/EditorSaveCommand",
"generation.submit": "#/$defs/GenerationSubmitCommand",
@@ -3894,6 +4141,27 @@
{
"$ref": "#/$defs/EditorSaveCommand"
},
+ {
+ "$ref": "#/$defs/DirectorApplyCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardAppendCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardReorderCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardResizeCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardDeleteCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorSetDurationCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorCameraDeleteCommand"
+ },
{
"$ref": "#/$defs/HistoryUndoCommand"
},
@@ -3919,6 +4187,7 @@
"asset.usage": "#/$defs/AssetUsageQuery",
"canvas.status": "#/$defs/CanvasStatusQuery",
"canvas.versions": "#/$defs/VersionsQuery",
+ "director.storyboard.get": "#/$defs/DirectorStoryboardQuery",
"generationSpec.versions": "#/$defs/VersionsQuery",
"job.get": "#/$defs/ObjectQuery",
"object.get": "#/$defs/ObjectQuery",
@@ -3947,6 +4216,9 @@
},
{
"$ref": "#/$defs/AssetPreviewQuery"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardQuery"
}
],
"title": "Query"
@@ -4073,13 +4345,28 @@
"title": "CreationContracts",
"type": "object"
},
- "DirectorCanvasItem": {
+ "DirectorApply": {
"additionalProperties": false,
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
+ "document": {
+ "$ref": "#/$defs/DirectorDocumentWrite",
+ "description": "Authoritative Director Stage document applied atomically."
+ }
+ },
+ "required": [
+ "document"
+ ],
+ "title": "DirectorApply",
+ "type": "object"
+ },
+ "DirectorApplyCommand": {
+ "additionalProperties": false,
+ "description": "Apply an authoritative Director Stage document atomically.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
"format": "uuid",
- "title": "Id",
+ "title": "Commandid",
"type": "string"
},
"projectId": {
@@ -4088,198 +4375,104 @@
"title": "Projectid",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "kind": {
- "const": "external",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
- },
- "title": {
- "default": "",
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
+ "type": {
+ "const": "director.apply",
+ "description": "Command discriminator.",
+ "title": "Type",
"type": "string"
},
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
- },
- "width": {
- "default": 352,
- "description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "title": "Width",
- "type": "number"
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
},
- "height": {
- "default": 198,
- "description": "Height in pixels.",
- "exclusiveMinimum": 0,
- "title": "Height",
- "type": "number"
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "zIndex": {
- "default": 0,
- "description": "Canvas stacking order.",
- "title": "Zindex",
- "type": "integer"
- },
- "locked": {
- "default": false,
- "description": "Whether edits to this object are blocked.",
- "title": "Locked",
- "type": "boolean"
- },
- "visible": {
- "default": true,
- "description": "Whether this object is displayed.",
- "title": "Visible",
- "type": "boolean"
- },
- "parentId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Parent canvas group ID, or null for the root.",
- "title": "Parentid"
- },
- "tags": {
- "default": [],
- "description": "User-defined search tags.",
- "items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "type": "string"
- },
- "title": "Tags",
- "type": "array"
- },
- "binding": {
- "$ref": "#/$defs/EditorBinding",
- "description": "Business object displayed by this canvas item."
+ "payload": {
+ "$ref": "#/$defs/DirectorApply",
+ "description": "Apply an authoritative Director Stage document atomically."
}
},
"required": [
- "id",
+ "commandId",
"projectId",
- "kind",
- "binding"
+ "type",
+ "payload"
],
- "title": "DirectorCanvasItem",
+ "title": "DirectorApplyCommand",
"type": "object"
},
- "DirectorData": {
+ "DirectorApplyCommandOperation": {
"additionalProperties": false,
+ "description": "Apply an authoritative Director Stage document atomically.",
"properties": {
- "background": {
- "description": "Composition background color.",
- "pattern": "^#[0-9a-fA-F]{6}$",
- "title": "Background",
+ "type": {
+ "const": "director.apply",
+ "description": "Operation discriminator.",
+ "title": "Type",
"type": "string"
},
- "grid": {
- "default": true,
- "description": "Whether to display the stage grid.",
- "title": "Grid",
- "type": "boolean"
- },
- "duration": {
- "description": "Interval duration in seconds.",
- "exclusiveMinimum": 0,
- "title": "Duration",
- "type": "number"
- },
- "aspectRatio": {
- "default": "16:9",
- "description": "Output width-to-height ratio.",
- "enum": [
- "16:9",
- "9:16",
- "1:1",
- "4:3",
- "3:4"
- ],
- "title": "Aspectratio",
+ "payload": {
+ "$ref": "#/$defs/DirectorApply",
+ "description": "Apply an authoritative Director Stage document atomically."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "DirectorApplyCommandOperation",
+ "type": "object"
+ },
+ "DirectorCameraDelete": {
+ "additionalProperties": false,
+ "properties": {
+ "documentId": {
+ "description": "Director Stage document that owns the camera.",
+ "format": "uuid",
+ "title": "Documentid",
"type": "string"
},
- "cameras": {
- "description": "Editable stage cameras.",
- "items": {
- "$ref": "#/$defs/CameraRig"
- },
- "minItems": 1,
- "title": "Cameras",
- "type": "array"
- },
- "activeCameraId": {
- "description": "Active stage camera ID.",
+ "cameraId": {
+ "description": "Camera to delete with its Storyboard blocks.",
"maxLength": 100,
"minLength": 1,
"pattern": "\\S",
- "title": "Activecameraid",
- "type": "string"
- },
- "cameraSource": {
- "default": "camera",
- "description": "Camera selection strategy.",
- "enum": [
- "camera",
- "storyboard"
- ],
- "title": "Camerasource",
+ "title": "Cameraid",
"type": "string"
- },
- "shots": {
- "default": [],
- "description": "Ordered camera shot intervals.",
- "items": {
- "$ref": "#/$defs/StageShot"
- },
- "title": "Shots",
- "type": "array"
- },
- "objects": {
- "default": [],
- "description": "Editable stage objects.",
- "items": {
- "$ref": "#/$defs/StageObject"
- },
- "title": "Objects",
- "type": "array"
}
},
"required": [
- "background",
- "duration",
- "cameras",
- "activeCameraId"
+ "documentId",
+ "cameraId"
],
- "title": "DirectorData",
+ "title": "DirectorCameraDelete",
"type": "object"
},
- "DirectorDocument": {
+ "DirectorCameraDeleteCommand": {
"additionalProperties": false,
+ "description": "Delete a non-final Director Stage camera and its Storyboard blocks atomically.",
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
"format": "uuid",
- "title": "Id",
+ "title": "Commandid",
"type": "string"
},
"projectId": {
@@ -4288,71 +4481,72 @@
"title": "Projectid",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "schemaVersion": {
- "const": 1,
- "default": 1,
- "description": "Record schema version.",
- "title": "Schemaversion",
- "type": "integer"
+ "type": {
+ "const": "director.camera.delete",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
},
- "inputConnections": {
+ "expectedVersions": {
"default": [],
- "description": "Persisted connections to source assets.",
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
"items": {
- "$ref": "#/$defs/EditorInputConnection"
+ "$ref": "#/$defs/ObjectVersion"
},
- "title": "Inputconnections",
+ "title": "Expectedversions",
"type": "array"
},
- "kind": {
- "const": "director",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "data": {
- "$ref": "#/$defs/DirectorData",
- "description": "Typed editable document contents."
+ "payload": {
+ "$ref": "#/$defs/DirectorCameraDelete",
+ "description": "Delete a non-final Director Stage camera and its Storyboard blocks atomically."
}
},
"required": [
- "id",
+ "commandId",
"projectId",
- "kind",
- "data"
+ "type",
+ "payload"
],
- "title": "DirectorDocument",
+ "title": "DirectorCameraDeleteCommand",
"type": "object"
},
- "EditorBinding": {
+ "DirectorCameraDeleteCommandOperation": {
"additionalProperties": false,
+ "description": "Delete a non-final Director Stage camera and its Storyboard blocks atomically.",
"properties": {
- "role": {
- "const": "editor",
- "description": "Business role of this binding or reference.",
- "title": "Role",
+ "type": {
+ "const": "director.camera.delete",
+ "description": "Operation discriminator.",
+ "title": "Type",
"type": "string"
},
- "objectRef": {
- "$ref": "#/$defs/EditorRef",
- "description": "Stable reference to the bound business object."
+ "payload": {
+ "$ref": "#/$defs/DirectorCameraDelete",
+ "description": "Delete a non-final Director Stage camera and its Storyboard blocks atomically."
}
},
"required": [
- "role",
- "objectRef"
+ "type",
+ "payload"
],
- "title": "EditorBinding",
+ "title": "DirectorCameraDeleteCommandOperation",
"type": "object"
},
- "EditorCanvasItem": {
+ "DirectorCanvasItem": {
"additionalProperties": false,
"properties": {
"id": {
@@ -4375,20 +4569,8 @@
"type": "integer"
},
"kind": {
+ "const": "external",
"description": "Business object or media type.",
- "enum": [
- "text",
- "image",
- "video",
- "audio",
- "file",
- "group",
- "timeline",
- "subject",
- "stack",
- "tool",
- "external"
- ],
"title": "Kind",
"type": "string"
},
@@ -4472,91 +4654,269 @@
"kind",
"binding"
],
- "title": "EditorCanvasItem",
+ "title": "DirectorCanvasItem",
"type": "object"
},
- "EditorCreateCommand": {
+ "DirectorData": {
"additionalProperties": false,
- "description": "Create an editable document.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
+ "background": {
+ "description": "Composition background color.",
+ "examples": [
+ "#000000"
+ ],
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "title": "Background",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "grid": {
+ "default": true,
+ "description": "Whether to display the stage grid.",
+ "title": "Grid",
+ "type": "boolean"
},
- "type": {
- "const": "editor.create",
- "description": "Command discriminator.",
- "title": "Type",
+ "duration": {
+ "description": "Interval duration in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Duration",
+ "type": "number"
+ },
+ "fps": {
+ "default": 30,
+ "description": "Frames per second. 帧率。",
+ "enum": [
+ 24,
+ 25,
+ 30,
+ 50,
+ 60
+ ],
+ "title": "Fps",
+ "type": "integer"
+ },
+ "aspectRatio": {
+ "default": "16:9",
+ "description": "Output width-to-height ratio.",
+ "enum": [
+ "16:9",
+ "2.39:1",
+ "9:16",
+ "1:1",
+ "4:3",
+ "3:4"
+ ],
+ "title": "Aspectratio",
"type": "string"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "cameras": {
+ "description": "Editable stage cameras.",
"items": {
- "$ref": "#/$defs/ObjectVersion"
+ "$ref": "#/$defs/CameraRig"
},
- "title": "Expectedversions",
+ "minItems": 1,
+ "title": "Cameras",
"type": "array"
},
- "expectedPreview": {
- "anyOf": [
- {
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
- },
- {
- "type": "null"
- }
+ "activeCameraId": {
+ "description": "Active stage camera ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Activecameraid",
+ "type": "string"
+ },
+ "cameraSource": {
+ "default": "camera",
+ "description": "Camera selection strategy.",
+ "enum": [
+ "camera",
+ "storyboard"
],
- "default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "title": "Camerasource",
+ "type": "string"
},
- "payload": {
- "$ref": "#/$defs/EditorWrite",
- "description": "Create an editable document."
+ "shots": {
+ "default": [],
+ "description": "Ordered camera shot intervals.",
+ "items": {
+ "$ref": "#/$defs/StageShot"
+ },
+ "title": "Shots",
+ "type": "array"
+ },
+ "objects": {
+ "default": [],
+ "description": "Editable stage objects.",
+ "items": {
+ "$ref": "#/$defs/StageObject"
+ },
+ "title": "Objects",
+ "type": "array"
+ },
+ "environment": {
+ "$ref": "#/$defs/StageEnvironment",
+ "description": "Authoritative environment reference and ground configuration. 权威环境引用和地面配置。"
+ },
+ "lights": {
+ "description": "The three retained stage lights. 舞台保留的三盏灯光。",
+ "items": {
+ "$ref": "#/$defs/StageLight"
+ },
+ "maxItems": 3,
+ "minItems": 3,
+ "title": "Lights",
+ "type": "array"
+ },
+ "stills": {
+ "default": [],
+ "description": "Captured still frames pinned as project image assets, oldest first.",
+ "items": {
+ "$ref": "#/$defs/AssetRef"
+ },
+ "title": "Stills",
+ "type": "array"
}
},
"required": [
- "commandId",
- "projectId",
- "type",
- "payload"
+ "background",
+ "duration",
+ "cameras",
+ "activeCameraId"
],
- "title": "EditorCreateCommand",
+ "title": "DirectorData",
"type": "object"
},
- "EditorCreateCommandOperation": {
+ "DirectorDataWrite": {
"additionalProperties": false,
- "description": "Create an editable document.",
+ "description": "A Director Stage document entering the project through a command.\n\nIt has the same fields and dump as the stored ``DirectorData``. Shot relations are\nnot checked while the command is parsed: both HTTP and Agent entry points parse the\npayload before the application service runs, so checking here would reject the write\nwith a generic code before the write boundary could report the specific one. The\nstored model still validates the committed snapshot as the last line of defence.",
"properties": {
- "type": {
- "const": "editor.create",
- "description": "Operation discriminator.",
- "title": "Type",
+ "background": {
+ "description": "Composition background color.",
+ "examples": [
+ "#000000"
+ ],
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "title": "Background",
"type": "string"
},
- "payload": {
- "$ref": "#/$defs/EditorWrite",
- "description": "Create an editable document."
+ "grid": {
+ "default": true,
+ "description": "Whether to display the stage grid.",
+ "title": "Grid",
+ "type": "boolean"
+ },
+ "duration": {
+ "description": "Interval duration in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Duration",
+ "type": "number"
+ },
+ "fps": {
+ "default": 30,
+ "description": "Frames per second. 帧率。",
+ "enum": [
+ 24,
+ 25,
+ 30,
+ 50,
+ 60
+ ],
+ "title": "Fps",
+ "type": "integer"
+ },
+ "aspectRatio": {
+ "default": "16:9",
+ "description": "Output width-to-height ratio.",
+ "enum": [
+ "16:9",
+ "2.39:1",
+ "9:16",
+ "1:1",
+ "4:3",
+ "3:4"
+ ],
+ "title": "Aspectratio",
+ "type": "string"
+ },
+ "cameras": {
+ "description": "Editable stage cameras.",
+ "items": {
+ "$ref": "#/$defs/CameraRig"
+ },
+ "minItems": 1,
+ "title": "Cameras",
+ "type": "array"
+ },
+ "activeCameraId": {
+ "description": "Active stage camera ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Activecameraid",
+ "type": "string"
+ },
+ "cameraSource": {
+ "default": "camera",
+ "description": "Camera selection strategy.",
+ "enum": [
+ "camera",
+ "storyboard"
+ ],
+ "title": "Camerasource",
+ "type": "string"
+ },
+ "shots": {
+ "default": [],
+ "description": "Ordered camera shot intervals.",
+ "items": {
+ "$ref": "#/$defs/StageShot"
+ },
+ "title": "Shots",
+ "type": "array"
+ },
+ "objects": {
+ "default": [],
+ "description": "Editable stage objects.",
+ "items": {
+ "$ref": "#/$defs/StageObject"
+ },
+ "title": "Objects",
+ "type": "array"
+ },
+ "environment": {
+ "$ref": "#/$defs/StageEnvironment",
+ "description": "Authoritative environment reference and ground configuration. 权威环境引用和地面配置。"
+ },
+ "lights": {
+ "description": "The three retained stage lights. 舞台保留的三盏灯光。",
+ "items": {
+ "$ref": "#/$defs/StageLight"
+ },
+ "maxItems": 3,
+ "minItems": 3,
+ "title": "Lights",
+ "type": "array"
+ },
+ "stills": {
+ "default": [],
+ "description": "Captured still frames pinned as project image assets, oldest first.",
+ "items": {
+ "$ref": "#/$defs/AssetRef"
+ },
+ "title": "Stills",
+ "type": "array"
}
},
"required": [
- "type",
- "payload"
+ "background",
+ "duration",
+ "cameras",
+ "activeCameraId"
],
- "title": "EditorCreateCommandOperation",
+ "title": "DirectorDataWrite",
"type": "object"
},
- "EditorDocumentBase": {
+ "DirectorDocument": {
"additionalProperties": false,
"properties": {
"id": {
@@ -4593,95 +4953,253 @@
},
"title": "Inputconnections",
"type": "array"
+ },
+ "kind": {
+ "const": "director",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "data": {
+ "$ref": "#/$defs/DirectorData",
+ "description": "Typed editable document contents."
}
},
"required": [
"id",
- "projectId"
+ "projectId",
+ "kind",
+ "data"
],
- "title": "EditorDocumentBase",
+ "title": "DirectorDocument",
"type": "object"
},
- "EditorInputConnection": {
+ "DirectorDocumentWrite": {
"additionalProperties": false,
- "description": "Assembly provenance binds a retained slot, never a generation spec.",
"properties": {
"id": {
- "description": "Stable object ID.",
+ "description": "Stable identity of this project-owned object.",
"format": "uuid",
"title": "Id",
"type": "string"
},
- "sourceId": {
- "description": "Source canvas item ID.",
+ "projectId": {
+ "description": "Owning project ID.",
"format": "uuid",
- "title": "Sourceid",
- "type": "string"
- },
- "slotId": {
- "description": "Destination editor input slot.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Slotid",
+ "title": "Projectid",
"type": "string"
},
- "asset": {
- "$ref": "#/$defs/AssetRef",
- "description": "Immutable asset version."
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "schemaVersion": {
+ "const": 1,
+ "default": 1,
+ "description": "Record schema version.",
+ "title": "Schemaversion",
+ "type": "integer"
+ },
+ "inputConnections": {
+ "default": [],
+ "description": "Persisted connections to source assets.",
+ "items": {
+ "$ref": "#/$defs/EditorInputConnection"
+ },
+ "title": "Inputconnections",
+ "type": "array"
+ },
+ "kind": {
+ "const": "director",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "data": {
+ "$ref": "#/$defs/DirectorDataWrite",
+ "description": "Typed editable document contents."
}
},
"required": [
"id",
- "sourceId",
- "slotId",
- "asset"
+ "projectId",
+ "kind",
+ "data"
],
- "title": "EditorInputConnection",
+ "title": "DirectorDocumentWrite",
"type": "object"
},
- "EditorRef": {
+ "DirectorDurationResult": {
"additionalProperties": false,
"properties": {
- "objectType": {
- "const": "editor_document",
- "default": "editor_document",
- "description": "Referenced business object type.",
- "title": "Objecttype",
- "type": "string"
- },
- "id": {
- "description": "Referenced editable document ID.",
+ "documentId": {
+ "description": "Director Stage document whose main timeline was evaluated.",
"format": "uuid",
- "title": "Id",
+ "title": "Documentid",
"type": "string"
},
- "kind": {
- "description": "Business object or media type.",
+ "requestedDuration": {
+ "description": "Main timeline duration requested in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Requestedduration",
+ "type": "number"
+ },
+ "appliedDuration": {
+ "description": "Main timeline duration applied in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Appliedduration",
+ "type": "number"
+ },
+ "clampReason": {
+ "anyOf": [
+ {
+ "const": "storyboard_end",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Stable reason for a limited duration, or null.",
+ "title": "Clampreason"
+ }
+ },
+ "required": [
+ "documentId",
+ "requestedDuration",
+ "appliedDuration",
+ "clampReason"
+ ],
+ "title": "DirectorDurationResult",
+ "type": "object"
+ },
+ "DirectorOutputPlan": {
+ "additionalProperties": false,
+ "properties": {
+ "cameraSource": {
+ "description": "Camera selection strategy fixed for this render.",
"enum": [
- "timeline",
- "subject",
- "stack",
- "tool",
- "director",
- "layers",
- "image_crop",
- "media_edit"
+ "camera",
+ "storyboard"
],
- "title": "Kind",
+ "title": "Camerasource",
"type": "string"
+ },
+ "cameraId": {
+ "anyOf": [
+ {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Camera rig fixed for a camera render; omitted for storyboard renders.",
+ "title": "Cameraid"
+ },
+ "width": {
+ "description": "Expected output width in pixels.",
+ "minimum": 1,
+ "title": "Width",
+ "type": "integer"
+ },
+ "height": {
+ "description": "Expected output height in pixels.",
+ "minimum": 1,
+ "title": "Height",
+ "type": "integer"
+ },
+ "durationSeconds": {
+ "description": "Expected output duration in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Durationseconds",
+ "type": "number"
+ },
+ "frameRate": {
+ "description": "Expected output frames per second.",
+ "exclusiveMinimum": 0,
+ "title": "Framerate",
+ "type": "number"
}
},
"required": [
- "id",
- "kind"
+ "cameraSource",
+ "width",
+ "height",
+ "durationSeconds",
+ "frameRate"
],
- "title": "EditorRef",
+ "title": "DirectorOutputPlan",
"type": "object"
},
- "EditorSaveCommand": {
+ "DirectorRenderEvidence": {
"additionalProperties": false,
- "description": "Save an editable document.",
+ "properties": {
+ "acceptedProjectCursor": {
+ "description": "Event cursor of the accepted project snapshot.",
+ "minimum": 1,
+ "title": "Acceptedprojectcursor",
+ "type": "integer"
+ },
+ "sourceEditorId": {
+ "description": "Editable Director Stage document fixed at acceptance.",
+ "format": "uuid",
+ "title": "Sourceeditorid",
+ "type": "string"
+ },
+ "sourceEditorRevision": {
+ "description": "Source stage revision fixed at acceptance.",
+ "minimum": 1,
+ "title": "Sourceeditorrevision",
+ "type": "integer"
+ },
+ "plan": {
+ "$ref": "#/$defs/DirectorOutputPlan",
+ "description": "The accepted camera strategy, output size, duration and frame rate."
+ }
+ },
+ "required": [
+ "acceptedProjectCursor",
+ "sourceEditorId",
+ "sourceEditorRevision",
+ "plan"
+ ],
+ "title": "DirectorRenderEvidence",
+ "type": "object"
+ },
+ "DirectorSetDuration": {
+ "additionalProperties": false,
+ "properties": {
+ "documentId": {
+ "description": "Director Stage document whose main timeline will change.",
+ "format": "uuid",
+ "title": "Documentid",
+ "type": "string"
+ },
+ "duration": {
+ "description": "Requested main timeline duration in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Duration",
+ "type": "number"
+ }
+ },
+ "required": [
+ "documentId",
+ "duration"
+ ],
+ "title": "DirectorSetDuration",
+ "type": "object"
+ },
+ "DirectorSetDurationCommand": {
+ "additionalProperties": false,
+ "description": "Set the Director Stage main timeline duration, preserving the Storyboard and animation.",
"properties": {
"commandId": {
"description": "Stable command ID for idempotent replay.",
@@ -4696,7 +5214,7 @@
"type": "string"
},
"type": {
- "const": "editor.save",
+ "const": "director.duration.set",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -4725,8 +5243,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/EditorWrite",
- "description": "Save an editable document."
+ "$ref": "#/$defs/DirectorSetDuration",
+ "description": "Set the Director Stage main timeline duration, preserving the Storyboard and animation."
}
},
"required": [
@@ -4735,110 +5253,100 @@
"type",
"payload"
],
- "title": "EditorSaveCommand",
+ "title": "DirectorSetDurationCommand",
"type": "object"
},
- "EditorSaveCommandOperation": {
+ "DirectorSetDurationCommandOperation": {
"additionalProperties": false,
- "description": "Save an editable document.",
+ "description": "Set the Director Stage main timeline duration, preserving the Storyboard and animation.",
"properties": {
"type": {
- "const": "editor.save",
+ "const": "director.duration.set",
"description": "Operation discriminator.",
"title": "Type",
"type": "string"
},
"payload": {
- "$ref": "#/$defs/EditorWrite",
- "description": "Save an editable document."
+ "$ref": "#/$defs/DirectorSetDuration",
+ "description": "Set the Director Stage main timeline duration, preserving the Storyboard and animation."
}
},
"required": [
"type",
"payload"
],
- "title": "EditorSaveCommandOperation",
+ "title": "DirectorSetDurationCommandOperation",
"type": "object"
},
- "EditorWrite": {
+ "DirectorStoryboardAppend": {
"additionalProperties": false,
"properties": {
- "document": {
- "description": "Editable document owned by this operation.",
- "discriminator": {
- "mapping": {
- "director": "#/$defs/DirectorDocument",
- "image_crop": "#/$defs/ImageCropDocument",
- "layers": "#/$defs/LayerDocument",
- "media_edit": "#/$defs/MediaEditDocument",
- "stack": "#/$defs/StackDocument",
- "subject": "#/$defs/SubjectDocument",
- "timeline": "#/$defs/TimelineDocument",
- "tool": "#/$defs/ToolDocument"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TimelineDocument"
- },
- {
- "$ref": "#/$defs/SubjectDocument"
- },
- {
- "$ref": "#/$defs/LayerDocument"
- },
- {
- "$ref": "#/$defs/ImageCropDocument"
- },
- {
- "$ref": "#/$defs/StackDocument"
- },
- {
- "$ref": "#/$defs/ToolDocument"
- },
- {
- "$ref": "#/$defs/DirectorDocument"
- },
- {
- "$ref": "#/$defs/MediaEditDocument"
- }
- ],
- "title": "Document"
+ "documentId": {
+ "description": "Director Stage document that receives the Storyboard block.",
+ "format": "uuid",
+ "title": "Documentid",
+ "type": "string"
+ },
+ "cameraId": {
+ "description": "Existing stage camera the new block references.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Cameraid",
+ "type": "string"
+ },
+ "blockId": {
+ "description": "Stable identity of the new Storyboard block; it must not be in use.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Blockid",
+ "type": "string"
}
},
"required": [
- "document"
+ "documentId",
+ "cameraId",
+ "blockId"
],
- "title": "EditorWrite",
+ "title": "DirectorStoryboardAppend",
"type": "object"
},
- "EmptyBinding": {
+ "DirectorStoryboardAppendCommand": {
"additionalProperties": false,
- "description": "An empty canvas item with optional editable draft or manual text.",
+ "description": "Append an existing camera to the end of the continuous Director Stage Storyboard.",
"properties": {
- "role": {
- "const": "empty",
- "description": "Business role of this binding or reference.",
- "title": "Role",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
"type": "string"
},
- "draftSpec": {
- "anyOf": [
- {
- "$ref": "#/$defs/GenerationSpecRef"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Editable generation draft associated with an empty item."
- },
- "manualText": {
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "director.storyboard.append",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
"anyOf": [
{
- "maxLength": 1048576,
+ "pattern": "^[0-9a-f]{64}$",
"type": "string"
},
{
@@ -4846,168 +5354,184 @@
}
],
"default": null,
- "description": "Manually entered text for an empty text item.",
- "title": "Manualtext"
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardAppend",
+ "description": "Append an existing camera to the end of the continuous Director Stage Storyboard."
}
},
"required": [
- "role"
+ "commandId",
+ "projectId",
+ "type",
+ "payload"
],
- "title": "EmptyBinding",
- "type": "object"
- },
- "EmptyPayload": {
- "additionalProperties": false,
- "properties": {},
- "title": "EmptyPayload",
+ "title": "DirectorStoryboardAppendCommand",
"type": "object"
},
- "FileCanvasItem": {
+ "DirectorStoryboardBlock": {
"additionalProperties": false,
"properties": {
"id": {
- "description": "Stable identity of this project-owned object.",
- "format": "uuid",
+ "description": "Stable block identity.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
"title": "Id",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ "cameraId": {
+ "description": "Stage camera the block references.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Cameraid",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
+ "order": {
+ "description": "Position in the stored Storyboard, starting at zero.",
+ "minimum": 0,
+ "title": "Order",
"type": "integer"
},
- "kind": {
- "const": "file",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
- },
- "title": {
- "default": "",
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
- "type": "string"
- },
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
- },
- "width": {
- "default": 352,
- "description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "title": "Width",
+ "start": {
+ "description": "Block start in seconds, as stored.",
+ "minimum": 0,
+ "title": "Start",
"type": "number"
},
- "height": {
- "default": 198,
- "description": "Height in pixels.",
+ "duration": {
+ "description": "Block duration in seconds, as stored.",
"exclusiveMinimum": 0,
- "title": "Height",
+ "title": "Duration",
"type": "number"
+ }
+ },
+ "required": [
+ "id",
+ "cameraId",
+ "order",
+ "start",
+ "duration"
+ ],
+ "title": "DirectorStoryboardBlock",
+ "type": "object"
+ },
+ "DirectorStoryboardDelete": {
+ "additionalProperties": false,
+ "properties": {
+ "documentId": {
+ "description": "Director Stage document that owns the Storyboard.",
+ "format": "uuid",
+ "title": "Documentid",
+ "type": "string"
},
- "zIndex": {
- "default": 0,
- "description": "Canvas stacking order.",
- "title": "Zindex",
- "type": "integer"
- },
- "locked": {
- "default": false,
- "description": "Whether edits to this object are blocked.",
- "title": "Locked",
- "type": "boolean"
+ "blockId": {
+ "description": "Storyboard block to delete.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Blockid",
+ "type": "string"
+ }
+ },
+ "required": [
+ "documentId",
+ "blockId"
+ ],
+ "title": "DirectorStoryboardDelete",
+ "type": "object"
+ },
+ "DirectorStoryboardDeleteCommand": {
+ "additionalProperties": false,
+ "description": "Delete a Storyboard block and shift later blocks without changing their durations.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
},
- "visible": {
- "default": true,
- "description": "Whether this object is displayed.",
- "title": "Visible",
- "type": "boolean"
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
},
- "parentId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Parent canvas group ID, or null for the root.",
- "title": "Parentid"
+ "type": {
+ "const": "director.storyboard.delete",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
},
- "tags": {
+ "expectedVersions": {
"default": [],
- "description": "User-defined search tags.",
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
"items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "type": "string"
+ "$ref": "#/$defs/ObjectVersion"
},
- "title": "Tags",
+ "title": "Expectedversions",
"type": "array"
},
- "binding": {
- "description": "Business object displayed by this canvas item.",
- "discriminator": {
- "mapping": {
- "empty": "#/$defs/EmptyBinding",
- "generation": "#/$defs/GenerationBinding",
- "material": "#/$defs/MaterialBinding"
- },
- "propertyName": "role"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/EmptyBinding"
- },
+ "expectedPreview": {
+ "anyOf": [
{
- "$ref": "#/$defs/MaterialBinding"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
- "$ref": "#/$defs/GenerationBinding"
+ "type": "null"
}
],
- "title": "Binding"
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "editors": {
- "default": [],
- "description": "Attached editable documents.",
- "items": {
- "$ref": "#/$defs/EditorRef"
- },
- "title": "Editors",
- "type": "array"
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardDelete",
+ "description": "Delete a Storyboard block and shift later blocks without changing their durations."
}
},
"required": [
- "id",
+ "commandId",
"projectId",
- "kind",
- "binding"
+ "type",
+ "payload"
],
- "title": "FileCanvasItem",
+ "title": "DirectorStoryboardDeleteCommand",
"type": "object"
},
- "FollowingReference": {
+ "DirectorStoryboardDeleteCommandOperation": {
"additionalProperties": false,
+ "description": "Delete a Storyboard block and shift later blocks without changing their durations.",
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
+ "type": {
+ "const": "director.storyboard.delete",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardDelete",
+ "description": "Delete a Storyboard block and shift later blocks without changing their durations."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "DirectorStoryboardDeleteCommandOperation",
+ "type": "object"
+ },
+ "DirectorStoryboardQuery": {
+ "additionalProperties": false,
+ "properties": {
+ "queryId": {
+ "description": "Caller-supplied query ID.",
"format": "uuid",
- "title": "Id",
+ "title": "Queryid",
"type": "string"
},
"projectId": {
@@ -5016,209 +5540,335 @@
"title": "Projectid",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
+ "type": {
+ "const": "director.storyboard.get",
+ "description": "Read the stored Director Stage Storyboard and whether a block can be appended.",
+ "title": "Type",
+ "type": "string"
},
- "targetSpecId": {
- "description": "Target generation configuration ID.",
+ "objectId": {
+ "description": "Director Stage document ID.",
"format": "uuid",
- "title": "Targetspecid",
+ "title": "Objectid",
"type": "string"
- },
- "role": {
- "default": "reference",
- "description": "Business role of this binding or reference.",
- "enum": [
- "reference",
- "first_frame",
- "last_frame",
- "continuation"
- ],
- "title": "Role",
+ }
+ },
+ "required": [
+ "queryId",
+ "projectId",
+ "type",
+ "objectId"
+ ],
+ "title": "DirectorStoryboardQuery",
+ "type": "object"
+ },
+ "DirectorStoryboardReorder": {
+ "additionalProperties": false,
+ "properties": {
+ "documentId": {
+ "description": "Director Stage document that owns the Storyboard.",
+ "format": "uuid",
+ "title": "Documentid",
"type": "string"
},
- "order": {
- "default": 0,
- "description": "Reference ordering within the target configuration.",
- "minimum": 0,
- "title": "Order",
- "type": "integer"
+ "blockIds": {
+ "description": "Every Storyboard block ID exactly once, in the desired order.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Blockids",
+ "type": "array"
+ }
+ },
+ "required": [
+ "documentId",
+ "blockIds"
+ ],
+ "title": "DirectorStoryboardReorder",
+ "type": "object"
+ },
+ "DirectorStoryboardReorderCommand": {
+ "additionalProperties": false,
+ "description": "Reorder the continuous Storyboard by block ID, preserving durations and camera references.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
},
- "active": {
- "default": true,
- "description": "Whether this reference participates in generation.",
- "title": "Active",
- "type": "boolean"
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
},
- "binding": {
- "const": "follow_current",
- "description": "Follow the source canvas item's current asset.",
- "title": "Binding",
+ "type": {
+ "const": "director.storyboard.reorder",
+ "description": "Command discriminator.",
+ "title": "Type",
"type": "string"
},
- "source": {
- "$ref": "#/$defs/FollowingSource",
- "description": "Source canvas_item identity."
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardReorder",
+ "description": "Reorder the continuous Storyboard by block ID, preserving durations and camera references."
}
},
"required": [
- "id",
+ "commandId",
"projectId",
- "targetSpecId",
- "binding",
- "source"
+ "type",
+ "payload"
],
- "title": "FollowingReference",
+ "title": "DirectorStoryboardReorderCommand",
"type": "object"
},
- "FollowingReferenceSource": {
+ "DirectorStoryboardReorderCommandOperation": {
"additionalProperties": false,
+ "description": "Reorder the continuous Storyboard by block ID, preserving durations and camera references.",
"properties": {
- "binding": {
- "const": "follow_current",
- "default": "follow_current",
- "description": "Follow the canvas source current asset.",
- "title": "Binding",
+ "type": {
+ "const": "director.storyboard.reorder",
+ "description": "Operation discriminator.",
+ "title": "Type",
"type": "string"
},
- "source": {
- "$ref": "#/$defs/FollowingSource",
- "description": "Source canvas_item identity."
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardReorder",
+ "description": "Reorder the continuous Storyboard by block ID, preserving durations and camera references."
}
},
"required": [
- "source"
+ "type",
+ "payload"
],
- "title": "FollowingReferenceSource",
+ "title": "DirectorStoryboardReorderCommandOperation",
"type": "object"
},
- "FollowingSource": {
+ "DirectorStoryboardResize": {
"additionalProperties": false,
"properties": {
- "objectType": {
- "const": "canvas_item",
- "default": "canvas_item",
- "description": "Referenced business object type.",
- "title": "Objecttype",
+ "documentId": {
+ "description": "Director Stage document that owns the Storyboard.",
+ "format": "uuid",
+ "title": "Documentid",
"type": "string"
},
- "id": {
- "description": "Source canvas item ID.",
- "format": "uuid",
- "title": "Id",
+ "blockId": {
+ "description": "Block that owns the boundary on its right.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Blockid",
"type": "string"
+ },
+ "duration": {
+ "description": "New duration of that block in seconds; must leave the Storyboard continuous and within the timeline.",
+ "title": "Duration",
+ "type": "number"
}
},
"required": [
- "id"
+ "documentId",
+ "blockId",
+ "duration"
],
- "title": "FollowingSource",
+ "title": "DirectorStoryboardResize",
"type": "object"
},
- "GenerationBinding": {
+ "DirectorStoryboardResizeCommand": {
"additionalProperties": false,
- "description": "Displays a generation configuration and its adopted result.",
+ "description": "Resize the given block and shift all subsequent blocks, preserving their durations.",
"properties": {
- "role": {
- "const": "generation",
- "description": "Business role of this binding or reference.",
- "title": "Role",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
"type": "string"
},
- "objectRef": {
- "$ref": "#/$defs/GenerationSpecRef",
- "description": "Stable reference to the bound business object."
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
},
- "materialOverride": {
+ "type": {
+ "const": "director.storyboard.resize",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
"anyOf": [
{
- "$ref": "#/$defs/AssetRef"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Adopted material that overrides the current generated result."
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardResize",
+ "description": "Resize the given block and shift all subsequent blocks, preserving their durations."
}
},
"required": [
- "role",
- "objectRef"
+ "commandId",
+ "projectId",
+ "type",
+ "payload"
],
- "title": "GenerationBinding",
+ "title": "DirectorStoryboardResizeCommand",
"type": "object"
},
- "GenerationFailure": {
+ "DirectorStoryboardResizeCommandOperation": {
"additionalProperties": false,
+ "description": "Resize the given block and shift all subsequent blocks, preserving their durations.",
"properties": {
- "category": {
- "description": "Stable failure category.",
- "enum": [
- "input",
- "reference",
- "authentication",
- "permission",
- "quota",
- "rate_limit",
- "temporary",
- "submission_unknown",
- "local",
- "protocol",
- "provider"
- ],
- "title": "Category",
+ "type": {
+ "const": "director.storyboard.resize",
+ "description": "Operation discriminator.",
+ "title": "Type",
"type": "string"
},
- "stage": {
- "description": "Execution stage where the failure occurred.",
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardResize",
+ "description": "Resize the given block and shift all subsequent blocks, preserving their durations."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "DirectorStoryboardResizeCommandOperation",
+ "type": "object"
+ },
+ "DirectorStoryboardResult": {
+ "additionalProperties": false,
+ "properties": {
+ "operationIndex": {
+ "description": "Zero-based position in the command or batch.",
+ "minimum": 0,
+ "title": "Operationindex",
+ "type": "integer"
+ },
+ "operation": {
+ "description": "Storyboard or related operation evaluated.",
"enum": [
- "prepare",
- "submit",
- "poll",
- "download",
- "check",
- "save",
- "adopt",
- "cancel"
+ "director.storyboard.append",
+ "director.storyboard.reorder",
+ "director.storyboard.resize",
+ "director.storyboard.delete",
+ "director.camera.delete",
+ "director.duration.set"
],
- "title": "Stage",
+ "title": "Operation",
"type": "string"
},
- "message": {
- "description": "Human-readable issue description.",
- "maxLength": 500,
- "title": "Message",
+ "documentId": {
+ "description": "Director Stage document that owns the Storyboard.",
+ "format": "uuid",
+ "title": "Documentid",
"type": "string"
},
- "suggestion": {
- "description": "Suggested action to resolve the failure.",
- "maxLength": 500,
- "title": "Suggestion",
- "type": "string"
+ "version": {
+ "description": "Committed document revision for the enclosing transaction.",
+ "minimum": 1,
+ "title": "Version",
+ "type": "integer"
},
- "providerCode": {
- "anyOf": [
- {
- "maxLength": 160,
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
+ "blocks": {
+ "description": "Block identities, order and stored times after this operation, before subsequent batch operations.",
+ "items": {
+ "$ref": "#/$defs/DirectorStoryboardBlock"
+ },
+ "title": "Blocks",
+ "type": "array"
+ },
+ "affectedBlockIds": {
+ "description": "New or changed surviving block IDs, in resulting order.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Affectedblockids",
+ "type": "array"
+ },
+ "removedBlockIds": {
+ "description": "Removed block IDs, in their previous order.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Removedblockids",
+ "type": "array"
+ },
+ "blockId": {
+ "anyOf": [
+ {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"default": null,
- "description": "Provider error code.",
- "title": "Providercode"
+ "description": "Block explicitly targeted by the operation, when applicable.",
+ "title": "Blockid"
},
- "requestId": {
+ "cameraId": {
"anyOf": [
{
- "maxLength": 200,
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
"type": "string"
},
{
@@ -5226,31 +5876,79 @@
}
],
"default": null,
- "description": "Provider request ID.",
- "title": "Requestid"
+ "description": "Camera explicitly targeted by the operation, when applicable.",
+ "title": "Cameraid"
},
- "httpStatus": {
+ "appendLimitReason": {
"anyOf": [
{
- "maximum": 599,
- "minimum": 100,
- "type": "integer"
+ "const": "storyboard_tail",
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Provider HTTP response status.",
- "title": "Httpstatus"
+ "description": "Stable reason a new block is shorter than the default duration, or null.",
+ "title": "Appendlimitreason"
+ }
+ },
+ "required": [
+ "operationIndex",
+ "operation",
+ "documentId",
+ "version",
+ "blocks",
+ "affectedBlockIds",
+ "removedBlockIds"
+ ],
+ "title": "DirectorStoryboardResult",
+ "type": "object"
+ },
+ "DirectorStoryboardState": {
+ "additionalProperties": false,
+ "properties": {
+ "documentId": {
+ "description": "Director Stage document that owns the Storyboard.",
+ "format": "uuid",
+ "title": "Documentid",
+ "type": "string"
},
- "providerStatus": {
+ "version": {
+ "description": "Current revision of the Director Stage document.",
+ "minimum": 1,
+ "title": "Version",
+ "type": "integer"
+ },
+ "storyboardEnd": {
+ "description": "End of the last block in seconds; zero when the Storyboard is empty.",
+ "minimum": 0,
+ "title": "Storyboardend",
+ "type": "number"
+ },
+ "canAppend": {
+ "description": "Whether a block can be appended in the main-timeline time that remains.",
+ "title": "Canappend",
+ "type": "boolean"
+ },
+ "cannotAppendReason": {
"anyOf": [
{
"enum": [
- "failed",
- "cancelled",
- "expired"
+ "storyboard_leading_gap",
+ "storyboard_internal_gap",
+ "storyboard_overlap",
+ "storyboard_exceeds_duration",
+ "storyboard_duration_invalid",
+ "storyboard_camera_unknown",
+ "storyboard_block_invalid",
+ "storyboard_block_exists",
+ "storyboard_exhausted",
+ "storyboard_order_invalid",
+ "storyboard_block_unknown",
+ "director_camera_unknown",
+ "director_camera_required"
],
"type": "string"
},
@@ -5259,20 +5957,50 @@
}
],
"default": null,
- "description": "Provider terminal task status.",
- "title": "Providerstatus"
+ "description": "Stable reason no block can be appended; null when one can.",
+ "title": "Cannotappendreason"
+ },
+ "blocks": {
+ "description": "Storyboard blocks in stored order, reported as stored.",
+ "items": {
+ "$ref": "#/$defs/DirectorStoryboardBlock"
+ },
+ "title": "Blocks",
+ "type": "array"
}
},
"required": [
- "category",
- "stage",
- "message",
- "suggestion"
+ "documentId",
+ "version",
+ "storyboardEnd",
+ "canAppend",
+ "blocks"
],
- "title": "GenerationFailure",
+ "title": "DirectorStoryboardState",
"type": "object"
},
- "GenerationSpecBase": {
+ "EditorBinding": {
+ "additionalProperties": false,
+ "properties": {
+ "role": {
+ "const": "editor",
+ "description": "Business role of this binding or reference.",
+ "title": "Role",
+ "type": "string"
+ },
+ "objectRef": {
+ "$ref": "#/$defs/EditorRef",
+ "description": "Stable reference to the bound business object."
+ }
+ },
+ "required": [
+ "role",
+ "objectRef"
+ ],
+ "title": "EditorBinding",
+ "type": "object"
+ },
+ "EditorCanvasItem": {
"additionalProperties": false,
"properties": {
"id": {
@@ -5294,68 +6022,68 @@
"title": "Revision",
"type": "integer"
},
- "purpose": {
- "default": "draft",
- "description": "Draft settings or executable generation configuration.",
+ "kind": {
+ "description": "Business object or media type.",
"enum": [
- "draft",
- "generation"
+ "text",
+ "image",
+ "video",
+ "audio",
+ "file",
+ "group",
+ "timeline",
+ "subject",
+ "stack",
+ "tool",
+ "external"
],
- "title": "Purpose",
+ "title": "Kind",
"type": "string"
},
- "modelConfigId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Model configuration ID from the model catalog or user model selections.",
- "title": "Modelconfigid"
- },
- "prompt": {
+ "title": {
"default": "",
- "description": "Generation prompt text.",
- "maxLength": 20000,
- "title": "Prompt",
+ "description": "User-visible title.",
+ "maxLength": 255,
+ "title": "Title",
"type": "string"
},
- "promptContent": {
- "anyOf": [
- {
- "items": {
- "discriminator": {
- "mapping": {
- "reference": "#/$defs/PromptReference",
- "text": "#/$defs/PromptText"
- },
- "propertyName": "type"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/PromptText"
- },
- {
- "$ref": "#/$defs/PromptReference"
- }
- ]
- },
- "type": "array"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Structured prompt text and reference tokens.",
- "title": "Promptcontent"
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
},
- "currentResultId": {
+ "width": {
+ "default": 352,
+ "description": "Width in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Width",
+ "type": "number"
+ },
+ "height": {
+ "default": 198,
+ "description": "Height in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Height",
+ "type": "number"
+ },
+ "zIndex": {
+ "default": 0,
+ "description": "Canvas stacking order.",
+ "title": "Zindex",
+ "type": "integer"
+ },
+ "locked": {
+ "default": false,
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
+ "type": "boolean"
+ },
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
+ },
+ "parentId": {
"anyOf": [
{
"format": "uuid",
@@ -5366,141 +6094,53 @@
}
],
"default": null,
- "description": "Currently adopted result ID.",
- "title": "Currentresultid"
+ "description": "Parent canvas group ID, or null for the root.",
+ "title": "Parentid"
+ },
+ "tags": {
+ "default": [],
+ "description": "User-defined search tags.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Tags",
+ "type": "array"
+ },
+ "binding": {
+ "$ref": "#/$defs/EditorBinding",
+ "description": "Business object displayed by this canvas item."
}
},
"required": [
"id",
- "projectId"
+ "projectId",
+ "kind",
+ "binding"
],
- "title": "GenerationSpecBase",
+ "title": "EditorCanvasItem",
"type": "object"
},
- "GenerationSpecRef": {
+ "EditorCreateCommand": {
"additionalProperties": false,
+ "description": "Create an editable document.",
"properties": {
- "objectType": {
- "const": "generation_spec",
- "default": "generation_spec",
- "description": "Referenced business object type.",
- "title": "Objecttype",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
"type": "string"
},
- "id": {
- "description": "Referenced generation configuration ID.",
+ "projectId": {
+ "description": "Owning project ID.",
"format": "uuid",
- "title": "Id",
- "type": "string"
- }
- },
- "required": [
- "id"
- ],
- "title": "GenerationSpecRef",
- "type": "object"
- },
- "GenerationSubmit": {
- "additionalProperties": false,
- "properties": {
- "specId": {
- "description": "Include its current generation_spec revision in expectedVersions.",
- "format": "uuid",
- "title": "Specid",
- "type": "string",
- "x-version-object-type": "generation_spec"
- },
- "expectedSpecRevision": {
- "description": "Must match the specId revision in expectedVersions.",
- "minimum": 1,
- "title": "Expectedspecrevision",
- "type": "integer"
- },
- "originItemId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "When set, include its current canvas_item revision in expectedVersions.",
- "title": "Originitemid",
- "x-version-object-type": "canvas_item"
- },
- "previousJobId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Previous generation attempt ID.",
- "title": "Previousjobid"
- },
- "adoptionPolicy": {
- "default": "if_current",
- "description": "Policy for adopting the completed result.",
- "enum": [
- "if_current",
- "candidate_only"
- ],
- "title": "Adoptionpolicy",
- "type": "string"
- },
- "batchId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Generation batch ID.",
- "title": "Batchid"
- },
- "showAdditionalResult": {
- "default": false,
- "description": "Whether to display an additional result item.",
- "title": "Showadditionalresult",
- "type": "boolean"
- }
- },
- "required": [
- "specId",
- "expectedSpecRevision"
- ],
- "title": "GenerationSubmit",
- "type": "object"
- },
- "GenerationSubmitCommand": {
- "additionalProperties": false,
- "description": "Submit a generation job with fixed inputs and an adoption policy.",
- "properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ "title": "Projectid",
"type": "string"
},
"type": {
- "const": "generation.submit",
+ "const": "editor.create",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -5529,8 +6169,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/GenerationSubmit",
- "description": "Submit a generation job with fixed inputs and an adoption policy."
+ "$ref": "#/$defs/EditorWrite",
+ "description": "Create an editable document."
}
},
"required": [
@@ -5539,10 +6179,32 @@
"type",
"payload"
],
- "title": "GenerationSubmitCommand",
+ "title": "EditorCreateCommand",
"type": "object"
},
- "GroupCanvasItem": {
+ "EditorCreateCommandOperation": {
+ "additionalProperties": false,
+ "description": "Create an editable document.",
+ "properties": {
+ "type": {
+ "const": "editor.create",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/EditorWrite",
+ "description": "Create an editable document."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "EditorCreateCommandOperation",
+ "type": "object"
+ },
+ "EditorDocumentBase": {
"additionalProperties": false,
"properties": {
"id": {
@@ -5564,172 +6226,110 @@
"title": "Revision",
"type": "integer"
},
- "kind": {
- "const": "group",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
- },
- "title": {
- "default": "",
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
- "type": "string"
- },
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
- },
- "width": {
- "default": 352,
- "description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "title": "Width",
- "type": "number"
- },
- "height": {
- "default": 198,
- "description": "Height in pixels.",
- "exclusiveMinimum": 0,
- "title": "Height",
- "type": "number"
- },
- "zIndex": {
- "default": 0,
- "description": "Canvas stacking order.",
- "title": "Zindex",
+ "schemaVersion": {
+ "const": 1,
+ "default": 1,
+ "description": "Record schema version.",
+ "title": "Schemaversion",
"type": "integer"
},
- "locked": {
- "default": false,
- "description": "Whether edits to this object are blocked.",
- "title": "Locked",
- "type": "boolean"
- },
- "visible": {
- "default": true,
- "description": "Whether this object is displayed.",
- "title": "Visible",
- "type": "boolean"
- },
- "parentId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Parent canvas group ID, or null for the root.",
- "title": "Parentid"
- },
- "tags": {
+ "inputConnections": {
"default": [],
- "description": "User-defined search tags.",
+ "description": "Persisted connections to source assets.",
"items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "type": "string"
+ "$ref": "#/$defs/EditorInputConnection"
},
- "title": "Tags",
+ "title": "Inputconnections",
"type": "array"
- },
- "binding": {
- "$ref": "#/$defs/ContainerBinding",
- "description": "Business object displayed by this canvas item."
}
},
"required": [
"id",
- "projectId",
- "kind"
+ "projectId"
],
- "title": "GroupCanvasItem",
+ "title": "EditorDocumentBase",
"type": "object"
},
- "HistoryRedoCommand": {
+ "EditorInputConnection": {
"additionalProperties": false,
- "description": "Reapply an undone command.",
+ "description": "Assembly provenance binds a retained slot, never a generation spec.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
+ "id": {
+ "description": "Stable object ID.",
"format": "uuid",
- "title": "Commandid",
+ "title": "Id",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
+ "sourceId": {
+ "description": "Source canvas item ID.",
"format": "uuid",
- "title": "Projectid",
+ "title": "Sourceid",
"type": "string"
},
- "type": {
- "const": "history.redo",
- "description": "Command discriminator.",
- "title": "Type",
+ "slotId": {
+ "description": "Destination editor input slot.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Slotid",
"type": "string"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
- },
- "expectedPreview": {
- "anyOf": [
- {
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
- },
- "payload": {
- "$ref": "#/$defs/HistoryReplay",
- "description": "Reapply an undone command."
+ "asset": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Immutable asset version."
}
},
"required": [
- "commandId",
- "projectId",
- "type",
- "payload"
+ "id",
+ "sourceId",
+ "slotId",
+ "asset"
],
- "title": "HistoryRedoCommand",
+ "title": "EditorInputConnection",
"type": "object"
},
- "HistoryReplay": {
+ "EditorRef": {
"additionalProperties": false,
"properties": {
- "targetCommandId": {
- "description": "Historical command to undo or redo.",
+ "objectType": {
+ "const": "editor_document",
+ "default": "editor_document",
+ "description": "Referenced business object type.",
+ "title": "Objecttype",
+ "type": "string"
+ },
+ "id": {
+ "description": "Referenced editable document ID.",
"format": "uuid",
- "title": "Targetcommandid",
+ "title": "Id",
+ "type": "string"
+ },
+ "kind": {
+ "description": "Business object or media type.",
+ "enum": [
+ "timeline",
+ "subject",
+ "stack",
+ "tool",
+ "director",
+ "layers",
+ "image_crop",
+ "media_edit"
+ ],
+ "title": "Kind",
"type": "string"
}
},
"required": [
- "targetCommandId"
+ "id",
+ "kind"
],
- "title": "HistoryReplay",
+ "title": "EditorRef",
"type": "object"
},
- "HistoryUndoCommand": {
+ "EditorSaveCommand": {
"additionalProperties": false,
- "description": "Undo a recorded reversible command.",
+ "description": "Save an editable document.",
"properties": {
"commandId": {
"description": "Stable command ID for idempotent replay.",
@@ -5744,7 +6344,7 @@
"type": "string"
},
"type": {
- "const": "history.undo",
+ "const": "editor.save",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -5773,8 +6373,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/HistoryReplay",
- "description": "Undo a recorded reversible command."
+ "$ref": "#/$defs/EditorWrite",
+ "description": "Save an editable document."
}
},
"required": [
@@ -5783,10 +6383,134 @@
"type",
"payload"
],
- "title": "HistoryUndoCommand",
+ "title": "EditorSaveCommand",
"type": "object"
},
- "ImageCanvasItem": {
+ "EditorSaveCommandOperation": {
+ "additionalProperties": false,
+ "description": "Save an editable document.",
+ "properties": {
+ "type": {
+ "const": "editor.save",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/EditorWrite",
+ "description": "Save an editable document."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "EditorSaveCommandOperation",
+ "type": "object"
+ },
+ "EditorWrite": {
+ "additionalProperties": false,
+ "properties": {
+ "document": {
+ "description": "Editable document owned by this operation.",
+ "discriminator": {
+ "mapping": {
+ "director": "#/$defs/DirectorDocumentWrite",
+ "image_crop": "#/$defs/ImageCropDocument",
+ "layers": "#/$defs/LayerDocument",
+ "media_edit": "#/$defs/MediaEditDocument",
+ "stack": "#/$defs/StackDocument",
+ "subject": "#/$defs/SubjectDocument",
+ "timeline": "#/$defs/TimelineDocument",
+ "tool": "#/$defs/ToolDocument"
+ },
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TimelineDocument"
+ },
+ {
+ "$ref": "#/$defs/SubjectDocument"
+ },
+ {
+ "$ref": "#/$defs/LayerDocument"
+ },
+ {
+ "$ref": "#/$defs/ImageCropDocument"
+ },
+ {
+ "$ref": "#/$defs/StackDocument"
+ },
+ {
+ "$ref": "#/$defs/ToolDocument"
+ },
+ {
+ "$ref": "#/$defs/DirectorDocumentWrite"
+ },
+ {
+ "$ref": "#/$defs/MediaEditDocument"
+ }
+ ],
+ "title": "Document"
+ }
+ },
+ "required": [
+ "document"
+ ],
+ "title": "EditorWrite",
+ "type": "object"
+ },
+ "EmptyBinding": {
+ "additionalProperties": false,
+ "description": "An empty canvas item with optional editable draft or manual text.",
+ "properties": {
+ "role": {
+ "const": "empty",
+ "description": "Business role of this binding or reference.",
+ "title": "Role",
+ "type": "string"
+ },
+ "draftSpec": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GenerationSpecRef"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Editable generation draft associated with an empty item."
+ },
+ "manualText": {
+ "anyOf": [
+ {
+ "maxLength": 1048576,
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Manually entered text for an empty text item.",
+ "title": "Manualtext"
+ }
+ },
+ "required": [
+ "role"
+ ],
+ "title": "EmptyBinding",
+ "type": "object"
+ },
+ "EmptyPayload": {
+ "additionalProperties": false,
+ "properties": {},
+ "title": "EmptyPayload",
+ "type": "object"
+ },
+ "FileCanvasItem": {
"additionalProperties": false,
"properties": {
"id": {
@@ -5809,7 +6533,7 @@
"type": "integer"
},
"kind": {
- "const": "image",
+ "const": "file",
"description": "Business object or media type.",
"title": "Kind",
"type": "string"
@@ -5922,43 +6646,10 @@
"kind",
"binding"
],
- "title": "ImageCanvasItem",
- "type": "object"
- },
- "ImageCropData": {
- "additionalProperties": false,
- "properties": {
- "source": {
- "$ref": "#/$defs/AssetRef",
- "description": "Input source or recorded provenance."
- },
- "options": {
- "$ref": "#/$defs/ImageCropOptions",
- "description": "Non-destructive image crop and color settings."
- },
- "width": {
- "description": "Width in pixels.",
- "minimum": 1,
- "title": "Width",
- "type": "integer"
- },
- "height": {
- "description": "Height in pixels.",
- "minimum": 1,
- "title": "Height",
- "type": "integer"
- }
- },
- "required": [
- "source",
- "options",
- "width",
- "height"
- ],
- "title": "ImageCropData",
+ "title": "FileCanvasItem",
"type": "object"
},
- "ImageCropDocument": {
+ "FollowingReference": {
"additionalProperties": false,
"properties": {
"id": {
@@ -5980,252 +6671,256 @@
"title": "Revision",
"type": "integer"
},
- "schemaVersion": {
- "const": 1,
- "default": 1,
- "description": "Record schema version.",
- "title": "Schemaversion",
- "type": "integer"
+ "targetSpecId": {
+ "description": "Target generation configuration ID.",
+ "format": "uuid",
+ "title": "Targetspecid",
+ "type": "string"
},
- "inputConnections": {
- "default": [],
- "description": "Persisted connections to source assets.",
- "items": {
- "$ref": "#/$defs/EditorInputConnection"
- },
- "title": "Inputconnections",
- "type": "array"
+ "role": {
+ "default": "reference",
+ "description": "Business role of this binding or reference.",
+ "enum": [
+ "reference",
+ "first_frame",
+ "last_frame",
+ "continuation"
+ ],
+ "title": "Role",
+ "type": "string"
},
- "kind": {
- "const": "image_crop",
- "description": "Business object or media type.",
- "title": "Kind",
+ "order": {
+ "default": 0,
+ "description": "Reference ordering within the target configuration.",
+ "minimum": 0,
+ "title": "Order",
+ "type": "integer"
+ },
+ "active": {
+ "default": true,
+ "description": "Whether this reference participates in generation.",
+ "title": "Active",
+ "type": "boolean"
+ },
+ "binding": {
+ "const": "follow_current",
+ "description": "Follow the source canvas item's current asset.",
+ "title": "Binding",
"type": "string"
},
- "data": {
- "$ref": "#/$defs/ImageCropData",
- "description": "Typed editable document contents."
+ "source": {
+ "$ref": "#/$defs/FollowingSource",
+ "description": "Source canvas_item identity."
}
},
"required": [
"id",
"projectId",
- "kind",
- "data"
+ "targetSpecId",
+ "binding",
+ "source"
],
- "title": "ImageCropDocument",
+ "title": "FollowingReference",
"type": "object"
},
- "ImageCropOptions": {
+ "FollowingReferenceSource": {
"additionalProperties": false,
"properties": {
- "rotation": {
- "default": 0,
- "description": "Crop rotation in degrees.",
- "enum": [
- 0,
- 90,
- 180,
- 270
- ],
- "title": "Rotation",
- "type": "integer"
- },
- "flipX": {
- "default": false,
- "description": "Whether the image is mirrored horizontally.",
- "title": "Flipx",
- "type": "boolean"
- },
- "flipY": {
- "default": false,
- "description": "Whether the image is mirrored vertically.",
- "title": "Flipy",
- "type": "boolean"
- },
- "aspect": {
- "default": "original",
- "description": "Crop aspect ratio or free crop mode.",
- "enum": [
- "free",
- "original",
- "1:1",
- "4:3",
- "3:4",
- "16:9",
- "9:16"
- ],
- "title": "Aspect",
+ "binding": {
+ "const": "follow_current",
+ "default": "follow_current",
+ "description": "Follow the canvas source current asset.",
+ "title": "Binding",
"type": "string"
},
- "zoom": {
- "default": 100,
- "description": "Crop zoom percentage.",
- "maximum": 400,
- "minimum": 100,
- "title": "Zoom",
- "type": "number"
- },
- "freeWidth": {
- "default": 100,
- "description": "Free crop width as a percentage.",
- "maximum": 100,
- "minimum": 1,
- "title": "Freewidth",
- "type": "number"
- },
- "freeHeight": {
- "default": 100,
- "description": "Free crop height as a percentage.",
- "maximum": 100,
- "minimum": 1,
- "title": "Freeheight",
- "type": "number"
- },
- "x": {
- "default": 50,
- "description": "Horizontal crop position percentage.",
- "maximum": 100,
- "minimum": 0,
- "title": "X",
- "type": "number"
- },
- "y": {
- "default": 50,
- "description": "Vertical crop position percentage.",
- "maximum": 100,
- "minimum": 0,
- "title": "Y",
- "type": "number"
- },
- "brightness": {
- "default": 100,
- "description": "Brightness percentage.",
- "maximum": 200,
- "minimum": 0,
- "title": "Brightness",
- "type": "number"
- },
- "contrast": {
- "default": 100,
- "description": "Contrast percentage.",
- "maximum": 200,
- "minimum": 0,
- "title": "Contrast",
- "type": "number"
- },
- "saturation": {
- "default": 100,
- "description": "Saturation percentage.",
- "maximum": 200,
- "minimum": 0,
- "title": "Saturation",
- "type": "number"
+ "source": {
+ "$ref": "#/$defs/FollowingSource",
+ "description": "Source canvas_item identity."
}
},
- "title": "ImageCropOptions",
+ "required": [
+ "source"
+ ],
+ "title": "FollowingReferenceSource",
"type": "object"
},
- "ImageExecution": {
+ "FollowingSource": {
"additionalProperties": false,
"properties": {
- "kind": {
- "const": "image",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
- },
- "quality": {
- "default": "auto",
- "description": "Image rendering quality fixed for this execution; auto omits the provider field.",
- "enum": [
- "auto",
- "low",
- "medium",
- "high"
- ],
- "title": "Quality",
+ "objectType": {
+ "const": "canvas_item",
+ "default": "canvas_item",
+ "description": "Referenced business object type.",
+ "title": "Objecttype",
"type": "string"
},
- "size": {
- "description": "Effective image dimensions sent to the provider.",
- "title": "Size",
+ "id": {
+ "description": "Source canvas item ID.",
+ "format": "uuid",
+ "title": "Id",
"type": "string"
- },
- "responseFormat": {
- "anyOf": [
- {
- "enum": [
- "url",
- "b64_json"
- ],
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Provider response representation.",
- "title": "Responseformat"
- },
- "outputFormat": {
- "const": "png",
- "default": "png",
- "description": "Generated image encoding.",
- "title": "Outputformat",
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "title": "FollowingSource",
+ "type": "object"
+ },
+ "GenerationBinding": {
+ "additionalProperties": false,
+ "description": "Displays a generation configuration and its adopted result.",
+ "properties": {
+ "role": {
+ "const": "generation",
+ "description": "Business role of this binding or reference.",
+ "title": "Role",
"type": "string"
},
- "watermark": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Whether provider watermarking is enabled.",
- "title": "Watermark"
+ "objectRef": {
+ "$ref": "#/$defs/GenerationSpecRef",
+ "description": "Stable reference to the bound business object."
},
- "numInferenceSteps": {
+ "materialOverride": {
"anyOf": [
{
- "minimum": 1,
- "type": "integer"
+ "$ref": "#/$defs/AssetRef"
},
{
"type": "null"
}
],
"default": null,
- "description": "Diffusion sampling step count.",
- "title": "Numinferencesteps"
+ "description": "Adopted material that overrides the current generated result."
+ }
+ },
+ "required": [
+ "role",
+ "objectRef"
+ ],
+ "title": "GenerationBinding",
+ "type": "object"
+ },
+ "GenerationFailure": {
+ "additionalProperties": false,
+ "properties": {
+ "category": {
+ "description": "Stable failure category.",
+ "enum": [
+ "input",
+ "reference",
+ "authentication",
+ "permission",
+ "quota",
+ "rate_limit",
+ "temporary",
+ "submission_unknown",
+ "local",
+ "protocol",
+ "provider"
+ ],
+ "title": "Category",
+ "type": "string"
},
- "guidanceScale": {
+ "stage": {
+ "description": "Execution stage where the failure occurred.",
+ "enum": [
+ "prepare",
+ "submit",
+ "poll",
+ "download",
+ "check",
+ "save",
+ "adopt",
+ "cancel"
+ ],
+ "title": "Stage",
+ "type": "string"
+ },
+ "message": {
+ "description": "Human-readable issue description.",
+ "maxLength": 500,
+ "title": "Message",
+ "type": "string"
+ },
+ "suggestion": {
+ "description": "Suggested action to resolve the failure.",
+ "maxLength": 500,
+ "title": "Suggestion",
+ "type": "string"
+ },
+ "providerCode": {
"anyOf": [
{
- "minimum": 0,
- "type": "number"
+ "maxLength": 160,
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Diffusion guidance scale.",
- "title": "Guidancescale"
+ "description": "Provider error code.",
+ "title": "Providercode"
+ },
+ "requestId": {
+ "anyOf": [
+ {
+ "maxLength": 200,
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Provider request ID.",
+ "title": "Requestid"
+ },
+ "httpStatus": {
+ "anyOf": [
+ {
+ "maximum": 599,
+ "minimum": 100,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Provider HTTP response status.",
+ "title": "Httpstatus"
+ },
+ "providerStatus": {
+ "anyOf": [
+ {
+ "enum": [
+ "failed",
+ "cancelled",
+ "expired"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Provider terminal task status.",
+ "title": "Providerstatus"
}
},
"required": [
- "kind",
- "size"
+ "category",
+ "stage",
+ "message",
+ "suggestion"
],
- "title": "ImageExecution",
+ "title": "GenerationFailure",
"type": "object"
},
- "ImageGenerationSpec": {
+ "GenerationSpecBase": {
"additionalProperties": false,
"properties": {
"id": {
@@ -6321,237 +7016,400 @@
"default": null,
"description": "Currently adopted result ID.",
"title": "Currentresultid"
- },
- "kind": {
- "const": "image",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
- },
- "parameters": {
- "$ref": "#/$defs/ImageParameters",
- "description": "Typed generation or editing parameters."
}
},
"required": [
"id",
- "projectId",
- "kind"
+ "projectId"
],
- "title": "ImageGenerationSpec",
+ "title": "GenerationSpecBase",
"type": "object"
},
- "ImageLayer": {
+ "GenerationSpecRef": {
"additionalProperties": false,
"properties": {
+ "objectType": {
+ "const": "generation_spec",
+ "default": "generation_spec",
+ "description": "Referenced business object type.",
+ "title": "Objecttype",
+ "type": "string"
+ },
"id": {
- "description": "Stable object ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
+ "description": "Referenced generation configuration ID.",
+ "format": "uuid",
"title": "Id",
"type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "title": "GenerationSpecRef",
+ "type": "object"
+ },
+ "GenerationSubmit": {
+ "additionalProperties": false,
+ "properties": {
+ "specId": {
+ "description": "Include its current generation_spec revision in expectedVersions.",
+ "format": "uuid",
+ "title": "Specid",
+ "type": "string",
+ "x-version-object-type": "generation_spec"
},
- "name": {
- "description": "User-visible name.",
- "maxLength": 200,
- "title": "Name",
- "type": "string"
+ "expectedSpecRevision": {
+ "description": "Must match the specId revision in expectedVersions.",
+ "minimum": 1,
+ "title": "Expectedspecrevision",
+ "type": "integer"
},
- "visible": {
- "default": true,
- "description": "Whether this object is displayed.",
- "title": "Visible",
- "type": "boolean"
+ "originItemId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "When set, include its current canvas_item revision in expectedVersions.",
+ "title": "Originitemid",
+ "x-version-object-type": "canvas_item"
},
- "locked": {
- "default": false,
- "description": "Whether edits to this object are blocked.",
- "title": "Locked",
- "type": "boolean"
+ "previousJobId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Previous generation attempt ID.",
+ "title": "Previousjobid"
},
- "opacity": {
- "default": 1,
- "description": "Layer opacity from zero to one.",
- "maximum": 1,
- "minimum": 0,
- "title": "Opacity",
- "type": "number"
+ "adoptionPolicy": {
+ "default": "if_current",
+ "description": "Policy for adopting the completed result.",
+ "enum": [
+ "if_current",
+ "candidate_only"
+ ],
+ "title": "Adoptionpolicy",
+ "type": "string"
},
- "x": {
- "default": 0,
- "description": "Horizontal coordinate.",
- "title": "X",
- "type": "number"
+ "batchId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Generation batch ID.",
+ "title": "Batchid"
},
- "y": {
- "default": 0,
- "description": "Vertical coordinate.",
- "title": "Y",
- "type": "number"
+ "showAdditionalResult": {
+ "default": false,
+ "description": "Whether to display an additional result item.",
+ "title": "Showadditionalresult",
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "specId",
+ "expectedSpecRevision"
+ ],
+ "title": "GenerationSubmit",
+ "type": "object"
+ },
+ "GenerationSubmitCommand": {
+ "additionalProperties": false,
+ "description": "Submit a generation job with fixed inputs and an adoption policy.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "generation.submit",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/GenerationSubmit",
+ "description": "Submit a generation job with fixed inputs and an adoption policy."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "payload"
+ ],
+ "title": "GenerationSubmitCommand",
+ "type": "object"
+ },
+ "GroupCanvasItem": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "kind": {
+ "const": "group",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "title": {
+ "default": "",
+ "description": "User-visible title.",
+ "maxLength": 255,
+ "title": "Title",
+ "type": "string"
+ },
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
},
"width": {
+ "default": 352,
"description": "Width in pixels.",
"exclusiveMinimum": 0,
- "maximum": 8192,
"title": "Width",
"type": "number"
},
"height": {
+ "default": 198,
"description": "Height in pixels.",
"exclusiveMinimum": 0,
- "maximum": 8192,
"title": "Height",
"type": "number"
},
- "rotation": {
+ "zIndex": {
"default": 0,
- "description": "Layer rotation in degrees.",
- "title": "Rotation",
- "type": "number"
+ "description": "Canvas stacking order.",
+ "title": "Zindex",
+ "type": "integer"
},
- "flipX": {
+ "locked": {
"default": false,
- "description": "Whether the image is mirrored horizontally.",
- "title": "Flipx",
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
"type": "boolean"
},
- "flipY": {
- "default": false,
- "description": "Whether the image is mirrored vertically.",
- "title": "Flipy",
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
"type": "boolean"
},
- "content": {
- "description": "Editable layer content.",
- "discriminator": {
- "mapping": {
- "image": "#/$defs/ImageLayerContent",
- "rectangle": "#/$defs/RectangleLayerContent",
- "text": "#/$defs/TextLayerContent"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/ImageLayerContent"
- },
+ "parentId": {
+ "anyOf": [
{
- "$ref": "#/$defs/TextLayerContent"
+ "format": "uuid",
+ "type": "string"
},
{
- "$ref": "#/$defs/RectangleLayerContent"
+ "type": "null"
}
],
- "title": "Content"
+ "default": null,
+ "description": "Parent canvas group ID, or null for the root.",
+ "title": "Parentid"
},
- "mask": {
+ "tags": {
"default": [],
- "description": "Ordered strokes or encoded selection mask.",
+ "description": "User-defined search tags.",
"items": {
- "$ref": "#/$defs/MaskStroke"
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
},
- "maxItems": 2000,
- "title": "Mask",
+ "title": "Tags",
"type": "array"
+ },
+ "binding": {
+ "$ref": "#/$defs/ContainerBinding",
+ "description": "Business object displayed by this canvas item."
}
},
"required": [
"id",
- "name",
- "width",
- "height",
- "content"
+ "projectId",
+ "kind"
],
- "title": "ImageLayer",
+ "title": "GroupCanvasItem",
"type": "object"
},
- "ImageLayerContent": {
+ "HistoryRedoCommand": {
"additionalProperties": false,
+ "description": "Reapply an undone command.",
"properties": {
- "width": {
- "description": "Width in pixels.",
- "maximum": 8192,
- "minimum": 1,
- "title": "Width",
- "type": "integer"
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
},
- "height": {
- "description": "Height in pixels.",
- "maximum": 8192,
- "minimum": 1,
- "title": "Height",
- "type": "integer"
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
},
- "kind": {
- "const": "image",
- "description": "Business object or media type.",
- "title": "Kind",
+ "type": {
+ "const": "history.redo",
+ "description": "Command discriminator.",
+ "title": "Type",
"type": "string"
},
- "asset": {
- "$ref": "#/$defs/AssetRef",
- "description": "Immutable asset version."
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/HistoryReplay",
+ "description": "Reapply an undone command."
}
},
"required": [
- "width",
- "height",
- "kind",
- "asset"
- ],
- "title": "ImageLayerContent",
+ "commandId",
+ "projectId",
+ "type",
+ "payload"
+ ],
+ "title": "HistoryRedoCommand",
"type": "object"
},
- "ImageOutput": {
+ "HistoryReplay": {
"additionalProperties": false,
"properties": {
- "aspectRatio": {
- "description": "Output width-to-height ratio.",
- "pattern": "^(?:auto|[1-9]\\d?:[1-9]\\d?)$",
- "title": "Aspectratio",
- "type": "string"
- },
- "size": {
- "description": "Supported image dimensions or size preset.",
- "pattern": "^(?:2K|[1-9]\\d{2,3}x[1-9]\\d{2,3})$",
- "title": "Size",
+ "targetCommandId": {
+ "description": "Historical command to undo or redo.",
+ "format": "uuid",
+ "title": "Targetcommandid",
"type": "string"
}
},
"required": [
- "aspectRatio",
- "size"
+ "targetCommandId"
],
- "title": "ImageOutput",
+ "title": "HistoryReplay",
"type": "object"
},
- "ImageParameters": {
+ "HistoryUndoCommand": {
"additionalProperties": false,
+ "description": "Undo a recorded reversible command.",
"properties": {
- "quality": {
- "default": "auto",
- "description": "Image rendering quality; auto leaves the provider request unchanged.",
- "enum": [
- "auto",
- "low",
- "medium",
- "high"
- ],
- "title": "Quality",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
"type": "string"
},
- "size": {
- "default": "auto",
- "description": "Requested image dimensions or size preset.",
- "pattern": "^(?:auto|2K|[1-9]\\d{2,3}x[1-9]\\d{2,3})$",
- "title": "Size",
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
"type": "string"
},
- "aspectRatio": {
+ "type": {
+ "const": "history.undo",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
"anyOf": [
{
- "pattern": "^[1-9]\\d?:[1-9]\\d?$",
+ "pattern": "^[0-9a-f]{64}$",
"type": "string"
},
{
@@ -6559,287 +7417,414 @@
}
],
"default": null,
- "description": "Output width-to-height ratio.",
- "title": "Aspectratio"
- },
- "preset": {
- "default": "none",
- "description": "Selected generation or motion preset.",
- "enum": [
- "none",
- "product-views"
- ],
- "title": "Preset",
- "type": "string"
- },
- "responseFormat": {
- "const": "url",
- "default": "url",
- "description": "Provider response representation.",
- "title": "Responseformat",
- "type": "string"
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "outputFormat": {
- "const": "png",
- "default": "png",
- "description": "Generated image encoding.",
- "title": "Outputformat",
- "type": "string"
+ "payload": {
+ "$ref": "#/$defs/HistoryReplay",
+ "description": "Undo a recorded reversible command."
}
},
- "title": "ImageParameters",
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "payload"
+ ],
+ "title": "HistoryUndoCommand",
"type": "object"
},
- "InputRules": {
+ "ImageCanvasItem": {
"additionalProperties": false,
"properties": {
- "fractionalDuration": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "kind": {
+ "const": "image",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "title": {
+ "default": "",
+ "description": "User-visible title.",
+ "maxLength": 255,
+ "title": "Title",
+ "type": "string"
+ },
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
+ },
+ "width": {
+ "default": 352,
+ "description": "Width in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Width",
+ "type": "number"
+ },
+ "height": {
+ "default": 198,
+ "description": "Height in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Height",
+ "type": "number"
+ },
+ "zIndex": {
+ "default": 0,
+ "description": "Canvas stacking order.",
+ "title": "Zindex",
+ "type": "integer"
+ },
+ "locked": {
"default": false,
- "description": "Accept fractional video seconds within each output duration range.",
- "title": "Fractionalduration",
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
"type": "boolean"
},
- "profile": {
- "description": "Model capability profile.",
- "maxLength": 100,
- "minLength": 1,
- "title": "Profile",
- "type": "string"
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
},
- "voiceLibrary": {
+ "parentId": {
"anyOf": [
{
- "$ref": "#/$defs/VoiceLibraryCapabilities"
+ "format": "uuid",
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Supported voice registry and adapter requirements; omitted for unsupported models."
+ "description": "Parent canvas group ID, or null for the root.",
+ "title": "Parentid"
},
- "maxPromptCharacters": {
- "anyOf": [
- {
- "minimum": 1,
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Maximum characters in the final prompt including text references.",
- "title": "Maxpromptcharacters"
+ "tags": {
+ "default": [],
+ "description": "User-defined search tags.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Tags",
+ "type": "array"
},
- "voiceRequired": {
- "anyOf": [
- {
- "type": "boolean"
+ "binding": {
+ "description": "Business object displayed by this canvas item.",
+ "discriminator": {
+ "mapping": {
+ "empty": "#/$defs/EmptyBinding",
+ "generation": "#/$defs/GenerationBinding",
+ "material": "#/$defs/MaterialBinding"
},
+ "propertyName": "role"
+ },
+ "oneOf": [
{
- "type": "null"
- }
- ],
- "default": null,
- "description": "Whether speech generation requires an explicit service voice ID.",
- "title": "Voicerequired"
- },
- "defaultVoice": {
- "anyOf": [
+ "$ref": "#/$defs/EmptyBinding"
+ },
{
- "pattern": "^[A-Za-z0-9_.-]{1,64}$",
- "type": "string"
+ "$ref": "#/$defs/MaterialBinding"
},
{
- "type": "null"
+ "$ref": "#/$defs/GenerationBinding"
}
],
- "default": null,
- "description": "Service voice ID applied when a required selection is still empty.",
- "title": "Defaultvoice"
+ "title": "Binding"
},
- "referencesAllowed": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Whether references may be attached, including context-only references.",
- "title": "Referencesallowed"
- },
- "allowedKinds": {
- "description": "Accepted reference media kinds.",
+ "editors": {
+ "default": [],
+ "description": "Attached editable documents.",
"items": {
- "enum": [
- "text",
- "image",
- "video",
- "audio"
- ],
- "type": "string"
+ "$ref": "#/$defs/EditorRef"
},
- "title": "Allowedkinds",
+ "title": "Editors",
"type": "array"
+ }
+ },
+ "required": [
+ "id",
+ "projectId",
+ "kind",
+ "binding"
+ ],
+ "title": "ImageCanvasItem",
+ "type": "object"
+ },
+ "ImageCropData": {
+ "additionalProperties": false,
+ "properties": {
+ "source": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Input source or recorded provenance."
},
- "maxImages": {
- "description": "Maximum reference image count.",
- "minimum": 0,
- "title": "Maximages",
- "type": "integer"
+ "options": {
+ "$ref": "#/$defs/ImageCropOptions",
+ "description": "Non-destructive image crop and color settings."
},
- "maxVideos": {
- "description": "Maximum reference video count.",
- "minimum": 0,
- "title": "Maxvideos",
+ "width": {
+ "description": "Width in pixels.",
+ "minimum": 1,
+ "title": "Width",
"type": "integer"
},
- "maxAudios": {
- "description": "Maximum reference audio count.",
- "minimum": 0,
- "title": "Maxaudios",
+ "height": {
+ "description": "Height in pixels.",
+ "minimum": 1,
+ "title": "Height",
"type": "integer"
+ }
+ },
+ "required": [
+ "source",
+ "options",
+ "width",
+ "height"
+ ],
+ "title": "ImageCropData",
+ "type": "object"
+ },
+ "ImageCropDocument": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
},
- "imageBytes": {
- "description": "Maximum bytes per reference image.",
- "minimum": 0,
- "title": "Imagebytes",
- "type": "integer"
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
},
- "videoBytes": {
- "description": "Maximum bytes per reference video.",
- "minimum": 0,
- "title": "Videobytes",
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
"type": "integer"
},
- "requestBytes": {
- "description": "Maximum aggregate reference bytes per request.",
- "minimum": 0,
- "title": "Requestbytes",
+ "schemaVersion": {
+ "const": 1,
+ "default": 1,
+ "description": "Record schema version.",
+ "title": "Schemaversion",
"type": "integer"
},
- "videoModes": {
- "description": "Supported video generation modes.",
- "items": {
- "enum": [
- "first_frame",
- "reference",
- "continuation"
- ],
- "type": "string"
- },
- "title": "Videomodes",
- "type": "array"
- },
- "imageOutputs": {
+ "inputConnections": {
"default": [],
- "description": "Supported image aspect ratios and sizes.",
+ "description": "Persisted connections to source assets.",
"items": {
- "$ref": "#/$defs/ImageOutput"
+ "$ref": "#/$defs/EditorInputConnection"
},
- "title": "Imageoutputs",
+ "title": "Inputconnections",
"type": "array"
},
- "imageQualities": {
- "anyOf": [
- {
- "items": {
- "enum": [
- "auto",
- "low",
- "medium",
- "high"
- ],
- "type": "string"
- },
- "type": "array"
- },
- {
- "type": "null"
- }
+ "kind": {
+ "const": "image_crop",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "data": {
+ "$ref": "#/$defs/ImageCropData",
+ "description": "Typed editable document contents."
+ }
+ },
+ "required": [
+ "id",
+ "projectId",
+ "kind",
+ "data"
+ ],
+ "title": "ImageCropDocument",
+ "type": "object"
+ },
+ "ImageCropOptions": {
+ "additionalProperties": false,
+ "properties": {
+ "rotation": {
+ "default": 0,
+ "description": "Crop rotation in degrees.",
+ "enum": [
+ 0,
+ 90,
+ 180,
+ 270
],
- "default": null,
- "description": "Supported image rendering qualities; omitted for models without quality control.",
- "title": "Imagequalities"
+ "title": "Rotation",
+ "type": "integer"
},
- "outputResolutions": {
- "default": [],
- "description": "Supported output resolution values.",
- "items": {
- "type": "string"
- },
- "title": "Outputresolutions",
- "type": "array"
+ "flipX": {
+ "default": false,
+ "description": "Whether the image is mirrored horizontally.",
+ "title": "Flipx",
+ "type": "boolean"
},
- "referenceImageResolutions": {
- "anyOf": [
- {
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Supported reference image resolution values.",
- "title": "Referenceimageresolutions"
+ "flipY": {
+ "default": false,
+ "description": "Whether the image is mirrored vertically.",
+ "title": "Flipy",
+ "type": "boolean"
},
- "videoCapabilities": {
- "anyOf": [
- {
- "$ref": "#/$defs/VideoCapabilities"
- },
- {
- "type": "null"
- }
+ "aspect": {
+ "default": "original",
+ "description": "Crop aspect ratio or free crop mode.",
+ "enum": [
+ "free",
+ "original",
+ "1:1",
+ "4:3",
+ "3:4",
+ "16:9",
+ "9:16"
],
- "default": null,
- "description": "Supported video generation capabilities."
+ "title": "Aspect",
+ "type": "string"
},
- "aspectRatios": {
- "anyOf": [
- {
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Supported explicit video output aspect ratios; unset uses existing protocol rules.",
- "title": "Aspectratios"
+ "zoom": {
+ "default": 100,
+ "description": "Crop zoom percentage.",
+ "maximum": 400,
+ "minimum": 100,
+ "title": "Zoom",
+ "type": "number"
},
- "frameRoles": {
+ "freeWidth": {
+ "default": 100,
+ "description": "Free crop width as a percentage.",
+ "maximum": 100,
+ "minimum": 1,
+ "title": "Freewidth",
+ "type": "number"
+ },
+ "freeHeight": {
+ "default": 100,
+ "description": "Free crop height as a percentage.",
+ "maximum": 100,
+ "minimum": 1,
+ "title": "Freeheight",
+ "type": "number"
+ },
+ "x": {
+ "default": 50,
+ "description": "Horizontal crop position percentage.",
+ "maximum": 100,
+ "minimum": 0,
+ "title": "X",
+ "type": "number"
+ },
+ "y": {
+ "default": 50,
+ "description": "Vertical crop position percentage.",
+ "maximum": 100,
+ "minimum": 0,
+ "title": "Y",
+ "type": "number"
+ },
+ "brightness": {
+ "default": 100,
+ "description": "Brightness percentage.",
+ "maximum": 200,
+ "minimum": 0,
+ "title": "Brightness",
+ "type": "number"
+ },
+ "contrast": {
+ "default": 100,
+ "description": "Contrast percentage.",
+ "maximum": 200,
+ "minimum": 0,
+ "title": "Contrast",
+ "type": "number"
+ },
+ "saturation": {
+ "default": 100,
+ "description": "Saturation percentage.",
+ "maximum": 200,
+ "minimum": 0,
+ "title": "Saturation",
+ "type": "number"
+ }
+ },
+ "title": "ImageCropOptions",
+ "type": "object"
+ },
+ "ImageExecution": {
+ "additionalProperties": false,
+ "properties": {
+ "kind": {
+ "const": "image",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "quality": {
+ "default": "auto",
+ "description": "Image rendering quality fixed for this execution; auto omits the provider field.",
+ "enum": [
+ "auto",
+ "low",
+ "medium",
+ "high"
+ ],
+ "title": "Quality",
+ "type": "string"
+ },
+ "size": {
+ "description": "Effective image dimensions sent to the provider.",
+ "title": "Size",
+ "type": "string"
+ },
+ "responseFormat": {
"anyOf": [
{
- "items": {
- "enum": [
- "first_frame",
- "last_frame"
- ],
- "type": "string"
- },
- "type": "array"
+ "enum": [
+ "url",
+ "b64_json"
+ ],
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Supported explicit image frame slots.",
- "title": "Frameroles"
+ "description": "Provider response representation.",
+ "title": "Responseformat"
},
- "audioReferenceStandalone": {
+ "outputFormat": {
+ "const": "png",
+ "default": "png",
+ "description": "Generated image encoding.",
+ "title": "Outputformat",
+ "type": "string"
+ },
+ "watermark": {
"anyOf": [
{
"type": "boolean"
@@ -6849,95 +7834,46 @@
}
],
"default": null,
- "description": "Whether audio-only references are supported.",
- "title": "Audioreferencestandalone"
+ "description": "Whether provider watermarking is enabled.",
+ "title": "Watermark"
},
- "generateAudioOptions": {
+ "numInferenceSteps": {
"anyOf": [
{
- "items": {
- "type": "boolean"
- },
- "maxItems": 2,
- "minItems": 1,
- "type": "array"
+ "minimum": 1,
+ "type": "integer"
},
{
"type": "null"
}
],
"default": null,
- "description": "Allowed generateAudio values; omitted in legacy execution snapshots.",
- "title": "Generateaudiooptions"
- }
- },
- "required": [
- "profile",
- "allowedKinds",
- "maxImages",
- "maxVideos",
- "maxAudios",
- "imageBytes",
- "videoBytes",
- "requestBytes",
- "videoModes"
- ],
- "title": "InputRules",
- "type": "object"
- },
- "InputSnapshot": {
- "additionalProperties": false,
- "description": "Only creative inputs; layout, selection and credentials are excluded.",
- "properties": {
- "spec": {
- "description": "Generation configuration for this operation.",
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioGenerationSpec",
- "image": "#/$defs/ImageGenerationSpec",
- "text": "#/$defs/TextGenerationSpec",
- "video": "#/$defs/VideoGenerationSpec"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TextGenerationSpec"
- },
- {
- "$ref": "#/$defs/ImageGenerationSpec"
- },
+ "description": "Diffusion sampling step count.",
+ "title": "Numinferencesteps"
+ },
+ "guidanceScale": {
+ "anyOf": [
{
- "$ref": "#/$defs/VideoGenerationSpec"
+ "minimum": 0,
+ "type": "number"
},
{
- "$ref": "#/$defs/AudioGenerationSpec"
+ "type": "null"
}
],
- "title": "Spec"
- },
- "model": {
- "$ref": "#/$defs/ModelSnapshot",
- "description": "Fixed model configuration for this execution."
- },
- "references": {
- "default": [],
- "description": "Ordered generation reference bindings.",
- "items": {
- "$ref": "#/$defs/ResolvedReference"
- },
- "title": "References",
- "type": "array"
+ "default": null,
+ "description": "Diffusion guidance scale.",
+ "title": "Guidancescale"
}
},
"required": [
- "spec",
- "model"
+ "kind",
+ "size"
],
- "title": "InputSnapshot",
+ "title": "ImageExecution",
"type": "object"
},
- "Job": {
+ "ImageGenerationSpec": {
"additionalProperties": false,
"properties": {
"id": {
@@ -6959,17 +7895,20 @@
"title": "Revision",
"type": "integer"
},
- "schemaVersion": {
- "const": 1,
- "default": 1,
- "description": "Record schema version.",
- "title": "Schemaversion",
- "type": "integer"
+ "purpose": {
+ "default": "draft",
+ "description": "Draft settings or executable generation configuration.",
+ "enum": [
+ "draft",
+ "generation"
+ ],
+ "title": "Purpose",
+ "type": "string"
},
- "createdAt": {
+ "modelConfigId": {
"anyOf": [
{
- "format": "date-time",
+ "format": "uuid",
"type": "string"
},
{
@@ -6977,209 +7916,290 @@
}
],
"default": null,
- "description": "Execution acceptance timestamp.",
- "title": "Createdat"
- },
- "inputSnapshot": {
- "$ref": "#/$defs/InputSnapshot",
- "description": "Fixed generation inputs accepted for this execution."
+ "description": "Model configuration ID from the model catalog or user model selections.",
+ "title": "Modelconfigid"
},
- "inputFingerprint": {
- "description": "Fingerprint of the fixed execution input.",
- "pattern": "^[0-9a-f]{64}$",
- "title": "Inputfingerprint",
+ "prompt": {
+ "default": "",
+ "description": "Generation prompt text.",
+ "maxLength": 20000,
+ "title": "Prompt",
"type": "string"
},
- "execution": {
- "description": "Fixed effective parameters submitted to the provider.",
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioExecution",
- "image": "#/$defs/ImageExecution",
- "text": "#/$defs/TextExecution",
- "video": "#/$defs/VideoExecution"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TextExecution"
- },
- {
- "$ref": "#/$defs/ImageExecution"
- },
- {
- "$ref": "#/$defs/VideoExecution"
- },
- {
- "$ref": "#/$defs/AudioExecution"
- }
- ],
- "title": "Execution"
- },
- "status": {
- "default": "queued",
- "description": "Current operation lifecycle state.",
- "enum": [
- "queued",
- "running",
- "succeeded",
- "failed",
- "cancelled",
- "interrupted"
- ],
- "title": "Status",
- "type": "string"
- },
- "phase": {
- "default": "queued",
- "description": "Current execution phase.",
- "enum": [
- "queued",
- "prepare",
- "submit",
- "poll",
- "download",
- "check",
- "save",
- "adopt",
- "complete"
- ],
- "title": "Phase",
- "type": "string"
- },
- "externalTaskId": {
+ "promptContent": {
"anyOf": [
{
- "maxLength": 200,
- "minLength": 1,
- "type": "string"
+ "items": {
+ "discriminator": {
+ "mapping": {
+ "reference": "#/$defs/PromptReference",
+ "text": "#/$defs/PromptText"
+ },
+ "propertyName": "type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/PromptText"
+ },
+ {
+ "$ref": "#/$defs/PromptReference"
+ }
+ ]
+ },
+ "type": "array"
},
{
"type": "null"
}
],
"default": null,
- "description": "Provider task ID for polling or recovery.",
- "title": "Externaltaskid"
+ "description": "Structured prompt text and reference tokens.",
+ "title": "Promptcontent"
},
- "asset": {
+ "currentResultId": {
"anyOf": [
{
- "$ref": "#/$defs/AssetRef"
+ "format": "uuid",
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Immutable asset version."
+ "description": "Currently adopted result ID.",
+ "title": "Currentresultid"
},
- "errorDetails": {
- "anyOf": [
- {
- "$ref": "#/$defs/GenerationFailure"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Structured execution failure, if any."
+ "kind": {
+ "const": "image",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
},
- "recovery": {
- "default": "submit",
- "description": "Available recovery strategy for this execution.",
- "enum": [
- "submit",
- "remote",
- "download",
- "local",
- "review",
- "retry",
- "done"
- ],
- "title": "Recovery",
+ "parameters": {
+ "$ref": "#/$defs/ImageParameters",
+ "description": "Typed generation or editing parameters."
+ }
+ },
+ "required": [
+ "id",
+ "projectId",
+ "kind"
+ ],
+ "title": "ImageGenerationSpec",
+ "type": "object"
+ },
+ "ImageLayer": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable object ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
"type": "string"
},
- "resumeAllowed": {
+ "name": {
+ "description": "User-visible name.",
+ "maxLength": 200,
+ "title": "Name",
+ "type": "string"
+ },
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
+ },
+ "locked": {
"default": false,
- "description": "Whether the existing execution can be resumed.",
- "title": "Resumeallowed",
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
"type": "boolean"
},
- "cancelRequested": {
+ "opacity": {
+ "default": 1,
+ "description": "Layer opacity from zero to one.",
+ "maximum": 1,
+ "minimum": 0,
+ "title": "Opacity",
+ "type": "number"
+ },
+ "x": {
+ "default": 0,
+ "description": "Horizontal coordinate.",
+ "title": "X",
+ "type": "number"
+ },
+ "y": {
+ "default": 0,
+ "description": "Vertical coordinate.",
+ "title": "Y",
+ "type": "number"
+ },
+ "width": {
+ "description": "Width in pixels.",
+ "exclusiveMinimum": 0,
+ "maximum": 8192,
+ "title": "Width",
+ "type": "number"
+ },
+ "height": {
+ "description": "Height in pixels.",
+ "exclusiveMinimum": 0,
+ "maximum": 8192,
+ "title": "Height",
+ "type": "number"
+ },
+ "rotation": {
+ "default": 0,
+ "description": "Layer rotation in degrees.",
+ "title": "Rotation",
+ "type": "number"
+ },
+ "flipX": {
"default": false,
- "description": "Whether cancellation was requested locally.",
- "title": "Cancelrequested",
+ "description": "Whether the image is mirrored horizontally.",
+ "title": "Flipx",
"type": "boolean"
},
- "remoteCancellation": {
- "default": "not_requested",
- "description": "Provider cancellation confirmation state.",
- "enum": [
- "not_requested",
- "requested",
- "confirmed",
- "unknown"
- ],
- "title": "Remotecancellation",
- "type": "string"
+ "flipY": {
+ "default": false,
+ "description": "Whether the image is mirrored vertically.",
+ "title": "Flipy",
+ "type": "boolean"
},
- "originItemId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
+ "content": {
+ "description": "Editable layer content.",
+ "discriminator": {
+ "mapping": {
+ "image": "#/$defs/ImageLayerContent",
+ "rectangle": "#/$defs/RectangleLayerContent",
+ "text": "#/$defs/TextLayerContent"
},
+ "propertyName": "kind"
+ },
+ "oneOf": [
{
- "type": "null"
- }
- ],
- "default": null,
- "description": "Originating canvas item ID.",
- "title": "Originitemid"
- },
- "previousJobId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
+ "$ref": "#/$defs/ImageLayerContent"
},
{
- "type": "null"
- }
- ],
- "default": null,
- "description": "Previous generation attempt ID.",
- "title": "Previousjobid"
- },
- "technicalCheck": {
- "anyOf": [
- {
- "$ref": "#/$defs/ResultCheck"
+ "$ref": "#/$defs/TextLayerContent"
},
{
- "type": "null"
+ "$ref": "#/$defs/RectangleLayerContent"
}
],
- "default": null,
- "description": "Technical validation outcome for the generated asset."
+ "title": "Content"
},
- "adoptionPolicy": {
- "default": "if_current",
- "description": "Policy for adopting the completed result.",
+ "mask": {
+ "default": [],
+ "description": "Ordered strokes or encoded selection mask.",
+ "items": {
+ "$ref": "#/$defs/MaskStroke"
+ },
+ "maxItems": 2000,
+ "title": "Mask",
+ "type": "array"
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "width",
+ "height",
+ "content"
+ ],
+ "title": "ImageLayer",
+ "type": "object"
+ },
+ "ImageLayerContent": {
+ "additionalProperties": false,
+ "properties": {
+ "width": {
+ "description": "Width in pixels.",
+ "maximum": 8192,
+ "minimum": 1,
+ "title": "Width",
+ "type": "integer"
+ },
+ "height": {
+ "description": "Height in pixels.",
+ "maximum": 8192,
+ "minimum": 1,
+ "title": "Height",
+ "type": "integer"
+ },
+ "kind": {
+ "const": "image",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "asset": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Immutable asset version."
+ }
+ },
+ "required": [
+ "width",
+ "height",
+ "kind",
+ "asset"
+ ],
+ "title": "ImageLayerContent",
+ "type": "object"
+ },
+ "ImageOutput": {
+ "additionalProperties": false,
+ "properties": {
+ "aspectRatio": {
+ "description": "Output width-to-height ratio.",
+ "pattern": "^(?:auto|[1-9]\\d?:[1-9]\\d?)$",
+ "title": "Aspectratio",
+ "type": "string"
+ },
+ "size": {
+ "description": "Supported image dimensions or size preset.",
+ "pattern": "^(?:2K|[1-9]\\d{2,3}x[1-9]\\d{2,3})$",
+ "title": "Size",
+ "type": "string"
+ }
+ },
+ "required": [
+ "aspectRatio",
+ "size"
+ ],
+ "title": "ImageOutput",
+ "type": "object"
+ },
+ "ImageParameters": {
+ "additionalProperties": false,
+ "properties": {
+ "quality": {
+ "default": "auto",
+ "description": "Image rendering quality; auto leaves the provider request unchanged.",
"enum": [
- "if_current",
- "candidate_only"
+ "auto",
+ "low",
+ "medium",
+ "high"
],
- "title": "Adoptionpolicy",
+ "title": "Quality",
"type": "string"
},
- "batchId": {
+ "size": {
+ "default": "auto",
+ "description": "Requested image dimensions or size preset.",
+ "pattern": "^(?:auto|2K|[1-9]\\d{2,3}x[1-9]\\d{2,3})$",
+ "title": "Size",
+ "type": "string"
+ },
+ "aspectRatio": {
"anyOf": [
{
- "format": "uuid",
+ "pattern": "^[1-9]\\d?:[1-9]\\d?$",
"type": "string"
},
{
@@ -7187,101 +8207,96 @@
}
],
"default": null,
- "description": "Generation batch ID.",
- "title": "Batchid"
+ "description": "Output width-to-height ratio.",
+ "title": "Aspectratio"
},
- "showAdditionalResult": {
+ "preset": {
+ "default": "none",
+ "description": "Selected generation or motion preset.",
+ "enum": [
+ "none",
+ "product-views"
+ ],
+ "title": "Preset",
+ "type": "string"
+ },
+ "responseFormat": {
+ "const": "url",
+ "default": "url",
+ "description": "Provider response representation.",
+ "title": "Responseformat",
+ "type": "string"
+ },
+ "outputFormat": {
+ "const": "png",
+ "default": "png",
+ "description": "Generated image encoding.",
+ "title": "Outputformat",
+ "type": "string"
+ }
+ },
+ "title": "ImageParameters",
+ "type": "object"
+ },
+ "InputRules": {
+ "additionalProperties": false,
+ "properties": {
+ "fractionalDuration": {
"default": false,
- "description": "Whether to display an additional result item.",
- "title": "Showadditionalresult",
+ "description": "Accept fractional video seconds within each output duration range.",
+ "title": "Fractionalduration",
"type": "boolean"
},
- "adoptionResultId": {
+ "profile": {
+ "description": "Model capability profile.",
+ "maxLength": 100,
+ "minLength": 1,
+ "title": "Profile",
+ "type": "string"
+ },
+ "voiceLibrary": {
"anyOf": [
{
- "format": "uuid",
- "type": "string"
+ "$ref": "#/$defs/VoiceLibraryCapabilities"
},
{
"type": "null"
}
],
"default": null,
- "description": "Result ID reserved for adoption.",
- "title": "Adoptionresultid"
+ "description": "Supported voice registry and adapter requirements; omitted for unsupported models."
},
- "adoptionMaterial": {
+ "maxPromptCharacters": {
"anyOf": [
{
- "$ref": "#/$defs/AssetRef"
+ "minimum": 1,
+ "type": "integer"
},
{
"type": "null"
}
],
"default": null,
- "description": "Material version reserved for adoption."
- },
- "adopted": {
- "default": false,
- "description": "Whether the generated result was adopted.",
- "title": "Adopted",
- "type": "boolean"
- },
- "adapterParameters": {
- "additionalProperties": {
- "$ref": "#/$defs/JsonValue"
- },
- "description": "Fixed provider-specific execution parameters.",
- "title": "Adapterparameters",
- "type": "object"
- }
- },
- "required": [
- "id",
- "projectId",
- "inputSnapshot",
- "inputFingerprint",
- "execution"
- ],
- "title": "Job",
- "type": "object"
- },
- "JobCancelCommand": {
- "additionalProperties": false,
- "description": "Request cancellation of an existing job.",
- "properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
- },
- "type": {
- "const": "job.cancel",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
+ "description": "Maximum characters in the final prompt including text references.",
+ "title": "Maxpromptcharacters"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
+ "voiceRequired": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Whether speech generation requires an explicit service voice ID.",
+ "title": "Voicerequired"
},
- "expectedPreview": {
+ "defaultVoice": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
+ "pattern": "^[A-Za-z0-9_.-]{1,64}$",
"type": "string"
},
{
@@ -7289,240 +8304,288 @@
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "description": "Service voice ID applied when a required selection is still empty.",
+ "title": "Defaultvoice"
},
- "payload": {
- "$ref": "#/$defs/JobControl",
- "description": "Request cancellation of an existing job."
- }
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "payload"
- ],
- "title": "JobCancelCommand",
- "type": "object"
- },
- "JobCheckpoint": {
- "additionalProperties": false,
- "properties": {
- "job": {
- "$ref": "#/$defs/Job",
- "description": "Generation execution record."
- }
- },
- "required": [
- "job"
- ],
- "title": "JobCheckpoint",
- "type": "object"
- },
- "JobCheckpointCommand": {
- "additionalProperties": false,
- "description": "Persist a job execution checkpoint.",
- "properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
+ "referencesAllowed": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Whether references may be attached, including context-only references.",
+ "title": "Referencesallowed"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "allowedKinds": {
+ "description": "Accepted reference media kinds.",
+ "items": {
+ "enum": [
+ "text",
+ "image",
+ "video",
+ "audio"
+ ],
+ "type": "string"
+ },
+ "title": "Allowedkinds",
+ "type": "array"
},
- "type": {
- "const": "job.checkpoint",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
+ "maxImages": {
+ "description": "Maximum reference image count.",
+ "minimum": 0,
+ "title": "Maximages",
+ "type": "integer"
},
- "expectedVersions": {
+ "maxVideos": {
+ "description": "Maximum reference video count.",
+ "minimum": 0,
+ "title": "Maxvideos",
+ "type": "integer"
+ },
+ "maxAudios": {
+ "description": "Maximum reference audio count.",
+ "minimum": 0,
+ "title": "Maxaudios",
+ "type": "integer"
+ },
+ "imageBytes": {
+ "description": "Maximum bytes per reference image.",
+ "minimum": 0,
+ "title": "Imagebytes",
+ "type": "integer"
+ },
+ "videoBytes": {
+ "description": "Maximum bytes per reference video.",
+ "minimum": 0,
+ "title": "Videobytes",
+ "type": "integer"
+ },
+ "requestBytes": {
+ "description": "Maximum aggregate reference bytes per request.",
+ "minimum": 0,
+ "title": "Requestbytes",
+ "type": "integer"
+ },
+ "videoModes": {
+ "description": "Supported video generation modes.",
+ "items": {
+ "enum": [
+ "first_frame",
+ "reference",
+ "continuation"
+ ],
+ "type": "string"
+ },
+ "title": "Videomodes",
+ "type": "array"
+ },
+ "imageOutputs": {
"default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "description": "Supported image aspect ratios and sizes.",
"items": {
- "$ref": "#/$defs/ObjectVersion"
+ "$ref": "#/$defs/ImageOutput"
},
- "title": "Expectedversions",
+ "title": "Imageoutputs",
"type": "array"
},
- "expectedPreview": {
+ "imageQualities": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
+ "items": {
+ "enum": [
+ "auto",
+ "low",
+ "medium",
+ "high"
+ ],
+ "type": "string"
+ },
+ "type": "array"
},
{
"type": "null"
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
- },
- "payload": {
- "$ref": "#/$defs/JobCheckpoint",
- "description": "Persist a job execution checkpoint."
- }
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "payload"
- ],
- "title": "JobCheckpointCommand",
- "type": "object"
- },
- "JobControl": {
- "additionalProperties": false,
- "properties": {
- "jobId": {
- "description": "Generation job ID.",
- "format": "uuid",
- "title": "Jobid",
- "type": "string"
- }
- },
- "required": [
- "jobId"
- ],
- "title": "JobControl",
- "type": "object"
- },
- "JobRecoverCommand": {
- "additionalProperties": false,
- "description": "Recover an existing job without creating a new attempt.",
- "properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
- },
- "type": {
- "const": "job.recover",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
+ "description": "Supported image rendering qualities; omitted for models without quality control.",
+ "title": "Imagequalities"
},
- "expectedVersions": {
+ "outputResolutions": {
"default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "description": "Supported output resolution values.",
"items": {
- "$ref": "#/$defs/ObjectVersion"
+ "type": "string"
},
- "title": "Expectedversions",
+ "title": "Outputresolutions",
"type": "array"
},
- "expectedPreview": {
+ "referenceImageResolutions": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
},
{
"type": "null"
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "description": "Supported reference image resolution values.",
+ "title": "Referenceimageresolutions"
},
- "payload": {
- "$ref": "#/$defs/JobControl",
- "description": "Recover an existing job without creating a new attempt."
- }
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "payload"
- ],
- "title": "JobRecoverCommand",
- "type": "object"
- },
- "JsonValue": {},
- "LayerContentBase": {
- "additionalProperties": false,
- "properties": {
- "width": {
- "description": "Width in pixels.",
- "maximum": 8192,
- "minimum": 1,
- "title": "Width",
- "type": "integer"
+ "videoCapabilities": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/VideoCapabilities"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Supported video generation capabilities."
},
- "height": {
- "description": "Height in pixels.",
- "maximum": 8192,
- "minimum": 1,
- "title": "Height",
- "type": "integer"
- }
- },
+ "aspectRatios": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Supported explicit video output aspect ratios; unset uses existing protocol rules.",
+ "title": "Aspectratios"
+ },
+ "frameRoles": {
+ "anyOf": [
+ {
+ "items": {
+ "enum": [
+ "first_frame",
+ "last_frame"
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Supported explicit image frame slots.",
+ "title": "Frameroles"
+ },
+ "audioReferenceStandalone": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Whether audio-only references are supported.",
+ "title": "Audioreferencestandalone"
+ },
+ "generateAudioOptions": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "boolean"
+ },
+ "maxItems": 2,
+ "minItems": 1,
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Allowed generateAudio values; omitted in legacy execution snapshots.",
+ "title": "Generateaudiooptions"
+ }
+ },
"required": [
- "width",
- "height"
+ "profile",
+ "allowedKinds",
+ "maxImages",
+ "maxVideos",
+ "maxAudios",
+ "imageBytes",
+ "videoBytes",
+ "requestBytes",
+ "videoModes"
],
- "title": "LayerContentBase",
+ "title": "InputRules",
"type": "object"
},
- "LayerData": {
+ "InputSnapshot": {
"additionalProperties": false,
+ "description": "Only creative inputs; layout, selection and credentials are excluded.",
"properties": {
- "width": {
- "description": "Width in pixels.",
- "maximum": 8192,
- "minimum": 1,
- "title": "Width",
- "type": "integer"
- },
- "height": {
- "description": "Height in pixels.",
- "maximum": 8192,
- "minimum": 1,
- "title": "Height",
- "type": "integer"
+ "spec": {
+ "description": "Generation configuration for this operation.",
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioGenerationSpec",
+ "image": "#/$defs/ImageGenerationSpec",
+ "text": "#/$defs/TextGenerationSpec",
+ "video": "#/$defs/VideoGenerationSpec"
+ },
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TextGenerationSpec"
+ },
+ {
+ "$ref": "#/$defs/ImageGenerationSpec"
+ },
+ {
+ "$ref": "#/$defs/VideoGenerationSpec"
+ },
+ {
+ "$ref": "#/$defs/AudioGenerationSpec"
+ }
+ ],
+ "title": "Spec"
},
- "background": {
- "default": "transparent",
- "description": "Composition background color.",
- "pattern": "^(transparent|#[0-9a-fA-F]{6})$",
- "title": "Background",
- "type": "string"
+ "model": {
+ "$ref": "#/$defs/ModelSnapshot",
+ "description": "Fixed model configuration for this execution."
},
- "layers": {
+ "references": {
"default": [],
- "description": "Ordered editable image layers.",
+ "description": "Ordered generation reference bindings.",
"items": {
- "$ref": "#/$defs/ImageLayer"
+ "$ref": "#/$defs/ResolvedReference"
},
- "maxItems": 40,
- "title": "Layers",
+ "title": "References",
"type": "array"
}
},
"required": [
- "width",
- "height"
+ "spec",
+ "model"
],
- "title": "LayerData",
+ "title": "InputSnapshot",
"type": "object"
},
- "LayerDocument": {
+ "Job": {
"additionalProperties": false,
"properties": {
"id": {
@@ -7551,179 +8614,167 @@
"title": "Schemaversion",
"type": "integer"
},
- "inputConnections": {
- "default": [],
- "description": "Persisted connections to source assets.",
- "items": {
- "$ref": "#/$defs/EditorInputConnection"
+ "createdAt": {
+ "anyOf": [
+ {
+ "format": "date-time",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Execution acceptance timestamp.",
+ "title": "Createdat"
+ },
+ "inputSnapshot": {
+ "$ref": "#/$defs/InputSnapshot",
+ "description": "Fixed generation inputs accepted for this execution."
+ },
+ "inputFingerprint": {
+ "description": "Fingerprint of the fixed execution input.",
+ "pattern": "^[0-9a-f]{64}$",
+ "title": "Inputfingerprint",
+ "type": "string"
+ },
+ "execution": {
+ "description": "Fixed effective parameters submitted to the provider.",
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioExecution",
+ "image": "#/$defs/ImageExecution",
+ "text": "#/$defs/TextExecution",
+ "video": "#/$defs/VideoExecution"
+ },
+ "propertyName": "kind"
},
- "title": "Inputconnections",
- "type": "array"
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TextExecution"
+ },
+ {
+ "$ref": "#/$defs/ImageExecution"
+ },
+ {
+ "$ref": "#/$defs/VideoExecution"
+ },
+ {
+ "$ref": "#/$defs/AudioExecution"
+ }
+ ],
+ "title": "Execution"
},
- "kind": {
- "const": "layers",
- "description": "Business object or media type.",
- "title": "Kind",
+ "status": {
+ "default": "queued",
+ "description": "Current operation lifecycle state.",
+ "enum": [
+ "queued",
+ "running",
+ "succeeded",
+ "failed",
+ "cancelled",
+ "interrupted"
+ ],
+ "title": "Status",
"type": "string"
},
- "data": {
- "$ref": "#/$defs/LayerData",
- "description": "Typed editable document contents."
- }
- },
- "required": [
- "id",
- "projectId",
- "kind",
- "data"
- ],
- "title": "LayerDocument",
- "type": "object"
- },
- "MaskStroke": {
- "additionalProperties": false,
- "properties": {
- "mode": {
- "description": "Operation mode within this contract variant.",
+ "phase": {
+ "default": "queued",
+ "description": "Current execution phase.",
"enum": [
- "erase",
- "restore"
+ "queued",
+ "prepare",
+ "submit",
+ "poll",
+ "download",
+ "check",
+ "save",
+ "adopt",
+ "complete"
],
- "title": "Mode",
+ "title": "Phase",
"type": "string"
},
- "size": {
- "description": "Mask brush diameter in pixels.",
- "maximum": 4096,
- "minimum": 1,
- "title": "Size",
- "type": "number"
- },
- "points": {
- "description": "Ordered mask stroke coordinates.",
- "items": {
- "$ref": "#/$defs/Point"
- },
- "maxItems": 200000,
- "minItems": 1,
- "title": "Points",
- "type": "array"
- }
- },
- "required": [
- "mode",
- "size",
- "points"
- ],
- "title": "MaskStroke",
- "type": "object"
- },
- "MaterialBinding": {
- "additionalProperties": false,
- "description": "Displays a registered project asset through objectRef.",
- "properties": {
- "role": {
- "const": "material",
- "description": "Business role of this binding or reference.",
- "title": "Role",
- "type": "string"
- },
- "objectRef": {
- "$ref": "#/$defs/AssetRef",
- "description": "Stable reference to the bound business object."
- }
- },
- "required": [
- "role",
- "objectRef"
- ],
- "title": "MaterialBinding",
- "type": "object"
- },
- "MediaCanvasItem": {
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
- "format": "uuid",
- "title": "Id",
- "type": "string"
+ "externalTaskId": {
+ "anyOf": [
+ {
+ "maxLength": 200,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Provider task ID for polling or recovery.",
+ "title": "Externaltaskid"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "asset": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AssetRef"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Immutable asset version."
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
+ "errorDetails": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GenerationFailure"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Structured execution failure, if any."
},
- "kind": {
- "description": "Business object or media type.",
+ "recovery": {
+ "default": "submit",
+ "description": "Available recovery strategy for this execution.",
"enum": [
- "text",
- "image",
- "video",
- "audio",
- "file",
- "group",
- "timeline",
- "subject",
- "stack",
- "tool",
- "external"
+ "submit",
+ "remote",
+ "download",
+ "local",
+ "review",
+ "retry",
+ "done"
],
- "title": "Kind",
- "type": "string"
- },
- "title": {
- "default": "",
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
+ "title": "Recovery",
"type": "string"
},
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
- },
- "width": {
- "default": 352,
- "description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "title": "Width",
- "type": "number"
- },
- "height": {
- "default": 198,
- "description": "Height in pixels.",
- "exclusiveMinimum": 0,
- "title": "Height",
- "type": "number"
- },
- "zIndex": {
- "default": 0,
- "description": "Canvas stacking order.",
- "title": "Zindex",
- "type": "integer"
- },
- "locked": {
+ "resumeAllowed": {
"default": false,
- "description": "Whether edits to this object are blocked.",
- "title": "Locked",
+ "description": "Whether the existing execution can be resumed.",
+ "title": "Resumeallowed",
"type": "boolean"
},
- "visible": {
- "default": true,
- "description": "Whether this object is displayed.",
- "title": "Visible",
+ "cancelRequested": {
+ "default": false,
+ "description": "Whether cancellation was requested locally.",
+ "title": "Cancelrequested",
"type": "boolean"
},
- "parentId": {
+ "remoteCancellation": {
+ "default": "not_requested",
+ "description": "Provider cancellation confirmation state.",
+ "enum": [
+ "not_requested",
+ "requested",
+ "confirmed",
+ "unknown"
+ ],
+ "title": "Remotecancellation",
+ "type": "string"
+ },
+ "originItemId": {
"anyOf": [
{
"format": "uuid",
@@ -7734,180 +8785,124 @@
}
],
"default": null,
- "description": "Parent canvas group ID, or null for the root.",
- "title": "Parentid"
- },
- "tags": {
- "default": [],
- "description": "User-defined search tags.",
- "items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "type": "string"
- },
- "title": "Tags",
- "type": "array"
+ "description": "Originating canvas item ID.",
+ "title": "Originitemid"
},
- "binding": {
- "description": "Business object displayed by this canvas item.",
- "discriminator": {
- "mapping": {
- "empty": "#/$defs/EmptyBinding",
- "generation": "#/$defs/GenerationBinding",
- "material": "#/$defs/MaterialBinding"
- },
- "propertyName": "role"
- },
- "oneOf": [
+ "previousJobId": {
+ "anyOf": [
{
- "$ref": "#/$defs/EmptyBinding"
+ "format": "uuid",
+ "type": "string"
},
{
- "$ref": "#/$defs/MaterialBinding"
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Previous generation attempt ID.",
+ "title": "Previousjobid"
+ },
+ "technicalCheck": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ResultCheck"
},
{
- "$ref": "#/$defs/GenerationBinding"
+ "type": "null"
}
],
- "title": "Binding"
+ "default": null,
+ "description": "Technical validation outcome for the generated asset."
},
- "editors": {
- "default": [],
- "description": "Attached editable documents.",
- "items": {
- "$ref": "#/$defs/EditorRef"
- },
- "title": "Editors",
- "type": "array"
- }
- },
- "required": [
- "id",
- "projectId",
- "kind",
- "binding"
- ],
- "title": "MediaCanvasItem",
- "type": "object"
- },
- "MediaEditData": {
- "additionalProperties": false,
- "properties": {
- "tool": {
- "description": "Registered editing tool name.",
+ "adoptionPolicy": {
+ "default": "if_current",
+ "description": "Policy for adopting the completed result.",
"enum": [
- "layers",
- "crop",
- "smart-edit",
- "outpaint",
- "cutout",
- "inpainting-remove",
- "image-hd",
- "view-control",
- "lighting",
- "layer-decompose",
- "panorama",
- "product-replacement",
- "multi-size",
- "dynamic-poster",
- "ecommerce-main",
- "image-presets",
- "grid-split",
- "composition",
- "annotation",
- "video-edit",
- "video-extend",
- "video-partial-reshoot",
- "video-upscale",
- "video-frame-interpolation",
- "video-depth-capture",
- "video-subtitle-erasure",
- "video-matting",
- "video-crop",
- "video-translation",
- "extract-audio",
- "audio-separation",
- "video-trim",
- "audio-trim",
- "video-frame-capture",
- "director-stage"
+ "if_current",
+ "candidate_only"
],
- "title": "Tool",
+ "title": "Adoptionpolicy",
"type": "string"
},
- "sources": {
- "default": [],
- "description": "Ordered source asset versions.",
- "items": {
- "$ref": "#/$defs/AssetRef"
- },
- "title": "Sources",
- "type": "array"
+ "batchId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Generation batch ID.",
+ "title": "Batchid"
},
- "sourceItems": {
- "default": [],
- "description": "Source canvas item IDs.",
- "items": {
- "format": "uuid",
- "type": "string"
- },
- "title": "Sourceitems",
- "type": "array"
+ "showAdditionalResult": {
+ "default": false,
+ "description": "Whether to display an additional result item.",
+ "title": "Showadditionalresult",
+ "type": "boolean"
},
- "parameters": {
- "additionalProperties": {
- "anyOf": [
- {
- "maxLength": 100000,
- "type": "string"
- },
- {
- "type": "boolean"
- },
- {
- "type": "integer"
- },
- {
- "type": "number"
- }
- ]
- },
- "description": "Typed generation or editing parameters.",
- "maxProperties": 100,
- "propertyNames": {
- "maxLength": 100,
- "minLength": 1
- },
- "title": "Parameters",
- "type": "object"
+ "adoptionResultId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Result ID reserved for adoption.",
+ "title": "Adoptionresultid"
},
- "selection": {
+ "adoptionMaterial": {
"anyOf": [
{
- "$ref": "#/$defs/ToolSelection"
+ "$ref": "#/$defs/AssetRef"
},
{
"type": "null"
}
],
"default": null,
- "description": "Saved source selection for this edit."
+ "description": "Material version reserved for adoption."
+ },
+ "adopted": {
+ "default": false,
+ "description": "Whether the generated result was adopted.",
+ "title": "Adopted",
+ "type": "boolean"
+ },
+ "adapterParameters": {
+ "additionalProperties": {
+ "$ref": "#/$defs/JsonValue"
+ },
+ "description": "Fixed provider-specific execution parameters.",
+ "title": "Adapterparameters",
+ "type": "object"
}
},
"required": [
- "tool"
+ "id",
+ "projectId",
+ "inputSnapshot",
+ "inputFingerprint",
+ "execution"
],
- "title": "MediaEditData",
+ "title": "Job",
"type": "object"
},
- "MediaEditDocument": {
+ "JobCancelCommand": {
"additionalProperties": false,
+ "description": "Request cancellation of an existing job.",
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
"format": "uuid",
- "title": "Id",
+ "title": "Commandid",
"type": "string"
},
"projectId": {
@@ -7916,879 +8911,867 @@
"title": "Projectid",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "schemaVersion": {
- "const": 1,
- "default": 1,
- "description": "Record schema version.",
- "title": "Schemaversion",
- "type": "integer"
+ "type": {
+ "const": "job.cancel",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
},
- "inputConnections": {
+ "expectedVersions": {
"default": [],
- "description": "Persisted connections to source assets.",
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
"items": {
- "$ref": "#/$defs/EditorInputConnection"
+ "$ref": "#/$defs/ObjectVersion"
},
- "title": "Inputconnections",
+ "title": "Expectedversions",
"type": "array"
},
- "kind": {
- "const": "media_edit",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "data": {
- "$ref": "#/$defs/MediaEditData",
- "description": "Typed editable document contents."
+ "payload": {
+ "$ref": "#/$defs/JobControl",
+ "description": "Request cancellation of an existing job."
}
},
"required": [
- "id",
+ "commandId",
"projectId",
- "kind",
- "data"
+ "type",
+ "payload"
],
- "title": "MediaEditDocument",
+ "title": "JobCancelCommand",
"type": "object"
},
- "MediaMetadata": {
+ "JobCheckpoint": {
"additionalProperties": false,
"properties": {
- "mimeType": {
- "description": "Verified media MIME type.",
- "maxLength": 255,
- "minLength": 1,
- "title": "Mimetype",
+ "job": {
+ "$ref": "#/$defs/Job",
+ "description": "Generation execution record."
+ }
+ },
+ "required": [
+ "job"
+ ],
+ "title": "JobCheckpoint",
+ "type": "object"
+ },
+ "JobCheckpointCommand": {
+ "additionalProperties": false,
+ "description": "Persist a job execution checkpoint.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
"type": "string"
},
- "size": {
- "description": "Content size in bytes.",
- "minimum": 0,
- "title": "Size",
- "type": "integer"
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
},
- "width": {
- "anyOf": [
- {
- "minimum": 1,
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Width in pixels.",
- "title": "Width"
+ "type": {
+ "const": "job.checkpoint",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
},
- "height": {
- "anyOf": [
- {
- "minimum": 1,
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Height in pixels.",
- "title": "Height"
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
},
- "durationSeconds": {
+ "expectedPreview": {
"anyOf": [
{
- "exclusiveMinimum": 0,
- "type": "number"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Duration in seconds.",
- "title": "Durationseconds"
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "frameRate": {
- "anyOf": [
- {
- "exclusiveMinimum": 0,
- "type": "number"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Video frames per second.",
- "title": "Framerate"
+ "payload": {
+ "$ref": "#/$defs/JobCheckpoint",
+ "description": "Persist a job execution checkpoint."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "payload"
+ ],
+ "title": "JobCheckpointCommand",
+ "type": "object"
+ },
+ "JobControl": {
+ "additionalProperties": false,
+ "properties": {
+ "jobId": {
+ "description": "Generation job ID.",
+ "format": "uuid",
+ "title": "Jobid",
+ "type": "string"
+ }
+ },
+ "required": [
+ "jobId"
+ ],
+ "title": "JobControl",
+ "type": "object"
+ },
+ "JobRecoverCommand": {
+ "additionalProperties": false,
+ "description": "Recover an existing job without creating a new attempt.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
},
- "hasAudio": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Whether the media contains an audio stream.",
- "title": "Hasaudio"
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
},
- "sampleRate": {
- "anyOf": [
- {
- "minimum": 1,
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Audio samples per second.",
- "title": "Samplerate"
+ "type": {
+ "const": "job.recover",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
},
- "channels": {
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
"anyOf": [
{
- "minimum": 1,
- "type": "integer"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Audio channel count.",
- "title": "Channels"
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/JobControl",
+ "description": "Recover an existing job without creating a new attempt."
}
},
"required": [
- "mimeType",
- "size"
+ "commandId",
+ "projectId",
+ "type",
+ "payload"
],
- "title": "MediaMetadata",
+ "title": "JobRecoverCommand",
"type": "object"
},
- "MediaPublicationOutput": {
+ "JsonValue": {},
+ "LayerContentBase": {
"additionalProperties": false,
"properties": {
- "itemId": {
- "description": "Canvas item ID.",
- "format": "uuid",
- "title": "Itemid",
- "type": "string"
- },
- "asset": {
- "$ref": "#/$defs/AssetRef",
- "description": "Immutable asset version."
- },
- "title": {
- "description": "User-visible title.",
- "maxLength": 255,
- "minLength": 1,
- "title": "Title",
- "type": "string"
- },
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
- },
"width": {
- "default": 352,
"description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "maximum": 10000,
+ "maximum": 8192,
+ "minimum": 1,
"title": "Width",
- "type": "number"
+ "type": "integer"
},
"height": {
- "default": 198,
"description": "Height in pixels.",
- "exclusiveMinimum": 0,
- "maximum": 10000,
+ "maximum": 8192,
+ "minimum": 1,
"title": "Height",
- "type": "number"
+ "type": "integer"
}
},
"required": [
- "itemId",
- "asset",
- "title"
+ "width",
+ "height"
],
- "title": "MediaPublicationOutput",
+ "title": "LayerContentBase",
"type": "object"
},
- "ModelConfigPublic": {
+ "LayerData": {
"additionalProperties": false,
- "description": "Application-level, never embedded in an editable project's credential data.",
"properties": {
- "kind": {
- "description": "Business object or media type.",
- "enum": [
- "agent",
- "image",
- "video",
- "audio",
- "vision"
- ],
- "title": "Kind",
- "type": "string"
+ "width": {
+ "description": "Width in pixels.",
+ "maximum": 8192,
+ "minimum": 1,
+ "title": "Width",
+ "type": "integer"
},
- "url": {
- "description": "Provider API base URL.",
- "maxLength": 2048,
- "minLength": 1,
- "title": "Url",
- "type": "string"
+ "height": {
+ "description": "Height in pixels.",
+ "maximum": 8192,
+ "minimum": 1,
+ "title": "Height",
+ "type": "integer"
},
- "modelId": {
- "description": "Provider-native model identifier.",
- "maxLength": 200,
- "minLength": 1,
- "title": "Modelid",
+ "background": {
+ "default": "transparent",
+ "description": "Composition background color.",
+ "pattern": "^(transparent|#[0-9a-fA-F]{6})$",
+ "title": "Background",
"type": "string"
},
- "connectionType": {
- "description": "Hosted or local model connection type.",
- "enum": [
- "api",
- "self_hosted"
- ],
- "title": "Connectiontype",
+ "layers": {
+ "default": [],
+ "description": "Ordered editable image layers.",
+ "items": {
+ "$ref": "#/$defs/ImageLayer"
+ },
+ "maxItems": 40,
+ "title": "Layers",
+ "type": "array"
+ }
+ },
+ "required": [
+ "width",
+ "height"
+ ],
+ "title": "LayerData",
+ "type": "object"
+ },
+ "LayerDocument": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
"type": "string"
},
- "protocol": {
- "description": "Provider wire protocol.",
- "enum": [
- "openai",
- "volcengine",
- "bigmodel_video",
- "kling_video",
- "minimax_video_v2",
- "vllm_omni",
- "vllm_omni_segmentation",
- "vllm_omni_music",
- "vllm_omni_depth",
- "vllm_omni_score"
- ],
- "title": "Protocol",
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
"type": "string"
},
- "authMode": {
- "description": "Authentication mode for the provider connection.",
- "enum": [
- "none",
- "bearer"
- ],
- "title": "Authmode",
- "type": "string"
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
},
- "proxyMode": {
- "default": "system",
- "description": "Use the system proxy or connect directly to the model service.",
- "enum": [
- "system",
- "direct"
- ],
- "title": "Proxymode",
- "type": "string"
+ "schemaVersion": {
+ "const": 1,
+ "default": 1,
+ "description": "Record schema version.",
+ "title": "Schemaversion",
+ "type": "integer"
},
- "inputModalities": {
- "anyOf": [
- {
- "items": {
- "enum": [
- "text",
- "image"
- ],
- "type": "string"
- },
- "type": "array"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Supported model input media kinds.",
- "title": "Inputmodalities"
+ "inputConnections": {
+ "default": [],
+ "description": "Persisted connections to source assets.",
+ "items": {
+ "$ref": "#/$defs/EditorInputConnection"
+ },
+ "title": "Inputconnections",
+ "type": "array"
},
- "videoAdapter": {
- "default": "auto",
- "description": "Provider-specific video adapter.",
+ "kind": {
+ "const": "layers",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "data": {
+ "$ref": "#/$defs/LayerData",
+ "description": "Typed editable document contents."
+ }
+ },
+ "required": [
+ "id",
+ "projectId",
+ "kind",
+ "data"
+ ],
+ "title": "LayerDocument",
+ "type": "object"
+ },
+ "MaskStroke": {
+ "additionalProperties": false,
+ "properties": {
+ "mode": {
+ "description": "Operation mode within this contract variant.",
"enum": [
- "auto",
- "fasth3",
- "fasth3_dual",
- "minimax_h3",
- "standard"
+ "erase",
+ "restore"
],
- "title": "Videoadapter",
+ "title": "Mode",
"type": "string"
},
- "videoCapabilities": {
- "anyOf": [
- {
- "$ref": "#/$defs/VideoCapabilities"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Supported video generation capabilities."
+ "size": {
+ "description": "Mask brush diameter in pixels.",
+ "maximum": 4096,
+ "minimum": 1,
+ "title": "Size",
+ "type": "number"
},
- "id": {
- "description": "Stable object ID.",
- "format": "uuid",
- "title": "Id",
+ "points": {
+ "description": "Ordered mask stroke coordinates.",
+ "items": {
+ "$ref": "#/$defs/Point"
+ },
+ "maxItems": 200000,
+ "minItems": 1,
+ "title": "Points",
+ "type": "array"
+ }
+ },
+ "required": [
+ "mode",
+ "size",
+ "points"
+ ],
+ "title": "MaskStroke",
+ "type": "object"
+ },
+ "MaterialBinding": {
+ "additionalProperties": false,
+ "description": "Displays a registered project asset through objectRef.",
+ "properties": {
+ "role": {
+ "const": "material",
+ "description": "Business role of this binding or reference.",
+ "title": "Role",
"type": "string"
},
- "providerId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Shared provider connection ID.",
- "title": "Providerid"
- },
- "inputRules": {
- "$ref": "#/$defs/InputRules",
- "description": "Verified model input limits and output choices."
+ "objectRef": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Stable reference to the bound business object."
}
},
"required": [
- "kind",
- "url",
- "modelId",
- "connectionType",
- "protocol",
- "authMode",
- "id",
- "inputRules"
+ "role",
+ "objectRef"
],
- "title": "ModelConfigPublic",
+ "title": "MaterialBinding",
"type": "object"
},
- "ModelConfigWrite": {
+ "MediaCanvasItem": {
"additionalProperties": false,
- "description": "Only the model-settings write boundary accepts a credential.",
"properties": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
"kind": {
"description": "Business object or media type.",
"enum": [
- "agent",
+ "text",
"image",
"video",
"audio",
- "vision"
+ "file",
+ "group",
+ "timeline",
+ "subject",
+ "stack",
+ "tool",
+ "external"
],
"title": "Kind",
"type": "string"
},
- "url": {
- "description": "Provider API base URL.",
- "maxLength": 2048,
- "minLength": 1,
- "title": "Url",
- "type": "string"
- },
- "modelId": {
- "description": "Provider-native model identifier.",
- "maxLength": 200,
- "minLength": 1,
- "title": "Modelid",
+ "title": {
+ "default": "",
+ "description": "User-visible title.",
+ "maxLength": 255,
+ "title": "Title",
"type": "string"
},
- "connectionType": {
- "description": "Hosted or local model connection type.",
- "enum": [
- "api",
- "self_hosted"
- ],
- "title": "Connectiontype",
- "type": "string"
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
},
- "protocol": {
- "description": "Provider wire protocol.",
- "enum": [
- "openai",
- "volcengine",
- "bigmodel_video",
- "kling_video",
- "minimax_video_v2",
- "vllm_omni",
- "vllm_omni_segmentation",
- "vllm_omni_music",
- "vllm_omni_depth",
- "vllm_omni_score"
- ],
- "title": "Protocol",
- "type": "string"
+ "width": {
+ "default": 352,
+ "description": "Width in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Width",
+ "type": "number"
},
- "authMode": {
- "description": "Authentication mode for the provider connection.",
- "enum": [
- "none",
- "bearer"
- ],
- "title": "Authmode",
- "type": "string"
+ "height": {
+ "default": 198,
+ "description": "Height in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Height",
+ "type": "number"
},
- "proxyMode": {
- "default": "system",
- "description": "Use the system proxy or connect directly to the model service.",
- "enum": [
- "system",
- "direct"
- ],
- "title": "Proxymode",
- "type": "string"
+ "zIndex": {
+ "default": 0,
+ "description": "Canvas stacking order.",
+ "title": "Zindex",
+ "type": "integer"
},
- "inputModalities": {
+ "locked": {
+ "default": false,
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
+ "type": "boolean"
+ },
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
+ },
+ "parentId": {
"anyOf": [
{
- "items": {
- "enum": [
- "text",
- "image"
- ],
- "type": "string"
- },
- "type": "array"
+ "format": "uuid",
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Supported model input media kinds.",
- "title": "Inputmodalities"
+ "description": "Parent canvas group ID, or null for the root.",
+ "title": "Parentid"
},
- "videoAdapter": {
- "default": "auto",
- "description": "Provider-specific video adapter.",
- "enum": [
- "auto",
- "fasth3",
- "fasth3_dual",
- "minimax_h3",
- "standard"
- ],
- "title": "Videoadapter",
- "type": "string"
+ "tags": {
+ "default": [],
+ "description": "User-defined search tags.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Tags",
+ "type": "array"
},
- "videoCapabilities": {
- "anyOf": [
- {
- "$ref": "#/$defs/VideoCapabilities"
+ "binding": {
+ "description": "Business object displayed by this canvas item.",
+ "discriminator": {
+ "mapping": {
+ "empty": "#/$defs/EmptyBinding",
+ "generation": "#/$defs/GenerationBinding",
+ "material": "#/$defs/MaterialBinding"
},
+ "propertyName": "role"
+ },
+ "oneOf": [
{
- "type": "null"
- }
- ],
- "default": null,
- "description": "Supported video generation capabilities."
- },
- "apiKey": {
- "anyOf": [
+ "$ref": "#/$defs/EmptyBinding"
+ },
{
- "format": "password",
- "maxLength": 8192,
- "type": "string",
- "writeOnly": true
+ "$ref": "#/$defs/MaterialBinding"
},
{
- "type": "null"
+ "$ref": "#/$defs/GenerationBinding"
}
],
- "default": null,
- "description": "Provider credential; omitted from public model records.",
- "title": "Apikey"
+ "title": "Binding"
+ },
+ "editors": {
+ "default": [],
+ "description": "Attached editable documents.",
+ "items": {
+ "$ref": "#/$defs/EditorRef"
+ },
+ "title": "Editors",
+ "type": "array"
}
},
"required": [
+ "id",
+ "projectId",
"kind",
- "url",
- "modelId",
- "connectionType",
- "protocol",
- "authMode"
+ "binding"
],
- "title": "ModelConfigWrite",
+ "title": "MediaCanvasItem",
"type": "object"
},
- "ModelConnection": {
+ "MediaEditData": {
"additionalProperties": false,
"properties": {
- "kind": {
- "description": "Business object or media type.",
+ "tool": {
+ "description": "Registered editing tool name.",
"enum": [
- "agent",
- "image",
- "video",
- "audio",
- "vision"
+ "layers",
+ "crop",
+ "smart-edit",
+ "outpaint",
+ "cutout",
+ "inpainting-remove",
+ "image-hd",
+ "view-control",
+ "lighting",
+ "layer-decompose",
+ "panorama",
+ "product-replacement",
+ "multi-size",
+ "dynamic-poster",
+ "ecommerce-main",
+ "image-presets",
+ "grid-split",
+ "composition",
+ "annotation",
+ "video-edit",
+ "video-extend",
+ "video-partial-reshoot",
+ "video-upscale",
+ "video-frame-interpolation",
+ "video-depth-capture",
+ "video-subtitle-erasure",
+ "video-matting",
+ "video-crop",
+ "video-translation",
+ "extract-audio",
+ "audio-separation",
+ "video-trim",
+ "audio-trim",
+ "video-frame-capture",
+ "director-stage"
],
- "title": "Kind",
+ "title": "Tool",
"type": "string"
},
- "url": {
- "description": "Provider API base URL.",
- "maxLength": 2048,
- "minLength": 1,
- "title": "Url",
- "type": "string"
+ "sources": {
+ "default": [],
+ "description": "Ordered source asset versions.",
+ "items": {
+ "$ref": "#/$defs/AssetRef"
+ },
+ "title": "Sources",
+ "type": "array"
},
- "modelId": {
- "description": "Provider-native model identifier.",
- "maxLength": 200,
- "minLength": 1,
- "title": "Modelid",
- "type": "string"
+ "sourceItems": {
+ "default": [],
+ "description": "Source canvas item IDs.",
+ "items": {
+ "format": "uuid",
+ "type": "string"
+ },
+ "title": "Sourceitems",
+ "type": "array"
},
- "connectionType": {
- "description": "Hosted or local model connection type.",
- "enum": [
- "api",
- "self_hosted"
- ],
- "title": "Connectiontype",
- "type": "string"
- },
- "protocol": {
- "description": "Provider wire protocol.",
- "enum": [
- "openai",
- "volcengine",
- "bigmodel_video",
- "kling_video",
- "minimax_video_v2",
- "vllm_omni",
- "vllm_omni_segmentation",
- "vllm_omni_music",
- "vllm_omni_depth",
- "vllm_omni_score"
- ],
- "title": "Protocol",
- "type": "string"
- },
- "authMode": {
- "description": "Authentication mode for the provider connection.",
- "enum": [
- "none",
- "bearer"
- ],
- "title": "Authmode",
- "type": "string"
- },
- "proxyMode": {
- "default": "system",
- "description": "Use the system proxy or connect directly to the model service.",
- "enum": [
- "system",
- "direct"
- ],
- "title": "Proxymode",
- "type": "string"
- },
- "inputModalities": {
- "anyOf": [
- {
- "items": {
- "enum": [
- "text",
- "image"
- ],
+ "parameters": {
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "maxLength": 100000,
"type": "string"
},
- "type": "array"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Supported model input media kinds.",
- "title": "Inputmodalities"
- },
- "videoAdapter": {
- "default": "auto",
- "description": "Provider-specific video adapter.",
- "enum": [
- "auto",
- "fasth3",
- "fasth3_dual",
- "minimax_h3",
- "standard"
- ],
- "title": "Videoadapter",
- "type": "string"
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "integer"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ "description": "Typed generation or editing parameters.",
+ "maxProperties": 100,
+ "propertyNames": {
+ "maxLength": 100,
+ "minLength": 1
+ },
+ "title": "Parameters",
+ "type": "object"
},
- "videoCapabilities": {
+ "selection": {
"anyOf": [
{
- "$ref": "#/$defs/VideoCapabilities"
+ "$ref": "#/$defs/ToolSelection"
},
{
"type": "null"
}
],
"default": null,
- "description": "Supported video generation capabilities."
+ "description": "Saved source selection for this edit."
}
},
"required": [
- "kind",
- "url",
- "modelId",
- "connectionType",
- "protocol",
- "authMode"
+ "tool"
],
- "title": "ModelConnection",
+ "title": "MediaEditData",
"type": "object"
},
- "ModelSnapshot": {
+ "MediaEditDocument": {
"additionalProperties": false,
"properties": {
- "modelConfigId": {
- "description": "Model configuration ID from the model catalog or user model selections.",
+ "id": {
+ "description": "Stable identity of this project-owned object.",
"format": "uuid",
- "title": "Modelconfigid",
+ "title": "Id",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
"type": "string"
},
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "schemaVersion": {
+ "const": 1,
+ "default": 1,
+ "description": "Record schema version.",
+ "title": "Schemaversion",
+ "type": "integer"
+ },
+ "inputConnections": {
+ "default": [],
+ "description": "Persisted connections to source assets.",
+ "items": {
+ "$ref": "#/$defs/EditorInputConnection"
+ },
+ "title": "Inputconnections",
+ "type": "array"
+ },
"kind": {
+ "const": "media_edit",
"description": "Business object or media type.",
- "enum": [
- "agent",
- "image",
- "video",
- "audio",
- "vision"
- ],
"title": "Kind",
"type": "string"
},
- "modelId": {
- "description": "Provider-native model identifier.",
- "maxLength": 200,
- "minLength": 1,
- "title": "Modelid",
- "type": "string"
- },
- "url": {
- "description": "Provider API base URL.",
- "maxLength": 2048,
+ "data": {
+ "$ref": "#/$defs/MediaEditData",
+ "description": "Typed editable document contents."
+ }
+ },
+ "required": [
+ "id",
+ "projectId",
+ "kind",
+ "data"
+ ],
+ "title": "MediaEditDocument",
+ "type": "object"
+ },
+ "MediaMetadata": {
+ "additionalProperties": false,
+ "properties": {
+ "mimeType": {
+ "description": "Verified media MIME type.",
+ "maxLength": 255,
"minLength": 1,
- "title": "Url",
- "type": "string"
- },
- "protocol": {
- "description": "Provider wire protocol.",
- "enum": [
- "openai",
- "volcengine",
- "bigmodel_video",
- "kling_video",
- "minimax_video_v2",
- "vllm_omni",
- "vllm_omni_segmentation",
- "vllm_omni_music",
- "vllm_omni_depth",
- "vllm_omni_score"
- ],
- "title": "Protocol",
+ "title": "Mimetype",
"type": "string"
},
- "connectionType": {
- "description": "Hosted or local model connection type.",
- "enum": [
- "api",
- "self_hosted"
- ],
- "title": "Connectiontype",
- "type": "string"
+ "size": {
+ "description": "Content size in bytes.",
+ "minimum": 0,
+ "title": "Size",
+ "type": "integer"
},
- "proxyMode": {
- "default": "system",
- "description": "Network routing selected when the job was accepted.",
- "enum": [
- "system",
- "direct"
+ "width": {
+ "anyOf": [
+ {
+ "minimum": 1,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
],
- "title": "Proxymode",
- "type": "string"
+ "default": null,
+ "description": "Width in pixels.",
+ "title": "Width"
},
- "inputModalities": {
+ "height": {
"anyOf": [
{
- "items": {
- "enum": [
- "text",
- "image"
- ],
- "type": "string"
- },
- "type": "array"
+ "minimum": 1,
+ "type": "integer"
},
{
"type": "null"
}
],
"default": null,
- "description": "Supported model input media kinds.",
- "title": "Inputmodalities"
+ "description": "Height in pixels.",
+ "title": "Height"
},
- "videoAdapter": {
- "default": "auto",
- "description": "Provider-specific video adapter.",
- "enum": [
- "auto",
- "fasth3",
- "fasth3_dual",
- "minimax_h3",
- "standard"
+ "durationSeconds": {
+ "anyOf": [
+ {
+ "exclusiveMinimum": 0,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
],
- "title": "Videoadapter",
- "type": "string"
+ "default": null,
+ "description": "Duration in seconds.",
+ "title": "Durationseconds"
},
- "inputRules": {
+ "frameRate": {
"anyOf": [
{
- "$ref": "#/$defs/InputRules"
+ "exclusiveMinimum": 0,
+ "type": "number"
},
{
"type": "null"
}
],
"default": null,
- "description": "Verified model input limits and output choices."
- }
- },
- "required": [
- "modelConfigId",
- "kind",
- "modelId",
- "url",
- "protocol",
- "connectionType"
- ],
- "title": "ModelSnapshot",
- "type": "object"
- },
- "MotionClip": {
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "Stable object ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Id",
- "type": "string"
- },
- "start": {
- "description": "Start time in seconds.",
- "minimum": 0,
- "title": "Start",
- "type": "number"
- },
- "duration": {
- "description": "Interval duration in seconds.",
- "exclusiveMinimum": 0,
- "title": "Duration",
- "type": "number"
- },
- "motion": {
- "$ref": "#/$defs/StageMotion",
- "description": "Procedural motion settings."
- }
- },
- "required": [
- "id",
- "start",
- "duration",
- "motion"
- ],
- "title": "MotionClip",
- "type": "object"
- },
- "NodeCapabilities": {
- "additionalProperties": false,
- "properties": {
- "canEdit": {
- "description": "Whether the current content can be edited.",
- "title": "Canedit",
- "type": "boolean"
- },
- "canConfigureGeneration": {
- "description": "Whether generation settings can be configured.",
- "title": "Canconfiguregeneration",
- "type": "boolean"
+ "description": "Video frames per second.",
+ "title": "Framerate"
},
- "canGenerate": {
- "description": "Whether generation can be submitted.",
- "title": "Cangenerate",
- "type": "boolean"
+ "frameCount": {
+ "anyOf": [
+ {
+ "minimum": 1,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Number of video frames reported by the media container.",
+ "title": "Framecount"
},
- "canAcceptReferences": {
- "description": "Whether the item accepts generation references.",
- "title": "Canacceptreferences",
- "type": "boolean"
+ "hasAudio": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Whether the media contains an audio stream.",
+ "title": "Hasaudio"
},
- "canUseAsReference": {
- "description": "Whether the item can supply a generation reference.",
- "title": "Canuseasreference",
- "type": "boolean"
+ "sampleRate": {
+ "anyOf": [
+ {
+ "minimum": 1,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Audio samples per second.",
+ "title": "Samplerate"
},
- "canPlay": {
- "description": "Whether the current media can be played.",
- "title": "Canplay",
- "type": "boolean"
+ "channels": {
+ "anyOf": [
+ {
+ "minimum": 1,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Audio channel count.",
+ "title": "Channels"
},
- "canExport": {
- "description": "Whether the current content can be exported.",
- "title": "Canexport",
- "type": "boolean"
+ "selfContained": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Whether a model container embeds all its buffers and images.",
+ "title": "Selfcontained"
},
- "canReplaceMaterial": {
- "description": "Whether the bound material can be replaced.",
- "title": "Canreplacematerial",
- "type": "boolean"
+ "animationNames": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Animation clip names declared by a parsed model container, in document order.",
+ "title": "Animationnames"
}
},
"required": [
- "canEdit",
- "canConfigureGeneration",
- "canGenerate",
- "canAcceptReferences",
- "canUseAsReference",
- "canPlay",
- "canExport",
- "canReplaceMaterial"
+ "mimeType",
+ "size"
],
- "title": "NodeCapabilities",
+ "title": "MediaMetadata",
"type": "object"
},
- "NodeVersionApply": {
+ "MediaPublicationOutput": {
"additionalProperties": false,
"properties": {
"itemId": {
@@ -8801,671 +9784,735 @@
"$ref": "#/$defs/AssetRef",
"description": "Immutable asset version."
},
- "referencePolicy": {
- "default": "follow_current",
- "description": "Policy for restoring associated reference bindings.",
- "enum": [
- "follow_current",
- "pinned"
- ],
- "title": "Referencepolicy",
+ "title": {
+ "description": "User-visible title.",
+ "maxLength": 255,
+ "minLength": 1,
+ "title": "Title",
"type": "string"
+ },
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
+ },
+ "width": {
+ "default": 352,
+ "description": "Width in pixels.",
+ "exclusiveMinimum": 0,
+ "maximum": 10000,
+ "title": "Width",
+ "type": "number"
+ },
+ "height": {
+ "default": 198,
+ "description": "Height in pixels.",
+ "exclusiveMinimum": 0,
+ "maximum": 10000,
+ "title": "Height",
+ "type": "number"
}
},
"required": [
"itemId",
- "asset"
+ "asset",
+ "title"
],
- "title": "NodeVersionApply",
+ "title": "MediaPublicationOutput",
"type": "object"
},
- "NodeVersionApplyCommand": {
+ "ModelConfigPublic": {
"additionalProperties": false,
- "description": "Apply a historical asset version and its reference policy to a canvas item.",
+ "description": "Application-level, never embedded in an editable project's credential data.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
+ "kind": {
+ "description": "Business object or media type.",
+ "enum": [
+ "agent",
+ "image",
+ "video",
+ "audio",
+ "vision"
+ ],
+ "title": "Kind",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ "url": {
+ "description": "Provider API base URL.",
+ "maxLength": 2048,
+ "minLength": 1,
+ "title": "Url",
"type": "string"
},
- "type": {
- "const": "canvas.applyVersion",
- "description": "Command discriminator.",
- "title": "Type",
+ "modelId": {
+ "description": "Provider-native model identifier.",
+ "maxLength": 200,
+ "minLength": 1,
+ "title": "Modelid",
"type": "string"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
- },
- "expectedPreview": {
- "anyOf": [
- {
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
- },
- {
- "type": "null"
- }
+ "connectionType": {
+ "description": "Hosted or local model connection type.",
+ "enum": [
+ "api",
+ "self_hosted"
],
- "default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
- },
- "payload": {
- "$ref": "#/$defs/NodeVersionApply",
- "description": "Apply a historical asset version and its reference policy to a canvas item."
- }
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "payload"
- ],
- "title": "NodeVersionApplyCommand",
- "type": "object"
- },
- "ObjectQuery": {
- "additionalProperties": false,
- "properties": {
- "queryId": {
- "description": "Caller-supplied query ID.",
- "format": "uuid",
- "title": "Queryid",
+ "title": "Connectiontype",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ "protocol": {
+ "description": "Provider wire protocol.",
+ "enum": [
+ "openai",
+ "volcengine",
+ "bigmodel_video",
+ "kling_video",
+ "minimax_video_v2",
+ "vllm_omni",
+ "vllm_omni_segmentation",
+ "vllm_omni_music",
+ "vllm_omni_depth",
+ "vllm_omni_score"
+ ],
+ "title": "Protocol",
"type": "string"
},
- "type": {
- "description": "Read an object or generation job.",
+ "authMode": {
+ "description": "Authentication mode for the provider connection.",
"enum": [
- "object.get",
- "job.get"
+ "none",
+ "bearer"
],
- "title": "Type",
+ "title": "Authmode",
"type": "string"
},
- "objectId": {
- "description": "Target business object ID.",
- "format": "uuid",
- "title": "Objectid",
+ "proxyMode": {
+ "default": "system",
+ "description": "Use the system proxy or connect directly to the model service.",
+ "enum": [
+ "system",
+ "direct"
+ ],
+ "title": "Proxymode",
"type": "string"
},
- "revision": {
+ "inputModalities": {
"anyOf": [
{
- "minimum": 1,
- "type": "integer"
+ "items": {
+ "enum": [
+ "text",
+ "image"
+ ],
+ "type": "string"
+ },
+ "type": "array"
},
{
"type": "null"
}
],
"default": null,
- "description": "Historical object revision, or current when omitted.",
- "title": "Revision"
- }
- },
- "required": [
- "queryId",
- "projectId",
- "type",
- "objectId"
- ],
- "title": "ObjectQuery",
- "type": "object"
- },
- "ObjectVersion": {
- "additionalProperties": false,
- "properties": {
- "objectType": {
- "description": "Referenced business object type.",
+ "description": "Supported model input media kinds.",
+ "title": "Inputmodalities"
+ },
+ "videoAdapter": {
+ "default": "auto",
+ "description": "Provider-specific video adapter.",
"enum": [
- "project",
- "asset",
- "generation_spec",
- "reference",
- "canvas_item",
- "editor_document",
- "job",
- "result"
+ "auto",
+ "fasth3",
+ "fasth3_dual",
+ "minimax_h3",
+ "standard"
],
- "title": "Objecttype",
- "type": "string"
- },
- "id": {
- "description": "Stable object ID.",
- "format": "uuid",
- "title": "Id",
+ "title": "Videoadapter",
"type": "string"
},
- "revision": {
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- }
- },
- "required": [
- "objectType",
- "id",
- "revision"
- ],
- "title": "ObjectVersion",
- "type": "object"
- },
- "PaletteData": {
- "additionalProperties": false,
- "properties": {
- "name": {
+ "videoCapabilities": {
"anyOf": [
{
- "maxLength": 255,
- "type": "string"
+ "$ref": "#/$defs/VideoCapabilities"
},
{
"type": "null"
}
],
"default": null,
- "description": "User-visible name.",
- "title": "Name"
+ "description": "Supported video generation capabilities."
},
- "sourceImage": {
+ "id": {
+ "description": "Stable object ID.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
+ },
+ "providerId": {
"anyOf": [
{
- "$ref": "#/$defs/AssetRef"
+ "format": "uuid",
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Source image used to extract palette colors."
- }
- },
- "title": "PaletteData",
- "type": "object"
- },
- "PaletteProvenance": {
- "additionalProperties": false,
- "properties": {
- "paletteId": {
- "description": "Palette ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Paletteid",
- "type": "string"
+ "description": "Shared provider connection ID.",
+ "title": "Providerid"
},
- "version": {
- "description": "Version of the referenced record.",
- "minimum": 1,
- "title": "Version",
- "type": "integer"
+ "inputRules": {
+ "$ref": "#/$defs/InputRules",
+ "description": "Verified model input limits and output choices."
}
},
"required": [
- "paletteId",
- "version"
+ "kind",
+ "url",
+ "modelId",
+ "connectionType",
+ "protocol",
+ "authMode",
+ "id",
+ "inputRules"
],
- "title": "PaletteProvenance",
+ "title": "ModelConfigPublic",
"type": "object"
},
- "PinnedReference": {
+ "ModelConfigWrite": {
"additionalProperties": false,
+ "description": "Only the model-settings write boundary accepts a credential.",
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
- "format": "uuid",
- "title": "Id",
+ "kind": {
+ "description": "Business object or media type.",
+ "enum": [
+ "agent",
+ "image",
+ "video",
+ "audio",
+ "vision"
+ ],
+ "title": "Kind",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ "url": {
+ "description": "Provider API base URL.",
+ "maxLength": 2048,
+ "minLength": 1,
+ "title": "Url",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "targetSpecId": {
- "description": "Target generation configuration ID.",
- "format": "uuid",
- "title": "Targetspecid",
+ "modelId": {
+ "description": "Provider-native model identifier.",
+ "maxLength": 200,
+ "minLength": 1,
+ "title": "Modelid",
"type": "string"
},
- "role": {
- "default": "reference",
- "description": "Business role of this binding or reference.",
+ "connectionType": {
+ "description": "Hosted or local model connection type.",
"enum": [
- "reference",
- "first_frame",
- "last_frame",
- "continuation"
+ "api",
+ "self_hosted"
],
- "title": "Role",
+ "title": "Connectiontype",
"type": "string"
},
- "order": {
- "default": 0,
- "description": "Reference ordering within the target configuration.",
- "minimum": 0,
- "title": "Order",
- "type": "integer"
+ "protocol": {
+ "description": "Provider wire protocol.",
+ "enum": [
+ "openai",
+ "volcengine",
+ "bigmodel_video",
+ "kling_video",
+ "minimax_video_v2",
+ "vllm_omni",
+ "vllm_omni_segmentation",
+ "vllm_omni_music",
+ "vllm_omni_depth",
+ "vllm_omni_score"
+ ],
+ "title": "Protocol",
+ "type": "string"
},
- "active": {
- "default": true,
- "description": "Whether this reference participates in generation.",
- "title": "Active",
- "type": "boolean"
+ "authMode": {
+ "description": "Authentication mode for the provider connection.",
+ "enum": [
+ "none",
+ "bearer"
+ ],
+ "title": "Authmode",
+ "type": "string"
},
- "binding": {
- "const": "pinned",
- "description": "Use a fixed asset version, retaining canvas provenance when supplied.",
- "title": "Binding",
+ "proxyMode": {
+ "default": "system",
+ "description": "Use the system proxy or connect directly to the model service.",
+ "enum": [
+ "system",
+ "direct"
+ ],
+ "title": "Proxymode",
"type": "string"
},
- "source": {
- "$ref": "#/$defs/AssetRef",
- "description": "Fixed asset version used by generation."
+ "inputModalities": {
+ "anyOf": [
+ {
+ "items": {
+ "enum": [
+ "text",
+ "image"
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Supported model input media kinds.",
+ "title": "Inputmodalities"
},
- "sourceVersion": {
+ "videoAdapter": {
+ "default": "auto",
+ "description": "Provider-specific video adapter.",
+ "enum": [
+ "auto",
+ "fasth3",
+ "fasth3_dual",
+ "minimax_h3",
+ "standard"
+ ],
+ "title": "Videoadapter",
+ "type": "string"
+ },
+ "videoCapabilities": {
"anyOf": [
{
- "$ref": "#/$defs/CanvasItemVersion"
+ "$ref": "#/$defs/VideoCapabilities"
},
{
"type": "null"
}
],
"default": null,
- "description": "Source canvas item identity and revision. Required for canvas-derived references to retain their connection."
+ "description": "Supported video generation capabilities."
},
- "subjectRole": {
+ "apiKey": {
"anyOf": [
{
- "enum": [
- "main",
- "auxiliary",
- "voice"
- ],
- "type": "string"
+ "format": "password",
+ "maxLength": 8192,
+ "type": "string",
+ "writeOnly": true
},
{
"type": "null"
}
],
"default": null,
- "description": "Subject media slot provenance only; omit for ordinary image references and explicit first_frame/last_frame assets. main does not mean first frame.",
- "title": "Subjectrole"
+ "description": "Provider credential; omitted from public model records.",
+ "title": "Apikey"
}
},
"required": [
- "id",
- "projectId",
- "targetSpecId",
- "binding",
- "source"
+ "kind",
+ "url",
+ "modelId",
+ "connectionType",
+ "protocol",
+ "authMode"
],
- "title": "PinnedReference",
+ "title": "ModelConfigWrite",
"type": "object"
},
- "PinnedReferenceSource": {
+ "ModelConnection": {
"additionalProperties": false,
"properties": {
- "binding": {
- "const": "pinned",
- "default": "pinned",
- "description": "Use the fixed asset version.",
- "title": "Binding",
+ "kind": {
+ "description": "Business object or media type.",
+ "enum": [
+ "agent",
+ "image",
+ "video",
+ "audio",
+ "vision"
+ ],
+ "title": "Kind",
"type": "string"
},
- "source": {
- "$ref": "#/$defs/AssetRef",
- "description": "Fixed current asset version."
- },
- "sourceVersion": {
- "$ref": "#/$defs/CanvasItemVersion",
- "description": "Canvas source version retaining the connection."
- }
- },
- "required": [
- "source",
- "sourceVersion"
- ],
- "title": "PinnedReferenceSource",
- "type": "object"
- },
- "Playhead": {
- "additionalProperties": false,
- "properties": {
- "editorDocumentId": {
- "description": "Editable document ID.",
- "format": "uuid",
- "title": "Editordocumentid",
+ "url": {
+ "description": "Provider API base URL.",
+ "maxLength": 2048,
+ "minLength": 1,
+ "title": "Url",
"type": "string"
},
- "seconds": {
- "default": 0,
- "description": "Playhead position in seconds.",
- "minimum": 0,
- "title": "Seconds",
- "type": "number"
- }
- },
- "required": [
- "editorDocumentId"
- ],
- "title": "Playhead",
- "type": "object"
- },
- "Point": {
- "additionalProperties": false,
- "properties": {
- "x": {
- "default": 0,
- "description": "Horizontal coordinate.",
- "title": "X",
- "type": "number"
+ "modelId": {
+ "description": "Provider-native model identifier.",
+ "maxLength": 200,
+ "minLength": 1,
+ "title": "Modelid",
+ "type": "string"
},
- "y": {
- "default": 0,
- "description": "Vertical coordinate.",
- "title": "Y",
- "type": "number"
- }
- },
- "title": "Point",
- "type": "object"
- },
- "Project": {
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "Stable object ID.",
- "format": "uuid",
- "title": "Id",
+ "connectionType": {
+ "description": "Hosted or local model connection type.",
+ "enum": [
+ "api",
+ "self_hosted"
+ ],
+ "title": "Connectiontype",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
+ "protocol": {
+ "description": "Provider wire protocol.",
+ "enum": [
+ "openai",
+ "volcengine",
+ "bigmodel_video",
+ "kling_video",
+ "minimax_video_v2",
+ "vllm_omni",
+ "vllm_omni_segmentation",
+ "vllm_omni_music",
+ "vllm_omni_depth",
+ "vllm_omni_score"
+ ],
+ "title": "Protocol",
+ "type": "string"
},
- "name": {
- "description": "User-visible name.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Name",
+ "authMode": {
+ "description": "Authentication mode for the provider connection.",
+ "enum": [
+ "none",
+ "bearer"
+ ],
+ "title": "Authmode",
"type": "string"
- }
- },
- "required": [
- "id",
- "name"
- ],
- "title": "Project",
- "type": "object"
- },
- "ProjectCreate": {
- "additionalProperties": false,
- "properties": {
- "name": {
- "description": "User-visible name.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Name",
+ },
+ "proxyMode": {
+ "default": "system",
+ "description": "Use the system proxy or connect directly to the model service.",
+ "enum": [
+ "system",
+ "direct"
+ ],
+ "title": "Proxymode",
+ "type": "string"
+ },
+ "inputModalities": {
+ "anyOf": [
+ {
+ "items": {
+ "enum": [
+ "text",
+ "image"
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Supported model input media kinds.",
+ "title": "Inputmodalities"
+ },
+ "videoAdapter": {
+ "default": "auto",
+ "description": "Provider-specific video adapter.",
+ "enum": [
+ "auto",
+ "fasth3",
+ "fasth3_dual",
+ "minimax_h3",
+ "standard"
+ ],
+ "title": "Videoadapter",
"type": "string"
+ },
+ "videoCapabilities": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/VideoCapabilities"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Supported video generation capabilities."
}
},
"required": [
- "name"
+ "kind",
+ "url",
+ "modelId",
+ "connectionType",
+ "protocol",
+ "authMode"
],
- "title": "ProjectCreate",
+ "title": "ModelConnection",
"type": "object"
},
- "ProjectCreateCommand": {
+ "ModelSnapshot": {
"additionalProperties": false,
- "description": "Create a project.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
+ "modelConfigId": {
+ "description": "Model configuration ID from the model catalog or user model selections.",
"format": "uuid",
- "title": "Commandid",
+ "title": "Modelconfigid",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ "kind": {
+ "description": "Business object or media type.",
+ "enum": [
+ "agent",
+ "image",
+ "video",
+ "audio",
+ "vision"
+ ],
+ "title": "Kind",
"type": "string"
},
- "type": {
- "const": "project.create",
- "description": "Command discriminator.",
- "title": "Type",
+ "modelId": {
+ "description": "Provider-native model identifier.",
+ "maxLength": 200,
+ "minLength": 1,
+ "title": "Modelid",
"type": "string"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
+ "url": {
+ "description": "Provider API base URL.",
+ "maxLength": 2048,
+ "minLength": 1,
+ "title": "Url",
+ "type": "string"
},
- "expectedPreview": {
+ "protocol": {
+ "description": "Provider wire protocol.",
+ "enum": [
+ "openai",
+ "volcengine",
+ "bigmodel_video",
+ "kling_video",
+ "minimax_video_v2",
+ "vllm_omni",
+ "vllm_omni_segmentation",
+ "vllm_omni_music",
+ "vllm_omni_depth",
+ "vllm_omni_score"
+ ],
+ "title": "Protocol",
+ "type": "string"
+ },
+ "connectionType": {
+ "description": "Hosted or local model connection type.",
+ "enum": [
+ "api",
+ "self_hosted"
+ ],
+ "title": "Connectiontype",
+ "type": "string"
+ },
+ "proxyMode": {
+ "default": "system",
+ "description": "Network routing selected when the job was accepted.",
+ "enum": [
+ "system",
+ "direct"
+ ],
+ "title": "Proxymode",
+ "type": "string"
+ },
+ "inputModalities": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
+ "items": {
+ "enum": [
+ "text",
+ "image"
+ ],
+ "type": "string"
+ },
+ "type": "array"
},
{
"type": "null"
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "description": "Supported model input media kinds.",
+ "title": "Inputmodalities"
},
- "payload": {
- "$ref": "#/$defs/ProjectCreate",
- "description": "Create a project."
+ "videoAdapter": {
+ "default": "auto",
+ "description": "Provider-specific video adapter.",
+ "enum": [
+ "auto",
+ "fasth3",
+ "fasth3_dual",
+ "minimax_h3",
+ "standard"
+ ],
+ "title": "Videoadapter",
+ "type": "string"
+ },
+ "inputRules": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InputRules"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Verified model input limits and output choices."
}
},
"required": [
- "commandId",
- "projectId",
- "type",
- "payload"
+ "modelConfigId",
+ "kind",
+ "modelId",
+ "url",
+ "protocol",
+ "connectionType"
],
- "title": "ProjectCreateCommand",
+ "title": "ModelSnapshot",
"type": "object"
},
- "ProjectEntity": {
+ "MotionClip": {
"additionalProperties": false,
"properties": {
"id": {
- "description": "Stable identity of this project-owned object.",
- "format": "uuid",
+ "description": "Stable object ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
"title": "Id",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "start": {
+ "description": "Start time in seconds.",
+ "minimum": 0,
+ "title": "Start",
+ "type": "number"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
+ "duration": {
+ "description": "Interval duration in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Duration",
+ "type": "number"
+ },
+ "motion": {
+ "$ref": "#/$defs/StageMotion",
+ "description": "Procedural motion settings."
}
},
"required": [
"id",
- "projectId"
+ "start",
+ "duration",
+ "motion"
],
- "title": "ProjectEntity",
+ "title": "MotionClip",
"type": "object"
},
- "ProjectEvent": {
+ "NodeCapabilities": {
"additionalProperties": false,
"properties": {
- "schemaVersion": {
- "const": 1,
- "default": 1,
- "description": "Record schema version.",
- "title": "Schemaversion",
- "type": "integer"
+ "canEdit": {
+ "description": "Whether the current content can be edited.",
+ "title": "Canedit",
+ "type": "boolean"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "canConfigureGeneration": {
+ "description": "Whether generation settings can be configured.",
+ "title": "Canconfiguregeneration",
+ "type": "boolean"
},
- "cursor": {
- "description": "Monotonically increasing project event cursor.",
- "minimum": 1,
- "title": "Cursor",
- "type": "integer"
+ "canGenerate": {
+ "description": "Whether generation can be submitted.",
+ "title": "Cangenerate",
+ "type": "boolean"
},
- "commandId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Stable command ID for idempotent replay.",
- "title": "Commandid"
+ "canAcceptReferences": {
+ "description": "Whether the item accepts generation references.",
+ "title": "Canacceptreferences",
+ "type": "boolean"
},
- "source": {
- "description": "Input source or recorded provenance.",
- "enum": [
- "ui",
- "agent",
- "background",
- "external"
- ],
- "title": "Source",
- "type": "string"
+ "canUseAsReference": {
+ "description": "Whether the item can supply a generation reference.",
+ "title": "Canuseasreference",
+ "type": "boolean"
},
- "changed": {
- "default": [],
- "description": "Business objects changed by the operation.",
- "items": {
- "$ref": "#/$defs/ChangedObject"
- },
- "title": "Changed",
- "type": "array"
+ "canPlay": {
+ "description": "Whether the current media can be played.",
+ "title": "Canplay",
+ "type": "boolean"
},
- "jobIds": {
- "default": [],
- "description": "Generation jobs associated with this operation.",
- "items": {
- "format": "uuid",
- "type": "string"
- },
- "title": "Jobids",
- "type": "array"
+ "canExport": {
+ "description": "Whether the current content can be exported.",
+ "title": "Canexport",
+ "type": "boolean"
+ },
+ "canReplaceMaterial": {
+ "description": "Whether the bound material can be replaced.",
+ "title": "Canreplacematerial",
+ "type": "boolean"
}
},
"required": [
- "projectId",
- "cursor",
- "source"
+ "canEdit",
+ "canConfigureGeneration",
+ "canGenerate",
+ "canAcceptReferences",
+ "canUseAsReference",
+ "canPlay",
+ "canExport",
+ "canReplaceMaterial"
],
- "title": "ProjectEvent",
+ "title": "NodeCapabilities",
"type": "object"
},
- "ProjectQuery": {
+ "NodeVersionApply": {
"additionalProperties": false,
"properties": {
- "queryId": {
- "description": "Caller-supplied query ID.",
+ "itemId": {
+ "description": "Canvas item ID.",
"format": "uuid",
- "title": "Queryid",
+ "title": "Itemid",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "asset": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Immutable asset version."
},
- "type": {
- "const": "project.get",
- "description": "Read the current project.",
- "title": "Type",
- "type": "string"
- }
- },
- "required": [
- "queryId",
- "projectId",
- "type"
- ],
- "title": "ProjectQuery",
- "type": "object"
- },
- "ProjectRename": {
- "additionalProperties": false,
- "properties": {
- "name": {
- "description": "User-visible name.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Name",
+ "referencePolicy": {
+ "default": "follow_current",
+ "description": "Policy for restoring associated reference bindings.",
+ "enum": [
+ "follow_current",
+ "pinned"
+ ],
+ "title": "Referencepolicy",
"type": "string"
}
},
"required": [
- "name"
+ "itemId",
+ "asset"
],
- "title": "ProjectRename",
+ "title": "NodeVersionApply",
"type": "object"
},
- "ProjectRenameCommand": {
+ "NodeVersionApplyCommand": {
"additionalProperties": false,
- "description": "Rename the project.",
+ "description": "Apply a historical asset version and its reference policy to a canvas item.",
"properties": {
"commandId": {
"description": "Stable command ID for idempotent replay.",
@@ -9480,7 +10527,7 @@
"type": "string"
},
"type": {
- "const": "project.rename",
+ "const": "canvas.applyVersion",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -9509,8 +10556,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/ProjectRename",
- "description": "Rename the project."
+ "$ref": "#/$defs/NodeVersionApply",
+ "description": "Apply a historical asset version and its reference policy to a canvas item."
}
},
"required": [
@@ -9519,17 +10566,16 @@
"type",
"payload"
],
- "title": "ProjectRenameCommand",
+ "title": "NodeVersionApplyCommand",
"type": "object"
},
- "ProjectRestoreCommand": {
+ "ObjectQuery": {
"additionalProperties": false,
- "description": "Restore a trashed project.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
+ "queryId": {
+ "description": "Caller-supplied query ID.",
"format": "uuid",
- "title": "Commandid",
+ "title": "Queryid",
"type": "string"
},
"projectId": {
@@ -9539,313 +10585,90 @@
"type": "string"
},
"type": {
- "const": "project.restore",
- "description": "Command discriminator.",
+ "description": "Read an object or generation job.",
+ "enum": [
+ "object.get",
+ "job.get"
+ ],
"title": "Type",
"type": "string"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
+ "objectId": {
+ "description": "Target business object ID.",
+ "format": "uuid",
+ "title": "Objectid",
+ "type": "string"
},
- "expectedPreview": {
+ "revision": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
+ "minimum": 1,
+ "type": "integer"
},
{
"type": "null"
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
- },
- "payload": {
- "$ref": "#/$defs/EmptyPayload",
- "description": "Restore a trashed project."
+ "description": "Historical object revision, or current when omitted.",
+ "title": "Revision"
}
},
"required": [
- "commandId",
+ "queryId",
"projectId",
"type",
- "payload"
+ "objectId"
],
- "title": "ProjectRestoreCommand",
+ "title": "ObjectQuery",
"type": "object"
},
- "ProjectSnapshot": {
+ "ObjectVersion": {
"additionalProperties": false,
"properties": {
- "format": {
- "const": "opendirector-project",
- "default": "opendirector-project",
- "description": "Serialized format identifier.",
- "title": "Format",
+ "objectType": {
+ "description": "Referenced business object type.",
+ "enum": [
+ "project",
+ "asset",
+ "generation_spec",
+ "reference",
+ "canvas_item",
+ "editor_document",
+ "job",
+ "result"
+ ],
+ "title": "Objecttype",
"type": "string"
},
- "formatVersion": {
- "const": 2,
- "default": 2,
- "description": "Project format version.",
- "title": "Formatversion",
- "type": "integer"
- },
- "project": {
- "$ref": "#/$defs/Project",
- "description": "Project identity and current revision."
- },
- "assets": {
- "default": [],
- "description": "Registered immutable assets.",
- "items": {
- "$ref": "#/$defs/Asset"
- },
- "title": "Assets",
- "type": "array"
- },
- "generationSpecs": {
- "default": [],
- "description": "Editable generation configurations.",
- "items": {
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioGenerationSpec",
- "image": "#/$defs/ImageGenerationSpec",
- "text": "#/$defs/TextGenerationSpec",
- "video": "#/$defs/VideoGenerationSpec"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TextGenerationSpec"
- },
- {
- "$ref": "#/$defs/ImageGenerationSpec"
- },
- {
- "$ref": "#/$defs/VideoGenerationSpec"
- },
- {
- "$ref": "#/$defs/AudioGenerationSpec"
- }
- ]
- },
- "title": "Generationspecs",
- "type": "array"
- },
- "references": {
- "default": [],
- "description": "Ordered generation reference bindings.",
- "items": {
- "description": "Generation input reference. Preserve source canvas identity for canvas-derived references, whether following or pinned.",
- "discriminator": {
- "mapping": {
- "follow_current": "#/$defs/FollowingReference",
- "pinned": "#/$defs/PinnedReference"
- },
- "propertyName": "binding"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/PinnedReference"
- },
- {
- "$ref": "#/$defs/FollowingReference"
- }
- ]
- },
- "title": "References",
- "type": "array"
- },
- "canvasItems": {
- "default": [],
- "description": "Canvas display items, including hidden items.",
- "items": {
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioCanvasItem",
- "external": "#/$defs/DirectorCanvasItem",
- "file": "#/$defs/FileCanvasItem",
- "group": "#/$defs/GroupCanvasItem",
- "image": "#/$defs/ImageCanvasItem",
- "stack": "#/$defs/StackCanvasItem",
- "subject": "#/$defs/SubjectCanvasItem",
- "text": "#/$defs/TextCanvasItem",
- "timeline": "#/$defs/TimelineCanvasItem",
- "tool": "#/$defs/ToolCanvasItem",
- "video": "#/$defs/VideoCanvasItem"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TextCanvasItem"
- },
- {
- "$ref": "#/$defs/ImageCanvasItem"
- },
- {
- "$ref": "#/$defs/VideoCanvasItem"
- },
- {
- "$ref": "#/$defs/AudioCanvasItem"
- },
- {
- "$ref": "#/$defs/FileCanvasItem"
- },
- {
- "$ref": "#/$defs/SubjectCanvasItem"
- },
- {
- "$ref": "#/$defs/TimelineCanvasItem"
- },
- {
- "$ref": "#/$defs/StackCanvasItem"
- },
- {
- "$ref": "#/$defs/ToolCanvasItem"
- },
- {
- "$ref": "#/$defs/DirectorCanvasItem"
- },
- {
- "$ref": "#/$defs/GroupCanvasItem"
- }
- ]
- },
- "title": "Canvasitems",
- "type": "array"
- },
- "editorDocuments": {
- "default": [],
- "description": "Persisted editable documents.",
- "items": {
- "discriminator": {
- "mapping": {
- "director": "#/$defs/DirectorDocument",
- "image_crop": "#/$defs/ImageCropDocument",
- "layers": "#/$defs/LayerDocument",
- "media_edit": "#/$defs/MediaEditDocument",
- "stack": "#/$defs/StackDocument",
- "subject": "#/$defs/SubjectDocument",
- "timeline": "#/$defs/TimelineDocument",
- "tool": "#/$defs/ToolDocument"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TimelineDocument"
- },
- {
- "$ref": "#/$defs/SubjectDocument"
- },
- {
- "$ref": "#/$defs/LayerDocument"
- },
- {
- "$ref": "#/$defs/ImageCropDocument"
- },
- {
- "$ref": "#/$defs/StackDocument"
- },
- {
- "$ref": "#/$defs/ToolDocument"
- },
- {
- "$ref": "#/$defs/DirectorDocument"
- },
- {
- "$ref": "#/$defs/MediaEditDocument"
- }
- ]
- },
- "title": "Editordocuments",
- "type": "array"
- },
- "jobs": {
- "default": [],
- "description": "Immutable generation execution records.",
- "items": {
- "$ref": "#/$defs/Job"
- },
- "title": "Jobs",
- "type": "array"
- },
- "results": {
- "default": [],
- "description": "Generated result candidates and adoption history.",
- "items": {
- "$ref": "#/$defs/ResultVersion"
- },
- "title": "Results",
- "type": "array"
- },
- "eventCursor": {
- "default": 0,
- "description": "Latest committed project event cursor.",
- "minimum": 0,
- "title": "Eventcursor",
- "type": "integer"
+ "id": {
+ "description": "Stable object ID.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
},
- "undoClearedThrough": {
- "default": 0,
- "description": "Event cursor through which undo history was cleared.",
- "minimum": 0,
- "title": "Undoclearedthrough",
+ "revision": {
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
"type": "integer"
}
},
"required": [
- "project"
+ "objectType",
+ "id",
+ "revision"
],
- "title": "ProjectSnapshot",
+ "title": "ObjectVersion",
"type": "object"
},
- "ProjectTrashCommand": {
+ "PaletteData": {
"additionalProperties": false,
- "description": "Move the project to trash.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
- },
- "type": {
- "const": "project.trash",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
- },
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
- },
- "expectedPreview": {
+ "name": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
+ "maxLength": 255,
"type": "string"
},
{
@@ -9853,213 +10676,51 @@
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
- },
- "payload": {
- "$ref": "#/$defs/EmptyPayload",
- "description": "Move the project to trash."
- }
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "payload"
- ],
- "title": "ProjectTrashCommand",
- "type": "object"
- },
- "PromptReference": {
- "additionalProperties": false,
- "properties": {
- "type": {
- "const": "reference",
- "description": "Operation or variant discriminator.",
- "title": "Type",
- "type": "string"
- },
- "referenceId": {
- "description": "Generation reference ID.",
- "format": "uuid",
- "title": "Referenceid",
- "type": "string"
- }
- },
- "required": [
- "type",
- "referenceId"
- ],
- "title": "PromptReference",
- "type": "object"
- },
- "PromptText": {
- "additionalProperties": false,
- "properties": {
- "type": {
- "const": "text",
- "description": "Operation or variant discriminator.",
- "title": "Type",
- "type": "string"
- },
- "text": {
- "description": "UTF-8 text content or search query.",
- "maxLength": 20000,
- "title": "Text",
- "type": "string"
- }
- },
- "required": [
- "type",
- "text"
- ],
- "title": "PromptText",
- "type": "object"
- },
- "QueryBase": {
- "additionalProperties": false,
- "properties": {
- "queryId": {
- "description": "Caller-supplied query ID.",
- "format": "uuid",
- "title": "Queryid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
- }
- },
- "required": [
- "queryId",
- "projectId"
- ],
- "title": "QueryBase",
- "type": "object"
- },
- "RectangleLayerContent": {
- "additionalProperties": false,
- "properties": {
- "width": {
- "description": "Width in pixels.",
- "maximum": 8192,
- "minimum": 1,
- "title": "Width",
- "type": "integer"
- },
- "height": {
- "description": "Height in pixels.",
- "maximum": 8192,
- "minimum": 1,
- "title": "Height",
- "type": "integer"
- },
- "kind": {
- "const": "rectangle",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
- },
- "color": {
- "description": "Serialized display color.",
- "pattern": "^#[0-9a-fA-F]{6}$",
- "title": "Color",
- "type": "string"
- }
- },
- "required": [
- "width",
- "height",
- "kind",
- "color"
- ],
- "title": "RectangleLayerContent",
- "type": "object"
- },
- "ReferenceAddCommand": {
- "additionalProperties": false,
- "description": "Add a generation reference; expectedVersions must include its target generation_spec.",
- "properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
- },
- "type": {
- "const": "reference.add",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
- },
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
+ "description": "User-visible name.",
+ "title": "Name"
},
- "expectedPreview": {
+ "sourceImage": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
+ "$ref": "#/$defs/AssetRef"
},
{
"type": "null"
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
- },
- "payload": {
- "$ref": "#/$defs/ReferenceWrite",
- "description": "Add a generation reference; expectedVersions must include its target generation_spec."
+ "description": "Source image used to extract palette colors."
}
},
- "required": [
- "commandId",
- "projectId",
- "type",
- "payload"
- ],
- "title": "ReferenceAddCommand",
+ "title": "PaletteData",
"type": "object"
},
- "ReferenceAddCommandOperation": {
+ "PaletteProvenance": {
"additionalProperties": false,
- "description": "Add a generation reference; expectedVersions must include its target generation_spec.",
"properties": {
- "type": {
- "const": "reference.add",
- "description": "Operation discriminator.",
- "title": "Type",
+ "paletteId": {
+ "description": "Palette ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Paletteid",
"type": "string"
},
- "payload": {
- "$ref": "#/$defs/ReferenceWrite",
- "description": "Add a generation reference; expectedVersions must include its target generation_spec."
+ "version": {
+ "description": "Version of the referenced record.",
+ "minimum": 1,
+ "title": "Version",
+ "type": "integer"
}
},
"required": [
- "type",
- "payload"
+ "paletteId",
+ "version"
],
- "title": "ReferenceAddCommandOperation",
+ "title": "PaletteProvenance",
"type": "object"
},
- "ReferenceBase": {
+ "PinnedReference": {
"additionalProperties": false,
"properties": {
"id": {
@@ -10111,67 +10772,37 @@
"description": "Whether this reference participates in generation.",
"title": "Active",
"type": "boolean"
- }
- },
- "required": [
- "id",
- "projectId",
- "targetSpecId"
- ],
- "title": "ReferenceBase",
- "type": "object"
- },
- "ReferenceRemove": {
- "additionalProperties": false,
- "properties": {
- "referenceId": {
- "description": "Generation reference ID.",
- "format": "uuid",
- "title": "Referenceid",
- "type": "string"
- }
- },
- "required": [
- "referenceId"
- ],
- "title": "ReferenceRemove",
- "type": "object"
- },
- "ReferenceRemoveCommand": {
- "additionalProperties": false,
- "description": "Deactivate a generation reference.",
- "properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ },
+ "binding": {
+ "const": "pinned",
+ "description": "Use a fixed asset version, retaining canvas provenance when supplied.",
+ "title": "Binding",
"type": "string"
},
- "type": {
- "const": "reference.remove",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
+ "source": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Fixed asset version used by generation."
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
+ "sourceVersion": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/CanvasItemVersion"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Source canvas item identity and revision. Required for canvas-derived references to retain their connection."
},
- "expectedPreview": {
+ "subjectRole": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
+ "enum": [
+ "main",
+ "auxiliary",
+ "voice"
+ ],
"type": "string"
},
{
@@ -10179,129 +10810,141 @@
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
- },
- "payload": {
- "$ref": "#/$defs/ReferenceRemove",
- "description": "Deactivate a generation reference."
+ "description": "Subject media slot provenance only; omit for ordinary image references and explicit first_frame/last_frame assets. main does not mean first frame.",
+ "title": "Subjectrole"
}
},
"required": [
- "commandId",
+ "id",
"projectId",
- "type",
- "payload"
+ "targetSpecId",
+ "binding",
+ "source"
],
- "title": "ReferenceRemoveCommand",
+ "title": "PinnedReference",
"type": "object"
},
- "ReferenceRemoveCommandOperation": {
+ "PinnedReferenceSource": {
"additionalProperties": false,
- "description": "Deactivate a generation reference.",
"properties": {
- "type": {
- "const": "reference.remove",
- "description": "Operation discriminator.",
- "title": "Type",
+ "binding": {
+ "const": "pinned",
+ "default": "pinned",
+ "description": "Use the fixed asset version.",
+ "title": "Binding",
"type": "string"
},
- "payload": {
- "$ref": "#/$defs/ReferenceRemove",
- "description": "Deactivate a generation reference."
+ "source": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Fixed current asset version."
+ },
+ "sourceVersion": {
+ "$ref": "#/$defs/CanvasItemVersion",
+ "description": "Canvas source version retaining the connection."
}
},
"required": [
- "type",
- "payload"
+ "source",
+ "sourceVersion"
],
- "title": "ReferenceRemoveCommandOperation",
+ "title": "PinnedReferenceSource",
"type": "object"
},
- "ReferenceRestoreCommand": {
+ "Playhead": {
"additionalProperties": false,
- "description": "Restore a generation reference.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
+ "editorDocumentId": {
+ "description": "Editable document ID.",
"format": "uuid",
- "title": "Commandid",
+ "title": "Editordocumentid",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "seconds": {
+ "default": 0,
+ "description": "Playhead position in seconds.",
+ "minimum": 0,
+ "title": "Seconds",
+ "type": "number"
+ }
+ },
+ "required": [
+ "editorDocumentId"
+ ],
+ "title": "Playhead",
+ "type": "object"
+ },
+ "Point": {
+ "additionalProperties": false,
+ "properties": {
+ "x": {
+ "default": 0,
+ "description": "Horizontal coordinate.",
+ "title": "X",
+ "type": "number"
},
- "type": {
- "const": "reference.restore",
- "description": "Command discriminator.",
- "title": "Type",
+ "y": {
+ "default": 0,
+ "description": "Vertical coordinate.",
+ "title": "Y",
+ "type": "number"
+ }
+ },
+ "title": "Point",
+ "type": "object"
+ },
+ "Project": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable object ID.",
+ "format": "uuid",
+ "title": "Id",
"type": "string"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
- },
- "expectedPreview": {
- "anyOf": [
- {
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
},
- "payload": {
- "$ref": "#/$defs/ReferenceWrite",
- "description": "Restore a generation reference."
+ "name": {
+ "description": "User-visible name.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Name",
+ "type": "string"
}
},
"required": [
- "commandId",
- "projectId",
- "type",
- "payload"
+ "id",
+ "name"
],
- "title": "ReferenceRestoreCommand",
+ "title": "Project",
"type": "object"
},
- "ReferenceRestoreCommandOperation": {
+ "ProjectCreate": {
"additionalProperties": false,
- "description": "Restore a generation reference.",
"properties": {
- "type": {
- "const": "reference.restore",
- "description": "Operation discriminator.",
- "title": "Type",
+ "name": {
+ "description": "User-visible name.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Name",
"type": "string"
- },
- "payload": {
- "$ref": "#/$defs/ReferenceWrite",
- "description": "Restore a generation reference."
}
},
"required": [
- "type",
- "payload"
+ "name"
],
- "title": "ReferenceRestoreCommandOperation",
+ "title": "ProjectCreate",
"type": "object"
},
- "ReferenceUpdateCommand": {
+ "ProjectCreateCommand": {
"additionalProperties": false,
- "description": "Update a generation reference.",
+ "description": "Create a project.",
"properties": {
"commandId": {
"description": "Stable command ID for idempotent replay.",
@@ -10316,7 +10959,7 @@
"type": "string"
},
"type": {
- "const": "reference.update",
+ "const": "project.create",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -10345,8 +10988,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/ReferenceWrite",
- "description": "Update a generation reference."
+ "$ref": "#/$defs/ProjectCreate",
+ "description": "Create a project."
}
},
"required": [
@@ -10355,120 +10998,65 @@
"type",
"payload"
],
- "title": "ReferenceUpdateCommand",
+ "title": "ProjectCreateCommand",
"type": "object"
},
- "ReferenceUpdateCommandOperation": {
+ "ProjectEntity": {
"additionalProperties": false,
- "description": "Update a generation reference.",
"properties": {
- "type": {
- "const": "reference.update",
- "description": "Operation discriminator.",
- "title": "Type",
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
"type": "string"
},
- "payload": {
- "$ref": "#/$defs/ReferenceWrite",
- "description": "Update a generation reference."
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
}
},
"required": [
- "type",
- "payload"
- ],
- "title": "ReferenceUpdateCommandOperation",
- "type": "object"
- },
- "ReferenceWrite": {
- "additionalProperties": false,
- "properties": {
- "reference": {
- "description": "Generation input reference. Preserve source canvas identity for canvas-derived references, whether following or pinned.",
- "discriminator": {
- "mapping": {
- "follow_current": "#/$defs/FollowingReference",
- "pinned": "#/$defs/PinnedReference"
- },
- "propertyName": "binding"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/PinnedReference"
- },
- {
- "$ref": "#/$defs/FollowingReference"
- }
- ],
- "title": "Reference"
- }
- },
- "required": [
- "reference"
+ "id",
+ "projectId"
],
- "title": "ReferenceWrite",
+ "title": "ProjectEntity",
"type": "object"
},
- "ResolvedReference": {
+ "ProjectEvent": {
"additionalProperties": false,
"properties": {
- "referenceId": {
- "description": "Generation reference ID.",
- "format": "uuid",
- "title": "Referenceid",
- "type": "string"
+ "schemaVersion": {
+ "const": 1,
+ "default": 1,
+ "description": "Record schema version.",
+ "title": "Schemaversion",
+ "type": "integer"
},
- "role": {
- "description": "Business role of this binding or reference.",
- "enum": [
- "reference",
- "first_frame",
- "last_frame",
- "continuation"
- ],
- "title": "Role",
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
"type": "string"
},
- "asset": {
- "$ref": "#/$defs/AssetRef",
- "description": "Immutable asset version."
- },
- "metadata": {
- "$ref": "#/$defs/MediaMetadata",
- "description": "Verified media properties."
- },
- "sourceVersion": {
- "anyOf": [
- {
- "$ref": "#/$defs/ObjectVersion"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Captured source object version."
- },
- "documentVersion": {
- "anyOf": [
- {
- "$ref": "#/$defs/ObjectVersion"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Version of the source editable document."
+ "cursor": {
+ "description": "Monotonically increasing project event cursor.",
+ "minimum": 1,
+ "title": "Cursor",
+ "type": "integer"
},
- "subjectRole": {
+ "commandId": {
"anyOf": [
{
- "enum": [
- "main",
- "auxiliary",
- "voice"
- ],
+ "format": "uuid",
"type": "string"
},
{
@@ -10476,108 +11064,99 @@
}
],
"default": null,
- "description": "Subject media slot used by this reference.",
- "title": "Subjectrole"
- },
- "name": {
- "default": "",
- "description": "User-visible name.",
- "maxLength": 255,
- "title": "Name",
- "type": "string"
- },
- "sourceTitle": {
- "default": "",
- "description": "Source canvas title captured for this reference.",
- "maxLength": 255,
- "title": "Sourcetitle",
- "type": "string"
+ "description": "Stable command ID for idempotent replay.",
+ "title": "Commandid"
},
- "transmission": {
- "default": "content",
- "description": "How reference content is sent to the provider.",
+ "source": {
+ "description": "Input source or recorded provenance.",
"enum": [
- "content",
- "metadata",
- "context_only",
- "latent"
+ "ui",
+ "agent",
+ "background",
+ "external"
],
- "title": "Transmission",
+ "title": "Source",
"type": "string"
+ },
+ "changed": {
+ "default": [],
+ "description": "Business objects changed by the operation.",
+ "items": {
+ "$ref": "#/$defs/ChangedObject"
+ },
+ "title": "Changed",
+ "type": "array"
+ },
+ "jobIds": {
+ "default": [],
+ "description": "Generation jobs associated with this operation.",
+ "items": {
+ "format": "uuid",
+ "type": "string"
+ },
+ "title": "Jobids",
+ "type": "array"
}
},
"required": [
- "referenceId",
- "role",
- "asset",
- "metadata"
+ "projectId",
+ "cursor",
+ "source"
],
- "title": "ResolvedReference",
+ "title": "ProjectEvent",
"type": "object"
},
- "ResultCheck": {
+ "ProjectQuery": {
"additionalProperties": false,
"properties": {
- "status": {
- "description": "Current operation lifecycle state.",
- "enum": [
- "passed",
- "failed"
- ],
- "title": "Status",
+ "queryId": {
+ "description": "Caller-supplied query ID.",
+ "format": "uuid",
+ "title": "Queryid",
"type": "string"
},
- "facts": {
- "additionalProperties": true,
- "description": "Observed technical validation facts.",
- "title": "Facts",
- "type": "object"
- },
- "message": {
- "description": "Human-readable issue description.",
- "title": "Message",
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
"type": "string"
},
- "humanReviewRequired": {
- "default": true,
- "description": "Whether creative quality still requires human review.",
- "title": "Humanreviewrequired",
- "type": "boolean"
+ "type": {
+ "const": "project.get",
+ "description": "Read the current project.",
+ "title": "Type",
+ "type": "string"
}
},
"required": [
- "status",
- "message"
+ "queryId",
+ "projectId",
+ "type"
],
- "title": "ResultCheck",
+ "title": "ProjectQuery",
"type": "object"
},
- "ResultSelect": {
+ "ProjectRename": {
"additionalProperties": false,
"properties": {
- "specId": {
- "description": "Generation configuration ID.",
- "format": "uuid",
- "title": "Specid",
- "type": "string"
- },
- "resultId": {
- "description": "Generation result ID.",
- "format": "uuid",
- "title": "Resultid",
+ "name": {
+ "description": "User-visible name.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Name",
"type": "string"
}
},
"required": [
- "specId",
- "resultId"
+ "name"
],
- "title": "ResultSelect",
+ "title": "ProjectRename",
"type": "object"
},
- "ResultSelectCommand": {
+ "ProjectRenameCommand": {
"additionalProperties": false,
- "description": "Adopt an existing generation result.",
+ "description": "Rename the project.",
"properties": {
"commandId": {
"description": "Stable command ID for idempotent replay.",
@@ -10592,7 +11171,7 @@
"type": "string"
},
"type": {
- "const": "result.select",
+ "const": "project.rename",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -10621,8 +11200,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/ResultSelect",
- "description": "Adopt an existing generation result."
+ "$ref": "#/$defs/ProjectRename",
+ "description": "Rename the project."
}
},
"required": [
@@ -10631,130 +11210,17 @@
"type",
"payload"
],
- "title": "ResultSelectCommand",
+ "title": "ProjectRenameCommand",
"type": "object"
},
- "ResultSelectCommandOperation": {
+ "ProjectRestoreCommand": {
"additionalProperties": false,
- "description": "Adopt an existing generation result.",
+ "description": "Restore a trashed project.",
"properties": {
- "type": {
- "const": "result.select",
- "description": "Operation discriminator.",
- "title": "Type",
- "type": "string"
- },
- "payload": {
- "$ref": "#/$defs/ResultSelect",
- "description": "Adopt an existing generation result."
- }
- },
- "required": [
- "type",
- "payload"
- ],
- "title": "ResultSelectCommandOperation",
- "type": "object"
- },
- "ResultVersion": {
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
- "format": "uuid",
- "title": "Id",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
- },
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "specId": {
- "description": "Generation configuration ID.",
- "format": "uuid",
- "title": "Specid",
- "type": "string"
- },
- "jobId": {
- "description": "Generation job ID.",
- "format": "uuid",
- "title": "Jobid",
- "type": "string"
- },
- "asset": {
- "$ref": "#/$defs/AssetRef",
- "description": "Immutable asset version."
- },
- "inputFingerprint": {
- "description": "Fingerprint of the fixed execution input.",
- "pattern": "^[0-9a-f]{64}$",
- "title": "Inputfingerprint",
- "type": "string"
- }
- },
- "required": [
- "id",
- "projectId",
- "specId",
- "jobId",
- "asset",
- "inputFingerprint"
- ],
- "title": "ResultVersion",
- "type": "object"
- },
- "SelectionBox": {
- "additionalProperties": false,
- "properties": {
- "x": {
- "description": "Horizontal coordinate.",
- "title": "X",
- "type": "number"
- },
- "y": {
- "description": "Vertical coordinate.",
- "title": "Y",
- "type": "number"
- },
- "width": {
- "description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "title": "Width",
- "type": "number"
- },
- "height": {
- "description": "Height in pixels.",
- "exclusiveMinimum": 0,
- "title": "Height",
- "type": "number"
- }
- },
- "required": [
- "x",
- "y",
- "width",
- "height"
- ],
- "title": "SelectionBox",
- "type": "object"
- },
- "SpecCreateCommand": {
- "additionalProperties": false,
- "description": "Create a generation configuration without submitting a job.",
- "properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
"type": "string"
},
"projectId": {
@@ -10764,7 +11230,7 @@
"type": "string"
},
"type": {
- "const": "generationSpec.create",
+ "const": "project.restore",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -10793,8 +11259,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/SpecWrite",
- "description": "Create a generation configuration without submitting a job."
+ "$ref": "#/$defs/EmptyPayload",
+ "description": "Restore a trashed project."
}
},
"required": [
@@ -10803,201 +11269,242 @@
"type",
"payload"
],
- "title": "SpecCreateCommand",
+ "title": "ProjectRestoreCommand",
"type": "object"
},
- "SpecCreateCommandOperation": {
+ "ProjectSnapshot": {
"additionalProperties": false,
- "description": "Create a generation configuration without submitting a job.",
"properties": {
- "type": {
- "const": "generationSpec.create",
- "description": "Operation discriminator.",
- "title": "Type",
+ "format": {
+ "const": "opendirector-project",
+ "default": "opendirector-project",
+ "description": "Serialized format identifier.",
+ "title": "Format",
"type": "string"
},
- "payload": {
- "$ref": "#/$defs/SpecWrite",
- "description": "Create a generation configuration without submitting a job."
- }
- },
- "required": [
- "type",
- "payload"
- ],
- "title": "SpecCreateCommandOperation",
- "type": "object"
- },
- "SpecPromptCommand": {
- "additionalProperties": false,
- "description": "Update prompt text and structured references.",
- "properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
+ "formatVersion": {
+ "const": 2,
+ "default": 2,
+ "description": "Project format version.",
+ "title": "Formatversion",
+ "type": "integer"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "project": {
+ "$ref": "#/$defs/Project",
+ "description": "Project identity and current revision."
},
- "type": {
- "const": "generationSpec.setPrompt",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
+ "assets": {
+ "default": [],
+ "description": "Registered immutable assets.",
+ "items": {
+ "$ref": "#/$defs/Asset"
+ },
+ "title": "Assets",
+ "type": "array"
},
- "expectedVersions": {
+ "generationSpecs": {
"default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "description": "Editable generation configurations.",
"items": {
- "$ref": "#/$defs/ObjectVersion"
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioGenerationSpec",
+ "image": "#/$defs/ImageGenerationSpec",
+ "text": "#/$defs/TextGenerationSpec",
+ "video": "#/$defs/VideoGenerationSpec"
+ },
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TextGenerationSpec"
+ },
+ {
+ "$ref": "#/$defs/ImageGenerationSpec"
+ },
+ {
+ "$ref": "#/$defs/VideoGenerationSpec"
+ },
+ {
+ "$ref": "#/$defs/AudioGenerationSpec"
+ }
+ ]
},
- "title": "Expectedversions",
+ "title": "Generationspecs",
"type": "array"
},
- "expectedPreview": {
- "anyOf": [
- {
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
+ "references": {
+ "default": [],
+ "description": "Ordered generation reference bindings.",
+ "items": {
+ "description": "Generation input reference. Preserve source canvas identity for canvas-derived references, whether following or pinned.",
+ "discriminator": {
+ "mapping": {
+ "follow_current": "#/$defs/FollowingReference",
+ "pinned": "#/$defs/PinnedReference"
+ },
+ "propertyName": "binding"
},
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "oneOf": [
+ {
+ "$ref": "#/$defs/PinnedReference"
+ },
+ {
+ "$ref": "#/$defs/FollowingReference"
+ }
+ ]
+ },
+ "title": "References",
+ "type": "array"
},
- "payload": {
- "$ref": "#/$defs/SpecPromptWrite",
- "description": "Update prompt text and structured references."
- }
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "payload"
- ],
- "title": "SpecPromptCommand",
- "type": "object"
- },
- "SpecPromptCommandOperation": {
- "additionalProperties": false,
- "description": "Update prompt text and structured references.",
- "properties": {
- "type": {
- "const": "generationSpec.setPrompt",
- "description": "Operation discriminator.",
- "title": "Type",
- "type": "string"
- },
- "payload": {
- "$ref": "#/$defs/SpecPromptWrite",
- "description": "Update prompt text and structured references."
- }
- },
- "required": [
- "type",
- "payload"
- ],
- "title": "SpecPromptCommandOperation",
- "type": "object"
- },
- "SpecPromptWrite": {
- "additionalProperties": false,
- "properties": {
- "specId": {
- "description": "Generation configuration ID.",
- "format": "uuid",
- "title": "Specid",
- "type": "string"
- },
- "prompt": {
- "description": "Generation prompt text.",
- "maxLength": 20000,
- "title": "Prompt",
- "type": "string"
+ "canvasItems": {
+ "default": [],
+ "description": "Canvas display items, including hidden items.",
+ "items": {
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioCanvasItem",
+ "external": "#/$defs/DirectorCanvasItem",
+ "file": "#/$defs/FileCanvasItem",
+ "group": "#/$defs/GroupCanvasItem",
+ "image": "#/$defs/ImageCanvasItem",
+ "stack": "#/$defs/StackCanvasItem",
+ "subject": "#/$defs/SubjectCanvasItem",
+ "text": "#/$defs/TextCanvasItem",
+ "timeline": "#/$defs/TimelineCanvasItem",
+ "tool": "#/$defs/ToolCanvasItem",
+ "video": "#/$defs/VideoCanvasItem"
+ },
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TextCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/ImageCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/VideoCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/AudioCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/FileCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/SubjectCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/TimelineCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/StackCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/ToolCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/DirectorCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/GroupCanvasItem"
+ }
+ ]
+ },
+ "title": "Canvasitems",
+ "type": "array"
},
- "promptContent": {
- "anyOf": [
- {
- "items": {
- "discriminator": {
- "mapping": {
- "reference": "#/$defs/PromptReference",
- "text": "#/$defs/PromptText"
- },
- "propertyName": "type"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/PromptText"
- },
- {
- "$ref": "#/$defs/PromptReference"
- }
- ]
+ "editorDocuments": {
+ "default": [],
+ "description": "Persisted editable documents.",
+ "items": {
+ "discriminator": {
+ "mapping": {
+ "director": "#/$defs/DirectorDocument",
+ "image_crop": "#/$defs/ImageCropDocument",
+ "layers": "#/$defs/LayerDocument",
+ "media_edit": "#/$defs/MediaEditDocument",
+ "stack": "#/$defs/StackDocument",
+ "subject": "#/$defs/SubjectDocument",
+ "timeline": "#/$defs/TimelineDocument",
+ "tool": "#/$defs/ToolDocument"
},
- "type": "array"
+ "propertyName": "kind"
},
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Structured prompt text and reference tokens.",
- "title": "Promptcontent"
- }
- },
- "required": [
- "specId",
- "prompt"
- ],
- "title": "SpecPromptWrite",
- "type": "object"
- },
- "SpecRestore": {
- "additionalProperties": false,
- "properties": {
- "specId": {
- "description": "Generation configuration ID.",
- "format": "uuid",
- "title": "Specid",
- "type": "string"
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TimelineDocument"
+ },
+ {
+ "$ref": "#/$defs/SubjectDocument"
+ },
+ {
+ "$ref": "#/$defs/LayerDocument"
+ },
+ {
+ "$ref": "#/$defs/ImageCropDocument"
+ },
+ {
+ "$ref": "#/$defs/StackDocument"
+ },
+ {
+ "$ref": "#/$defs/ToolDocument"
+ },
+ {
+ "$ref": "#/$defs/DirectorDocument"
+ },
+ {
+ "$ref": "#/$defs/MediaEditDocument"
+ }
+ ]
+ },
+ "title": "Editordocuments",
+ "type": "array"
},
- "commandId": {
- "description": "Historical command providing the settings to restore.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
+ "jobs": {
+ "default": [],
+ "description": "Immutable generation execution records.",
+ "items": {
+ "$ref": "#/$defs/Job"
+ },
+ "title": "Jobs",
+ "type": "array"
},
- "referencePolicy": {
- "default": "follow_current",
- "description": "Policy for restoring associated reference bindings.",
- "enum": [
- "follow_current",
- "pinned"
- ],
- "title": "Referencepolicy",
- "type": "string"
+ "results": {
+ "default": [],
+ "description": "Generated result candidates and adoption history.",
+ "items": {
+ "$ref": "#/$defs/ResultVersion"
+ },
+ "title": "Results",
+ "type": "array"
+ },
+ "eventCursor": {
+ "default": 0,
+ "description": "Latest committed project event cursor.",
+ "minimum": 0,
+ "title": "Eventcursor",
+ "type": "integer"
+ },
+ "undoClearedThrough": {
+ "default": 0,
+ "description": "Event cursor through which undo history was cleared.",
+ "minimum": 0,
+ "title": "Undoclearedthrough",
+ "type": "integer"
}
},
"required": [
- "specId",
- "commandId"
+ "project"
],
- "title": "SpecRestore",
+ "title": "ProjectSnapshot",
"type": "object"
},
- "SpecRestoreCommand": {
+ "ProjectTrashCommand": {
"additionalProperties": false,
- "description": "Restore generation settings from a historical command.",
+ "description": "Move the project to trash.",
"properties": {
"commandId": {
"description": "Stable command ID for idempotent replay.",
@@ -11012,7 +11519,7 @@
"type": "string"
},
"type": {
- "const": "generationSpec.restore",
+ "const": "project.trash",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -11041,8 +11548,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/SpecRestore",
- "description": "Restore generation settings from a historical command."
+ "$ref": "#/$defs/EmptyPayload",
+ "description": "Move the project to trash."
}
},
"required": [
@@ -11051,27 +11558,138 @@
"type",
"payload"
],
- "title": "SpecRestoreCommand",
+ "title": "ProjectTrashCommand",
"type": "object"
},
- "SpecUpdateCommand": {
+ "PromptReference": {
"additionalProperties": false,
- "description": "Replace the complete generation configuration; preserve unedited fields and use the current version. Jobs are unchanged.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
+ "type": {
+ "const": "reference",
+ "description": "Operation or variant discriminator.",
+ "title": "Type",
"type": "string"
},
- "projectId": {
+ "referenceId": {
+ "description": "Generation reference ID.",
+ "format": "uuid",
+ "title": "Referenceid",
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "referenceId"
+ ],
+ "title": "PromptReference",
+ "type": "object"
+ },
+ "PromptText": {
+ "additionalProperties": false,
+ "properties": {
+ "type": {
+ "const": "text",
+ "description": "Operation or variant discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "text": {
+ "description": "UTF-8 text content or search query.",
+ "maxLength": 20000,
+ "title": "Text",
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "text"
+ ],
+ "title": "PromptText",
+ "type": "object"
+ },
+ "QueryBase": {
+ "additionalProperties": false,
+ "properties": {
+ "queryId": {
+ "description": "Caller-supplied query ID.",
+ "format": "uuid",
+ "title": "Queryid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ }
+ },
+ "required": [
+ "queryId",
+ "projectId"
+ ],
+ "title": "QueryBase",
+ "type": "object"
+ },
+ "RectangleLayerContent": {
+ "additionalProperties": false,
+ "properties": {
+ "width": {
+ "description": "Width in pixels.",
+ "maximum": 8192,
+ "minimum": 1,
+ "title": "Width",
+ "type": "integer"
+ },
+ "height": {
+ "description": "Height in pixels.",
+ "maximum": 8192,
+ "minimum": 1,
+ "title": "Height",
+ "type": "integer"
+ },
+ "kind": {
+ "const": "rectangle",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "color": {
+ "description": "Serialized display color.",
+ "examples": [
+ "#000000"
+ ],
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "title": "Color",
+ "type": "string"
+ }
+ },
+ "required": [
+ "width",
+ "height",
+ "kind",
+ "color"
+ ],
+ "title": "RectangleLayerContent",
+ "type": "object"
+ },
+ "ReferenceAddCommand": {
+ "additionalProperties": false,
+ "description": "Add a generation reference; expectedVersions must include its target generation_spec.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
"description": "Owning project ID.",
"format": "uuid",
"title": "Projectid",
"type": "string"
},
"type": {
- "const": "generationSpec.update",
+ "const": "reference.add",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -11100,8 +11718,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/SpecWrite",
- "description": "Replace the complete generation configuration; preserve unedited fields and use the current version. Jobs are unchanged."
+ "$ref": "#/$defs/ReferenceWrite",
+ "description": "Add a generation reference; expectedVersions must include its target generation_spec."
}
},
"required": [
@@ -11110,69 +11728,32 @@
"type",
"payload"
],
- "title": "SpecUpdateCommand",
+ "title": "ReferenceAddCommand",
"type": "object"
},
- "SpecUpdateCommandOperation": {
+ "ReferenceAddCommandOperation": {
"additionalProperties": false,
- "description": "Replace the complete generation configuration; preserve unedited fields and use the current version. Jobs are unchanged.",
+ "description": "Add a generation reference; expectedVersions must include its target generation_spec.",
"properties": {
"type": {
- "const": "generationSpec.update",
+ "const": "reference.add",
"description": "Operation discriminator.",
"title": "Type",
"type": "string"
},
"payload": {
- "$ref": "#/$defs/SpecWrite",
- "description": "Replace the complete generation configuration; preserve unedited fields and use the current version. Jobs are unchanged."
+ "$ref": "#/$defs/ReferenceWrite",
+ "description": "Add a generation reference; expectedVersions must include its target generation_spec."
}
},
"required": [
"type",
"payload"
],
- "title": "SpecUpdateCommandOperation",
- "type": "object"
- },
- "SpecWrite": {
- "additionalProperties": false,
- "properties": {
- "spec": {
- "description": "Complete configuration with its current revision; the server increments it on commit. For updates, read the current spec, preserve unedited fields and submit its current expected version. Accepted job snapshots never change.",
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioGenerationSpec",
- "image": "#/$defs/ImageGenerationSpec",
- "text": "#/$defs/TextGenerationSpec",
- "video": "#/$defs/VideoGenerationSpec"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TextGenerationSpec"
- },
- {
- "$ref": "#/$defs/ImageGenerationSpec"
- },
- {
- "$ref": "#/$defs/VideoGenerationSpec"
- },
- {
- "$ref": "#/$defs/AudioGenerationSpec"
- }
- ],
- "title": "Spec"
- }
- },
- "required": [
- "spec"
- ],
- "title": "SpecWrite",
+ "title": "ReferenceAddCommandOperation",
"type": "object"
},
- "StackCanvasItem": {
+ "ReferenceBase": {
"additionalProperties": false,
"properties": {
"id": {
@@ -11194,126 +11775,70 @@
"title": "Revision",
"type": "integer"
},
- "kind": {
- "const": "stack",
- "description": "Business object or media type.",
- "title": "Kind",
+ "targetSpecId": {
+ "description": "Target generation configuration ID.",
+ "format": "uuid",
+ "title": "Targetspecid",
"type": "string"
},
- "title": {
- "default": "",
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
+ "role": {
+ "default": "reference",
+ "description": "Business role of this binding or reference.",
+ "enum": [
+ "reference",
+ "first_frame",
+ "last_frame",
+ "continuation"
+ ],
+ "title": "Role",
"type": "string"
},
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
- },
- "width": {
- "default": 352,
- "description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "title": "Width",
- "type": "number"
- },
- "height": {
- "default": 198,
- "description": "Height in pixels.",
- "exclusiveMinimum": 0,
- "title": "Height",
- "type": "number"
- },
- "zIndex": {
+ "order": {
"default": 0,
- "description": "Canvas stacking order.",
- "title": "Zindex",
+ "description": "Reference ordering within the target configuration.",
+ "minimum": 0,
+ "title": "Order",
"type": "integer"
},
- "locked": {
- "default": false,
- "description": "Whether edits to this object are blocked.",
- "title": "Locked",
- "type": "boolean"
- },
- "visible": {
+ "active": {
"default": true,
- "description": "Whether this object is displayed.",
- "title": "Visible",
+ "description": "Whether this reference participates in generation.",
+ "title": "Active",
"type": "boolean"
- },
- "parentId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Parent canvas group ID, or null for the root.",
- "title": "Parentid"
- },
- "tags": {
- "default": [],
- "description": "User-defined search tags.",
- "items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "type": "string"
- },
- "title": "Tags",
- "type": "array"
- },
- "binding": {
- "$ref": "#/$defs/EditorBinding",
- "description": "Business object displayed by this canvas item."
}
},
"required": [
"id",
"projectId",
- "kind",
- "binding"
+ "targetSpecId"
],
- "title": "StackCanvasItem",
+ "title": "ReferenceBase",
"type": "object"
},
- "StackData": {
+ "ReferenceRemove": {
"additionalProperties": false,
"properties": {
- "nodeIds": {
- "default": [],
- "description": "Ordered member canvas item IDs.",
- "items": {
- "format": "uuid",
- "type": "string"
- },
- "title": "Nodeids",
- "type": "array"
- },
- "activeIndex": {
- "default": 0,
- "description": "Index of the active member.",
- "minimum": 0,
- "title": "Activeindex",
- "type": "integer"
+ "referenceId": {
+ "description": "Generation reference ID.",
+ "format": "uuid",
+ "title": "Referenceid",
+ "type": "string"
}
},
- "title": "StackData",
+ "required": [
+ "referenceId"
+ ],
+ "title": "ReferenceRemove",
"type": "object"
},
- "StackDocument": {
+ "ReferenceRemoveCommand": {
"additionalProperties": false,
+ "description": "Deactivate a generation reference.",
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
"format": "uuid",
- "title": "Id",
+ "title": "Commandid",
"type": "string"
},
"projectId": {
@@ -11322,260 +11847,160 @@
"title": "Projectid",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "schemaVersion": {
- "const": 1,
- "default": 1,
- "description": "Record schema version.",
- "title": "Schemaversion",
- "type": "integer"
+ "type": {
+ "const": "reference.remove",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
},
- "inputConnections": {
+ "expectedVersions": {
"default": [],
- "description": "Persisted connections to source assets.",
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
"items": {
- "$ref": "#/$defs/EditorInputConnection"
+ "$ref": "#/$defs/ObjectVersion"
},
- "title": "Inputconnections",
+ "title": "Expectedversions",
"type": "array"
},
- "kind": {
- "const": "stack",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "data": {
- "$ref": "#/$defs/StackData",
- "description": "Typed editable document contents."
+ "payload": {
+ "$ref": "#/$defs/ReferenceRemove",
+ "description": "Deactivate a generation reference."
}
},
"required": [
- "id",
+ "commandId",
"projectId",
- "kind",
- "data"
- ],
- "title": "StackDocument",
- "type": "object"
- },
- "StageCamera": {
- "additionalProperties": false,
- "properties": {
- "position": {
- "$ref": "#/$defs/Vector3",
- "description": "Position in the owning canvas or stage."
- },
- "target": {
- "$ref": "#/$defs/Vector3",
- "description": "Camera look-at position."
- },
- "fov": {
- "description": "Camera vertical field of view in degrees.",
- "exclusiveMaximum": 180,
- "exclusiveMinimum": 0,
- "title": "Fov",
- "type": "number"
- }
- },
- "required": [
- "position",
- "target",
- "fov"
+ "type",
+ "payload"
],
- "title": "StageCamera",
+ "title": "ReferenceRemoveCommand",
"type": "object"
},
- "StageMotion": {
+ "ReferenceRemoveCommandOperation": {
"additionalProperties": false,
+ "description": "Deactivate a generation reference.",
"properties": {
- "preset": {
- "description": "Selected generation or motion preset.",
- "enum": [
- "idle",
- "walk",
- "run",
- "wave"
- ],
- "title": "Preset",
+ "type": {
+ "const": "reference.remove",
+ "description": "Operation discriminator.",
+ "title": "Type",
"type": "string"
},
- "speed": {
- "description": "Playback or motion speed multiplier.",
- "exclusiveMinimum": 0,
- "title": "Speed",
- "type": "number"
- },
- "amount": {
- "description": "Magnitude of the procedural motion.",
- "maximum": 1,
- "minimum": 0,
- "title": "Amount",
- "type": "number"
+ "payload": {
+ "$ref": "#/$defs/ReferenceRemove",
+ "description": "Deactivate a generation reference."
}
},
"required": [
- "preset",
- "speed",
- "amount"
+ "type",
+ "payload"
],
- "title": "StageMotion",
+ "title": "ReferenceRemoveCommandOperation",
"type": "object"
},
- "StageObject": {
+ "ReferenceRestoreCommand": {
"additionalProperties": false,
+ "description": "Restore a generation reference.",
"properties": {
- "position": {
- "$ref": "#/$defs/Vector3",
- "description": "Position in the owning canvas or stage."
- },
- "rotation": {
- "$ref": "#/$defs/Vector3",
- "description": "Rotation in radians around each stage axis."
- },
- "scale": {
- "$ref": "#/$defs/Vector3",
- "description": "Positive scale along each stage axis."
- },
- "id": {
- "description": "Stable object ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Id",
- "type": "string"
- },
- "kind": {
- "description": "Business object or media type.",
- "enum": [
- "person",
- "box",
- "sphere"
- ],
- "title": "Kind",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
"type": "string"
},
- "name": {
- "description": "User-visible name.",
- "maxLength": 255,
- "title": "Name",
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
"type": "string"
},
- "color": {
- "description": "Serialized display color.",
- "pattern": "^#[0-9a-fA-F]{6}$",
- "title": "Color",
+ "type": {
+ "const": "reference.restore",
+ "description": "Command discriminator.",
+ "title": "Type",
"type": "string"
},
- "keyframes": {
+ "expectedVersions": {
"default": [],
- "description": "Ordered animation keyframes.",
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
"items": {
- "$ref": "#/$defs/TransformFrame"
+ "$ref": "#/$defs/ObjectVersion"
},
- "title": "Keyframes",
+ "title": "Expectedversions",
"type": "array"
},
- "motionClips": {
- "default": [],
- "description": "Ordered procedural motion intervals.",
- "items": {
- "$ref": "#/$defs/MotionClip"
- },
- "title": "Motionclips",
- "type": "array"
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/ReferenceWrite",
+ "description": "Restore a generation reference."
}
},
"required": [
- "position",
- "rotation",
- "scale",
- "id",
- "kind",
- "name",
- "color"
+ "commandId",
+ "projectId",
+ "type",
+ "payload"
],
- "title": "StageObject",
+ "title": "ReferenceRestoreCommand",
"type": "object"
},
- "StageShot": {
+ "ReferenceRestoreCommandOperation": {
"additionalProperties": false,
+ "description": "Restore a generation reference.",
"properties": {
- "id": {
- "description": "Stable object ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Id",
- "type": "string"
- },
- "cameraId": {
- "description": "Stage camera ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Cameraid",
+ "type": {
+ "const": "reference.restore",
+ "description": "Operation discriminator.",
+ "title": "Type",
"type": "string"
},
- "start": {
- "description": "Start time in seconds.",
- "minimum": 0,
- "title": "Start",
- "type": "number"
- },
- "duration": {
- "description": "Interval duration in seconds.",
- "exclusiveMinimum": 0,
- "title": "Duration",
- "type": "number"
- }
- },
- "required": [
- "id",
- "cameraId",
- "start",
- "duration"
- ],
- "title": "StageShot",
- "type": "object"
- },
- "StageTransform": {
- "additionalProperties": false,
- "properties": {
- "position": {
- "$ref": "#/$defs/Vector3",
- "description": "Position in the owning canvas or stage."
- },
- "rotation": {
- "$ref": "#/$defs/Vector3",
- "description": "Rotation in radians around each stage axis."
- },
- "scale": {
- "$ref": "#/$defs/Vector3",
- "description": "Positive scale along each stage axis."
+ "payload": {
+ "$ref": "#/$defs/ReferenceWrite",
+ "description": "Restore a generation reference."
}
},
"required": [
- "position",
- "rotation",
- "scale"
+ "type",
+ "payload"
],
- "title": "StageTransform",
+ "title": "ReferenceRestoreCommandOperation",
"type": "object"
},
- "SubjectCanvasItem": {
+ "ReferenceUpdateCommand": {
"additionalProperties": false,
+ "description": "Update a generation reference.",
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
"format": "uuid",
- "title": "Id",
+ "title": "Commandid",
"type": "string"
},
"projectId": {
@@ -11584,66 +12009,25 @@
"title": "Projectid",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "kind": {
- "const": "subject",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
- },
- "title": {
- "default": "",
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
+ "type": {
+ "const": "reference.update",
+ "description": "Command discriminator.",
+ "title": "Type",
"type": "string"
},
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
- },
- "width": {
- "default": 352,
- "description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "title": "Width",
- "type": "number"
- },
- "height": {
- "default": 198,
- "description": "Height in pixels.",
- "exclusiveMinimum": 0,
- "title": "Height",
- "type": "number"
- },
- "zIndex": {
- "default": 0,
- "description": "Canvas stacking order.",
- "title": "Zindex",
- "type": "integer"
- },
- "locked": {
- "default": false,
- "description": "Whether edits to this object are blocked.",
- "title": "Locked",
- "type": "boolean"
- },
- "visible": {
- "default": true,
- "description": "Whether this object is displayed.",
- "title": "Visible",
- "type": "boolean"
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
},
- "parentId": {
+ "expectedPreview": {
"anyOf": [
{
- "format": "uuid",
+ "pattern": "^[0-9a-f]{64}$",
"type": "string"
},
{
@@ -11651,198 +12035,248 @@
}
],
"default": null,
- "description": "Parent canvas group ID, or null for the root.",
- "title": "Parentid"
- },
- "tags": {
- "default": [],
- "description": "User-defined search tags.",
- "items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "type": "string"
- },
- "title": "Tags",
- "type": "array"
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "binding": {
- "$ref": "#/$defs/EditorBinding",
- "description": "Business object displayed by this canvas item."
+ "payload": {
+ "$ref": "#/$defs/ReferenceWrite",
+ "description": "Update a generation reference."
}
},
"required": [
- "id",
+ "commandId",
"projectId",
- "kind",
- "binding"
+ "type",
+ "payload"
],
- "title": "SubjectCanvasItem",
+ "title": "ReferenceUpdateCommand",
"type": "object"
},
- "SubjectData": {
+ "ReferenceUpdateCommandOperation": {
"additionalProperties": false,
+ "description": "Update a generation reference.",
"properties": {
- "description": {
- "default": "",
- "description": "User-facing annotation only; not subject media or a generation reference",
- "maxLength": 20000,
- "title": "Description",
- "type": "string"
- },
- "category": {
- "default": "",
- "description": "Subject category.",
- "maxLength": 100,
- "title": "Category",
+ "type": {
+ "const": "reference.update",
+ "description": "Operation discriminator.",
+ "title": "Type",
"type": "string"
},
- "main": {
- "anyOf": [
- {
- "$ref": "#/$defs/AssetRef"
+ "payload": {
+ "$ref": "#/$defs/ReferenceWrite",
+ "description": "Update a generation reference."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "ReferenceUpdateCommandOperation",
+ "type": "object"
+ },
+ "ReferenceWrite": {
+ "additionalProperties": false,
+ "properties": {
+ "reference": {
+ "description": "Generation input reference. Preserve source canvas identity for canvas-derived references, whether following or pinned.",
+ "discriminator": {
+ "mapping": {
+ "follow_current": "#/$defs/FollowingReference",
+ "pinned": "#/$defs/PinnedReference"
},
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Primary subject media."
- },
- "auxiliaries": {
- "default": [],
- "description": "Ordered auxiliary subject media.",
- "items": {
- "$ref": "#/$defs/AssetRef"
+ "propertyName": "binding"
},
- "maxItems": 3,
- "title": "Auxiliaries",
- "type": "array"
- },
- "voice": {
- "anyOf": [
+ "oneOf": [
{
- "$ref": "#/$defs/AssetRef"
+ "$ref": "#/$defs/PinnedReference"
},
{
- "type": "null"
+ "$ref": "#/$defs/FollowingReference"
}
],
- "default": null,
- "description": "Subject voice asset version."
- },
- "librarySource": {
+ "title": "Reference"
+ }
+ },
+ "required": [
+ "reference"
+ ],
+ "title": "ReferenceWrite",
+ "type": "object"
+ },
+ "ResolvedReference": {
+ "additionalProperties": false,
+ "properties": {
+ "referenceId": {
+ "description": "Generation reference ID.",
+ "format": "uuid",
+ "title": "Referenceid",
+ "type": "string"
+ },
+ "role": {
+ "description": "Business role of this binding or reference.",
+ "enum": [
+ "reference",
+ "first_frame",
+ "last_frame",
+ "continuation"
+ ],
+ "title": "Role",
+ "type": "string"
+ },
+ "asset": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Immutable asset version."
+ },
+ "metadata": {
+ "$ref": "#/$defs/MediaMetadata",
+ "description": "Verified media properties."
+ },
+ "sourceVersion": {
"anyOf": [
{
- "$ref": "#/$defs/SubjectLibrarySource"
+ "$ref": "#/$defs/ObjectVersion"
},
{
"type": "null"
}
],
"default": null,
- "description": "Immutable source library version."
+ "description": "Captured source object version."
+ },
+ "documentVersion": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Version of the source editable document."
+ },
+ "subjectRole": {
+ "anyOf": [
+ {
+ "enum": [
+ "main",
+ "auxiliary",
+ "voice"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Subject media slot used by this reference.",
+ "title": "Subjectrole"
+ },
+ "name": {
+ "default": "",
+ "description": "User-visible name.",
+ "maxLength": 255,
+ "title": "Name",
+ "type": "string"
+ },
+ "sourceTitle": {
+ "default": "",
+ "description": "Source canvas title captured for this reference.",
+ "maxLength": 255,
+ "title": "Sourcetitle",
+ "type": "string"
+ },
+ "transmission": {
+ "default": "content",
+ "description": "How reference content is sent to the provider.",
+ "enum": [
+ "content",
+ "metadata",
+ "context_only",
+ "latent"
+ ],
+ "title": "Transmission",
+ "type": "string"
}
},
- "title": "SubjectData",
+ "required": [
+ "referenceId",
+ "role",
+ "asset",
+ "metadata"
+ ],
+ "title": "ResolvedReference",
"type": "object"
},
- "SubjectDocument": {
+ "ResultCheck": {
"additionalProperties": false,
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
- "format": "uuid",
- "title": "Id",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ "status": {
+ "description": "Current operation lifecycle state.",
+ "enum": [
+ "passed",
+ "failed"
+ ],
+ "title": "Status",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "schemaVersion": {
- "const": 1,
- "default": 1,
- "description": "Record schema version.",
- "title": "Schemaversion",
- "type": "integer"
- },
- "inputConnections": {
- "default": [],
- "description": "Persisted connections to source assets.",
- "items": {
- "$ref": "#/$defs/EditorInputConnection"
- },
- "title": "Inputconnections",
- "type": "array"
+ "facts": {
+ "additionalProperties": true,
+ "description": "Observed technical validation facts.",
+ "title": "Facts",
+ "type": "object"
},
- "kind": {
- "const": "subject",
- "description": "Business object or media type.",
- "title": "Kind",
+ "message": {
+ "description": "Human-readable issue description.",
+ "title": "Message",
"type": "string"
},
- "data": {
- "$ref": "#/$defs/SubjectData",
- "description": "Typed editable document contents."
+ "humanReviewRequired": {
+ "default": true,
+ "description": "Whether creative quality still requires human review.",
+ "title": "Humanreviewrequired",
+ "type": "boolean"
}
},
"required": [
- "id",
- "projectId",
- "kind",
- "data"
+ "status",
+ "message"
],
- "title": "SubjectDocument",
+ "title": "ResultCheck",
"type": "object"
},
- "SubjectLibrarySource": {
+ "ResultSelect": {
"additionalProperties": false,
- "description": "Frozen import provenance; subsequent editing never follows the library.",
"properties": {
- "itemId": {
- "description": "Canvas item ID.",
+ "specId": {
+ "description": "Generation configuration ID.",
"format": "uuid",
- "title": "Itemid",
+ "title": "Specid",
"type": "string"
},
- "revision": {
- "description": "Captured library item revision.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "importId": {
- "description": "Library import ID.",
+ "resultId": {
+ "description": "Generation result ID.",
"format": "uuid",
- "title": "Importid",
+ "title": "Resultid",
"type": "string"
}
},
"required": [
- "itemId",
- "revision",
- "importId"
+ "specId",
+ "resultId"
],
- "title": "SubjectLibrarySource",
+ "title": "ResultSelect",
"type": "object"
},
- "TextCanvasItem": {
+ "ResultSelectCommand": {
"additionalProperties": false,
+ "description": "Adopt an existing generation result.",
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
"format": "uuid",
- "title": "Id",
+ "title": "Commandid",
"type": "string"
},
"projectId": {
@@ -11851,66 +12285,25 @@
"title": "Projectid",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "kind": {
- "const": "text",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
- },
- "title": {
- "default": "",
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
+ "type": {
+ "const": "result.select",
+ "description": "Command discriminator.",
+ "title": "Type",
"type": "string"
},
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
- },
- "width": {
- "default": 352,
- "description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "title": "Width",
- "type": "number"
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
},
- "height": {
- "default": 198,
- "description": "Height in pixels.",
- "exclusiveMinimum": 0,
- "title": "Height",
- "type": "number"
- },
- "zIndex": {
- "default": 0,
- "description": "Canvas stacking order.",
- "title": "Zindex",
- "type": "integer"
- },
- "locked": {
- "default": false,
- "description": "Whether edits to this object are blocked.",
- "title": "Locked",
- "type": "boolean"
- },
- "visible": {
- "default": true,
- "description": "Whether this object is displayed.",
- "title": "Visible",
- "type": "boolean"
- },
- "parentId": {
+ "expectedPreview": {
"anyOf": [
{
- "format": "uuid",
+ "pattern": "^[0-9a-f]{64}$",
"type": "string"
},
{
@@ -11918,100 +12311,46 @@
}
],
"default": null,
- "description": "Parent canvas group ID, or null for the root.",
- "title": "Parentid"
- },
- "tags": {
- "default": [],
- "description": "User-defined search tags.",
- "items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "type": "string"
- },
- "title": "Tags",
- "type": "array"
- },
- "binding": {
- "description": "Business object displayed by this canvas item.",
- "discriminator": {
- "mapping": {
- "empty": "#/$defs/EmptyBinding",
- "generation": "#/$defs/GenerationBinding",
- "material": "#/$defs/MaterialBinding"
- },
- "propertyName": "role"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/EmptyBinding"
- },
- {
- "$ref": "#/$defs/MaterialBinding"
- },
- {
- "$ref": "#/$defs/GenerationBinding"
- }
- ],
- "title": "Binding"
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "editors": {
- "default": [],
- "description": "Attached editable documents.",
- "items": {
- "$ref": "#/$defs/EditorRef"
- },
- "title": "Editors",
- "type": "array"
+ "payload": {
+ "$ref": "#/$defs/ResultSelect",
+ "description": "Adopt an existing generation result."
}
},
"required": [
- "id",
+ "commandId",
"projectId",
- "kind",
- "binding"
+ "type",
+ "payload"
],
- "title": "TextCanvasItem",
+ "title": "ResultSelectCommand",
"type": "object"
},
- "TextExecution": {
+ "ResultSelectCommandOperation": {
"additionalProperties": false,
+ "description": "Adopt an existing generation result.",
"properties": {
- "thinking": {
- "default": "auto",
- "description": "Requested reasoning effort.",
- "enum": [
- "auto",
- "low",
- "medium",
- "high"
- ],
- "title": "Thinking",
+ "type": {
+ "const": "result.select",
+ "description": "Operation discriminator.",
+ "title": "Type",
"type": "string"
},
- "maxTokens": {
- "default": 8192,
- "description": "Maximum generated text tokens.",
- "maximum": 32768,
- "minimum": 1,
- "title": "Maxtokens",
- "type": "integer"
- },
- "kind": {
- "const": "text",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
+ "payload": {
+ "$ref": "#/$defs/ResultSelect",
+ "description": "Adopt an existing generation result."
}
},
"required": [
- "kind"
+ "type",
+ "payload"
],
- "title": "TextExecution",
+ "title": "ResultSelectCommandOperation",
"type": "object"
},
- "TextGenerationSpec": {
+ "ResultVersion": {
"additionalProperties": false,
"properties": {
"id": {
@@ -12033,188 +12372,83 @@
"title": "Revision",
"type": "integer"
},
- "purpose": {
- "default": "draft",
- "description": "Draft settings or executable generation configuration.",
- "enum": [
- "draft",
- "generation"
- ],
- "title": "Purpose",
+ "specId": {
+ "description": "Generation configuration ID.",
+ "format": "uuid",
+ "title": "Specid",
"type": "string"
},
- "modelConfigId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Model configuration ID from the model catalog or user model selections.",
- "title": "Modelconfigid"
- },
- "prompt": {
- "default": "",
- "description": "Generation prompt text.",
- "maxLength": 20000,
- "title": "Prompt",
+ "jobId": {
+ "description": "Generation job ID.",
+ "format": "uuid",
+ "title": "Jobid",
"type": "string"
},
- "promptContent": {
- "anyOf": [
- {
- "items": {
- "discriminator": {
- "mapping": {
- "reference": "#/$defs/PromptReference",
- "text": "#/$defs/PromptText"
- },
- "propertyName": "type"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/PromptText"
- },
- {
- "$ref": "#/$defs/PromptReference"
- }
- ]
- },
- "type": "array"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Structured prompt text and reference tokens.",
- "title": "Promptcontent"
- },
- "currentResultId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Currently adopted result ID.",
- "title": "Currentresultid"
+ "asset": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Immutable asset version."
},
- "kind": {
- "const": "text",
- "description": "Business object or media type.",
- "title": "Kind",
+ "inputFingerprint": {
+ "description": "Fingerprint of the fixed execution input.",
+ "pattern": "^[0-9a-f]{64}$",
+ "title": "Inputfingerprint",
"type": "string"
- },
- "parameters": {
- "$ref": "#/$defs/TextParameters",
- "description": "Typed generation or editing parameters."
}
},
"required": [
"id",
"projectId",
- "kind"
+ "specId",
+ "jobId",
+ "asset",
+ "inputFingerprint"
],
- "title": "TextGenerationSpec",
+ "title": "ResultVersion",
"type": "object"
},
- "TextLayerContent": {
+ "SelectionBox": {
"additionalProperties": false,
"properties": {
+ "x": {
+ "description": "Horizontal coordinate.",
+ "title": "X",
+ "type": "number"
+ },
+ "y": {
+ "description": "Vertical coordinate.",
+ "title": "Y",
+ "type": "number"
+ },
"width": {
"description": "Width in pixels.",
- "maximum": 8192,
- "minimum": 1,
+ "exclusiveMinimum": 0,
"title": "Width",
- "type": "integer"
+ "type": "number"
},
"height": {
"description": "Height in pixels.",
- "maximum": 8192,
- "minimum": 1,
+ "exclusiveMinimum": 0,
"title": "Height",
- "type": "integer"
- },
- "kind": {
- "const": "text",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
- },
- "text": {
- "description": "UTF-8 text content or search query.",
- "maxLength": 10000,
- "title": "Text",
- "type": "string"
- },
- "color": {
- "description": "Serialized display color.",
- "pattern": "^#[0-9a-fA-F]{6}$",
- "title": "Color",
- "type": "string"
- },
- "fontSize": {
- "description": "Text size in pixels.",
- "maximum": 1000,
- "minimum": 4,
- "title": "Fontsize",
"type": "number"
}
},
"required": [
+ "x",
+ "y",
"width",
- "height",
- "kind",
- "text",
- "color",
- "fontSize"
+ "height"
],
- "title": "TextLayerContent",
- "type": "object"
- },
- "TextParameters": {
- "additionalProperties": false,
- "properties": {
- "thinking": {
- "default": "auto",
- "description": "Requested reasoning effort.",
- "enum": [
- "auto",
- "low",
- "medium",
- "high"
- ],
- "title": "Thinking",
- "type": "string"
- },
- "maxTokens": {
- "default": 8192,
- "description": "Maximum generated text tokens.",
- "maximum": 32768,
- "minimum": 1,
- "title": "Maxtokens",
- "type": "integer"
- }
- },
- "title": "TextParameters",
+ "title": "SelectionBox",
"type": "object"
},
- "TimelineCanvasItem": {
+ "SpecCreateCommand": {
"additionalProperties": false,
+ "description": "Create a generation configuration without submitting a job.",
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
"format": "uuid",
- "title": "Id",
+ "title": "Commandid",
"type": "string"
},
"projectId": {
@@ -12223,66 +12457,25 @@
"title": "Projectid",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "kind": {
- "const": "timeline",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
- },
- "title": {
- "default": "",
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
+ "type": {
+ "const": "generationSpec.create",
+ "description": "Command discriminator.",
+ "title": "Type",
"type": "string"
},
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
- },
- "width": {
- "default": 352,
- "description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "title": "Width",
- "type": "number"
- },
- "height": {
- "default": 198,
- "description": "Height in pixels.",
- "exclusiveMinimum": 0,
- "title": "Height",
- "type": "number"
- },
- "zIndex": {
- "default": 0,
- "description": "Canvas stacking order.",
- "title": "Zindex",
- "type": "integer"
- },
- "locked": {
- "default": false,
- "description": "Whether edits to this object are blocked.",
- "title": "Locked",
- "type": "boolean"
- },
- "visible": {
- "default": true,
- "description": "Whether this object is displayed.",
- "title": "Visible",
- "type": "boolean"
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
},
- "parentId": {
+ "expectedPreview": {
"anyOf": [
{
- "format": "uuid",
+ "pattern": "^[0-9a-f]{64}$",
"type": "string"
},
{
@@ -12290,183 +12483,220 @@
}
],
"default": null,
- "description": "Parent canvas group ID, or null for the root.",
- "title": "Parentid"
- },
- "tags": {
- "default": [],
- "description": "User-defined search tags.",
- "items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "type": "string"
- },
- "title": "Tags",
- "type": "array"
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "binding": {
- "$ref": "#/$defs/EditorBinding",
- "description": "Business object displayed by this canvas item."
+ "payload": {
+ "$ref": "#/$defs/SpecWrite",
+ "description": "Create a generation configuration without submitting a job."
}
},
"required": [
- "id",
+ "commandId",
"projectId",
- "kind",
- "binding"
+ "type",
+ "payload"
],
- "title": "TimelineCanvasItem",
+ "title": "SpecCreateCommand",
"type": "object"
},
- "TimelineClip": {
+ "SpecCreateCommandOperation": {
"additionalProperties": false,
+ "description": "Create a generation configuration without submitting a job.",
"properties": {
- "id": {
- "description": "Stable object ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Id",
+ "type": {
+ "const": "generationSpec.create",
+ "description": "Operation discriminator.",
+ "title": "Type",
"type": "string"
},
- "resource": {
- "$ref": "#/$defs/TimelineResource",
- "description": "Clip source from the imported asset collection."
+ "payload": {
+ "$ref": "#/$defs/SpecWrite",
+ "description": "Create a generation configuration without submitting a job."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "SpecCreateCommandOperation",
+ "type": "object"
+ },
+ "SpecPromptCommand": {
+ "additionalProperties": false,
+ "description": "Update prompt text and structured references.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
},
- "start": {
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "generationSpec.setPrompt",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
"anyOf": [
{
- "minimum": 0,
- "type": "number"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Start time in seconds.",
- "title": "Start"
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "inPoint": {
- "description": "Source trim start in seconds.",
- "minimum": 0,
- "title": "Inpoint",
- "type": "number"
+ "payload": {
+ "$ref": "#/$defs/SpecPromptWrite",
+ "description": "Update prompt text and structured references."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "payload"
+ ],
+ "title": "SpecPromptCommand",
+ "type": "object"
+ },
+ "SpecPromptCommandOperation": {
+ "additionalProperties": false,
+ "description": "Update prompt text and structured references.",
+ "properties": {
+ "type": {
+ "const": "generationSpec.setPrompt",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
},
- "outPoint": {
- "description": "Source trim end in seconds.",
- "exclusiveMinimum": 0,
- "title": "Outpoint",
- "type": "number"
- },
- "speed": {
- "default": 1,
- "description": "Playback or motion speed multiplier.",
- "exclusiveMinimum": 0,
- "title": "Speed",
- "type": "number"
- },
- "volume": {
- "default": 1,
- "description": "Linear audio gain.",
- "maximum": 1,
- "minimum": 0,
- "title": "Volume",
- "type": "number"
- },
- "muted": {
- "default": false,
- "description": "Whether audio output is muted.",
- "title": "Muted",
- "type": "boolean"
+ "payload": {
+ "$ref": "#/$defs/SpecPromptWrite",
+ "description": "Update prompt text and structured references."
}
},
"required": [
- "id",
- "resource",
- "inPoint",
- "outPoint"
+ "type",
+ "payload"
],
- "title": "TimelineClip",
+ "title": "SpecPromptCommandOperation",
"type": "object"
},
- "TimelineData": {
+ "SpecPromptWrite": {
"additionalProperties": false,
"properties": {
- "fps": {
- "description": "Frames per second.",
- "minimum": 1,
- "title": "Fps",
- "type": "integer"
- },
- "width": {
- "description": "Width in pixels.",
- "minimum": 1,
- "title": "Width",
- "type": "integer"
- },
- "height": {
- "description": "Height in pixels.",
- "minimum": 1,
- "title": "Height",
- "type": "integer"
+ "specId": {
+ "description": "Generation configuration ID.",
+ "format": "uuid",
+ "title": "Specid",
+ "type": "string"
},
- "tracks": {
- "description": "Ordered timeline tracks.",
- "items": {
- "$ref": "#/$defs/TimelineTrack"
- },
- "minItems": 1,
- "title": "Tracks",
- "type": "array"
+ "prompt": {
+ "description": "Generation prompt text.",
+ "maxLength": 20000,
+ "title": "Prompt",
+ "type": "string"
},
- "importedAssets": {
- "default": [],
- "description": "Source assets available to timeline clips.",
- "items": {
- "$ref": "#/$defs/TimelineResource"
- },
- "title": "Importedassets",
- "type": "array"
+ "promptContent": {
+ "anyOf": [
+ {
+ "items": {
+ "discriminator": {
+ "mapping": {
+ "reference": "#/$defs/PromptReference",
+ "text": "#/$defs/PromptText"
+ },
+ "propertyName": "type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/PromptText"
+ },
+ {
+ "$ref": "#/$defs/PromptReference"
+ }
+ ]
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Structured prompt text and reference tokens.",
+ "title": "Promptcontent"
+ }
+ },
+ "required": [
+ "specId",
+ "prompt"
+ ],
+ "title": "SpecPromptWrite",
+ "type": "object"
+ },
+ "SpecRestore": {
+ "additionalProperties": false,
+ "properties": {
+ "specId": {
+ "description": "Generation configuration ID.",
+ "format": "uuid",
+ "title": "Specid",
+ "type": "string"
},
- "fonts": {
- "default": [],
- "description": "Document-local registered font resources; omitted when empty.",
- "items": {
- "$ref": "#/$defs/TimelineFontResource"
- },
- "maxItems": 16,
- "title": "Fonts",
- "type": "array"
+ "commandId": {
+ "description": "Historical command providing the settings to restore.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
},
- "overlays": {
- "default": [],
- "description": "Timed text ordered from bottom to top; omitted when empty.",
- "items": {
- "$ref": "#/$defs/TimelineTextOverlay"
- },
- "maxItems": 2000,
- "title": "Overlays",
- "type": "array"
+ "referencePolicy": {
+ "default": "follow_current",
+ "description": "Policy for restoring associated reference bindings.",
+ "enum": [
+ "follow_current",
+ "pinned"
+ ],
+ "title": "Referencepolicy",
+ "type": "string"
}
},
"required": [
- "fps",
- "width",
- "height",
- "tracks"
+ "specId",
+ "commandId"
],
- "title": "TimelineData",
+ "title": "SpecRestore",
"type": "object"
},
- "TimelineDocument": {
+ "SpecRestoreCommand": {
"additionalProperties": false,
+ "description": "Restore generation settings from a historical command.",
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
"format": "uuid",
- "title": "Id",
+ "title": "Commandid",
"type": "string"
},
"projectId": {
@@ -12475,219 +12705,242 @@
"title": "Projectid",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "schemaVersion": {
- "const": 1,
- "default": 1,
- "description": "Record schema version.",
- "title": "Schemaversion",
- "type": "integer"
+ "type": {
+ "const": "generationSpec.restore",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
},
- "inputConnections": {
+ "expectedVersions": {
"default": [],
- "description": "Persisted connections to source assets.",
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
"items": {
- "$ref": "#/$defs/EditorInputConnection"
+ "$ref": "#/$defs/ObjectVersion"
},
- "title": "Inputconnections",
+ "title": "Expectedversions",
"type": "array"
},
- "kind": {
- "const": "timeline",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "data": {
- "$ref": "#/$defs/TimelineData",
- "description": "Typed editable document contents."
+ "payload": {
+ "$ref": "#/$defs/SpecRestore",
+ "description": "Restore generation settings from a historical command."
}
},
"required": [
- "id",
+ "commandId",
"projectId",
- "kind",
- "data"
+ "type",
+ "payload"
],
- "title": "TimelineDocument",
+ "title": "SpecRestoreCommand",
"type": "object"
},
- "TimelineFontResource": {
+ "SpecUpdateCommand": {
"additionalProperties": false,
+ "description": "Replace the complete generation configuration; preserve unedited fields and use the current version. Jobs are unchanged.",
"properties": {
- "id": {
- "description": "Stable document-local font ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Id",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
"type": "string"
},
- "title": {
- "description": "Display title of the font.",
- "maxLength": 255,
- "title": "Title",
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
"type": "string"
},
- "asset": {
- "$ref": "#/$defs/AssetRef",
- "description": "Immutable registered font asset version."
+ "type": {
+ "const": "generationSpec.update",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/SpecWrite",
+ "description": "Replace the complete generation configuration; preserve unedited fields and use the current version. Jobs are unchanged."
}
},
"required": [
- "id",
- "title",
- "asset"
+ "commandId",
+ "projectId",
+ "type",
+ "payload"
],
- "title": "TimelineFontResource",
+ "title": "SpecUpdateCommand",
"type": "object"
},
- "TimelinePackageExportFile": {
+ "SpecUpdateCommandOperation": {
"additionalProperties": false,
+ "description": "Replace the complete generation configuration; preserve unedited fields and use the current version. Jobs are unchanged.",
"properties": {
- "editorId": {
- "description": "Saved timeline ID in the active project.",
- "format": "uuid",
- "title": "Editorid",
+ "type": {
+ "const": "generationSpec.update",
+ "description": "Operation discriminator.",
+ "title": "Type",
"type": "string"
},
- "revision": {
- "description": "Exact saved revision to export.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "path": {
- "description": "New output file under the active execution directory.",
- "maxLength": 4096,
- "minLength": 1,
- "title": "Path",
- "type": "string"
+ "payload": {
+ "$ref": "#/$defs/SpecWrite",
+ "description": "Replace the complete generation configuration; preserve unedited fields and use the current version. Jobs are unchanged."
}
},
"required": [
- "editorId",
- "revision",
- "path"
+ "type",
+ "payload"
],
- "title": "TimelinePackageExportFile",
+ "title": "SpecUpdateCommandOperation",
"type": "object"
},
- "TimelinePackageImportFile": {
+ "SpecWrite": {
"additionalProperties": false,
"properties": {
- "operationId": {
- "description": "Stable import operation identity.",
- "format": "uuid",
- "title": "Operationid",
- "type": "string"
- },
- "archiveFingerprint": {
- "description": "Expected SHA-256 of archive bytes.",
- "pattern": "^sha256:[0-9a-f]{64}$",
- "title": "Archivefingerprint",
- "type": "string"
- },
- "path": {
- "description": "Existing bundle under the active execution directory.",
- "maxLength": 4096,
- "minLength": 1,
- "title": "Path",
- "type": "string"
- },
- "replaceEditorId": {
- "anyOf": [
+ "spec": {
+ "description": "Complete configuration with its current revision; the server increments it on commit. For updates, read the current spec, preserve unedited fields and submit its current expected version. Accepted job snapshots never change.",
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioGenerationSpec",
+ "image": "#/$defs/ImageGenerationSpec",
+ "text": "#/$defs/TextGenerationSpec",
+ "video": "#/$defs/VideoGenerationSpec"
+ },
+ "propertyName": "kind"
+ },
+ "oneOf": [
{
- "format": "uuid",
- "type": "string"
+ "$ref": "#/$defs/TextGenerationSpec"
},
{
- "type": "null"
- }
- ],
- "default": null,
- "description": "Explicit replacement target.",
- "title": "Replaceeditorid"
- },
- "expectedRevision": {
- "anyOf": [
+ "$ref": "#/$defs/ImageGenerationSpec"
+ },
{
- "minimum": 1,
- "type": "integer"
+ "$ref": "#/$defs/VideoGenerationSpec"
},
{
- "type": "null"
+ "$ref": "#/$defs/AudioGenerationSpec"
}
],
- "default": null,
- "description": "Expected replacement revision.",
- "title": "Expectedrevision"
+ "title": "Spec"
}
},
"required": [
- "operationId",
- "archiveFingerprint",
- "path"
+ "spec"
],
- "title": "TimelinePackageImportFile",
+ "title": "SpecWrite",
"type": "object"
},
- "TimelinePackageImportReceipt": {
+ "StackCanvasItem": {
"additionalProperties": false,
"properties": {
- "operationId": {
- "description": "Import identity.",
+ "id": {
+ "description": "Stable identity of this project-owned object.",
"format": "uuid",
- "title": "Operationid",
+ "title": "Id",
"type": "string"
},
- "status": {
- "description": "Partial registration, complete publication, or terminal rejection.",
- "enum": [
- "registered",
- "applied",
- "rejected"
- ],
- "title": "Status",
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
"type": "string"
},
- "editorId": {
- "description": "Stable destination document ID.",
- "format": "uuid",
- "title": "Editorid",
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "kind": {
+ "const": "stack",
+ "description": "Business object or media type.",
+ "title": "Kind",
"type": "string"
},
- "registeredAssetIds": {
- "default": [],
- "description": "Resources actually committed before final publication.",
- "items": {
- "format": "uuid",
- "type": "string"
- },
- "title": "Registeredassetids",
- "type": "array"
+ "title": {
+ "default": "",
+ "description": "User-visible title.",
+ "maxLength": 255,
+ "title": "Title",
+ "type": "string"
},
- "receipt": {
- "anyOf": [
- {
- "$ref": "#/$defs/CommandReceipt"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Final atomic business command receipt, when committed."
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
},
- "errorCode": {
+ "width": {
+ "default": 352,
+ "description": "Width in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Width",
+ "type": "number"
+ },
+ "height": {
+ "default": 198,
+ "description": "Height in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Height",
+ "type": "number"
+ },
+ "zIndex": {
+ "default": 0,
+ "description": "Canvas stacking order.",
+ "title": "Zindex",
+ "type": "integer"
+ },
+ "locked": {
+ "default": false,
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
+ "type": "boolean"
+ },
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
+ },
+ "parentId": {
"anyOf": [
{
+ "format": "uuid",
"type": "string"
},
{
@@ -12695,553 +12948,537 @@
}
],
"default": null,
- "description": "Stable failure code for retryable registration failure.",
- "title": "Errorcode"
- }
- },
- "required": [
- "operationId",
- "status",
- "editorId"
- ],
- "title": "TimelinePackageImportReceipt",
- "type": "object"
- },
- "TimelinePackageImportRequest": {
- "additionalProperties": false,
- "properties": {
- "operationId": {
- "description": "Stable identity for this entire import and all retries.",
- "format": "uuid",
- "title": "Operationid",
- "type": "string"
- },
- "uploadHandle": {
- "description": "Project/session-owned staged ZIP upload.",
- "format": "uuid",
- "title": "Uploadhandle",
- "type": "string"
- },
- "archiveFingerprint": {
- "description": "Fixed archive bytes for recovery and replay.",
- "pattern": "^sha256:[0-9a-f]{64}$",
- "title": "Archivefingerprint",
- "type": "string"
+ "description": "Parent canvas group ID, or null for the root.",
+ "title": "Parentid"
},
- "replaceEditorId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Explicit replacement target; omitted creates a timeline.",
- "title": "Replaceeditorid"
+ "tags": {
+ "default": [],
+ "description": "User-defined search tags.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Tags",
+ "type": "array"
},
- "expectedRevision": {
- "anyOf": [
- {
- "minimum": 1,
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Required original revision for replacement.",
- "title": "Expectedrevision"
+ "binding": {
+ "$ref": "#/$defs/EditorBinding",
+ "description": "Business object displayed by this canvas item."
}
},
"required": [
- "operationId",
- "uploadHandle",
- "archiveFingerprint"
+ "id",
+ "projectId",
+ "kind",
+ "binding"
],
- "title": "TimelinePackageImportRequest",
+ "title": "StackCanvasItem",
"type": "object"
},
- "TimelinePackageManifest": {
+ "StackData": {
"additionalProperties": false,
"properties": {
- "format": {
- "const": "opendirector-timeline-bundle",
- "default": "opendirector-timeline-bundle",
- "description": "Native bundle format.",
- "title": "Format",
- "type": "string"
- },
- "version": {
- "const": 1,
- "default": 1,
- "description": "Native bundle format version.",
- "title": "Version",
- "type": "integer"
- },
- "requiredCapabilities": {
+ "nodeIds": {
"default": [],
- "description": "Required editable document capabilities.",
+ "description": "Ordered member canvas item IDs.",
"items": {
- "const": "timeline.text.v1",
+ "format": "uuid",
"type": "string"
},
- "maxItems": 1,
- "title": "Requiredcapabilities",
+ "title": "Nodeids",
"type": "array"
},
- "resources": {
- "description": "Distinct logical resources; paths may share identical bytes.",
- "items": {
- "$ref": "#/$defs/TimelinePackageResource"
- },
- "maxItems": 4093,
- "title": "Resources",
- "type": "array"
+ "activeIndex": {
+ "default": 0,
+ "description": "Index of the active member.",
+ "minimum": 0,
+ "title": "Activeindex",
+ "type": "integer"
}
},
- "required": [
- "resources"
- ],
- "title": "TimelinePackageManifest",
+ "title": "StackData",
"type": "object"
},
- "TimelinePackageResource": {
+ "StackDocument": {
"additionalProperties": false,
"properties": {
- "source": {
- "$ref": "#/$defs/AssetRef",
- "description": "Original logical reference; only a package mapping key."
- },
- "name": {
- "description": "Original resource filename.",
- "maxLength": 255,
- "minLength": 1,
- "title": "Name",
- "type": "string"
- },
- "path": {
- "description": "Content-addressed archive member.",
- "pattern": "^assets/[0-9a-f]{64}\\.[a-z0-9]{1,10}$",
- "title": "Path",
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
"type": "string"
},
- "kind": {
- "description": "Verified media kind.",
- "enum": [
- "text",
- "image",
- "video",
- "audio",
- "file"
- ],
- "title": "Kind",
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
"type": "string"
},
- "mimeType": {
- "description": "Verified MIME type.",
- "maxLength": 255,
- "minLength": 1,
- "title": "Mimetype",
- "type": "string"
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
},
- "size": {
- "description": "Actual resource byte count.",
- "maximum": 536870912,
- "minimum": 0,
- "title": "Size",
+ "schemaVersion": {
+ "const": 1,
+ "default": 1,
+ "description": "Record schema version.",
+ "title": "Schemaversion",
"type": "integer"
},
- "fingerprint": {
- "description": "SHA-256 identity of resource bytes.",
- "pattern": "^sha256:[0-9a-f]{64}$",
- "title": "Fingerprint",
+ "inputConnections": {
+ "default": [],
+ "description": "Persisted connections to source assets.",
+ "items": {
+ "$ref": "#/$defs/EditorInputConnection"
+ },
+ "title": "Inputconnections",
+ "type": "array"
+ },
+ "kind": {
+ "const": "stack",
+ "description": "Business object or media type.",
+ "title": "Kind",
"type": "string"
+ },
+ "data": {
+ "$ref": "#/$defs/StackData",
+ "description": "Typed editable document contents."
}
},
"required": [
- "source",
- "name",
- "path",
+ "id",
+ "projectId",
"kind",
- "mimeType",
- "size",
- "fingerprint"
+ "data"
],
- "title": "TimelinePackageResource",
+ "title": "StackDocument",
"type": "object"
},
- "TimelinePublishRender": {
+ "StageBezierTransition": {
"additionalProperties": false,
"properties": {
- "itemId": {
- "description": "Canvas item ID.",
- "format": "uuid",
- "title": "Itemid",
- "type": "string"
- },
- "editorId": {
- "description": "Editable document ID.",
- "format": "uuid",
- "title": "Editorid",
- "type": "string"
- },
- "asset": {
- "$ref": "#/$defs/AssetRef",
- "description": "Immutable asset version."
- },
- "outputId": {
- "description": "Published canvas output ID.",
- "format": "uuid",
- "title": "Outputid",
+ "kind": {
+ "const": "bezier",
+ "description": "Cubic Bezier interpolation for the outgoing segment.",
+ "title": "Kind",
"type": "string"
},
- "expectedOutputRevision": {
- "anyOf": [
+ "controlPoints": {
+ "description": "Normalized x1, y1, x2 and y2 control points.",
+ "maxItems": 4,
+ "minItems": 4,
+ "prefixItems": [
{
- "minimum": 1,
- "type": "integer"
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
},
{
- "type": "null"
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ },
+ {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ },
+ {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
}
],
- "default": null,
- "description": "Current output node revision when appending a rendered version.",
- "title": "Expectedoutputrevision"
- },
- "title": {
- "default": "合成视频",
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
- "type": "string"
- },
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
+ "title": "Controlpoints",
+ "type": "array"
}
},
"required": [
- "itemId",
- "editorId",
- "asset",
- "outputId"
+ "kind",
+ "controlPoints"
],
- "title": "TimelinePublishRender",
+ "title": "StageBezierTransition",
"type": "object"
},
- "TimelinePublishRenderCommand": {
+ "StageCamera": {
"additionalProperties": false,
- "description": "Publish a rendered timeline result.",
+ "examples": [
+ {
+ "fov": 45,
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 1
+ },
+ "roll": 0,
+ "target": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ }
+ }
+ ],
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
- },
- "type": {
- "const": "timeline.publishRender",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
+ "position": {
+ "$ref": "#/$defs/Vector3",
+ "description": "Position in the owning canvas or stage."
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
+ "target": {
+ "$ref": "#/$defs/Vector3",
+ "description": "Camera look-at position."
},
- "expectedPreview": {
- "anyOf": [
- {
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "fov": {
+ "description": "Camera vertical field of view in degrees.",
+ "exclusiveMaximum": 180,
+ "exclusiveMinimum": 0,
+ "title": "Fov",
+ "type": "number"
},
- "payload": {
- "$ref": "#/$defs/TimelinePublishRender",
- "description": "Publish a rendered timeline result."
+ "roll": {
+ "default": 0.0,
+ "description": "Roll around the view axis in radians.",
+ "maximum": 3.141592653589793,
+ "minimum": -3.141592653589793,
+ "title": "Roll",
+ "type": "number"
}
},
"required": [
- "commandId",
- "projectId",
- "type",
- "payload"
+ "position",
+ "target",
+ "fov"
],
- "title": "TimelinePublishRenderCommand",
+ "title": "StageCamera",
"type": "object"
},
- "TimelineResource": {
+ "StageEnvironment": {
"additionalProperties": false,
+ "description": "The named environment used by the retained Director scene.",
"properties": {
- "asset": {
- "$ref": "#/$defs/AssetRef",
- "description": "Immutable asset version."
+ "preset": {
+ "default": "studio",
+ "description": "Environment preset reference. 环境预设引用。",
+ "enum": [
+ "studio",
+ "warm-sunset",
+ "moonlit"
+ ],
+ "title": "Preset",
+ "type": "string"
},
- "title": {
- "description": "Display title of the imported asset.",
- "maxLength": 255,
- "title": "Title",
+ "groundColor": {
+ "default": "#181818",
+ "description": "Ground plane color. 地面颜色。",
+ "examples": [
+ "#000000"
+ ],
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "title": "Groundcolor",
"type": "string"
},
- "durationSeconds": {
+ "groundVisible": {
+ "default": true,
+ "description": "Whether the ground plane is visible. 是否显示地面。",
+ "title": "Groundvisible",
+ "type": "boolean"
+ },
+ "exposure": {
+ "default": 1.0,
+ "description": "Scene exposure from zero to four. 场景曝光范围为 0 到 4。",
+ "maximum": 4,
+ "minimum": 0,
+ "title": "Exposure",
+ "type": "number"
+ },
+ "backgroundAsset": {
"anyOf": [
{
- "exclusiveMinimum": 0,
- "type": "number"
+ "$ref": "#/$defs/AssetRef"
},
{
"type": "null"
}
],
"default": null,
- "description": "Duration in seconds.",
- "title": "Durationseconds"
+ "description": "Optional registered image asset used as the stage background. 可选的已登记图片背景素材。"
}
},
- "required": [
- "asset",
- "title"
- ],
- "title": "TimelineResource",
+ "title": "StageEnvironment",
"type": "object"
},
- "TimelineTextBackground": {
+ "StageLight": {
"additionalProperties": false,
"properties": {
+ "id": {
+ "description": "Stable light role. 稳定灯光角色。",
+ "enum": [
+ "hemisphere",
+ "key",
+ "fill"
+ ],
+ "title": "Id",
+ "type": "string"
+ },
"color": {
- "description": "Background color in #RRGGBB format.",
+ "description": "Light color in #RRGGBB format. 灯光颜色。",
+ "examples": [
+ "#000000"
+ ],
"pattern": "^#[0-9a-fA-F]{6}$",
"title": "Color",
"type": "string"
},
- "opacity": {
- "description": "Background opacity.",
- "maximum": 1,
+ "intensity": {
+ "description": "Light intensity from zero to ten. 灯光强度范围为 0 到 10。",
+ "maximum": 10,
"minimum": 0,
- "title": "Opacity",
+ "title": "Intensity",
"type": "number"
},
- "padding": {
- "description": "Background padding in output pixels.",
- "maximum": 128,
- "minimum": 0,
- "title": "Padding",
- "type": "number"
+ "position": {
+ "$ref": "#/$defs/Vector3",
+ "description": "Light position in stage coordinates. 灯光在舞台坐标中的位置。"
+ },
+ "castShadow": {
+ "default": false,
+ "description": "Whether the light casts shadows. 是否投射阴影。",
+ "title": "Castshadow",
+ "type": "boolean"
}
},
"required": [
+ "id",
"color",
- "opacity",
- "padding"
+ "intensity",
+ "position"
],
- "title": "TimelineTextBackground",
+ "title": "StageLight",
"type": "object"
},
- "TimelineTextOverlay": {
+ "StageMotion": {
"additionalProperties": false,
"properties": {
- "id": {
- "description": "Stable document-local text ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Id",
+ "preset": {
+ "description": "Selected generation or motion preset.",
+ "enum": [
+ "idle",
+ "walk",
+ "run",
+ "wave"
+ ],
+ "title": "Preset",
"type": "string"
},
- "start": {
- "description": "Absolute start time in seconds.",
- "minimum": 0,
- "title": "Start",
- "type": "number"
- },
- "end": {
- "description": "Exclusive absolute end time in seconds.",
+ "speed": {
+ "description": "Playback or motion speed multiplier.",
"exclusiveMinimum": 0,
- "title": "End",
- "type": "number"
- },
- "text": {
- "description": "Plain text normalized to LF, counted in Unicode code points.",
- "maxLength": 4096,
- "minLength": 1,
- "title": "Text",
- "type": "string"
- },
- "x": {
- "description": "Normalized text box left position.",
- "maximum": 1,
- "minimum": 0,
- "title": "X",
+ "title": "Speed",
"type": "number"
},
- "y": {
- "description": "Normalized text box top position.",
+ "amount": {
+ "description": "Magnitude of the procedural motion.",
"maximum": 1,
"minimum": 0,
- "title": "Y",
- "type": "number"
- },
- "maxWidth": {
- "description": "Text box width as a fraction of output width.",
- "exclusiveMinimum": 0,
- "maximum": 1,
- "title": "Maxwidth",
+ "title": "Amount",
"type": "number"
- },
- "fontId": {
- "description": "Font resource ID in this document.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Fontid",
- "type": "string"
- },
- "style": {
- "$ref": "#/$defs/TimelineTextStyle",
- "description": "Output-space text styling."
- },
- "sourceAsset": {
- "anyOf": [
- {
- "$ref": "#/$defs/AssetRef"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Frozen source text asset, independent of subsequent edits."
}
},
"required": [
- "id",
- "start",
- "end",
- "text",
- "x",
- "y",
- "maxWidth",
- "fontId",
- "style"
+ "preset",
+ "speed",
+ "amount"
],
- "title": "TimelineTextOverlay",
+ "title": "StageMotion",
"type": "object"
},
- "TimelineTextStroke": {
+ "StageObject": {
"additionalProperties": false,
"properties": {
- "color": {
- "description": "Stroke color in #RRGGBB format.",
- "pattern": "^#[0-9a-fA-F]{6}$",
- "title": "Color",
+ "position": {
+ "$ref": "#/$defs/Vector3",
+ "description": "Position in the owning canvas or stage."
+ },
+ "rotation": {
+ "$ref": "#/$defs/Vector3",
+ "description": "Rotation in radians around each stage axis."
+ },
+ "scale": {
+ "$ref": "#/$defs/Vector3",
+ "description": "Positive scale along each stage axis."
+ },
+ "id": {
+ "description": "Stable object ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
"type": "string"
},
- "width": {
- "description": "Stroke width in output pixels.",
- "maximum": 32,
- "minimum": 0,
- "title": "Width",
- "type": "number"
- }
- },
- "required": [
- "color",
- "width"
- ],
- "title": "TimelineTextStroke",
- "type": "object"
- },
- "TimelineTextStyle": {
- "additionalProperties": false,
- "properties": {
- "fontSize": {
- "description": "Font size in output pixels.",
- "maximum": 512,
- "minimum": 1,
- "title": "Fontsize",
- "type": "number"
+ "kind": {
+ "description": "Business object or media type.",
+ "enum": [
+ "person",
+ "box",
+ "sphere",
+ "gltf",
+ "cylinder",
+ "cone",
+ "pyramid",
+ "torus",
+ "plane",
+ "capsule",
+ "disk",
+ "arc",
+ "halfCylinder"
+ ],
+ "title": "Kind",
+ "type": "string"
+ },
+ "name": {
+ "description": "User-visible name.",
+ "maxLength": 255,
+ "title": "Name",
+ "type": "string"
},
"color": {
- "description": "Text color in #RRGGBB format.",
+ "description": "Serialized display color.",
+ "examples": [
+ "#000000"
+ ],
"pattern": "^#[0-9a-fA-F]{6}$",
"title": "Color",
"type": "string"
},
- "align": {
- "description": "Horizontal text alignment.",
- "enum": [
- "left",
- "center",
- "right"
- ],
- "title": "Align",
- "type": "string"
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
},
- "lineHeight": {
- "description": "Line height as a font size multiplier.",
- "maximum": 3,
- "minimum": 0.8,
- "title": "Lineheight",
+ "locked": {
+ "default": false,
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
+ "type": "boolean"
+ },
+ "opacity": {
+ "default": 1,
+ "description": "Layer opacity from zero to one.",
+ "maximum": 1,
+ "minimum": 0,
+ "title": "Opacity",
"type": "number"
},
- "background": {
+ "keyframes": {
+ "default": [],
+ "description": "Ordered animation keyframes.",
+ "items": {
+ "$ref": "#/$defs/TransformFrame"
+ },
+ "title": "Keyframes",
+ "type": "array"
+ },
+ "motionClips": {
+ "default": [],
+ "description": "Ordered procedural motion intervals.",
+ "items": {
+ "$ref": "#/$defs/MotionClip"
+ },
+ "title": "Motionclips",
+ "type": "array"
+ },
+ "asset": {
"anyOf": [
{
- "$ref": "#/$defs/TimelineTextBackground"
+ "$ref": "#/$defs/AssetRef"
},
{
"type": "null"
}
],
"default": null,
- "description": "Optional text background."
+ "description": "Registered GLB or self-contained GLTF asset for an imported stage object."
},
- "stroke": {
+ "thumbnailAsset": {
"anyOf": [
{
- "$ref": "#/$defs/TimelineTextStroke"
+ "$ref": "#/$defs/AssetRef"
},
{
"type": "null"
}
],
"default": null,
- "description": "Optional text stroke."
+ "description": "Registered image asset used by the stage object card thumbnail."
+ },
+ "role": {
+ "anyOf": [
+ {
+ "enum": [
+ "character",
+ "scene"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Imported stage object role.",
+ "title": "Role"
+ },
+ "format": {
+ "anyOf": [
+ {
+ "enum": [
+ "glb",
+ "gltf"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Imported stage asset container format.",
+ "title": "Format"
+ },
+ "animationNames": {
+ "default": [],
+ "description": "Animation clip names discovered in the imported asset.",
+ "items": {
+ "type": "string"
+ },
+ "title": "Animationnames",
+ "type": "array"
+ },
+ "hasAnimation": {
+ "default": false,
+ "description": "Whether the imported asset contains animation clips.",
+ "title": "Hasanimation",
+ "type": "boolean"
}
},
"required": [
- "fontSize",
- "color",
- "align",
- "lineHeight"
+ "position",
+ "rotation",
+ "scale",
+ "id",
+ "kind",
+ "name",
+ "color"
],
- "title": "TimelineTextStyle",
+ "title": "StageObject",
"type": "object"
},
- "TimelineTrack": {
+ "StageShot": {
"additionalProperties": false,
"properties": {
"id": {
@@ -13252,46 +13489,104 @@
"title": "Id",
"type": "string"
},
- "kind": {
- "description": "Business object or media type.",
- "enum": [
- "visual",
- "audio"
- ],
- "title": "Kind",
- "type": "string"
- },
- "title": {
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
+ "cameraId": {
+ "description": "Stage camera ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Cameraid",
"type": "string"
},
- "muted": {
- "default": false,
- "description": "Whether audio output is muted.",
- "title": "Muted",
- "type": "boolean"
+ "start": {
+ "description": "Start time in seconds.",
+ "minimum": 0,
+ "title": "Start",
+ "type": "number"
},
- "clips": {
- "default": [],
- "description": "Ordered clips on this track.",
- "items": {
- "$ref": "#/$defs/TimelineClip"
- },
- "title": "Clips",
- "type": "array"
+ "duration": {
+ "description": "Interval duration in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Duration",
+ "type": "number"
}
},
"required": [
"id",
- "kind",
- "title"
+ "cameraId",
+ "start",
+ "duration"
],
- "title": "TimelineTrack",
+ "title": "StageShot",
"type": "object"
},
- "ToolCanvasItem": {
+ "StageTransform": {
+ "additionalProperties": false,
+ "properties": {
+ "position": {
+ "$ref": "#/$defs/Vector3",
+ "description": "Position in the owning canvas or stage."
+ },
+ "rotation": {
+ "$ref": "#/$defs/Vector3",
+ "description": "Rotation in radians around each stage axis."
+ },
+ "scale": {
+ "$ref": "#/$defs/Vector3",
+ "description": "Positive scale along each stage axis."
+ }
+ },
+ "required": [
+ "position",
+ "rotation",
+ "scale"
+ ],
+ "title": "StageTransform",
+ "type": "object"
+ },
+ "StageTransformTransitions": {
+ "additionalProperties": false,
+ "properties": {
+ "position": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/StageBezierTransition"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Outgoing position interpolation."
+ },
+ "rotation": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/StageBezierTransition"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Outgoing rotation interpolation."
+ },
+ "scale": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/StageBezierTransition"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Outgoing scale interpolation."
+ }
+ },
+ "title": "StageTransformTransitions",
+ "type": "object"
+ },
+ "SubjectCanvasItem": {
"additionalProperties": false,
"properties": {
"id": {
@@ -13314,7 +13609,7 @@
"type": "integer"
},
"kind": {
- "const": "tool",
+ "const": "subject",
"description": "Business object or media type.",
"title": "Kind",
"type": "string"
@@ -13399,64 +13694,77 @@
"kind",
"binding"
],
- "title": "ToolCanvasItem",
+ "title": "SubjectCanvasItem",
"type": "object"
},
- "ToolData": {
+ "SubjectData": {
"additionalProperties": false,
"properties": {
- "kind": {
- "description": "Business object or media type.",
- "enum": [
- "camera",
- "style",
- "palette",
- "camera_motion"
- ],
- "title": "Kind",
+ "description": {
+ "default": "",
+ "description": "User-facing annotation only; not subject media or a generation reference",
+ "maxLength": 20000,
+ "title": "Description",
"type": "string"
},
- "fields": {
+ "category": {
+ "default": "",
+ "description": "Subject category.",
+ "maxLength": 100,
+ "title": "Category",
+ "type": "string"
+ },
+ "main": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AssetRef"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Primary subject media."
+ },
+ "auxiliaries": {
"default": [],
- "description": "Named tool-specific parameter fields.",
+ "description": "Ordered auxiliary subject media.",
"items": {
- "$ref": "#/$defs/ToolField"
+ "$ref": "#/$defs/AssetRef"
},
- "title": "Fields",
+ "maxItems": 3,
+ "title": "Auxiliaries",
"type": "array"
},
- "provenance": {
+ "voice": {
"anyOf": [
{
- "$ref": "#/$defs/PaletteProvenance"
+ "$ref": "#/$defs/AssetRef"
},
{
"type": "null"
}
],
"default": null,
- "description": "Recorded origin and execution context."
+ "description": "Subject voice asset version."
},
- "palette": {
+ "librarySource": {
"anyOf": [
{
- "$ref": "#/$defs/PaletteData"
+ "$ref": "#/$defs/SubjectLibrarySource"
},
{
"type": "null"
}
],
"default": null,
- "description": "Reusable palette data."
+ "description": "Immutable source library version."
}
},
- "required": [
- "kind"
- ],
- "title": "ToolData",
+ "title": "SubjectData",
"type": "object"
},
- "ToolDocument": {
+ "SubjectDocument": {
"additionalProperties": false,
"properties": {
"id": {
@@ -13495,13 +13803,13 @@
"type": "array"
},
"kind": {
- "const": "tool",
+ "const": "subject",
"description": "Business object or media type.",
"title": "Kind",
"type": "string"
},
"data": {
- "$ref": "#/$defs/ToolData",
+ "$ref": "#/$defs/SubjectData",
"description": "Typed editable document contents."
}
},
@@ -13511,156 +13819,220 @@
"kind",
"data"
],
- "title": "ToolDocument",
+ "title": "SubjectDocument",
"type": "object"
},
- "ToolDraftBinding": {
+ "SubjectLibrarySource": {
"additionalProperties": false,
+ "description": "Frozen import provenance; subsequent editing never follows the library.",
"properties": {
- "editorId": {
- "description": "Editable document ID.",
- "format": "uuid",
- "title": "Editorid",
- "type": "string"
- },
- "editorRevision": {
- "description": "Expected editable document revision.",
- "minimum": 1,
- "title": "Editorrevision",
- "type": "integer"
- },
"itemId": {
"description": "Canvas item ID.",
"format": "uuid",
"title": "Itemid",
"type": "string"
},
- "itemRevision": {
- "description": "Expected canvas item revision.",
+ "revision": {
+ "description": "Captured library item revision.",
"minimum": 1,
- "title": "Itemrevision",
+ "title": "Revision",
"type": "integer"
+ },
+ "importId": {
+ "description": "Library import ID.",
+ "format": "uuid",
+ "title": "Importid",
+ "type": "string"
}
},
"required": [
- "editorId",
- "editorRevision",
"itemId",
- "itemRevision"
+ "revision",
+ "importId"
],
- "title": "ToolDraftBinding",
+ "title": "SubjectLibrarySource",
"type": "object"
},
- "ToolField": {
+ "TextCanvasItem": {
"additionalProperties": false,
"properties": {
- "name": {
- "description": "User-visible name.",
- "maxLength": 200,
- "minLength": 1,
- "title": "Name",
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
"type": "string"
},
- "values": {
- "description": "Ordered tool field values.",
- "items": {
- "type": "string"
- },
- "title": "Values",
- "type": "array"
- }
- },
- "required": [
- "name",
- "values"
- ],
- "title": "ToolField",
- "type": "object"
- },
- "ToolSelection": {
- "additionalProperties": false,
- "properties": {
- "source": {
- "$ref": "#/$defs/AssetRef",
- "description": "Input source or recorded provenance."
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "kind": {
+ "const": "text",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "title": {
+ "default": "",
+ "description": "User-visible title.",
+ "maxLength": 255,
+ "title": "Title",
+ "type": "string"
+ },
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
},
"width": {
+ "default": 352,
"description": "Width in pixels.",
- "minimum": 1,
+ "exclusiveMinimum": 0,
"title": "Width",
- "type": "integer"
+ "type": "number"
},
"height": {
+ "default": 198,
"description": "Height in pixels.",
- "minimum": 1,
+ "exclusiveMinimum": 0,
"title": "Height",
+ "type": "number"
+ },
+ "zIndex": {
+ "default": 0,
+ "description": "Canvas stacking order.",
+ "title": "Zindex",
"type": "integer"
},
- "mask": {
+ "locked": {
+ "default": false,
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
+ "type": "boolean"
+ },
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
+ },
+ "parentId": {
"anyOf": [
{
- "$ref": "#/$defs/AssetRef"
+ "format": "uuid",
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Ordered strokes or encoded selection mask."
+ "description": "Parent canvas group ID, or null for the root.",
+ "title": "Parentid"
},
- "boxes": {
+ "tags": {
"default": [],
- "description": "Selection rectangles in source image pixels.",
+ "description": "User-defined search tags.",
"items": {
- "$ref": "#/$defs/SelectionBox"
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
},
- "title": "Boxes",
+ "title": "Tags",
+ "type": "array"
+ },
+ "binding": {
+ "description": "Business object displayed by this canvas item.",
+ "discriminator": {
+ "mapping": {
+ "empty": "#/$defs/EmptyBinding",
+ "generation": "#/$defs/GenerationBinding",
+ "material": "#/$defs/MaterialBinding"
+ },
+ "propertyName": "role"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/EmptyBinding"
+ },
+ {
+ "$ref": "#/$defs/MaterialBinding"
+ },
+ {
+ "$ref": "#/$defs/GenerationBinding"
+ }
+ ],
+ "title": "Binding"
+ },
+ "editors": {
+ "default": [],
+ "description": "Attached editable documents.",
+ "items": {
+ "$ref": "#/$defs/EditorRef"
+ },
+ "title": "Editors",
"type": "array"
}
},
"required": [
- "source",
- "width",
- "height"
+ "id",
+ "projectId",
+ "kind",
+ "binding"
],
- "title": "ToolSelection",
+ "title": "TextCanvasItem",
"type": "object"
},
- "TransformFrame": {
+ "TextExecution": {
"additionalProperties": false,
"properties": {
- "id": {
- "description": "Stable object ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Id",
+ "thinking": {
+ "default": "auto",
+ "description": "Requested reasoning effort.",
+ "enum": [
+ "auto",
+ "low",
+ "medium",
+ "high"
+ ],
+ "title": "Thinking",
"type": "string"
},
- "time": {
- "description": "Keyframe time in seconds.",
- "minimum": 0,
- "title": "Time",
- "type": "number"
+ "maxTokens": {
+ "default": 8192,
+ "description": "Maximum generated text tokens.",
+ "maximum": 32768,
+ "minimum": 1,
+ "title": "Maxtokens",
+ "type": "integer"
},
- "value": {
- "$ref": "#/$defs/StageTransform",
- "description": "Keyframed transform or camera pose."
+ "kind": {
+ "const": "text",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
}
},
"required": [
- "id",
- "time",
- "value"
+ "kind"
],
- "title": "TransformFrame",
+ "title": "TextExecution",
"type": "object"
},
- "UploadInfo": {
+ "TextGenerationSpec": {
"additionalProperties": false,
"properties": {
"id": {
- "description": "Stable object ID.",
+ "description": "Stable identity of this project-owned object.",
"format": "uuid",
"title": "Id",
"type": "string"
@@ -13671,32 +14043,27 @@
"title": "Projectid",
"type": "string"
},
- "name": {
- "description": "User-visible name.",
- "title": "Name",
- "type": "string"
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
},
- "status": {
- "description": "Current operation lifecycle state.",
+ "purpose": {
+ "default": "draft",
+ "description": "Draft settings or executable generation configuration.",
"enum": [
- "uploading",
- "ready",
- "registered",
- "cancelled"
+ "draft",
+ "generation"
],
- "title": "Status",
+ "title": "Purpose",
"type": "string"
},
- "kind": {
+ "modelConfigId": {
"anyOf": [
{
- "enum": [
- "text",
- "image",
- "video",
- "audio",
- "file"
- ],
+ "format": "uuid",
"type": "string"
},
{
@@ -13704,36 +14071,47 @@
}
],
"default": null,
- "description": "Business object or media type.",
- "title": "Kind"
+ "description": "Model configuration ID from the model catalog or user model selections.",
+ "title": "Modelconfigid"
},
- "fingerprint": {
- "anyOf": [
- {
- "pattern": "^sha256:[0-9a-f]{64}$",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Immutable content fingerprint.",
- "title": "Fingerprint"
+ "prompt": {
+ "default": "",
+ "description": "Generation prompt text.",
+ "maxLength": 20000,
+ "title": "Prompt",
+ "type": "string"
},
- "metadata": {
+ "promptContent": {
"anyOf": [
{
- "$ref": "#/$defs/MediaMetadata"
+ "items": {
+ "discriminator": {
+ "mapping": {
+ "reference": "#/$defs/PromptReference",
+ "text": "#/$defs/PromptText"
+ },
+ "propertyName": "type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/PromptText"
+ },
+ {
+ "$ref": "#/$defs/PromptReference"
+ }
+ ]
+ },
+ "type": "array"
},
{
"type": "null"
}
],
"default": null,
- "description": "Verified media properties."
+ "description": "Structured prompt text and reference tokens.",
+ "title": "Promptcontent"
},
- "assetId": {
+ "currentResultId": {
"anyOf": [
{
"format": "uuid",
@@ -13744,87 +14122,113 @@
}
],
"default": null,
- "description": "Asset ID.",
- "title": "Assetid"
+ "description": "Currently adopted result ID.",
+ "title": "Currentresultid"
+ },
+ "kind": {
+ "const": "text",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/$defs/TextParameters",
+ "description": "Typed generation or editing parameters."
}
},
"required": [
"id",
"projectId",
- "name",
- "status"
+ "kind"
],
- "title": "UploadInfo",
+ "title": "TextGenerationSpec",
"type": "object"
},
- "Vector3": {
+ "TextLayerContent": {
"additionalProperties": false,
"properties": {
- "x": {
- "description": "X component in stage coordinates.",
- "title": "X",
- "type": "number"
+ "width": {
+ "description": "Width in pixels.",
+ "maximum": 8192,
+ "minimum": 1,
+ "title": "Width",
+ "type": "integer"
},
- "y": {
- "description": "Y component in stage coordinates.",
- "title": "Y",
- "type": "number"
+ "height": {
+ "description": "Height in pixels.",
+ "maximum": 8192,
+ "minimum": 1,
+ "title": "Height",
+ "type": "integer"
},
- "z": {
- "description": "Z component in stage coordinates.",
- "title": "Z",
+ "kind": {
+ "const": "text",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "text": {
+ "description": "UTF-8 text content or search query.",
+ "maxLength": 10000,
+ "title": "Text",
+ "type": "string"
+ },
+ "color": {
+ "description": "Serialized display color.",
+ "examples": [
+ "#000000"
+ ],
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "title": "Color",
+ "type": "string"
+ },
+ "fontSize": {
+ "description": "Text size in pixels.",
+ "maximum": 1000,
+ "minimum": 4,
+ "title": "Fontsize",
"type": "number"
}
},
"required": [
- "x",
- "y",
- "z"
+ "width",
+ "height",
+ "kind",
+ "text",
+ "color",
+ "fontSize"
],
- "title": "Vector3",
+ "title": "TextLayerContent",
"type": "object"
},
- "VersionsQuery": {
+ "TextParameters": {
"additionalProperties": false,
"properties": {
- "queryId": {
- "description": "Caller-supplied query ID.",
- "format": "uuid",
- "title": "Queryid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
- },
- "type": {
- "description": "Read object versions.",
+ "thinking": {
+ "default": "auto",
+ "description": "Requested reasoning effort.",
"enum": [
- "generationSpec.versions",
- "canvas.versions"
+ "auto",
+ "low",
+ "medium",
+ "high"
],
- "title": "Type",
+ "title": "Thinking",
"type": "string"
},
- "objectId": {
- "description": "Target configuration or canvas item ID.",
- "format": "uuid",
- "title": "Objectid",
- "type": "string"
+ "maxTokens": {
+ "default": 8192,
+ "description": "Maximum generated text tokens.",
+ "maximum": 32768,
+ "minimum": 1,
+ "title": "Maxtokens",
+ "type": "integer"
}
},
- "required": [
- "queryId",
- "projectId",
- "type",
- "objectId"
- ],
- "title": "VersionsQuery",
+ "title": "TextParameters",
"type": "object"
},
- "VideoCanvasItem": {
+ "TimelineCanvasItem": {
"additionalProperties": false,
"properties": {
"id": {
@@ -13847,7 +14251,7 @@
"type": "integer"
},
"kind": {
- "const": "video",
+ "const": "timeline",
"description": "Business object or media type.",
"title": "Kind",
"type": "string"
@@ -13922,137 +14326,305 @@
"type": "array"
},
"binding": {
- "description": "Business object displayed by this canvas item.",
- "discriminator": {
- "mapping": {
- "empty": "#/$defs/EmptyBinding",
- "generation": "#/$defs/GenerationBinding",
- "material": "#/$defs/MaterialBinding"
- },
- "propertyName": "role"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/EmptyBinding"
- },
+ "$ref": "#/$defs/EditorBinding",
+ "description": "Business object displayed by this canvas item."
+ }
+ },
+ "required": [
+ "id",
+ "projectId",
+ "kind",
+ "binding"
+ ],
+ "title": "TimelineCanvasItem",
+ "type": "object"
+ },
+ "TimelineClip": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable object ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
+ "type": "string"
+ },
+ "resource": {
+ "$ref": "#/$defs/TimelineResource",
+ "description": "Clip source from the imported asset collection."
+ },
+ "start": {
+ "anyOf": [
{
- "$ref": "#/$defs/MaterialBinding"
+ "minimum": 0,
+ "type": "number"
},
{
- "$ref": "#/$defs/GenerationBinding"
+ "type": "null"
}
],
- "title": "Binding"
+ "default": null,
+ "description": "Start time in seconds.",
+ "title": "Start"
},
- "editors": {
- "default": [],
- "description": "Attached editable documents.",
- "items": {
- "$ref": "#/$defs/EditorRef"
- },
- "title": "Editors",
- "type": "array"
+ "inPoint": {
+ "description": "Source trim start in seconds.",
+ "minimum": 0,
+ "title": "Inpoint",
+ "type": "number"
+ },
+ "outPoint": {
+ "description": "Source trim end in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Outpoint",
+ "type": "number"
+ },
+ "speed": {
+ "default": 1,
+ "description": "Playback or motion speed multiplier.",
+ "exclusiveMinimum": 0,
+ "title": "Speed",
+ "type": "number"
+ },
+ "volume": {
+ "default": 1,
+ "description": "Linear audio gain.",
+ "maximum": 1,
+ "minimum": 0,
+ "title": "Volume",
+ "type": "number"
+ },
+ "muted": {
+ "default": false,
+ "description": "Whether audio output is muted.",
+ "title": "Muted",
+ "type": "boolean"
}
},
"required": [
"id",
- "projectId",
- "kind",
- "binding"
+ "resource",
+ "inPoint",
+ "outPoint"
],
- "title": "VideoCanvasItem",
+ "title": "TimelineClip",
"type": "object"
},
- "VideoCapabilities": {
+ "TimelineData": {
"additionalProperties": false,
"properties": {
- "outputs": {
- "description": "Supported output resolution and duration combinations.",
+ "fps": {
+ "description": "Frames per second.",
+ "minimum": 1,
+ "title": "Fps",
+ "type": "integer"
+ },
+ "width": {
+ "description": "Width in pixels.",
+ "minimum": 1,
+ "title": "Width",
+ "type": "integer"
+ },
+ "height": {
+ "description": "Height in pixels.",
+ "minimum": 1,
+ "title": "Height",
+ "type": "integer"
+ },
+ "tracks": {
+ "description": "Ordered timeline tracks.",
"items": {
- "$ref": "#/$defs/VideoOutput"
+ "$ref": "#/$defs/TimelineTrack"
},
- "maxItems": 20,
"minItems": 1,
- "title": "Outputs",
+ "title": "Tracks",
"type": "array"
},
- "defaultResolution": {
- "default": "auto",
- "description": "Default output resolution or auto.",
- "title": "Defaultresolution",
+ "importedAssets": {
+ "default": [],
+ "description": "Source assets available to timeline clips.",
+ "items": {
+ "$ref": "#/$defs/TimelineResource"
+ },
+ "title": "Importedassets",
+ "type": "array"
+ },
+ "fonts": {
+ "default": [],
+ "description": "Document-local registered font resources; omitted when empty.",
+ "items": {
+ "$ref": "#/$defs/TimelineFontResource"
+ },
+ "maxItems": 16,
+ "title": "Fonts",
+ "type": "array"
+ },
+ "overlays": {
+ "default": [],
+ "description": "Timed text ordered from bottom to top; omitted when empty.",
+ "items": {
+ "$ref": "#/$defs/TimelineTextOverlay"
+ },
+ "maxItems": 2000,
+ "title": "Overlays",
+ "type": "array"
+ }
+ },
+ "required": [
+ "fps",
+ "width",
+ "height",
+ "tracks"
+ ],
+ "title": "TimelineData",
+ "type": "object"
+ },
+ "TimelineDocument": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
"type": "string"
},
- "defaultDuration": {
- "default": 5,
- "description": "Default output duration in seconds.",
- "maximum": 60,
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
"minimum": 1,
- "title": "Defaultduration",
+ "title": "Revision",
"type": "integer"
},
- "dimensionStep": {
- "default": 2,
- "description": "Required pixel alignment of output dimensions.",
- "enum": [
- 1,
- 2,
- 8,
- 16,
- 32,
- 64
- ],
- "title": "Dimensionstep",
+ "schemaVersion": {
+ "const": 1,
+ "default": 1,
+ "description": "Record schema version.",
+ "title": "Schemaversion",
"type": "integer"
+ },
+ "inputConnections": {
+ "default": [],
+ "description": "Persisted connections to source assets.",
+ "items": {
+ "$ref": "#/$defs/EditorInputConnection"
+ },
+ "title": "Inputconnections",
+ "type": "array"
+ },
+ "kind": {
+ "const": "timeline",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "data": {
+ "$ref": "#/$defs/TimelineData",
+ "description": "Typed editable document contents."
}
},
"required": [
- "outputs"
+ "id",
+ "projectId",
+ "kind",
+ "data"
],
- "title": "VideoCapabilities",
+ "title": "TimelineDocument",
"type": "object"
},
- "VideoExecution": {
+ "TimelineFontResource": {
"additionalProperties": false,
- "description": "Resolved adapter parameters, distinct from user intent and source layout.",
"properties": {
- "kind": {
- "const": "video",
- "description": "Business object or media type.",
- "title": "Kind",
+ "id": {
+ "description": "Stable document-local font ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
"type": "string"
},
- "durationSeconds": {
- "anyOf": [
- {
- "maximum": 60,
- "minimum": 1,
- "type": "number"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Duration in seconds.",
- "title": "Durationseconds"
+ "title": {
+ "description": "Display title of the font.",
+ "maxLength": 255,
+ "title": "Title",
+ "type": "string"
},
- "size": {
- "anyOf": [
- {
- "pattern": "^\\d+x\\d+$",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Effective video dimensions sent to the provider.",
- "title": "Size"
+ "asset": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Immutable registered font asset version."
+ }
+ },
+ "required": [
+ "id",
+ "title",
+ "asset"
+ ],
+ "title": "TimelineFontResource",
+ "type": "object"
+ },
+ "TimelinePackageExportFile": {
+ "additionalProperties": false,
+ "properties": {
+ "editorId": {
+ "description": "Saved timeline ID in the active project.",
+ "format": "uuid",
+ "title": "Editorid",
+ "type": "string"
},
- "resolution": {
+ "revision": {
+ "description": "Exact saved revision to export.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "path": {
+ "description": "New output file under the active execution directory.",
+ "maxLength": 4096,
+ "minLength": 1,
+ "title": "Path",
+ "type": "string"
+ }
+ },
+ "required": [
+ "editorId",
+ "revision",
+ "path"
+ ],
+ "title": "TimelinePackageExportFile",
+ "type": "object"
+ },
+ "TimelinePackageImportFile": {
+ "additionalProperties": false,
+ "properties": {
+ "operationId": {
+ "description": "Stable import operation identity.",
+ "format": "uuid",
+ "title": "Operationid",
+ "type": "string"
+ },
+ "archiveFingerprint": {
+ "description": "Expected SHA-256 of archive bytes.",
+ "pattern": "^sha256:[0-9a-f]{64}$",
+ "title": "Archivefingerprint",
+ "type": "string"
+ },
+ "path": {
+ "description": "Existing bundle under the active execution directory.",
+ "maxLength": 4096,
+ "minLength": 1,
+ "title": "Path",
+ "type": "string"
+ },
+ "replaceEditorId": {
"anyOf": [
{
+ "format": "uuid",
"type": "string"
},
{
@@ -14060,10 +14632,10 @@
}
],
"default": null,
- "description": "Requested output resolution.",
- "title": "Resolution"
+ "description": "Explicit replacement target.",
+ "title": "Replaceeditorid"
},
- "fps": {
+ "expectedRevision": {
"anyOf": [
{
"minimum": 1,
@@ -14074,297 +14646,390 @@
}
],
"default": null,
- "description": "Frames per second.",
- "title": "Fps"
+ "description": "Expected replacement revision.",
+ "title": "Expectedrevision"
+ }
+ },
+ "required": [
+ "operationId",
+ "archiveFingerprint",
+ "path"
+ ],
+ "title": "TimelinePackageImportFile",
+ "type": "object"
+ },
+ "TimelinePackageImportReceipt": {
+ "additionalProperties": false,
+ "properties": {
+ "operationId": {
+ "description": "Import identity.",
+ "format": "uuid",
+ "title": "Operationid",
+ "type": "string"
},
- "numFrames": {
- "anyOf": [
- {
- "minimum": 1,
- "type": "integer"
- },
- {
- "type": "null"
- }
+ "status": {
+ "description": "Partial registration, complete publication, or terminal rejection.",
+ "enum": [
+ "registered",
+ "applied",
+ "rejected"
],
- "default": null,
- "description": "Requested video frame count.",
- "title": "Numframes"
+ "title": "Status",
+ "type": "string"
},
- "numInferenceSteps": {
- "anyOf": [
- {
- "minimum": 1,
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Diffusion sampling step count.",
- "title": "Numinferencesteps"
+ "editorId": {
+ "description": "Stable destination document ID.",
+ "format": "uuid",
+ "title": "Editorid",
+ "type": "string"
},
- "guidanceScale": {
+ "registeredAssetIds": {
+ "default": [],
+ "description": "Resources actually committed before final publication.",
+ "items": {
+ "format": "uuid",
+ "type": "string"
+ },
+ "title": "Registeredassetids",
+ "type": "array"
+ },
+ "receipt": {
"anyOf": [
{
- "minimum": 0,
- "type": "number"
+ "$ref": "#/$defs/CommandReceipt"
},
{
"type": "null"
}
],
"default": null,
- "description": "Diffusion guidance scale.",
- "title": "Guidancescale"
+ "description": "Final atomic business command receipt, when committed."
},
- "seed": {
+ "errorCode": {
"anyOf": [
{
- "type": "integer"
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Random seed, when specified.",
- "title": "Seed"
+ "description": "Stable failure code for retryable registration failure.",
+ "title": "Errorcode"
+ }
+ },
+ "required": [
+ "operationId",
+ "status",
+ "editorId"
+ ],
+ "title": "TimelinePackageImportReceipt",
+ "type": "object"
+ },
+ "TimelinePackageImportRequest": {
+ "additionalProperties": false,
+ "properties": {
+ "operationId": {
+ "description": "Stable identity for this entire import and all retries.",
+ "format": "uuid",
+ "title": "Operationid",
+ "type": "string"
},
- "watermark": {
+ "uploadHandle": {
+ "description": "Project/session-owned staged ZIP upload.",
+ "format": "uuid",
+ "title": "Uploadhandle",
+ "type": "string"
+ },
+ "archiveFingerprint": {
+ "description": "Fixed archive bytes for recovery and replay.",
+ "pattern": "^sha256:[0-9a-f]{64}$",
+ "title": "Archivefingerprint",
+ "type": "string"
+ },
+ "replaceEditorId": {
"anyOf": [
{
- "type": "boolean"
+ "format": "uuid",
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Whether provider watermarking is enabled.",
- "title": "Watermark"
+ "description": "Explicit replacement target; omitted creates a timeline.",
+ "title": "Replaceeditorid"
},
- "generateAudio": {
+ "expectedRevision": {
"anyOf": [
{
- "type": "boolean"
+ "minimum": 1,
+ "type": "integer"
},
{
"type": "null"
}
],
"default": null,
- "description": "Whether video generation includes audio.",
- "title": "Generateaudio"
+ "description": "Required original revision for replacement.",
+ "title": "Expectedrevision"
}
},
"required": [
- "kind"
+ "operationId",
+ "uploadHandle",
+ "archiveFingerprint"
],
- "title": "VideoExecution",
+ "title": "TimelinePackageImportRequest",
"type": "object"
},
- "VideoGenerationSpec": {
+ "TimelinePackageManifest": {
"additionalProperties": false,
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
- "format": "uuid",
- "title": "Id",
+ "format": {
+ "const": "opendirector-timeline-bundle",
+ "default": "opendirector-timeline-bundle",
+ "description": "Native bundle format.",
+ "title": "Format",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
- },
- "revision": {
+ "version": {
+ "const": 1,
"default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
+ "description": "Native bundle format version.",
+ "title": "Version",
"type": "integer"
},
- "purpose": {
- "default": "draft",
- "description": "Draft settings or executable generation configuration.",
+ "requiredCapabilities": {
+ "default": [],
+ "description": "Required editable document capabilities.",
+ "items": {
+ "const": "timeline.text.v1",
+ "type": "string"
+ },
+ "maxItems": 1,
+ "title": "Requiredcapabilities",
+ "type": "array"
+ },
+ "resources": {
+ "description": "Distinct logical resources; paths may share identical bytes.",
+ "items": {
+ "$ref": "#/$defs/TimelinePackageResource"
+ },
+ "maxItems": 4093,
+ "title": "Resources",
+ "type": "array"
+ }
+ },
+ "required": [
+ "resources"
+ ],
+ "title": "TimelinePackageManifest",
+ "type": "object"
+ },
+ "TimelinePackageResource": {
+ "additionalProperties": false,
+ "properties": {
+ "source": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Original logical reference; only a package mapping key."
+ },
+ "name": {
+ "description": "Original resource filename.",
+ "maxLength": 255,
+ "minLength": 1,
+ "title": "Name",
+ "type": "string"
+ },
+ "path": {
+ "description": "Content-addressed archive member.",
+ "pattern": "^assets/[0-9a-f]{64}\\.[a-z0-9]{1,10}$",
+ "title": "Path",
+ "type": "string"
+ },
+ "kind": {
+ "description": "Verified media kind.",
"enum": [
- "draft",
- "generation"
+ "text",
+ "image",
+ "video",
+ "audio",
+ "file"
],
- "title": "Purpose",
+ "title": "Kind",
"type": "string"
},
- "modelConfigId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Model configuration ID from the model catalog or user model selections.",
- "title": "Modelconfigid"
+ "mimeType": {
+ "description": "Verified MIME type.",
+ "maxLength": 255,
+ "minLength": 1,
+ "title": "Mimetype",
+ "type": "string"
},
- "prompt": {
- "default": "",
- "description": "Generation prompt text.",
- "maxLength": 20000,
- "title": "Prompt",
+ "size": {
+ "description": "Actual resource byte count.",
+ "maximum": 536870912,
+ "minimum": 0,
+ "title": "Size",
+ "type": "integer"
+ },
+ "fingerprint": {
+ "description": "SHA-256 identity of resource bytes.",
+ "pattern": "^sha256:[0-9a-f]{64}$",
+ "title": "Fingerprint",
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "name",
+ "path",
+ "kind",
+ "mimeType",
+ "size",
+ "fingerprint"
+ ],
+ "title": "TimelinePackageResource",
+ "type": "object"
+ },
+ "TimelinePublishRender": {
+ "additionalProperties": false,
+ "properties": {
+ "itemId": {
+ "description": "Canvas item ID.",
+ "format": "uuid",
+ "title": "Itemid",
"type": "string"
},
- "promptContent": {
- "anyOf": [
- {
- "items": {
- "discriminator": {
- "mapping": {
- "reference": "#/$defs/PromptReference",
- "text": "#/$defs/PromptText"
- },
- "propertyName": "type"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/PromptText"
- },
- {
- "$ref": "#/$defs/PromptReference"
- }
- ]
- },
- "type": "array"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Structured prompt text and reference tokens.",
- "title": "Promptcontent"
+ "editorId": {
+ "description": "Editable document ID.",
+ "format": "uuid",
+ "title": "Editorid",
+ "type": "string"
},
- "currentResultId": {
+ "asset": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Immutable asset version."
+ },
+ "outputId": {
+ "description": "Published canvas output ID.",
+ "format": "uuid",
+ "title": "Outputid",
+ "type": "string"
+ },
+ "expectedOutputRevision": {
"anyOf": [
{
- "format": "uuid",
- "type": "string"
+ "minimum": 1,
+ "type": "integer"
},
{
"type": "null"
}
],
"default": null,
- "description": "Currently adopted result ID.",
- "title": "Currentresultid"
+ "description": "Current output node revision when appending a rendered version.",
+ "title": "Expectedoutputrevision"
},
- "kind": {
- "const": "video",
- "description": "Business object or media type.",
- "title": "Kind",
+ "title": {
+ "default": "合成视频",
+ "description": "User-visible title.",
+ "maxLength": 255,
+ "title": "Title",
"type": "string"
},
- "parameters": {
- "$ref": "#/$defs/VideoParameters",
- "description": "Typed generation or editing parameters."
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
}
},
"required": [
- "id",
- "projectId",
- "kind"
+ "itemId",
+ "editorId",
+ "asset",
+ "outputId"
],
- "title": "VideoGenerationSpec",
+ "title": "TimelinePublishRender",
"type": "object"
},
- "VideoOutput": {
+ "TimelinePublishRenderCommand": {
"additionalProperties": false,
+ "description": "Publish a rendered timeline result.",
"properties": {
- "resolution": {
- "description": "Requested output resolution.",
- "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,23}$",
- "title": "Resolution",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
"type": "string"
},
- "durations": {
- "description": "Supported output durations in seconds.",
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "timeline.publishRender",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
"items": {
- "maximum": 60,
- "minimum": 1,
- "type": "integer"
+ "$ref": "#/$defs/ObjectVersion"
},
- "maxItems": 60,
- "minItems": 1,
- "title": "Durations",
+ "title": "Expectedversions",
"type": "array"
},
- "width": {
+ "expectedPreview": {
"anyOf": [
{
- "maximum": 8192,
- "minimum": 64,
- "type": "integer"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Width in pixels.",
- "title": "Width"
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "height": {
- "anyOf": [
- {
- "maximum": 8192,
- "minimum": 64,
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Height in pixels.",
- "title": "Height"
+ "payload": {
+ "$ref": "#/$defs/TimelinePublishRender",
+ "description": "Publish a rendered timeline result."
}
},
"required": [
- "resolution",
- "durations"
+ "commandId",
+ "projectId",
+ "type",
+ "payload"
],
- "title": "VideoOutput",
+ "title": "TimelinePublishRenderCommand",
"type": "object"
},
- "VideoParameters": {
+ "TimelineResource": {
"additionalProperties": false,
"properties": {
- "generateAudio": {
- "default": true,
- "description": "Include audio; value must be allowed by model inputRules.generateAudioOptions.",
- "title": "Generateaudio",
- "type": "boolean"
+ "asset": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Immutable asset version."
},
- "videoMode": {
- "default": "first_frame",
- "description": "Video generation input mode.",
- "enum": [
- "first_frame",
- "reference",
- "continuation"
- ],
- "title": "Videomode",
+ "title": {
+ "description": "Display title of the imported asset.",
+ "maxLength": 255,
+ "title": "Title",
"type": "string"
},
"durationSeconds": {
"anyOf": [
{
- "maximum": 60,
- "minimum": 1,
+ "exclusiveMinimum": 0,
"type": "number"
},
{
@@ -14372,946 +15037,1197 @@
}
],
"default": null,
- "description": "Duration in seconds; fractional values require model inputRules.fractionalDuration. Generated frames may be aligned by the model.",
+ "description": "Duration in seconds.",
"title": "Durationseconds"
- },
- "aspectRatio": {
- "anyOf": [
- {
- "pattern": "^[1-9]\\d?:[1-9]\\d?$",
- "type": "string"
- },
- {
- "type": "null"
- }
+ }
+ },
+ "required": [
+ "asset",
+ "title"
+ ],
+ "title": "TimelineResource",
+ "type": "object"
+ },
+ "TimelineTextBackground": {
+ "additionalProperties": false,
+ "properties": {
+ "color": {
+ "description": "Background color in #RRGGBB format.",
+ "examples": [
+ "#000000"
],
- "default": null,
- "description": "Output width-to-height ratio.",
- "title": "Aspectratio"
- },
- "resolution": {
- "default": "auto",
- "description": "Requested output resolution.",
- "pattern": "^(?:auto|[A-Z0-9][A-Z0-9_.-]{0,23})$",
- "title": "Resolution",
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "title": "Color",
"type": "string"
+ },
+ "opacity": {
+ "description": "Background opacity.",
+ "maximum": 1,
+ "minimum": 0,
+ "title": "Opacity",
+ "type": "number"
+ },
+ "padding": {
+ "description": "Background padding in output pixels.",
+ "maximum": 128,
+ "minimum": 0,
+ "title": "Padding",
+ "type": "number"
}
},
- "title": "VideoParameters",
+ "required": [
+ "color",
+ "opacity",
+ "padding"
+ ],
+ "title": "TimelineTextBackground",
"type": "object"
},
- "ViewState": {
+ "TimelineTextOverlay": {
"additionalProperties": false,
"properties": {
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ "id": {
+ "description": "Stable document-local text ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
"type": "string"
},
- "clientId": {
- "description": "Client identity for independent view state.",
- "format": "uuid",
- "title": "Clientid",
+ "start": {
+ "description": "Absolute start time in seconds.",
+ "minimum": 0,
+ "title": "Start",
+ "type": "number"
+ },
+ "end": {
+ "description": "Exclusive absolute end time in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "End",
+ "type": "number"
+ },
+ "text": {
+ "description": "Plain text normalized to LF, counted in Unicode code points.",
+ "maxLength": 4096,
+ "minLength": 1,
+ "title": "Text",
"type": "string"
},
- "viewport": {
- "$ref": "#/$defs/Viewport",
- "description": "Canvas pan and zoom state."
+ "x": {
+ "description": "Normalized text box left position.",
+ "maximum": 1,
+ "minimum": 0,
+ "title": "X",
+ "type": "number"
},
- "selectedItemIds": {
- "default": [],
- "description": "Currently selected canvas item IDs.",
- "items": {
- "format": "uuid",
- "type": "string"
- },
- "title": "Selecteditemids",
- "type": "array"
+ "y": {
+ "description": "Normalized text box top position.",
+ "maximum": 1,
+ "minimum": 0,
+ "title": "Y",
+ "type": "number"
},
- "activeEditorId": {
+ "maxWidth": {
+ "description": "Text box width as a fraction of output width.",
+ "exclusiveMinimum": 0,
+ "maximum": 1,
+ "title": "Maxwidth",
+ "type": "number"
+ },
+ "fontId": {
+ "description": "Font resource ID in this document.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Fontid",
+ "type": "string"
+ },
+ "style": {
+ "$ref": "#/$defs/TimelineTextStyle",
+ "description": "Output-space text styling."
+ },
+ "sourceAsset": {
"anyOf": [
{
- "format": "uuid",
- "type": "string"
+ "$ref": "#/$defs/AssetRef"
},
{
"type": "null"
}
],
"default": null,
- "description": "Currently active editable document ID.",
- "title": "Activeeditorid"
- },
- "playheads": {
- "default": [],
- "description": "Playback positions keyed by editor identity.",
- "items": {
- "$ref": "#/$defs/Playhead"
- },
- "title": "Playheads",
- "type": "array"
- },
- "generationCounts": {
- "additionalProperties": {
- "maximum": 8,
- "minimum": 1,
- "type": "integer"
- },
- "description": "Requested generation counts keyed by canvas item ID.",
- "propertyNames": {
- "format": "uuid"
- },
- "title": "Generationcounts",
- "type": "object"
+ "description": "Frozen source text asset, independent of subsequent edits."
}
},
"required": [
- "projectId",
- "clientId"
+ "id",
+ "start",
+ "end",
+ "text",
+ "x",
+ "y",
+ "maxWidth",
+ "fontId",
+ "style"
],
- "title": "ViewState",
+ "title": "TimelineTextOverlay",
"type": "object"
},
- "Viewport": {
+ "TimelineTextStroke": {
"additionalProperties": false,
"properties": {
- "x": {
- "default": 0,
- "description": "Horizontal coordinate.",
- "title": "X",
- "type": "number"
- },
- "y": {
- "default": 0,
- "description": "Vertical coordinate.",
- "title": "Y",
- "type": "number"
+ "color": {
+ "description": "Stroke color in #RRGGBB format.",
+ "examples": [
+ "#000000"
+ ],
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "title": "Color",
+ "type": "string"
},
- "zoom": {
- "default": 1,
- "description": "Canvas viewport zoom factor.",
- "maximum": 8,
- "minimum": 0.08,
- "title": "Zoom",
+ "width": {
+ "description": "Stroke width in output pixels.",
+ "maximum": 32,
+ "minimum": 0,
+ "title": "Width",
"type": "number"
}
},
- "title": "Viewport",
+ "required": [
+ "color",
+ "width"
+ ],
+ "title": "TimelineTextStroke",
"type": "object"
},
- "VoiceLibraryCapabilities": {
+ "TimelineTextStyle": {
"additionalProperties": false,
"properties": {
- "provider": {
- "description": "Voice registry protocol.",
- "enum": [
- "vllm_omni",
- "moss",
- "minimax",
- "zhipu"
+ "fontSize": {
+ "description": "Font size in output pixels.",
+ "maximum": 512,
+ "minimum": 1,
+ "title": "Fontsize",
+ "type": "number"
+ },
+ "color": {
+ "description": "Text color in #RRGGBB format.",
+ "examples": [
+ "#000000"
],
- "title": "Provider",
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "title": "Color",
"type": "string"
},
- "connectionId": {
- "description": "Opaque service, endpoint and account identity.",
- "maxLength": 200,
- "minLength": 1,
- "title": "Connectionid",
+ "align": {
+ "description": "Horizontal text alignment.",
+ "enum": [
+ "left",
+ "center",
+ "right"
+ ],
+ "title": "Align",
"type": "string"
},
- "requiresTranscript": {
- "description": "Registered voice must have a reference transcript.",
- "title": "Requirestranscript",
- "type": "boolean"
- },
- "acceptsTranscript": {
- "default": false,
- "description": "Registry stores an optional reference transcript when one is supplied.",
- "title": "Acceptstranscript",
- "type": "boolean"
- },
- "requiresReferenceAudio": {
- "description": "Registered voice must have actual reference audio.",
- "title": "Requiresreferenceaudio",
- "type": "boolean"
- },
- "supportsUploadedVoices": {
- "default": true,
- "description": "Selected model checkpoint accepts uploaded registry voices.",
- "title": "Supportsuploadedvoices",
- "type": "boolean"
+ "lineHeight": {
+ "description": "Line height as a font size multiplier.",
+ "maximum": 3,
+ "minimum": 0.8,
+ "title": "Lineheight",
+ "type": "number"
},
- "referenceEmbeddingDimension": {
+ "background": {
"anyOf": [
{
- "maximum": 65536,
- "minimum": 1,
- "type": "integer"
+ "$ref": "#/$defs/TimelineTextBackground"
},
{
"type": "null"
}
],
"default": null,
- "description": "Accepted registered reference embedding dimension; null requires actual reference audio when required.",
- "title": "Referenceembeddingdimension"
- },
- "canDelete": {
- "description": "Provider supports uploaded voice deletion.",
- "title": "Candelete",
- "type": "boolean"
- },
- "maxBytes": {
- "description": "Maximum audio sample bytes.",
- "minimum": 1,
- "title": "Maxbytes",
- "type": "integer"
- },
- "formats": {
- "description": "Supported recording file extensions.",
- "items": {
- "type": "string"
- },
- "title": "Formats",
- "type": "array"
- },
- "minSeconds": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ],
- "description": "Minimum recording duration, if documented.",
- "title": "Minseconds"
+ "description": "Optional text background."
},
- "maxSeconds": {
+ "stroke": {
"anyOf": [
{
- "type": "number"
+ "$ref": "#/$defs/TimelineTextStroke"
},
{
"type": "null"
}
],
- "description": "Maximum recording duration, if documented.",
- "title": "Maxseconds"
+ "default": null,
+ "description": "Optional text stroke."
}
},
"required": [
- "provider",
- "connectionId",
- "requiresTranscript",
- "requiresReferenceAudio",
- "canDelete",
- "maxBytes",
- "formats",
- "minSeconds",
- "maxSeconds"
+ "fontSize",
+ "color",
+ "align",
+ "lineHeight"
],
- "title": "VoiceLibraryCapabilities",
+ "title": "TimelineTextStyle",
"type": "object"
},
- "VoiceSelection": {
+ "TimelineTrack": {
"additionalProperties": false,
"properties": {
- "connectionId": {
- "description": "Opaque voice service identity.",
- "maxLength": 200,
+ "id": {
+ "description": "Stable object ID.",
+ "maxLength": 100,
"minLength": 1,
- "title": "Connectionid",
+ "pattern": "\\S",
+ "title": "Id",
"type": "string"
},
- "voiceId": {
- "description": "Provider voice identity.",
- "maxLength": 200,
- "minLength": 1,
- "pattern": "^[^/\\\\\\x00-\\x1f\\x7f]+$",
- "title": "Voiceid",
+ "kind": {
+ "description": "Business object or media type.",
+ "enum": [
+ "visual",
+ "audio"
+ ],
+ "title": "Kind",
"type": "string"
},
- "name": {
- "description": "Readable provider voice name.",
+ "title": {
+ "description": "User-visible title.",
"maxLength": 255,
- "minLength": 1,
- "title": "Name",
- "type": "string"
- },
- "source": {
- "description": "Provider voice source; used to check checkpoint compatibility.",
- "enum": [
- "builtin",
- "uploaded"
- ],
- "title": "Source",
+ "title": "Title",
"type": "string"
},
- "hasReferenceAudio": {
- "description": "Provider reports a registered reference recording.",
- "title": "Hasreferenceaudio",
+ "muted": {
+ "default": false,
+ "description": "Whether audio output is muted.",
+ "title": "Muted",
"type": "boolean"
},
- "embeddingDim": {
- "anyOf": [
- {
- "maximum": 65536,
- "minimum": 1,
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Registered reference embedding dimension, when the provider reports one.",
- "title": "Embeddingdim"
- },
- "refText": {
- "anyOf": [
- {
- "maxLength": 100000,
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Provider reference transcript, when available.",
- "title": "Reftext"
+ "clips": {
+ "default": [],
+ "description": "Ordered clips on this track.",
+ "items": {
+ "$ref": "#/$defs/TimelineClip"
+ },
+ "title": "Clips",
+ "type": "array"
}
},
"required": [
- "connectionId",
- "voiceId",
- "name",
- "source",
- "hasReferenceAudio"
+ "id",
+ "kind",
+ "title"
],
- "title": "VoiceSelection",
+ "title": "TimelineTrack",
"type": "object"
- }
- },
- "additionalProperties": false,
- "properties": {
- "project": {
- "$ref": "#/$defs/ProjectSnapshot",
- "description": "Authoritative project snapshot schema."
},
- "canvasItem": {
- "description": "Canvas item schema.",
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioCanvasItem",
- "external": "#/$defs/DirectorCanvasItem",
- "file": "#/$defs/FileCanvasItem",
- "group": "#/$defs/GroupCanvasItem",
- "image": "#/$defs/ImageCanvasItem",
- "stack": "#/$defs/StackCanvasItem",
- "subject": "#/$defs/SubjectCanvasItem",
- "text": "#/$defs/TextCanvasItem",
- "timeline": "#/$defs/TimelineCanvasItem",
- "tool": "#/$defs/ToolCanvasItem",
- "video": "#/$defs/VideoCanvasItem"
+ "ToolCanvasItem": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
},
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TextCanvasItem"
- },
- {
- "$ref": "#/$defs/ImageCanvasItem"
- },
- {
- "$ref": "#/$defs/VideoCanvasItem"
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
},
- {
- "$ref": "#/$defs/AudioCanvasItem"
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
},
- {
- "$ref": "#/$defs/FileCanvasItem"
+ "kind": {
+ "const": "tool",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
},
- {
- "$ref": "#/$defs/SubjectCanvasItem"
+ "title": {
+ "default": "",
+ "description": "User-visible title.",
+ "maxLength": 255,
+ "title": "Title",
+ "type": "string"
},
- {
- "$ref": "#/$defs/TimelineCanvasItem"
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
},
- {
- "$ref": "#/$defs/StackCanvasItem"
+ "width": {
+ "default": 352,
+ "description": "Width in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Width",
+ "type": "number"
},
- {
- "$ref": "#/$defs/ToolCanvasItem"
+ "height": {
+ "default": 198,
+ "description": "Height in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Height",
+ "type": "number"
},
- {
- "$ref": "#/$defs/DirectorCanvasItem"
+ "zIndex": {
+ "default": 0,
+ "description": "Canvas stacking order.",
+ "title": "Zindex",
+ "type": "integer"
},
- {
- "$ref": "#/$defs/GroupCanvasItem"
- }
- ],
- "title": "Canvasitem"
- },
- "generationSpec": {
- "description": "Generation configuration schema.",
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioGenerationSpec",
- "image": "#/$defs/ImageGenerationSpec",
- "text": "#/$defs/TextGenerationSpec",
- "video": "#/$defs/VideoGenerationSpec"
+ "locked": {
+ "default": false,
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
+ "type": "boolean"
},
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TextGenerationSpec"
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
},
- {
- "$ref": "#/$defs/ImageGenerationSpec"
+ "parentId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Parent canvas group ID, or null for the root.",
+ "title": "Parentid"
},
- {
- "$ref": "#/$defs/VideoGenerationSpec"
+ "tags": {
+ "default": [],
+ "description": "User-defined search tags.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Tags",
+ "type": "array"
},
- {
- "$ref": "#/$defs/AudioGenerationSpec"
+ "binding": {
+ "$ref": "#/$defs/EditorBinding",
+ "description": "Business object displayed by this canvas item."
}
+ },
+ "required": [
+ "id",
+ "projectId",
+ "kind",
+ "binding"
],
- "title": "Generationspec"
+ "title": "ToolCanvasItem",
+ "type": "object"
},
- "reference": {
- "description": "Generation reference to create or update.",
- "discriminator": {
- "mapping": {
- "follow_current": "#/$defs/FollowingReference",
- "pinned": "#/$defs/PinnedReference"
+ "ToolData": {
+ "additionalProperties": false,
+ "properties": {
+ "kind": {
+ "description": "Business object or media type.",
+ "enum": [
+ "camera",
+ "style",
+ "palette",
+ "camera_motion"
+ ],
+ "title": "Kind",
+ "type": "string"
},
- "propertyName": "binding"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/PinnedReference"
+ "fields": {
+ "default": [],
+ "description": "Named tool-specific parameter fields.",
+ "items": {
+ "$ref": "#/$defs/ToolField"
+ },
+ "title": "Fields",
+ "type": "array"
},
- {
- "$ref": "#/$defs/FollowingReference"
+ "provenance": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PaletteProvenance"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Recorded origin and execution context."
+ },
+ "palette": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PaletteData"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Reusable palette data."
}
+ },
+ "required": [
+ "kind"
],
- "title": "Reference"
+ "title": "ToolData",
+ "type": "object"
},
- "editorDocument": {
- "description": "Editable document schema.",
- "discriminator": {
- "mapping": {
- "director": "#/$defs/DirectorDocument",
- "image_crop": "#/$defs/ImageCropDocument",
- "layers": "#/$defs/LayerDocument",
- "media_edit": "#/$defs/MediaEditDocument",
- "stack": "#/$defs/StackDocument",
- "subject": "#/$defs/SubjectDocument",
- "timeline": "#/$defs/TimelineDocument",
- "tool": "#/$defs/ToolDocument"
+ "ToolDocument": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
},
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TimelineDocument"
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
},
- {
- "$ref": "#/$defs/SubjectDocument"
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
},
- {
- "$ref": "#/$defs/LayerDocument"
+ "schemaVersion": {
+ "const": 1,
+ "default": 1,
+ "description": "Record schema version.",
+ "title": "Schemaversion",
+ "type": "integer"
},
- {
- "$ref": "#/$defs/ImageCropDocument"
+ "inputConnections": {
+ "default": [],
+ "description": "Persisted connections to source assets.",
+ "items": {
+ "$ref": "#/$defs/EditorInputConnection"
+ },
+ "title": "Inputconnections",
+ "type": "array"
},
- {
- "$ref": "#/$defs/StackDocument"
+ "kind": {
+ "const": "tool",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
},
- {
- "$ref": "#/$defs/ToolDocument"
+ "data": {
+ "$ref": "#/$defs/ToolData",
+ "description": "Typed editable document contents."
+ }
+ },
+ "required": [
+ "id",
+ "projectId",
+ "kind",
+ "data"
+ ],
+ "title": "ToolDocument",
+ "type": "object"
+ },
+ "ToolDraftBinding": {
+ "additionalProperties": false,
+ "properties": {
+ "editorId": {
+ "description": "Editable document ID.",
+ "format": "uuid",
+ "title": "Editorid",
+ "type": "string"
},
- {
- "$ref": "#/$defs/DirectorDocument"
+ "editorRevision": {
+ "description": "Expected editable document revision.",
+ "minimum": 1,
+ "title": "Editorrevision",
+ "type": "integer"
},
- {
- "$ref": "#/$defs/MediaEditDocument"
+ "itemId": {
+ "description": "Canvas item ID.",
+ "format": "uuid",
+ "title": "Itemid",
+ "type": "string"
+ },
+ "itemRevision": {
+ "description": "Expected canvas item revision.",
+ "minimum": 1,
+ "title": "Itemrevision",
+ "type": "integer"
}
+ },
+ "required": [
+ "editorId",
+ "editorRevision",
+ "itemId",
+ "itemRevision"
],
- "title": "Editordocument"
+ "title": "ToolDraftBinding",
+ "type": "object"
},
- "command": {
- "description": "Immutable command recorded in this commit.",
- "discriminator": {
- "mapping": {
- "artifact.publish": "#/$defs/ArtifactPublishCommand",
- "asset.delete": "#/$defs/AssetDeleteCommand",
- "asset.import": "#/$defs/AssetImportCommand",
- "asset.updateMetadata": "#/$defs/AssetMetadataCommand",
- "asset.writeText": "#/$defs/AssetWriteTextCommand",
- "canvas.applyEdit": "#/$defs/CanvasApplyEditCommand",
- "canvas.applyVersion": "#/$defs/NodeVersionApplyCommand",
- "canvas.attachEditor": "#/$defs/CanvasEditorAttachCommand",
- "canvas.configure": "#/$defs/CanvasConfigureCommand",
- "canvas.createGeneration": "#/$defs/CanvasCreateGenerationCommand",
- "canvas.detachEditor": "#/$defs/CanvasEditorDetachCommand",
- "canvas.hide": "#/$defs/CanvasHideCommand",
- "canvas.materialize": "#/$defs/CanvasMaterializeCommand",
- "canvas.move": "#/$defs/CanvasMoveCommand",
- "canvas.publishMedia": "#/$defs/CanvasPublishMediaCommand",
- "canvas.show": "#/$defs/CanvasShowCommand",
- "canvas.update": "#/$defs/CanvasUpdateCommand",
- "creation.batch": "#/$defs/BatchCommand",
- "editor.create": "#/$defs/EditorCreateCommand",
- "editor.save": "#/$defs/EditorSaveCommand",
- "generation.submit": "#/$defs/GenerationSubmitCommand",
- "generationSpec.create": "#/$defs/SpecCreateCommand",
- "generationSpec.restore": "#/$defs/SpecRestoreCommand",
- "generationSpec.setPrompt": "#/$defs/SpecPromptCommand",
- "generationSpec.update": "#/$defs/SpecUpdateCommand",
- "history.redo": "#/$defs/HistoryRedoCommand",
- "history.undo": "#/$defs/HistoryUndoCommand",
- "job.cancel": "#/$defs/JobCancelCommand",
- "job.checkpoint": "#/$defs/JobCheckpointCommand",
- "job.recover": "#/$defs/JobRecoverCommand",
- "project.create": "#/$defs/ProjectCreateCommand",
- "project.rename": "#/$defs/ProjectRenameCommand",
- "project.restore": "#/$defs/ProjectRestoreCommand",
- "project.trash": "#/$defs/ProjectTrashCommand",
- "reference.add": "#/$defs/ReferenceAddCommand",
- "reference.remove": "#/$defs/ReferenceRemoveCommand",
- "reference.restore": "#/$defs/ReferenceRestoreCommand",
- "reference.update": "#/$defs/ReferenceUpdateCommand",
- "result.select": "#/$defs/ResultSelectCommand",
- "timeline.publishRender": "#/$defs/TimelinePublishRenderCommand"
+ "ToolField": {
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "description": "User-visible name.",
+ "maxLength": 200,
+ "minLength": 1,
+ "title": "Name",
+ "type": "string"
},
- "propertyName": "type"
+ "values": {
+ "description": "Ordered tool field values.",
+ "items": {
+ "type": "string"
+ },
+ "title": "Values",
+ "type": "array"
+ }
},
- "oneOf": [
- {
- "$ref": "#/$defs/ProjectCreateCommand"
+ "required": [
+ "name",
+ "values"
+ ],
+ "title": "ToolField",
+ "type": "object"
+ },
+ "ToolSelection": {
+ "additionalProperties": false,
+ "properties": {
+ "source": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Input source or recorded provenance."
},
- {
- "$ref": "#/$defs/ProjectRenameCommand"
+ "width": {
+ "description": "Width in pixels.",
+ "minimum": 1,
+ "title": "Width",
+ "type": "integer"
},
- {
- "$ref": "#/$defs/ProjectTrashCommand"
+ "height": {
+ "description": "Height in pixels.",
+ "minimum": 1,
+ "title": "Height",
+ "type": "integer"
},
- {
- "$ref": "#/$defs/ProjectRestoreCommand"
+ "mask": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AssetRef"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Ordered strokes or encoded selection mask."
},
- {
- "$ref": "#/$defs/AssetImportCommand"
+ "boxes": {
+ "default": [],
+ "description": "Selection rectangles in source image pixels.",
+ "items": {
+ "$ref": "#/$defs/SelectionBox"
+ },
+ "title": "Boxes",
+ "type": "array"
+ }
+ },
+ "required": [
+ "source",
+ "width",
+ "height"
+ ],
+ "title": "ToolSelection",
+ "type": "object"
+ },
+ "TransformFrame": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable object ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
+ "type": "string"
},
- {
- "$ref": "#/$defs/ArtifactPublishCommand"
+ "time": {
+ "description": "Keyframe time in seconds.",
+ "minimum": 0,
+ "title": "Time",
+ "type": "number"
},
- {
- "$ref": "#/$defs/AssetWriteTextCommand"
+ "value": {
+ "$ref": "#/$defs/StageTransform",
+ "description": "Keyframed transform or camera pose."
},
- {
- "$ref": "#/$defs/AssetMetadataCommand"
+ "keyedChannels": {
+ "anyOf": [
+ {
+ "items": {
+ "enum": [
+ "position",
+ "rotation",
+ "scale"
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Transform properties explicitly keyed at this frame.",
+ "title": "Keyedchannels"
},
- {
- "$ref": "#/$defs/AssetDeleteCommand"
+ "transitions": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/StageTransformTransitions"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Per-property interpolation for the outgoing segment."
+ }
+ },
+ "required": [
+ "id",
+ "time",
+ "value"
+ ],
+ "title": "TransformFrame",
+ "type": "object"
+ },
+ "UploadInfo": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable object ID.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
},
- {
- "$ref": "#/$defs/CanvasCreateGenerationCommand"
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
},
- {
- "$ref": "#/$defs/CanvasShowCommand"
- },
- {
- "$ref": "#/$defs/CanvasMoveCommand"
- },
- {
- "$ref": "#/$defs/CanvasUpdateCommand"
- },
- {
- "$ref": "#/$defs/CanvasHideCommand"
+ "name": {
+ "description": "User-visible name.",
+ "title": "Name",
+ "type": "string"
},
- {
- "$ref": "#/$defs/CanvasMaterializeCommand"
+ "status": {
+ "description": "Current operation lifecycle state.",
+ "enum": [
+ "uploading",
+ "ready",
+ "registered",
+ "cancelled"
+ ],
+ "title": "Status",
+ "type": "string"
},
- {
- "$ref": "#/$defs/CanvasApplyEditCommand"
+ "kind": {
+ "anyOf": [
+ {
+ "enum": [
+ "text",
+ "image",
+ "video",
+ "audio",
+ "file"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Business object or media type.",
+ "title": "Kind"
},
- {
- "$ref": "#/$defs/CanvasPublishMediaCommand"
+ "fingerprint": {
+ "anyOf": [
+ {
+ "pattern": "^sha256:[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Immutable content fingerprint.",
+ "title": "Fingerprint"
},
- {
- "$ref": "#/$defs/TimelinePublishRenderCommand"
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/MediaMetadata"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Verified media properties."
},
- {
- "$ref": "#/$defs/NodeVersionApplyCommand"
+ "assetId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Asset ID.",
+ "title": "Assetid"
+ }
+ },
+ "required": [
+ "id",
+ "projectId",
+ "name",
+ "status"
+ ],
+ "title": "UploadInfo",
+ "type": "object"
+ },
+ "Vector3": {
+ "additionalProperties": false,
+ "properties": {
+ "x": {
+ "description": "X component in stage coordinates.",
+ "title": "X",
+ "type": "number"
},
- {
- "$ref": "#/$defs/CanvasConfigureCommand"
+ "y": {
+ "description": "Y component in stage coordinates.",
+ "title": "Y",
+ "type": "number"
},
- {
- "$ref": "#/$defs/CanvasEditorAttachCommand"
+ "z": {
+ "description": "Z component in stage coordinates.",
+ "title": "Z",
+ "type": "number"
+ }
+ },
+ "required": [
+ "x",
+ "y",
+ "z"
+ ],
+ "title": "Vector3",
+ "type": "object"
+ },
+ "VersionsQuery": {
+ "additionalProperties": false,
+ "properties": {
+ "queryId": {
+ "description": "Caller-supplied query ID.",
+ "format": "uuid",
+ "title": "Queryid",
+ "type": "string"
},
- {
- "$ref": "#/$defs/CanvasEditorDetachCommand"
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
},
- {
- "$ref": "#/$defs/SpecCreateCommand"
+ "type": {
+ "description": "Read object versions.",
+ "enum": [
+ "generationSpec.versions",
+ "canvas.versions"
+ ],
+ "title": "Type",
+ "type": "string"
},
- {
- "$ref": "#/$defs/SpecUpdateCommand"
+ "objectId": {
+ "description": "Target configuration or canvas item ID.",
+ "format": "uuid",
+ "title": "Objectid",
+ "type": "string"
+ }
+ },
+ "required": [
+ "queryId",
+ "projectId",
+ "type",
+ "objectId"
+ ],
+ "title": "VersionsQuery",
+ "type": "object"
+ },
+ "VideoCanvasItem": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
},
- {
- "$ref": "#/$defs/SpecRestoreCommand"
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
},
- {
- "$ref": "#/$defs/SpecPromptCommand"
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
},
- {
- "$ref": "#/$defs/ReferenceAddCommand"
+ "kind": {
+ "const": "video",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
},
- {
- "$ref": "#/$defs/ReferenceUpdateCommand"
+ "title": {
+ "default": "",
+ "description": "User-visible title.",
+ "maxLength": 255,
+ "title": "Title",
+ "type": "string"
},
- {
- "$ref": "#/$defs/ReferenceRestoreCommand"
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
},
- {
- "$ref": "#/$defs/ReferenceRemoveCommand"
+ "width": {
+ "default": 352,
+ "description": "Width in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Width",
+ "type": "number"
},
- {
- "$ref": "#/$defs/GenerationSubmitCommand"
+ "height": {
+ "default": 198,
+ "description": "Height in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Height",
+ "type": "number"
},
- {
- "$ref": "#/$defs/JobCancelCommand"
+ "zIndex": {
+ "default": 0,
+ "description": "Canvas stacking order.",
+ "title": "Zindex",
+ "type": "integer"
},
- {
- "$ref": "#/$defs/JobRecoverCommand"
+ "locked": {
+ "default": false,
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
+ "type": "boolean"
},
- {
- "$ref": "#/$defs/JobCheckpointCommand"
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
},
- {
- "$ref": "#/$defs/ResultSelectCommand"
- },
- {
- "$ref": "#/$defs/EditorCreateCommand"
- },
- {
- "$ref": "#/$defs/EditorSaveCommand"
+ "parentId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Parent canvas group ID, or null for the root.",
+ "title": "Parentid"
},
- {
- "$ref": "#/$defs/HistoryUndoCommand"
+ "tags": {
+ "default": [],
+ "description": "User-defined search tags.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Tags",
+ "type": "array"
},
- {
- "$ref": "#/$defs/HistoryRedoCommand"
+ "binding": {
+ "description": "Business object displayed by this canvas item.",
+ "discriminator": {
+ "mapping": {
+ "empty": "#/$defs/EmptyBinding",
+ "generation": "#/$defs/GenerationBinding",
+ "material": "#/$defs/MaterialBinding"
+ },
+ "propertyName": "role"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/EmptyBinding"
+ },
+ {
+ "$ref": "#/$defs/MaterialBinding"
+ },
+ {
+ "$ref": "#/$defs/GenerationBinding"
+ }
+ ],
+ "title": "Binding"
},
- {
- "$ref": "#/$defs/BatchCommand"
+ "editors": {
+ "default": [],
+ "description": "Attached editable documents.",
+ "items": {
+ "$ref": "#/$defs/EditorRef"
+ },
+ "title": "Editors",
+ "type": "array"
}
+ },
+ "required": [
+ "id",
+ "projectId",
+ "kind",
+ "binding"
],
- "title": "Command"
- },
- "receipt": {
- "$ref": "#/$defs/CommandReceipt",
- "description": "Immutable command execution receipt."
+ "title": "VideoCanvasItem",
+ "type": "object"
},
- "query": {
- "description": "Read-only project query.",
- "discriminator": {
- "mapping": {
- "asset.preview": "#/$defs/AssetPreviewQuery",
- "asset.search": "#/$defs/AssetSearchQuery",
- "asset.usage": "#/$defs/AssetUsageQuery",
- "canvas.status": "#/$defs/CanvasStatusQuery",
- "canvas.versions": "#/$defs/VersionsQuery",
- "generationSpec.versions": "#/$defs/VersionsQuery",
- "job.get": "#/$defs/ObjectQuery",
- "object.get": "#/$defs/ObjectQuery",
- "project.get": "#/$defs/ProjectQuery"
- },
- "propertyName": "type"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/ProjectQuery"
- },
- {
- "$ref": "#/$defs/ObjectQuery"
- },
- {
- "$ref": "#/$defs/VersionsQuery"
- },
- {
- "$ref": "#/$defs/AssetSearchQuery"
+ "VideoCapabilities": {
+ "additionalProperties": false,
+ "properties": {
+ "outputs": {
+ "description": "Supported output resolution and duration combinations.",
+ "items": {
+ "$ref": "#/$defs/VideoOutput"
+ },
+ "maxItems": 20,
+ "minItems": 1,
+ "title": "Outputs",
+ "type": "array"
},
- {
- "$ref": "#/$defs/AssetUsageQuery"
+ "defaultResolution": {
+ "default": "auto",
+ "description": "Default output resolution or auto.",
+ "title": "Defaultresolution",
+ "type": "string"
},
- {
- "$ref": "#/$defs/CanvasStatusQuery"
+ "defaultDuration": {
+ "default": 5,
+ "description": "Default output duration in seconds.",
+ "maximum": 60,
+ "minimum": 1,
+ "title": "Defaultduration",
+ "type": "integer"
},
- {
- "$ref": "#/$defs/AssetPreviewQuery"
+ "dimensionStep": {
+ "default": 2,
+ "description": "Required pixel alignment of output dimensions.",
+ "enum": [
+ 1,
+ 2,
+ 8,
+ 16,
+ 32,
+ 64
+ ],
+ "title": "Dimensionstep",
+ "type": "integer"
}
+ },
+ "required": [
+ "outputs"
],
- "title": "Query"
- },
- "event": {
- "$ref": "#/$defs/ProjectEvent",
- "description": "Project change event, if emitted."
- },
- "job": {
- "$ref": "#/$defs/Job",
- "description": "Generation execution record."
- },
- "result": {
- "$ref": "#/$defs/ResultVersion",
- "description": "Generated result schema."
- },
- "snapshot": {
- "$ref": "#/$defs/InputSnapshot",
- "description": "Fixed generation input schema."
+ "title": "VideoCapabilities",
+ "type": "object"
},
- "executionParameters": {
- "description": "Effective provider execution parameter schema.",
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioExecution",
- "image": "#/$defs/ImageExecution",
- "text": "#/$defs/TextExecution",
- "video": "#/$defs/VideoExecution"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TextExecution"
- },
- {
- "$ref": "#/$defs/ImageExecution"
+ "VideoExecution": {
+ "additionalProperties": false,
+ "description": "Resolved adapter parameters, distinct from user intent and source layout.",
+ "properties": {
+ "kind": {
+ "const": "video",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
},
- {
- "$ref": "#/$defs/VideoExecution"
+ "durationSeconds": {
+ "anyOf": [
+ {
+ "maximum": 60,
+ "minimum": 1,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Duration in seconds.",
+ "title": "Durationseconds"
},
- {
- "$ref": "#/$defs/AudioExecution"
- }
- ],
- "title": "Executionparameters"
- },
- "promptPart": {
- "description": "Structured prompt token schema.",
- "discriminator": {
- "mapping": {
- "reference": "#/$defs/PromptReference",
- "text": "#/$defs/PromptText"
+ "size": {
+ "anyOf": [
+ {
+ "pattern": "^\\d+x\\d+$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Effective video dimensions sent to the provider.",
+ "title": "Size"
},
- "propertyName": "type"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/PromptText"
+ "resolution": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Requested output resolution.",
+ "title": "Resolution"
},
- {
- "$ref": "#/$defs/PromptReference"
- }
- ],
- "title": "Promptpart"
- },
- "publicModel": {
- "$ref": "#/$defs/ModelConfigPublic",
- "description": "Public model connection schema."
- },
- "writeModel": {
- "$ref": "#/$defs/ModelConfigWrite",
- "description": "Model configuration input schema."
- },
- "capabilities": {
- "$ref": "#/$defs/NodeCapabilities",
- "description": "Available canvas item operations."
- },
- "viewState": {
- "$ref": "#/$defs/ViewState",
- "description": "Client-specific canvas view state."
- },
- "timelinePackageManifest": {
- "$ref": "#/$defs/TimelinePackageManifest",
- "description": "Native editable timeline bundle manifest."
- },
- "timelinePackageImport": {
- "$ref": "#/$defs/TimelinePackageImportRequest",
- "description": "Recoverable native bundle import request."
- },
- "timelinePackageReceipt": {
- "$ref": "#/$defs/TimelinePackageImportReceipt",
- "description": "Native bundle import progress and final receipt."
- },
- "upload": {
- "$ref": "#/$defs/UploadInfo",
- "description": "Staged upload schema."
- }
- },
- "required": [
- "project",
- "canvasItem",
- "generationSpec",
- "reference",
- "editorDocument",
- "command",
- "receipt",
- "query",
- "event",
- "job",
- "result",
- "snapshot",
- "executionParameters",
- "promptPart",
- "publicModel",
- "writeModel",
- "capabilities",
- "viewState",
- "timelinePackageManifest",
- "timelinePackageImport",
- "timelinePackageReceipt",
- "upload"
- ],
- "title": "CreationContracts",
- "type": "object"
- },
- "output": {
- "$defs": {
- "ArtifactPublish": {
- "additionalProperties": false,
- "description": "Publish a file from a server-owned execution context without generating media.",
- "examples": [
- {
- "name": "片段 01",
- "path": "clips/segment-01.mp4"
- }
- ],
- "properties": {
- "path": {
- "description": "Artifact path relative to the server-owned execution directory.",
- "maxLength": 4096,
- "minLength": 1,
- "title": "Path",
- "type": "string"
- },
- "name": {
- "description": "User-visible name.",
- "maxLength": 255,
- "minLength": 1,
- "title": "Name",
- "type": "string"
- },
- "expectedKind": {
+ "fps": {
"anyOf": [
{
- "enum": [
- "text",
- "image",
- "video",
- "audio",
- "file"
- ],
- "type": "string"
+ "minimum": 1,
+ "type": "integer"
},
{
"type": "null"
}
],
"default": null,
- "description": "Required media kind, when specified.",
- "title": "Expectedkind"
+ "description": "Frames per second.",
+ "title": "Fps"
},
- "sources": {
- "default": [],
- "description": "Ordered source asset versions.",
- "items": {
- "$ref": "#/$defs/AssetRef"
- },
- "maxItems": 100,
- "title": "Sources",
- "type": "array"
- }
- },
- "required": [
- "path",
- "name",
- "expectedKind",
- "sources"
- ],
- "title": "ArtifactPublish",
- "type": "object"
- },
- "ArtifactPublishCommand": {
- "additionalProperties": false,
- "description": "Register an execution file as a project asset.",
- "properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
+ "numFrames": {
+ "anyOf": [
+ {
+ "minimum": 1,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Requested video frame count.",
+ "title": "Numframes"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "numInferenceSteps": {
+ "anyOf": [
+ {
+ "minimum": 1,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Diffusion sampling step count.",
+ "title": "Numinferencesteps"
},
- "type": {
- "const": "artifact.publish",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
+ "guidanceScale": {
+ "anyOf": [
+ {
+ "minimum": 0,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Diffusion guidance scale.",
+ "title": "Guidancescale"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
+ "seed": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Random seed, when specified.",
+ "title": "Seed"
},
- "expectedPreview": {
+ "watermark": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "description": "Whether provider watermarking is enabled.",
+ "title": "Watermark"
},
- "payload": {
- "$ref": "#/$defs/ArtifactPublish",
- "description": "Register an execution file as a project asset."
+ "generateAudio": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Whether video generation includes audio.",
+ "title": "Generateaudio"
}
},
"required": [
- "commandId",
- "projectId",
- "type",
- "expectedVersions",
- "expectedPreview",
- "payload"
+ "kind"
],
- "title": "ArtifactPublishCommand",
+ "title": "VideoExecution",
"type": "object"
},
- "Asset": {
+ "VideoGenerationSpec": {
"additionalProperties": false,
"properties": {
"id": {
@@ -15333,122 +16249,252 @@
"title": "Revision",
"type": "integer"
},
- "kind": {
- "description": "Business object or media type.",
+ "purpose": {
+ "default": "draft",
+ "description": "Draft settings or executable generation configuration.",
"enum": [
- "text",
- "image",
- "video",
- "audio",
- "file"
+ "draft",
+ "generation"
],
- "title": "Kind",
+ "title": "Purpose",
"type": "string"
},
- "name": {
- "description": "User-visible name.",
- "maxLength": 255,
- "minLength": 1,
- "title": "Name",
- "type": "string"
+ "modelConfigId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Model configuration ID from the model catalog or user model selections.",
+ "title": "Modelconfigid"
},
- "fingerprint": {
- "description": "Immutable content fingerprint.",
- "pattern": "^sha256:[0-9a-f]{64}$",
- "title": "Fingerprint",
+ "prompt": {
+ "default": "",
+ "description": "Generation prompt text.",
+ "maxLength": 20000,
+ "title": "Prompt",
"type": "string"
},
- "path": {
- "description": "Immutable asset path relative to the project directory.",
- "title": "Path",
- "type": "string"
+ "promptContent": {
+ "anyOf": [
+ {
+ "items": {
+ "discriminator": {
+ "mapping": {
+ "reference": "#/$defs/PromptReference",
+ "text": "#/$defs/PromptText"
+ },
+ "propertyName": "type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/PromptText"
+ },
+ {
+ "$ref": "#/$defs/PromptReference"
+ }
+ ]
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Structured prompt text and reference tokens.",
+ "title": "Promptcontent"
},
- "metadata": {
- "$ref": "#/$defs/MediaMetadata",
- "description": "Verified media properties."
+ "currentResultId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Currently adopted result ID.",
+ "title": "Currentresultid"
},
- "provenance": {
- "$ref": "#/$defs/AssetProvenance",
- "description": "Recorded origin and execution context."
+ "kind": {
+ "const": "video",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/$defs/VideoParameters",
+ "description": "Typed generation or editing parameters."
}
},
"required": [
"id",
"projectId",
- "revision",
- "kind",
- "name",
- "fingerprint",
- "path",
- "metadata",
- "provenance"
+ "kind"
],
- "title": "Asset",
+ "title": "VideoGenerationSpec",
"type": "object"
},
- "AssetDelete": {
+ "VideoOutput": {
"additionalProperties": false,
"properties": {
- "assetIds": {
- "description": "Target asset IDs.",
+ "resolution": {
+ "description": "Requested output resolution.",
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,23}$",
+ "title": "Resolution",
+ "type": "string"
+ },
+ "durations": {
+ "description": "Supported output durations in seconds.",
"items": {
- "format": "uuid",
- "type": "string"
+ "maximum": 60,
+ "minimum": 1,
+ "type": "integer"
},
- "maxItems": 100,
+ "maxItems": 60,
"minItems": 1,
- "title": "Assetids",
+ "title": "Durations",
"type": "array"
},
- "clearHistory": {
- "default": false,
- "description": "Whether the confirmed deletion also clears dependent history.",
- "title": "Clearhistory",
- "type": "boolean"
+ "width": {
+ "anyOf": [
+ {
+ "maximum": 8192,
+ "minimum": 64,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Width in pixels.",
+ "title": "Width"
+ },
+ "height": {
+ "anyOf": [
+ {
+ "maximum": 8192,
+ "minimum": 64,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Height in pixels.",
+ "title": "Height"
}
},
"required": [
- "assetIds",
- "clearHistory"
+ "resolution",
+ "durations"
],
- "title": "AssetDelete",
+ "title": "VideoOutput",
"type": "object"
},
- "AssetDeleteCommand": {
+ "VideoParameters": {
"additionalProperties": false,
- "description": "Delete assets after an impact preview.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
+ "generateAudio": {
+ "default": true,
+ "description": "Include audio; value must be allowed by model inputRules.generateAudioOptions.",
+ "title": "Generateaudio",
+ "type": "boolean"
+ },
+ "videoMode": {
+ "default": "first_frame",
+ "description": "Video generation input mode.",
+ "enum": [
+ "first_frame",
+ "reference",
+ "continuation"
+ ],
+ "title": "Videomode",
"type": "string"
},
+ "durationSeconds": {
+ "anyOf": [
+ {
+ "maximum": 60,
+ "minimum": 1,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Duration in seconds; fractional values require model inputRules.fractionalDuration. Generated frames may be aligned by the model.",
+ "title": "Durationseconds"
+ },
+ "aspectRatio": {
+ "anyOf": [
+ {
+ "pattern": "^[1-9]\\d?:[1-9]\\d?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Output width-to-height ratio.",
+ "title": "Aspectratio"
+ },
+ "resolution": {
+ "default": "auto",
+ "description": "Requested output resolution.",
+ "pattern": "^(?:auto|[A-Z0-9][A-Z0-9_.-]{0,23})$",
+ "title": "Resolution",
+ "type": "string"
+ }
+ },
+ "title": "VideoParameters",
+ "type": "object"
+ },
+ "ViewState": {
+ "additionalProperties": false,
+ "properties": {
"projectId": {
"description": "Owning project ID.",
"format": "uuid",
"title": "Projectid",
"type": "string"
},
- "type": {
- "const": "asset.delete",
- "description": "Command discriminator.",
- "title": "Type",
+ "clientId": {
+ "description": "Client identity for independent view state.",
+ "format": "uuid",
+ "title": "Clientid",
"type": "string"
},
- "expectedVersions": {
+ "viewport": {
+ "$ref": "#/$defs/Viewport",
+ "description": "Canvas pan and zoom state."
+ },
+ "selectedItemIds": {
"default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "description": "Currently selected canvas item IDs.",
"items": {
- "$ref": "#/$defs/ObjectVersion"
+ "format": "uuid",
+ "type": "string"
},
- "title": "Expectedversions",
+ "title": "Selecteditemids",
"type": "array"
},
- "expectedPreview": {
+ "activeEditorId": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
+ "format": "uuid",
"type": "string"
},
{
@@ -15456,321 +16502,225 @@
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "description": "Currently active editable document ID.",
+ "title": "Activeeditorid"
},
- "payload": {
- "$ref": "#/$defs/AssetDelete",
- "description": "Delete assets after an impact preview."
+ "playheads": {
+ "default": [],
+ "description": "Playback positions keyed by editor identity.",
+ "items": {
+ "$ref": "#/$defs/Playhead"
+ },
+ "title": "Playheads",
+ "type": "array"
+ },
+ "generationCounts": {
+ "additionalProperties": {
+ "maximum": 8,
+ "minimum": 1,
+ "type": "integer"
+ },
+ "description": "Requested generation counts keyed by canvas item ID.",
+ "propertyNames": {
+ "format": "uuid"
+ },
+ "title": "Generationcounts",
+ "type": "object"
}
},
"required": [
- "commandId",
"projectId",
- "type",
- "expectedVersions",
- "expectedPreview",
- "payload"
+ "clientId"
],
- "title": "AssetDeleteCommand",
+ "title": "ViewState",
"type": "object"
},
- "AssetImport": {
+ "Viewport": {
"additionalProperties": false,
"properties": {
- "uploadHandle": {
- "description": "Server-issued staged upload ID.",
- "format": "uuid",
- "title": "Uploadhandle",
- "type": "string"
+ "x": {
+ "default": 0,
+ "description": "Horizontal coordinate.",
+ "title": "X",
+ "type": "number"
},
- "name": {
- "description": "User-visible name.",
- "maxLength": 255,
- "minLength": 1,
- "title": "Name",
- "type": "string"
+ "y": {
+ "default": 0,
+ "description": "Vertical coordinate.",
+ "title": "Y",
+ "type": "number"
},
- "expectedKind": {
- "description": "Required media kind, when specified.",
- "enum": [
- "text",
- "image",
- "video",
- "audio",
- "file"
- ],
- "title": "Expectedkind",
- "type": "string"
+ "zoom": {
+ "default": 1,
+ "description": "Canvas viewport zoom factor.",
+ "maximum": 8,
+ "minimum": 0.08,
+ "title": "Zoom",
+ "type": "number"
}
},
- "required": [
- "uploadHandle",
- "name",
- "expectedKind"
- ],
- "title": "AssetImport",
+ "title": "Viewport",
"type": "object"
},
- "AssetImportCommand": {
+ "VoiceLibraryCapabilities": {
"additionalProperties": false,
- "description": "Register an uploaded file as a project asset.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
+ "provider": {
+ "description": "Voice registry protocol.",
+ "enum": [
+ "vllm_omni",
+ "moss",
+ "minimax",
+ "zhipu"
+ ],
+ "title": "Provider",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ "connectionId": {
+ "description": "Opaque service, endpoint and account identity.",
+ "maxLength": 200,
+ "minLength": 1,
+ "title": "Connectionid",
"type": "string"
},
- "type": {
- "const": "asset.import",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
+ "requiresTranscript": {
+ "description": "Registered voice must have a reference transcript.",
+ "title": "Requirestranscript",
+ "type": "boolean"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
+ "acceptsTranscript": {
+ "default": false,
+ "description": "Registry stores an optional reference transcript when one is supplied.",
+ "title": "Acceptstranscript",
+ "type": "boolean"
},
- "expectedPreview": {
+ "requiresReferenceAudio": {
+ "description": "Registered voice must have actual reference audio.",
+ "title": "Requiresreferenceaudio",
+ "type": "boolean"
+ },
+ "supportsUploadedVoices": {
+ "default": true,
+ "description": "Selected model checkpoint accepts uploaded registry voices.",
+ "title": "Supportsuploadedvoices",
+ "type": "boolean"
+ },
+ "referenceEmbeddingDimension": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
+ "maximum": 65536,
+ "minimum": 1,
+ "type": "integer"
},
{
"type": "null"
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
- },
- "payload": {
- "$ref": "#/$defs/AssetImport",
- "description": "Register an uploaded file as a project asset."
- }
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "expectedVersions",
- "expectedPreview",
- "payload"
- ],
- "title": "AssetImportCommand",
- "type": "object"
- },
- "AssetMetadataCommand": {
- "additionalProperties": false,
- "description": "Rename an asset.",
- "properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
+ "description": "Accepted registered reference embedding dimension; null requires actual reference audio when required.",
+ "title": "Referenceembeddingdimension"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "canDelete": {
+ "description": "Provider supports uploaded voice deletion.",
+ "title": "Candelete",
+ "type": "boolean"
},
- "type": {
- "const": "asset.updateMetadata",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
+ "maxBytes": {
+ "description": "Maximum audio sample bytes.",
+ "minimum": 1,
+ "title": "Maxbytes",
+ "type": "integer"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "formats": {
+ "description": "Supported recording file extensions.",
"items": {
- "$ref": "#/$defs/ObjectVersion"
+ "type": "string"
},
- "title": "Expectedversions",
+ "title": "Formats",
"type": "array"
},
- "expectedPreview": {
+ "minSeconds": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
+ "type": "number"
},
{
"type": "null"
}
],
- "default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "description": "Minimum recording duration, if documented.",
+ "title": "Minseconds"
},
- "payload": {
- "$ref": "#/$defs/AssetMetadataUpdate",
- "description": "Rename an asset."
+ "maxSeconds": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Maximum recording duration, if documented.",
+ "title": "Maxseconds"
}
},
"required": [
- "commandId",
- "projectId",
- "type",
- "expectedVersions",
- "expectedPreview",
- "payload"
+ "provider",
+ "connectionId",
+ "requiresTranscript",
+ "requiresReferenceAudio",
+ "canDelete",
+ "maxBytes",
+ "formats",
+ "minSeconds",
+ "maxSeconds"
],
- "title": "AssetMetadataCommand",
+ "title": "VoiceLibraryCapabilities",
"type": "object"
},
- "AssetMetadataUpdate": {
+ "VoiceSelection": {
"additionalProperties": false,
"properties": {
- "assetId": {
- "description": "Asset ID.",
- "format": "uuid",
- "title": "Assetid",
+ "connectionId": {
+ "description": "Opaque voice service identity.",
+ "maxLength": 200,
+ "minLength": 1,
+ "title": "Connectionid",
"type": "string"
},
- "name": {
- "description": "User-visible name.",
- "maxLength": 255,
- "minLength": 1,
- "title": "Name",
- "type": "string"
- }
- },
- "required": [
- "assetId",
- "name"
- ],
- "title": "AssetMetadataUpdate",
- "type": "object"
- },
- "AssetPreviewQuery": {
- "additionalProperties": false,
- "properties": {
- "queryId": {
- "description": "Caller-supplied query ID.",
- "format": "uuid",
- "title": "Queryid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ "voiceId": {
+ "description": "Provider voice identity.",
+ "maxLength": 200,
+ "minLength": 1,
+ "pattern": "^[^/\\\\\\x00-\\x1f\\x7f]+$",
+ "title": "Voiceid",
"type": "string"
},
- "type": {
- "const": "asset.preview",
- "description": "Preview an asset; does not establish model observation.",
- "title": "Type",
+ "name": {
+ "description": "Readable provider voice name.",
+ "maxLength": 255,
+ "minLength": 1,
+ "title": "Name",
"type": "string"
},
- "objectId": {
- "description": "Asset ID.",
- "format": "uuid",
- "title": "Objectid",
- "type": "string"
- }
- },
- "required": [
- "queryId",
- "projectId",
- "type",
- "objectId"
- ],
- "title": "AssetPreviewQuery",
- "type": "object"
- },
- "AssetProvenance": {
- "additionalProperties": false,
- "properties": {
"source": {
- "description": "Input source or recorded provenance.",
+ "description": "Provider voice source; used to check checkpoint compatibility.",
"enum": [
- "upload",
- "manual",
- "agent_written",
- "generated",
- "edited",
- "rendered",
- "imported"
+ "builtin",
+ "uploaded"
],
"title": "Source",
"type": "string"
},
- "jobId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Generation job ID.",
- "title": "Jobid"
- },
- "toolTaskId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Tool execution ID.",
- "title": "Tooltaskid"
- },
- "sourceItemId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Source canvas item ID.",
- "title": "Sourceitemid"
- },
- "editorDocumentId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Editable document ID.",
- "title": "Editordocumentid"
+ "hasReferenceAudio": {
+ "description": "Provider reports a registered reference recording.",
+ "title": "Hasreferenceaudio",
+ "type": "boolean"
},
- "editorRevision": {
+ "embeddingDim": {
"anyOf": [
{
+ "maximum": 65536,
"minimum": 1,
"type": "integer"
},
@@ -15779,99 +16729,13 @@
}
],
"default": null,
- "description": "Expected editable document revision.",
- "title": "Editorrevision"
- },
- "sources": {
- "default": [],
- "description": "Ordered source asset versions.",
- "items": {
- "$ref": "#/$defs/AssetRef"
- },
- "title": "Sources",
- "type": "array"
- },
- "inputFingerprint": {
- "anyOf": [
- {
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Fingerprint of the fixed execution input.",
- "title": "Inputfingerprint"
- },
- "agentRunId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Agent turn ID.",
- "title": "Agentrunid"
- },
- "agentRuntime": {
- "anyOf": [
- {
- "enum": [
- "opencode",
- "codex",
- "claude",
- "jiuwenswarm",
- "deepseek"
- ],
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Native Agent runtime that produced this asset.",
- "title": "Agentruntime"
- },
- "modelSnapshot": {
- "anyOf": [
- {
- "$ref": "#/$defs/ModelSnapshot"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Fixed model connection recorded for provenance."
- },
- "prompt": {
- "anyOf": [
- {
- "maxLength": 20000,
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Generation prompt text.",
- "title": "Prompt"
+ "description": "Registered reference embedding dimension, when the provider reports one.",
+ "title": "Embeddingdim"
},
- "importedFrom": {
+ "refText": {
"anyOf": [
{
- "enum": [
- "generated",
- "edited"
- ],
+ "maxLength": 100000,
"type": "string"
},
{
@@ -15879,1067 +16743,610 @@
}
],
"default": null,
- "description": "Original source recorded by a canvas archive this asset was imported from.",
- "title": "Importedfrom"
+ "description": "Provider reference transcript, when available.",
+ "title": "Reftext"
}
},
"required": [
+ "connectionId",
+ "voiceId",
+ "name",
"source",
- "jobId",
- "toolTaskId",
- "sourceItemId",
- "editorDocumentId",
- "editorRevision",
- "sources",
- "inputFingerprint",
- "agentRunId",
- "agentRuntime",
- "modelSnapshot",
- "prompt",
- "importedFrom"
+ "hasReferenceAudio"
],
- "title": "AssetProvenance",
+ "title": "VoiceSelection",
"type": "object"
+ }
+ },
+ "additionalProperties": false,
+ "properties": {
+ "project": {
+ "$ref": "#/$defs/ProjectSnapshot",
+ "description": "Authoritative project snapshot schema."
},
- "AssetRef": {
- "additionalProperties": false,
- "properties": {
- "assetId": {
- "description": "ID of a registered project asset from project.assets[].id or a successful asset command result.",
- "format": "uuid",
- "title": "Assetid",
- "type": "string"
+ "canvasItem": {
+ "description": "Canvas item schema.",
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioCanvasItem",
+ "external": "#/$defs/DirectorCanvasItem",
+ "file": "#/$defs/FileCanvasItem",
+ "group": "#/$defs/GroupCanvasItem",
+ "image": "#/$defs/ImageCanvasItem",
+ "stack": "#/$defs/StackCanvasItem",
+ "subject": "#/$defs/SubjectCanvasItem",
+ "text": "#/$defs/TextCanvasItem",
+ "timeline": "#/$defs/TimelineCanvasItem",
+ "tool": "#/$defs/ToolCanvasItem",
+ "video": "#/$defs/VideoCanvasItem"
},
- "revision": {
- "description": "Referenced immutable asset revision.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TextCanvasItem"
},
- "fingerprint": {
- "description": "Immutable content fingerprint.",
- "pattern": "^sha256:[0-9a-f]{64}$",
- "title": "Fingerprint",
- "type": "string"
+ {
+ "$ref": "#/$defs/ImageCanvasItem"
},
- "kind": {
- "description": "Business object or media type.",
- "enum": [
- "text",
- "image",
- "video",
- "audio",
- "file"
- ],
- "title": "Kind",
- "type": "string"
- }
- },
- "required": [
- "assetId",
- "revision",
- "fingerprint",
- "kind"
- ],
- "title": "AssetRef",
- "type": "object"
- },
- "AssetSearchQuery": {
- "additionalProperties": false,
- "properties": {
- "queryId": {
- "description": "Caller-supplied query ID.",
- "format": "uuid",
- "title": "Queryid",
- "type": "string"
+ {
+ "$ref": "#/$defs/VideoCanvasItem"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ {
+ "$ref": "#/$defs/AudioCanvasItem"
},
- "type": {
- "const": "asset.search",
- "description": "Search project assets.",
- "title": "Type",
- "type": "string"
+ {
+ "$ref": "#/$defs/FileCanvasItem"
},
- "text": {
- "default": "",
- "description": "Asset search text.",
- "maxLength": 1000,
- "title": "Text",
- "type": "string"
+ {
+ "$ref": "#/$defs/SubjectCanvasItem"
},
- "offset": {
- "default": 0,
- "description": "Number of matching records to skip.",
- "minimum": 0,
- "title": "Offset",
- "type": "integer"
+ {
+ "$ref": "#/$defs/TimelineCanvasItem"
},
- "limit": {
- "default": 50,
- "description": "Maximum number of records to return.",
- "maximum": 200,
- "minimum": 1,
- "title": "Limit",
- "type": "integer"
+ {
+ "$ref": "#/$defs/StackCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/ToolCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/DirectorCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/GroupCanvasItem"
}
- },
- "required": [
- "queryId",
- "projectId",
- "type",
- "text",
- "offset",
- "limit"
],
- "title": "AssetSearchQuery",
- "type": "object"
+ "title": "Canvasitem"
},
- "AssetUsageQuery": {
- "additionalProperties": false,
- "properties": {
- "queryId": {
- "description": "Caller-supplied query ID.",
- "format": "uuid",
- "title": "Queryid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "generationSpec": {
+ "description": "Generation configuration schema.",
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioGenerationSpec",
+ "image": "#/$defs/ImageGenerationSpec",
+ "text": "#/$defs/TextGenerationSpec",
+ "video": "#/$defs/VideoGenerationSpec"
},
- "type": {
- "const": "asset.usage",
- "description": "Read asset dependencies.",
- "title": "Type",
- "type": "string"
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TextGenerationSpec"
},
- "objectId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Asset ID, or all assets when omitted.",
- "title": "Objectid"
+ {
+ "$ref": "#/$defs/ImageGenerationSpec"
},
- "offset": {
- "default": 0,
- "description": "Number of matching records to skip.",
- "minimum": 0,
- "title": "Offset",
- "type": "integer"
+ {
+ "$ref": "#/$defs/VideoGenerationSpec"
},
- "limit": {
- "default": 50,
- "description": "Maximum number of records to return.",
- "maximum": 200,
- "minimum": 1,
- "title": "Limit",
- "type": "integer"
+ {
+ "$ref": "#/$defs/AudioGenerationSpec"
}
- },
- "required": [
- "queryId",
- "projectId",
- "type",
- "objectId",
- "offset",
- "limit"
],
- "title": "AssetUsageQuery",
- "type": "object"
+ "title": "Generationspec"
},
- "AssetWriteText": {
- "additionalProperties": false,
- "properties": {
- "name": {
- "description": "User-visible name.",
- "maxLength": 255,
- "minLength": 1,
- "title": "Name",
- "type": "string"
+ "reference": {
+ "description": "Generation reference to create or update.",
+ "discriminator": {
+ "mapping": {
+ "follow_current": "#/$defs/FollowingReference",
+ "pinned": "#/$defs/PinnedReference"
},
- "text": {
- "description": "UTF-8 text content or search query.",
- "maxLength": 1048576,
- "title": "Text",
- "type": "string"
+ "propertyName": "binding"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/PinnedReference"
},
- "previousAsset": {
- "anyOf": [
- {
- "$ref": "#/$defs/AssetRef"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Previous immutable version for a new text asset version."
+ {
+ "$ref": "#/$defs/FollowingReference"
}
- },
- "required": [
- "name",
- "text",
- "previousAsset"
],
- "title": "AssetWriteText",
- "type": "object"
+ "title": "Reference"
},
- "AssetWriteTextCommand": {
- "additionalProperties": false,
- "description": "Write a text asset or a new version of an existing text asset.",
- "properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
+ "editorDocument": {
+ "description": "Editable document schema.",
+ "discriminator": {
+ "mapping": {
+ "director": "#/$defs/DirectorDocument",
+ "image_crop": "#/$defs/ImageCropDocument",
+ "layers": "#/$defs/LayerDocument",
+ "media_edit": "#/$defs/MediaEditDocument",
+ "stack": "#/$defs/StackDocument",
+ "subject": "#/$defs/SubjectDocument",
+ "timeline": "#/$defs/TimelineDocument",
+ "tool": "#/$defs/ToolDocument"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TimelineDocument"
},
- "type": {
- "const": "asset.writeText",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
+ {
+ "$ref": "#/$defs/SubjectDocument"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
+ {
+ "$ref": "#/$defs/LayerDocument"
},
- "expectedPreview": {
- "anyOf": [
- {
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ {
+ "$ref": "#/$defs/ImageCropDocument"
},
- "payload": {
- "$ref": "#/$defs/AssetWriteText",
- "description": "Write a text asset or a new version of an existing text asset."
+ {
+ "$ref": "#/$defs/StackDocument"
+ },
+ {
+ "$ref": "#/$defs/ToolDocument"
+ },
+ {
+ "$ref": "#/$defs/DirectorDocument"
+ },
+ {
+ "$ref": "#/$defs/MediaEditDocument"
}
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "expectedVersions",
- "expectedPreview",
- "payload"
],
- "title": "AssetWriteTextCommand",
- "type": "object"
+ "title": "Editordocument"
},
- "AudioCanvasItem": {
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
- "format": "uuid",
- "title": "Id",
- "type": "string"
+ "command": {
+ "description": "Immutable command recorded in this commit.",
+ "discriminator": {
+ "mapping": {
+ "artifact.publish": "#/$defs/ArtifactPublishCommand",
+ "asset.delete": "#/$defs/AssetDeleteCommand",
+ "asset.import": "#/$defs/AssetImportCommand",
+ "asset.updateMetadata": "#/$defs/AssetMetadataCommand",
+ "asset.writeText": "#/$defs/AssetWriteTextCommand",
+ "canvas.applyEdit": "#/$defs/CanvasApplyEditCommand",
+ "canvas.applyVersion": "#/$defs/NodeVersionApplyCommand",
+ "canvas.attachEditor": "#/$defs/CanvasEditorAttachCommand",
+ "canvas.configure": "#/$defs/CanvasConfigureCommand",
+ "canvas.createGeneration": "#/$defs/CanvasCreateGenerationCommand",
+ "canvas.detachEditor": "#/$defs/CanvasEditorDetachCommand",
+ "canvas.hide": "#/$defs/CanvasHideCommand",
+ "canvas.materialize": "#/$defs/CanvasMaterializeCommand",
+ "canvas.move": "#/$defs/CanvasMoveCommand",
+ "canvas.publishMedia": "#/$defs/CanvasPublishMediaCommand",
+ "canvas.show": "#/$defs/CanvasShowCommand",
+ "canvas.update": "#/$defs/CanvasUpdateCommand",
+ "creation.batch": "#/$defs/BatchCommand",
+ "director.apply": "#/$defs/DirectorApplyCommand",
+ "director.camera.delete": "#/$defs/DirectorCameraDeleteCommand",
+ "director.duration.set": "#/$defs/DirectorSetDurationCommand",
+ "director.storyboard.append": "#/$defs/DirectorStoryboardAppendCommand",
+ "director.storyboard.delete": "#/$defs/DirectorStoryboardDeleteCommand",
+ "director.storyboard.reorder": "#/$defs/DirectorStoryboardReorderCommand",
+ "director.storyboard.resize": "#/$defs/DirectorStoryboardResizeCommand",
+ "editor.create": "#/$defs/EditorCreateCommand",
+ "editor.save": "#/$defs/EditorSaveCommand",
+ "generation.submit": "#/$defs/GenerationSubmitCommand",
+ "generationSpec.create": "#/$defs/SpecCreateCommand",
+ "generationSpec.restore": "#/$defs/SpecRestoreCommand",
+ "generationSpec.setPrompt": "#/$defs/SpecPromptCommand",
+ "generationSpec.update": "#/$defs/SpecUpdateCommand",
+ "history.redo": "#/$defs/HistoryRedoCommand",
+ "history.undo": "#/$defs/HistoryUndoCommand",
+ "job.cancel": "#/$defs/JobCancelCommand",
+ "job.checkpoint": "#/$defs/JobCheckpointCommand",
+ "job.recover": "#/$defs/JobRecoverCommand",
+ "project.create": "#/$defs/ProjectCreateCommand",
+ "project.rename": "#/$defs/ProjectRenameCommand",
+ "project.restore": "#/$defs/ProjectRestoreCommand",
+ "project.trash": "#/$defs/ProjectTrashCommand",
+ "reference.add": "#/$defs/ReferenceAddCommand",
+ "reference.remove": "#/$defs/ReferenceRemoveCommand",
+ "reference.restore": "#/$defs/ReferenceRestoreCommand",
+ "reference.update": "#/$defs/ReferenceUpdateCommand",
+ "result.select": "#/$defs/ResultSelectCommand",
+ "timeline.publishRender": "#/$defs/TimelinePublishRenderCommand"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "propertyName": "type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/ProjectCreateCommand"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
+ {
+ "$ref": "#/$defs/ProjectRenameCommand"
},
- "kind": {
- "const": "audio",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
+ {
+ "$ref": "#/$defs/ProjectTrashCommand"
},
- "title": {
- "default": "",
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
- "type": "string"
+ {
+ "$ref": "#/$defs/ProjectRestoreCommand"
},
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
+ {
+ "$ref": "#/$defs/AssetImportCommand"
},
- "width": {
- "default": 352,
- "description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "title": "Width",
- "type": "number"
+ {
+ "$ref": "#/$defs/ArtifactPublishCommand"
},
- "height": {
- "default": 198,
- "description": "Height in pixels.",
- "exclusiveMinimum": 0,
- "title": "Height",
- "type": "number"
+ {
+ "$ref": "#/$defs/AssetWriteTextCommand"
},
- "zIndex": {
- "default": 0,
- "description": "Canvas stacking order.",
- "title": "Zindex",
- "type": "integer"
+ {
+ "$ref": "#/$defs/AssetMetadataCommand"
},
- "locked": {
- "default": false,
- "description": "Whether edits to this object are blocked.",
- "title": "Locked",
- "type": "boolean"
+ {
+ "$ref": "#/$defs/AssetDeleteCommand"
},
- "visible": {
- "default": true,
- "description": "Whether this object is displayed.",
- "title": "Visible",
- "type": "boolean"
+ {
+ "$ref": "#/$defs/CanvasCreateGenerationCommand"
},
- "parentId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Parent canvas group ID, or null for the root.",
- "title": "Parentid"
+ {
+ "$ref": "#/$defs/CanvasShowCommand"
},
- "tags": {
- "default": [],
- "description": "User-defined search tags.",
- "items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "type": "string"
- },
- "title": "Tags",
- "type": "array"
+ {
+ "$ref": "#/$defs/CanvasMoveCommand"
},
- "binding": {
- "description": "Business object displayed by this canvas item.",
- "discriminator": {
- "mapping": {
- "empty": "#/$defs/EmptyBinding",
- "generation": "#/$defs/GenerationBinding",
- "material": "#/$defs/MaterialBinding"
- },
- "propertyName": "role"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/EmptyBinding"
- },
- {
- "$ref": "#/$defs/MaterialBinding"
- },
- {
- "$ref": "#/$defs/GenerationBinding"
- }
- ],
- "title": "Binding"
+ {
+ "$ref": "#/$defs/CanvasUpdateCommand"
},
- "editors": {
- "default": [],
- "description": "Attached editable documents.",
- "items": {
- "$ref": "#/$defs/EditorRef"
- },
- "title": "Editors",
- "type": "array"
- }
- },
- "required": [
- "id",
- "projectId",
- "revision",
- "kind",
- "title",
- "position",
- "width",
- "height",
- "zIndex",
- "locked",
- "visible",
- "parentId",
- "tags",
- "binding",
- "editors"
- ],
- "title": "AudioCanvasItem",
- "type": "object"
- },
- "AudioExecution": {
- "additionalProperties": false,
- "properties": {
- "kind": {
- "const": "audio",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
+ {
+ "$ref": "#/$defs/CanvasHideCommand"
},
- "voice": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Provider voice identifier or name.",
- "title": "Voice"
+ {
+ "$ref": "#/$defs/CanvasMaterializeCommand"
},
- "speaker": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Provider speaker identifier.",
- "title": "Speaker"
+ {
+ "$ref": "#/$defs/CanvasApplyEditCommand"
},
- "format": {
- "description": "Audio container or codec format.",
- "enum": [
- "mp3",
- "wav"
- ],
- "title": "Format",
- "type": "string"
+ {
+ "$ref": "#/$defs/CanvasPublishMediaCommand"
},
- "sampleRate": {
- "anyOf": [
- {
- "minimum": 1,
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Audio samples per second.",
- "title": "Samplerate"
+ {
+ "$ref": "#/$defs/TimelinePublishRenderCommand"
},
- "creationType": {
- "default": "audio",
- "description": "Speech or music creation mode.",
- "enum": [
- "audio",
- "music"
- ],
- "title": "Creationtype",
- "type": "string"
+ {
+ "$ref": "#/$defs/NodeVersionApplyCommand"
},
- "instrumental": {
- "default": false,
- "description": "Legacy explicit instrumental choice retained for stored records.",
- "title": "Instrumental",
- "type": "boolean"
+ {
+ "$ref": "#/$defs/CanvasConfigureCommand"
},
- "maxDurationSeconds": {
- "anyOf": [
- {
- "maximum": 360,
- "minimum": 8,
- "type": "number"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Maximum generated audio duration in seconds.",
- "title": "Maxdurationseconds"
+ {
+ "$ref": "#/$defs/CanvasEditorAttachCommand"
},
- "scoreMode": {
- "anyOf": [
- {
- "enum": [
- "melody",
- "full"
- ],
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Whether reference music supplies melody or full accompaniment.",
- "title": "Scoremode"
+ {
+ "$ref": "#/$defs/CanvasEditorDetachCommand"
},
- "seed": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Random seed fixed when the job was accepted.",
- "title": "Seed"
- }
- },
- "required": [
- "kind",
- "voice",
- "speaker",
- "format",
- "sampleRate"
- ],
- "title": "AudioExecution",
- "type": "object"
- },
- "AudioGenerationSpec": {
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
- "format": "uuid",
- "title": "Id",
- "type": "string"
+ {
+ "$ref": "#/$defs/SpecCreateCommand"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ {
+ "$ref": "#/$defs/SpecUpdateCommand"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
+ {
+ "$ref": "#/$defs/SpecRestoreCommand"
},
- "purpose": {
- "default": "draft",
- "description": "Draft settings or executable generation configuration.",
- "enum": [
- "draft",
- "generation"
- ],
- "title": "Purpose",
- "type": "string"
+ {
+ "$ref": "#/$defs/SpecPromptCommand"
},
- "modelConfigId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Model configuration ID from the model catalog or user model selections.",
- "title": "Modelconfigid"
+ {
+ "$ref": "#/$defs/ReferenceAddCommand"
},
- "prompt": {
- "default": "",
- "description": "Generation prompt text.",
- "maxLength": 20000,
- "title": "Prompt",
- "type": "string"
+ {
+ "$ref": "#/$defs/ReferenceUpdateCommand"
},
- "promptContent": {
- "anyOf": [
- {
- "items": {
- "discriminator": {
- "mapping": {
- "reference": "#/$defs/PromptReference",
- "text": "#/$defs/PromptText"
- },
- "propertyName": "type"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/PromptText"
- },
- {
- "$ref": "#/$defs/PromptReference"
- }
- ]
- },
- "type": "array"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Structured prompt text and reference tokens.",
- "title": "Promptcontent"
+ {
+ "$ref": "#/$defs/ReferenceRestoreCommand"
},
- "currentResultId": {
- "anyOf": [
- {
- "format": "uuid",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Currently adopted result ID.",
- "title": "Currentresultid"
+ {
+ "$ref": "#/$defs/ReferenceRemoveCommand"
},
- "kind": {
- "const": "audio",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
+ {
+ "$ref": "#/$defs/GenerationSubmitCommand"
},
- "parameters": {
- "$ref": "#/$defs/AudioParameters",
- "description": "Typed generation or editing parameters."
- }
- },
- "required": [
- "id",
- "projectId",
- "revision",
- "purpose",
- "modelConfigId",
- "prompt",
- "promptContent",
- "currentResultId",
- "kind",
- "parameters"
- ],
- "title": "AudioGenerationSpec",
- "type": "object"
- },
- "AudioParameters": {
- "additionalProperties": false,
- "properties": {
- "creationType": {
- "default": "audio",
- "description": "Speech or music creation mode.",
- "enum": [
- "audio",
- "music"
- ],
- "title": "Creationtype",
- "type": "string"
+ {
+ "$ref": "#/$defs/JobCancelCommand"
},
- "mode": {
- "default": "tts",
- "description": "Operation mode within this contract variant.",
- "enum": [
- "tts",
- "unified"
- ],
- "title": "Mode",
- "type": "string"
+ {
+ "$ref": "#/$defs/JobRecoverCommand"
},
- "voice": {
- "anyOf": [
- {
- "maxLength": 200,
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Provider voice identifier or name; library voices retain provider naming.",
- "title": "Voice"
+ {
+ "$ref": "#/$defs/JobCheckpointCommand"
},
- "voiceSelection": {
- "anyOf": [
- {
- "$ref": "#/$defs/VoiceSelection"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Connection-scoped voice selection; validated against the live registry before generation."
+ {
+ "$ref": "#/$defs/ResultSelectCommand"
},
- "instrumental": {
- "default": false,
- "description": "Legacy explicit instrumental choice retained for stored records.",
- "title": "Instrumental",
- "type": "boolean"
+ {
+ "$ref": "#/$defs/EditorCreateCommand"
},
- "lyrics": {
- "default": "",
- "description": "Song lyrics; empty lyrics request instrumental music.",
- "maxLength": 5000,
- "title": "Lyrics",
- "type": "string"
+ {
+ "$ref": "#/$defs/EditorSaveCommand"
},
- "durationSeconds": {
- "anyOf": [
- {
- "maximum": 360,
- "minimum": 8,
- "type": "number"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Maximum music duration in seconds.",
- "title": "Durationseconds"
+ {
+ "$ref": "#/$defs/DirectorApplyCommand"
},
- "scoreMode": {
- "default": "melody",
- "description": "Music with one audio reference: follow its transcribed melody, or melody and chords",
- "enum": [
- "melody",
- "full"
- ],
- "title": "Scoremode",
- "type": "string"
+ {
+ "$ref": "#/$defs/DirectorStoryboardAppendCommand"
},
- "durationFromReference": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Music with one audio reference: cap the length at the reference length (unset follows it) instead of durationSeconds",
- "title": "Durationfromreference"
- }
- },
- "required": [
- "creationType",
- "mode",
- "voice"
- ],
- "title": "AudioParameters",
- "type": "object"
- },
- "BatchCommand": {
- "additionalProperties": false,
- "description": "Apply multiple operations atomically; all succeed or none are committed.",
- "properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
+ {
+ "$ref": "#/$defs/DirectorStoryboardReorderCommand"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ {
+ "$ref": "#/$defs/DirectorStoryboardResizeCommand"
},
- "type": {
- "const": "creation.batch",
- "description": "Batch command discriminator.",
- "title": "Type",
- "type": "string"
+ {
+ "$ref": "#/$defs/DirectorStoryboardDeleteCommand"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
+ {
+ "$ref": "#/$defs/DirectorSetDurationCommand"
},
- "expectedPreview": {
- "anyOf": [
- {
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ {
+ "$ref": "#/$defs/DirectorCameraDeleteCommand"
},
- "payload": {
- "$ref": "#/$defs/BatchPayload",
- "description": "Ordered operations committed atomically."
+ {
+ "$ref": "#/$defs/HistoryUndoCommand"
+ },
+ {
+ "$ref": "#/$defs/HistoryRedoCommand"
+ },
+ {
+ "$ref": "#/$defs/BatchCommand"
}
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "expectedVersions",
- "expectedPreview",
- "payload"
],
- "title": "BatchCommand",
- "type": "object"
+ "title": "Command"
},
- "BatchPayload": {
- "additionalProperties": false,
- "properties": {
- "operations": {
- "description": "Ordered operations committed as one atomic transaction.",
- "items": {
- "discriminator": {
- "mapping": {
- "canvas.applyEdit": "#/$defs/CanvasApplyEditCommandOperation",
- "canvas.attachEditor": "#/$defs/CanvasEditorAttachCommandOperation",
- "canvas.configure": "#/$defs/CanvasConfigureCommandOperation",
- "canvas.detachEditor": "#/$defs/CanvasEditorDetachCommandOperation",
- "canvas.hide": "#/$defs/CanvasHideCommandOperation",
- "canvas.materialize": "#/$defs/CanvasMaterializeCommandOperation",
- "canvas.move": "#/$defs/CanvasMoveCommandOperation",
- "canvas.show": "#/$defs/CanvasShowCommandOperation",
- "canvas.update": "#/$defs/CanvasUpdateCommandOperation",
- "editor.create": "#/$defs/EditorCreateCommandOperation",
- "editor.save": "#/$defs/EditorSaveCommandOperation",
- "generationSpec.create": "#/$defs/SpecCreateCommandOperation",
- "generationSpec.setPrompt": "#/$defs/SpecPromptCommandOperation",
- "generationSpec.update": "#/$defs/SpecUpdateCommandOperation",
- "reference.add": "#/$defs/ReferenceAddCommandOperation",
- "reference.remove": "#/$defs/ReferenceRemoveCommandOperation",
- "reference.restore": "#/$defs/ReferenceRestoreCommandOperation",
- "reference.update": "#/$defs/ReferenceUpdateCommandOperation",
- "result.select": "#/$defs/ResultSelectCommandOperation"
- },
- "propertyName": "type"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/CanvasShowCommandOperation"
- },
- {
- "$ref": "#/$defs/CanvasMoveCommandOperation"
- },
- {
- "$ref": "#/$defs/CanvasUpdateCommandOperation"
- },
- {
- "$ref": "#/$defs/CanvasHideCommandOperation"
- },
- {
- "$ref": "#/$defs/CanvasMaterializeCommandOperation"
- },
- {
- "$ref": "#/$defs/CanvasApplyEditCommandOperation"
- },
- {
- "$ref": "#/$defs/CanvasConfigureCommandOperation"
- },
- {
- "$ref": "#/$defs/CanvasEditorAttachCommandOperation"
- },
- {
- "$ref": "#/$defs/CanvasEditorDetachCommandOperation"
- },
- {
- "$ref": "#/$defs/SpecCreateCommandOperation"
- },
- {
- "$ref": "#/$defs/SpecUpdateCommandOperation"
- },
- {
- "$ref": "#/$defs/SpecPromptCommandOperation"
- },
- {
- "$ref": "#/$defs/ReferenceAddCommandOperation"
- },
- {
- "$ref": "#/$defs/ReferenceUpdateCommandOperation"
- },
- {
- "$ref": "#/$defs/ReferenceRestoreCommandOperation"
- },
- {
- "$ref": "#/$defs/ReferenceRemoveCommandOperation"
- },
- {
- "$ref": "#/$defs/ResultSelectCommandOperation"
- },
- {
- "$ref": "#/$defs/EditorCreateCommandOperation"
- },
- {
- "$ref": "#/$defs/EditorSaveCommandOperation"
- }
- ]
- },
- "maxItems": 500,
- "minItems": 1,
- "title": "Operations",
- "type": "array"
- }
- },
- "required": [
- "operations"
- ],
- "title": "BatchPayload",
- "type": "object"
+ "receipt": {
+ "$ref": "#/$defs/CommandReceipt",
+ "description": "Immutable command execution receipt."
},
- "CameraFrame": {
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "Stable object ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Id",
- "type": "string"
+ "query": {
+ "description": "Read-only project query.",
+ "discriminator": {
+ "mapping": {
+ "asset.preview": "#/$defs/AssetPreviewQuery",
+ "asset.search": "#/$defs/AssetSearchQuery",
+ "asset.usage": "#/$defs/AssetUsageQuery",
+ "canvas.status": "#/$defs/CanvasStatusQuery",
+ "canvas.versions": "#/$defs/VersionsQuery",
+ "director.storyboard.get": "#/$defs/DirectorStoryboardQuery",
+ "generationSpec.versions": "#/$defs/VersionsQuery",
+ "job.get": "#/$defs/ObjectQuery",
+ "object.get": "#/$defs/ObjectQuery",
+ "project.get": "#/$defs/ProjectQuery"
},
- "time": {
- "description": "Keyframe time in seconds.",
- "minimum": 0,
- "title": "Time",
- "type": "number"
+ "propertyName": "type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/ProjectQuery"
},
- "value": {
- "$ref": "#/$defs/StageCamera",
- "description": "Keyframed transform or camera pose."
+ {
+ "$ref": "#/$defs/ObjectQuery"
+ },
+ {
+ "$ref": "#/$defs/VersionsQuery"
+ },
+ {
+ "$ref": "#/$defs/AssetSearchQuery"
+ },
+ {
+ "$ref": "#/$defs/AssetUsageQuery"
+ },
+ {
+ "$ref": "#/$defs/CanvasStatusQuery"
+ },
+ {
+ "$ref": "#/$defs/AssetPreviewQuery"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardQuery"
}
- },
- "required": [
- "id",
- "time",
- "value"
],
- "title": "CameraFrame",
- "type": "object"
+ "title": "Query"
},
- "CameraRig": {
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "Stable object ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Id",
- "type": "string"
+ "event": {
+ "$ref": "#/$defs/ProjectEvent",
+ "description": "Project change event, if emitted."
+ },
+ "job": {
+ "$ref": "#/$defs/Job",
+ "description": "Generation execution record."
+ },
+ "result": {
+ "$ref": "#/$defs/ResultVersion",
+ "description": "Generated result schema."
+ },
+ "snapshot": {
+ "$ref": "#/$defs/InputSnapshot",
+ "description": "Fixed generation input schema."
+ },
+ "executionParameters": {
+ "description": "Effective provider execution parameter schema.",
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioExecution",
+ "image": "#/$defs/ImageExecution",
+ "text": "#/$defs/TextExecution",
+ "video": "#/$defs/VideoExecution"
},
- "name": {
- "description": "User-visible name.",
- "maxLength": 255,
- "title": "Name",
- "type": "string"
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TextExecution"
},
- "pose": {
- "$ref": "#/$defs/StageCamera",
- "description": "Camera position and look-at target."
+ {
+ "$ref": "#/$defs/ImageExecution"
},
- "keyframes": {
- "default": [],
- "description": "Ordered animation keyframes.",
- "items": {
- "$ref": "#/$defs/CameraFrame"
- },
- "title": "Keyframes",
- "type": "array"
+ {
+ "$ref": "#/$defs/VideoExecution"
+ },
+ {
+ "$ref": "#/$defs/AudioExecution"
}
- },
- "required": [
- "id",
- "name",
- "pose",
- "keyframes"
],
- "title": "CameraRig",
- "type": "object"
+ "title": "Executionparameters"
},
- "CanvasApplyEdit": {
- "additionalProperties": false,
- "properties": {
- "itemId": {
- "description": "Canvas item ID.",
- "format": "uuid",
- "title": "Itemid",
- "type": "string"
- },
- "source": {
- "$ref": "#/$defs/AssetRef",
- "description": "Input source or recorded provenance."
+ "promptPart": {
+ "description": "Structured prompt token schema.",
+ "discriminator": {
+ "mapping": {
+ "reference": "#/$defs/PromptReference",
+ "text": "#/$defs/PromptText"
},
- "asset": {
- "$ref": "#/$defs/AssetRef",
- "description": "Immutable asset version."
+ "propertyName": "type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/PromptText"
},
- "editorId": {
- "description": "Editable document ID.",
- "format": "uuid",
- "title": "Editorid",
- "type": "string"
+ {
+ "$ref": "#/$defs/PromptReference"
}
- },
- "required": [
- "itemId",
- "source",
- "asset",
- "editorId"
],
- "title": "CanvasApplyEdit",
- "type": "object"
+ "title": "Promptpart"
},
- "CanvasApplyEditCommand": {
+ "publicModel": {
+ "$ref": "#/$defs/ModelConfigPublic",
+ "description": "Public model connection schema."
+ },
+ "writeModel": {
+ "$ref": "#/$defs/ModelConfigWrite",
+ "description": "Model configuration input schema."
+ },
+ "capabilities": {
+ "$ref": "#/$defs/NodeCapabilities",
+ "description": "Available canvas item operations."
+ },
+ "viewState": {
+ "$ref": "#/$defs/ViewState",
+ "description": "Client-specific canvas view state."
+ },
+ "timelinePackageManifest": {
+ "$ref": "#/$defs/TimelinePackageManifest",
+ "description": "Native editable timeline bundle manifest."
+ },
+ "timelinePackageImport": {
+ "$ref": "#/$defs/TimelinePackageImportRequest",
+ "description": "Recoverable native bundle import request."
+ },
+ "timelinePackageReceipt": {
+ "$ref": "#/$defs/TimelinePackageImportReceipt",
+ "description": "Native bundle import progress and final receipt."
+ },
+ "upload": {
+ "$ref": "#/$defs/UploadInfo",
+ "description": "Staged upload schema."
+ }
+ },
+ "required": [
+ "project",
+ "canvasItem",
+ "generationSpec",
+ "reference",
+ "editorDocument",
+ "command",
+ "receipt",
+ "query",
+ "event",
+ "job",
+ "result",
+ "snapshot",
+ "executionParameters",
+ "promptPart",
+ "publicModel",
+ "writeModel",
+ "capabilities",
+ "viewState",
+ "timelinePackageManifest",
+ "timelinePackageImport",
+ "timelinePackageReceipt",
+ "upload"
+ ],
+ "title": "CreationContracts",
+ "type": "object"
+ },
+ "output": {
+ "$defs": {
+ "ArtifactPublish": {
"additionalProperties": false,
- "description": "Apply an editor result to a canvas item.",
+ "description": "Publish a file from a server-owned execution context without generating media.",
+ "examples": [
+ {
+ "name": "片段 01",
+ "path": "clips/segment-01.mp4"
+ }
+ ],
+ "properties": {
+ "path": {
+ "description": "Artifact path relative to the server-owned execution directory.",
+ "maxLength": 4096,
+ "minLength": 1,
+ "title": "Path",
+ "type": "string"
+ },
+ "name": {
+ "description": "User-visible name.",
+ "maxLength": 255,
+ "minLength": 1,
+ "title": "Name",
+ "type": "string"
+ },
+ "expectedKind": {
+ "anyOf": [
+ {
+ "enum": [
+ "text",
+ "image",
+ "video",
+ "audio",
+ "file"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Required media kind, when specified.",
+ "title": "Expectedkind"
+ },
+ "sources": {
+ "default": [],
+ "description": "Ordered source asset versions.",
+ "items": {
+ "$ref": "#/$defs/AssetRef"
+ },
+ "maxItems": 100,
+ "title": "Sources",
+ "type": "array"
+ }
+ },
+ "required": [
+ "path",
+ "name",
+ "expectedKind",
+ "sources"
+ ],
+ "title": "ArtifactPublish",
+ "type": "object"
+ },
+ "ArtifactPublishCommand": {
+ "additionalProperties": false,
+ "description": "Register an execution file as a project asset.",
"properties": {
"commandId": {
"description": "Stable command ID for idempotent replay.",
@@ -16954,7 +17361,7 @@
"type": "string"
},
"type": {
- "const": "canvas.applyEdit",
+ "const": "artifact.publish",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -16983,8 +17390,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/CanvasApplyEdit",
- "description": "Apply an editor result to a canvas item."
+ "$ref": "#/$defs/ArtifactPublish",
+ "description": "Register an execution file as a project asset."
}
},
"required": [
@@ -16995,64 +17402,115 @@
"expectedPreview",
"payload"
],
- "title": "CanvasApplyEditCommand",
+ "title": "ArtifactPublishCommand",
"type": "object"
},
- "CanvasApplyEditCommandOperation": {
+ "Asset": {
"additionalProperties": false,
- "description": "Apply an editor result to a canvas item.",
"properties": {
- "type": {
- "const": "canvas.applyEdit",
- "description": "Operation discriminator.",
- "title": "Type",
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
"type": "string"
},
- "payload": {
- "$ref": "#/$defs/CanvasApplyEdit",
- "description": "Apply an editor result to a canvas item."
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "kind": {
+ "description": "Business object or media type.",
+ "enum": [
+ "text",
+ "image",
+ "video",
+ "audio",
+ "file"
+ ],
+ "title": "Kind",
+ "type": "string"
+ },
+ "name": {
+ "description": "User-visible name.",
+ "maxLength": 255,
+ "minLength": 1,
+ "title": "Name",
+ "type": "string"
+ },
+ "fingerprint": {
+ "description": "Immutable content fingerprint.",
+ "pattern": "^sha256:[0-9a-f]{64}$",
+ "title": "Fingerprint",
+ "type": "string"
+ },
+ "path": {
+ "description": "Immutable asset path relative to the project directory.",
+ "title": "Path",
+ "type": "string"
+ },
+ "metadata": {
+ "$ref": "#/$defs/MediaMetadata",
+ "description": "Verified media properties."
+ },
+ "provenance": {
+ "$ref": "#/$defs/AssetProvenance",
+ "description": "Recorded origin and execution context."
}
},
"required": [
- "type",
- "payload"
+ "id",
+ "projectId",
+ "revision",
+ "kind",
+ "name",
+ "fingerprint",
+ "path",
+ "metadata",
+ "provenance"
],
- "title": "CanvasApplyEditCommandOperation",
+ "title": "Asset",
"type": "object"
},
- "CanvasConfigure": {
+ "AssetDelete": {
"additionalProperties": false,
"properties": {
- "itemId": {
- "description": "Canvas item ID.",
- "format": "uuid",
- "title": "Itemid",
- "type": "string"
- },
- "specId": {
- "description": "Generation configuration ID.",
- "format": "uuid",
- "title": "Specid",
- "type": "string"
+ "assetIds": {
+ "description": "Target asset IDs.",
+ "items": {
+ "format": "uuid",
+ "type": "string"
+ },
+ "maxItems": 100,
+ "minItems": 1,
+ "title": "Assetids",
+ "type": "array"
},
- "preserveMaterial": {
+ "clearHistory": {
"default": false,
- "description": "Whether configuring generation retains current material.",
- "title": "Preservematerial",
+ "description": "Whether the confirmed deletion also clears dependent history.",
+ "title": "Clearhistory",
"type": "boolean"
}
},
"required": [
- "itemId",
- "specId",
- "preserveMaterial"
+ "assetIds",
+ "clearHistory"
],
- "title": "CanvasConfigure",
+ "title": "AssetDelete",
"type": "object"
},
- "CanvasConfigureCommand": {
+ "AssetDeleteCommand": {
"additionalProperties": false,
- "description": "Bind a generation configuration to a canvas item.",
+ "description": "Delete assets after an impact preview.",
"properties": {
"commandId": {
"description": "Stable command ID for idempotent replay.",
@@ -17067,7 +17525,7 @@
"type": "string"
},
"type": {
- "const": "canvas.configure",
+ "const": "asset.delete",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -17096,8 +17554,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/CanvasConfigure",
- "description": "Bind a generation configuration to a canvas item."
+ "$ref": "#/$defs/AssetDelete",
+ "description": "Delete assets after an impact preview."
}
},
"required": [
@@ -17108,152 +17566,49 @@
"expectedPreview",
"payload"
],
- "title": "CanvasConfigureCommand",
+ "title": "AssetDeleteCommand",
"type": "object"
},
- "CanvasConfigureCommandOperation": {
+ "AssetImport": {
"additionalProperties": false,
- "description": "Bind a generation configuration to a canvas item.",
"properties": {
- "type": {
- "const": "canvas.configure",
- "description": "Operation discriminator.",
- "title": "Type",
+ "uploadHandle": {
+ "description": "Server-issued staged upload ID.",
+ "format": "uuid",
+ "title": "Uploadhandle",
"type": "string"
},
- "payload": {
- "$ref": "#/$defs/CanvasConfigure",
- "description": "Bind a generation configuration to a canvas item."
- }
- },
- "required": [
- "type",
- "payload"
- ],
- "title": "CanvasConfigureCommandOperation",
- "type": "object"
- },
- "CanvasCreateGeneration": {
- "additionalProperties": false,
- "properties": {
- "spec": {
- "description": "New configuration with purpose=generation.",
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioGenerationSpec",
- "image": "#/$defs/ImageGenerationSpec",
- "text": "#/$defs/TextGenerationSpec",
- "video": "#/$defs/VideoGenerationSpec"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TextGenerationSpec"
- },
- {
- "$ref": "#/$defs/ImageGenerationSpec"
- },
- {
- "$ref": "#/$defs/VideoGenerationSpec"
- },
- {
- "$ref": "#/$defs/AudioGenerationSpec"
- }
- ],
- "title": "Spec"
+ "name": {
+ "description": "User-visible name.",
+ "maxLength": 255,
+ "minLength": 1,
+ "title": "Name",
+ "type": "string"
},
- "item": {
- "description": "Visible item bound to spec.id with role=generation.",
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioCanvasItem",
- "external": "#/$defs/DirectorCanvasItem",
- "file": "#/$defs/FileCanvasItem",
- "group": "#/$defs/GroupCanvasItem",
- "image": "#/$defs/ImageCanvasItem",
- "stack": "#/$defs/StackCanvasItem",
- "subject": "#/$defs/SubjectCanvasItem",
- "text": "#/$defs/TextCanvasItem",
- "timeline": "#/$defs/TimelineCanvasItem",
- "tool": "#/$defs/ToolCanvasItem",
- "video": "#/$defs/VideoCanvasItem"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TextCanvasItem"
- },
- {
- "$ref": "#/$defs/ImageCanvasItem"
- },
- {
- "$ref": "#/$defs/VideoCanvasItem"
- },
- {
- "$ref": "#/$defs/AudioCanvasItem"
- },
- {
- "$ref": "#/$defs/FileCanvasItem"
- },
- {
- "$ref": "#/$defs/SubjectCanvasItem"
- },
- {
- "$ref": "#/$defs/TimelineCanvasItem"
- },
- {
- "$ref": "#/$defs/StackCanvasItem"
- },
- {
- "$ref": "#/$defs/ToolCanvasItem"
- },
- {
- "$ref": "#/$defs/DirectorCanvasItem"
- },
- {
- "$ref": "#/$defs/GroupCanvasItem"
- }
+ "expectedKind": {
+ "description": "Required media kind, when specified.",
+ "enum": [
+ "text",
+ "image",
+ "video",
+ "audio",
+ "file"
],
- "title": "Item"
- },
- "references": {
- "default": [],
- "description": "Input references. Every canvas-derived reference must retain its source node: source.id for follow_current, sourceVersion for pinned. Never replace a canvas reference with an asset-only binding.",
- "items": {
- "description": "Generation input reference. Preserve source canvas identity for canvas-derived references, whether following or pinned.",
- "discriminator": {
- "mapping": {
- "follow_current": "#/$defs/FollowingReference",
- "pinned": "#/$defs/PinnedReference"
- },
- "propertyName": "binding"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/PinnedReference"
- },
- {
- "$ref": "#/$defs/FollowingReference"
- }
- ]
- },
- "title": "References",
- "type": "array"
+ "title": "Expectedkind",
+ "type": "string"
}
},
"required": [
- "spec",
- "item",
- "references"
+ "uploadHandle",
+ "name",
+ "expectedKind"
],
- "title": "CanvasCreateGeneration",
+ "title": "AssetImport",
"type": "object"
},
- "CanvasCreateGenerationCommand": {
+ "AssetImportCommand": {
"additionalProperties": false,
- "description": "Create a visible generation node and references atomically, preserving canvas source connections, including pinned ones.",
+ "description": "Register an uploaded file as a project asset.",
"properties": {
"commandId": {
"description": "Stable command ID for idempotent replay.",
@@ -17268,7 +17623,7 @@
"type": "string"
},
"type": {
- "const": "canvas.createGeneration",
+ "const": "asset.import",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -17297,8 +17652,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/CanvasCreateGeneration",
- "description": "Create a visible generation node and references atomically, preserving canvas source connections, including pinned ones."
+ "$ref": "#/$defs/AssetImport",
+ "description": "Register an uploaded file as a project asset."
}
},
"required": [
@@ -17309,35 +17664,12 @@
"expectedPreview",
"payload"
],
- "title": "CanvasCreateGenerationCommand",
- "type": "object"
- },
- "CanvasEditorAttach": {
- "additionalProperties": false,
- "properties": {
- "itemId": {
- "description": "Canvas item ID.",
- "format": "uuid",
- "title": "Itemid",
- "type": "string"
- },
- "editorId": {
- "description": "Editable document ID.",
- "format": "uuid",
- "title": "Editorid",
- "type": "string"
- }
- },
- "required": [
- "itemId",
- "editorId"
- ],
- "title": "CanvasEditorAttach",
+ "title": "AssetImportCommand",
"type": "object"
},
- "CanvasEditorAttachCommand": {
+ "AssetMetadataCommand": {
"additionalProperties": false,
- "description": "Attach an editor document to a canvas item.",
+ "description": "Rename an asset.",
"properties": {
"commandId": {
"description": "Stable command ID for idempotent replay.",
@@ -17352,7 +17684,7 @@
"type": "string"
},
"type": {
- "const": "canvas.attachEditor",
+ "const": "asset.updateMetadata",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -17381,8 +17713,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/CanvasEditorAttach",
- "description": "Attach an editor document to a canvas item."
+ "$ref": "#/$defs/AssetMetadataUpdate",
+ "description": "Rename an asset."
}
},
"required": [
@@ -17393,39 +17725,40 @@
"expectedPreview",
"payload"
],
- "title": "CanvasEditorAttachCommand",
+ "title": "AssetMetadataCommand",
"type": "object"
},
- "CanvasEditorAttachCommandOperation": {
+ "AssetMetadataUpdate": {
"additionalProperties": false,
- "description": "Attach an editor document to a canvas item.",
"properties": {
- "type": {
- "const": "canvas.attachEditor",
- "description": "Operation discriminator.",
- "title": "Type",
+ "assetId": {
+ "description": "Asset ID.",
+ "format": "uuid",
+ "title": "Assetid",
"type": "string"
},
- "payload": {
- "$ref": "#/$defs/CanvasEditorAttach",
- "description": "Attach an editor document to a canvas item."
+ "name": {
+ "description": "User-visible name.",
+ "maxLength": 255,
+ "minLength": 1,
+ "title": "Name",
+ "type": "string"
}
},
"required": [
- "type",
- "payload"
+ "assetId",
+ "name"
],
- "title": "CanvasEditorAttachCommandOperation",
+ "title": "AssetMetadataUpdate",
"type": "object"
},
- "CanvasEditorDetachCommand": {
+ "AssetPreviewQuery": {
"additionalProperties": false,
- "description": "Detach an editor document from a canvas item.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
+ "queryId": {
+ "description": "Caller-supplied query ID.",
"format": "uuid",
- "title": "Commandid",
+ "title": "Queryid",
"type": "string"
},
"projectId": {
@@ -17435,123 +17768,48 @@
"type": "string"
},
"type": {
- "const": "canvas.detachEditor",
- "description": "Command discriminator.",
+ "const": "asset.preview",
+ "description": "Preview an asset; does not establish model observation.",
"title": "Type",
"type": "string"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
- },
- "expectedPreview": {
- "anyOf": [
- {
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
- },
- "payload": {
- "$ref": "#/$defs/CanvasEditorAttach",
- "description": "Detach an editor document from a canvas item."
- }
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "expectedVersions",
- "expectedPreview",
- "payload"
- ],
- "title": "CanvasEditorDetachCommand",
- "type": "object"
- },
- "CanvasEditorDetachCommandOperation": {
- "additionalProperties": false,
- "description": "Detach an editor document from a canvas item.",
- "properties": {
- "type": {
- "const": "canvas.detachEditor",
- "description": "Operation discriminator.",
- "title": "Type",
- "type": "string"
- },
- "payload": {
- "$ref": "#/$defs/CanvasEditorAttach",
- "description": "Detach an editor document from a canvas item."
- }
- },
- "required": [
- "type",
- "payload"
- ],
- "title": "CanvasEditorDetachCommandOperation",
- "type": "object"
- },
- "CanvasHide": {
- "additionalProperties": false,
- "properties": {
- "itemId": {
- "description": "Canvas item ID.",
+ "objectId": {
+ "description": "Asset ID.",
"format": "uuid",
- "title": "Itemid",
+ "title": "Objectid",
"type": "string"
}
},
"required": [
- "itemId"
+ "queryId",
+ "projectId",
+ "type",
+ "objectId"
],
- "title": "CanvasHide",
+ "title": "AssetPreviewQuery",
"type": "object"
},
- "CanvasHideCommand": {
+ "AssetProvenance": {
"additionalProperties": false,
- "description": "Remove a canvas item; preserves project contents. Remove all visible items to clear the canvas.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
- },
- "type": {
- "const": "canvas.hide",
- "description": "Command discriminator.",
- "title": "Type",
+ "source": {
+ "description": "Input source or recorded provenance.",
+ "enum": [
+ "upload",
+ "manual",
+ "agent_written",
+ "generated",
+ "edited",
+ "rendered",
+ "imported"
+ ],
+ "title": "Source",
"type": "string"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
- },
- "expectedPreview": {
+ "jobId": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
+ "format": "uuid",
"type": "string"
},
{
@@ -17559,131 +17817,24 @@
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
- },
- "payload": {
- "$ref": "#/$defs/CanvasHide",
- "description": "Remove a canvas item; preserves project contents. Remove all visible items to clear the canvas."
- }
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "expectedVersions",
- "expectedPreview",
- "payload"
- ],
- "title": "CanvasHideCommand",
- "type": "object"
- },
- "CanvasHideCommandOperation": {
- "additionalProperties": false,
- "description": "Remove a canvas item; preserves project contents. Remove all visible items to clear the canvas.",
- "properties": {
- "type": {
- "const": "canvas.hide",
- "description": "Operation discriminator.",
- "title": "Type",
- "type": "string"
- },
- "payload": {
- "$ref": "#/$defs/CanvasHide",
- "description": "Remove a canvas item; preserves project contents. Remove all visible items to clear the canvas."
- }
- },
- "required": [
- "type",
- "payload"
- ],
- "title": "CanvasHideCommandOperation",
- "type": "object"
- },
- "CanvasItemBase": {
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
- "format": "uuid",
- "title": "Id",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
- },
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
+ "description": "Generation job ID.",
+ "title": "Jobid"
},
- "kind": {
- "description": "Business object or media type.",
- "enum": [
- "text",
- "image",
- "video",
- "audio",
- "file",
- "group",
- "timeline",
- "subject",
- "stack",
- "tool",
- "external"
+ "toolTaskId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
],
- "title": "Kind",
- "type": "string"
- },
- "title": {
- "default": "",
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
- "type": "string"
- },
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
- },
- "width": {
- "default": 352,
- "description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "title": "Width",
- "type": "number"
- },
- "height": {
- "default": 198,
- "description": "Height in pixels.",
- "exclusiveMinimum": 0,
- "title": "Height",
- "type": "number"
- },
- "zIndex": {
- "default": 0,
- "description": "Canvas stacking order.",
- "title": "Zindex",
- "type": "integer"
- },
- "locked": {
- "default": false,
- "description": "Whether edits to this object are blocked.",
- "title": "Locked",
- "type": "boolean"
- },
- "visible": {
- "default": true,
- "description": "Whether this object is displayed.",
- "title": "Visible",
- "type": "boolean"
+ "default": null,
+ "description": "Tool execution ID.",
+ "title": "Tooltaskid"
},
- "parentId": {
+ "sourceItemId": {
"anyOf": [
{
"format": "uuid",
@@ -17694,106 +17845,218 @@
}
],
"default": null,
- "description": "Parent canvas group ID, or null for the root.",
- "title": "Parentid"
+ "description": "Source canvas item ID.",
+ "title": "Sourceitemid"
},
- "tags": {
- "default": [],
- "description": "User-defined search tags.",
- "items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "type": "string"
+ "editorDocumentId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Editable document ID.",
+ "title": "Editordocumentid"
+ },
+ "editorRevision": {
+ "anyOf": [
+ {
+ "minimum": 1,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Expected editable document revision.",
+ "title": "Editorrevision"
+ },
+ "directorRender": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/DirectorRenderEvidence"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Frozen Director video output evidence and source version."
+ },
+ "sources": {
+ "default": [],
+ "description": "Ordered source asset versions.",
+ "items": {
+ "$ref": "#/$defs/AssetRef"
},
- "title": "Tags",
+ "title": "Sources",
"type": "array"
+ },
+ "inputFingerprint": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the fixed execution input.",
+ "title": "Inputfingerprint"
+ },
+ "agentRunId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Agent turn ID.",
+ "title": "Agentrunid"
+ },
+ "agentRuntime": {
+ "anyOf": [
+ {
+ "enum": [
+ "opencode",
+ "codex",
+ "claude",
+ "jiuwenswarm",
+ "deepseek"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Native Agent runtime that produced this asset.",
+ "title": "Agentruntime"
+ },
+ "modelSnapshot": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ModelSnapshot"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fixed model connection recorded for provenance."
+ },
+ "prompt": {
+ "anyOf": [
+ {
+ "maxLength": 20000,
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Generation prompt text.",
+ "title": "Prompt"
+ },
+ "importedFrom": {
+ "anyOf": [
+ {
+ "enum": [
+ "generated",
+ "edited"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Original source recorded by a canvas archive this asset was imported from.",
+ "title": "Importedfrom"
}
},
"required": [
- "id",
- "projectId",
- "revision",
- "kind",
- "title",
- "position",
- "width",
- "height",
- "zIndex",
- "locked",
- "visible",
- "parentId",
- "tags"
+ "source",
+ "jobId",
+ "toolTaskId",
+ "sourceItemId",
+ "editorDocumentId",
+ "editorRevision",
+ "sources",
+ "inputFingerprint",
+ "agentRunId",
+ "agentRuntime",
+ "modelSnapshot",
+ "prompt",
+ "importedFrom"
],
- "title": "CanvasItemBase",
+ "title": "AssetProvenance",
"type": "object"
},
- "CanvasItemVersion": {
+ "AssetRef": {
"additionalProperties": false,
"properties": {
- "objectType": {
- "const": "canvas_item",
- "description": "Source canvas item type.",
- "title": "Objecttype",
- "type": "string"
- },
- "id": {
- "description": "Stable object ID.",
+ "assetId": {
+ "description": "ID of a registered project asset from project.assets[].id or a successful asset command result.",
"format": "uuid",
- "title": "Id",
+ "title": "Assetid",
"type": "string"
},
"revision": {
- "description": "Current object revision for optimistic concurrency.",
+ "description": "Referenced immutable asset revision.",
"minimum": 1,
"title": "Revision",
"type": "integer"
- }
- },
- "required": [
- "objectType",
- "id",
- "revision"
- ],
- "title": "CanvasItemVersion",
- "type": "object"
- },
- "CanvasMaterialize": {
- "additionalProperties": false,
- "properties": {
- "itemId": {
- "description": "Canvas item ID.",
- "format": "uuid",
- "title": "Itemid",
- "type": "string"
},
- "asset": {
- "$ref": "#/$defs/AssetRef",
- "description": "Immutable asset version."
+ "fingerprint": {
+ "description": "Immutable content fingerprint.",
+ "pattern": "^sha256:[0-9a-f]{64}$",
+ "title": "Fingerprint",
+ "type": "string"
},
- "discardGenerationDraft": {
- "default": false,
- "description": "Whether material replacement discards the generation draft.",
- "title": "Discardgenerationdraft",
- "type": "boolean"
+ "kind": {
+ "description": "Business object or media type.",
+ "enum": [
+ "text",
+ "image",
+ "video",
+ "audio",
+ "file"
+ ],
+ "title": "Kind",
+ "type": "string"
}
},
"required": [
- "itemId",
- "asset",
- "discardGenerationDraft"
+ "assetId",
+ "revision",
+ "fingerprint",
+ "kind"
],
- "title": "CanvasMaterialize",
+ "title": "AssetRef",
"type": "object"
},
- "CanvasMaterializeCommand": {
+ "AssetSearchQuery": {
"additionalProperties": false,
- "description": "Bind an asset to an empty or material canvas item.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
+ "queryId": {
+ "description": "Caller-supplied query ID.",
"format": "uuid",
- "title": "Commandid",
+ "title": "Queryid",
"type": "string"
},
"projectId": {
@@ -17803,95 +18066,147 @@
"type": "string"
},
"type": {
- "const": "canvas.materialize",
- "description": "Command discriminator.",
+ "const": "asset.search",
+ "description": "Search project assets.",
"title": "Type",
"type": "string"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
- },
- "expectedPreview": {
- "anyOf": [
- {
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "text": {
+ "default": "",
+ "description": "Asset search text.",
+ "maxLength": 1000,
+ "title": "Text",
+ "type": "string"
},
- "payload": {
- "$ref": "#/$defs/CanvasMaterialize",
- "description": "Bind an asset to an empty or material canvas item."
+ "offset": {
+ "default": 0,
+ "description": "Number of matching records to skip.",
+ "minimum": 0,
+ "title": "Offset",
+ "type": "integer"
+ },
+ "limit": {
+ "default": 50,
+ "description": "Maximum number of records to return.",
+ "maximum": 200,
+ "minimum": 1,
+ "title": "Limit",
+ "type": "integer"
}
},
"required": [
- "commandId",
+ "queryId",
"projectId",
"type",
- "expectedVersions",
- "expectedPreview",
- "payload"
+ "text",
+ "offset",
+ "limit"
],
- "title": "CanvasMaterializeCommand",
+ "title": "AssetSearchQuery",
"type": "object"
},
- "CanvasMaterializeCommandOperation": {
+ "AssetUsageQuery": {
"additionalProperties": false,
- "description": "Bind an asset to an empty or material canvas item.",
"properties": {
+ "queryId": {
+ "description": "Caller-supplied query ID.",
+ "format": "uuid",
+ "title": "Queryid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
"type": {
- "const": "canvas.materialize",
- "description": "Operation discriminator.",
+ "const": "asset.usage",
+ "description": "Read asset dependencies.",
"title": "Type",
"type": "string"
},
- "payload": {
- "$ref": "#/$defs/CanvasMaterialize",
- "description": "Bind an asset to an empty or material canvas item."
+ "objectId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Asset ID, or all assets when omitted.",
+ "title": "Objectid"
+ },
+ "offset": {
+ "default": 0,
+ "description": "Number of matching records to skip.",
+ "minimum": 0,
+ "title": "Offset",
+ "type": "integer"
+ },
+ "limit": {
+ "default": 50,
+ "description": "Maximum number of records to return.",
+ "maximum": 200,
+ "minimum": 1,
+ "title": "Limit",
+ "type": "integer"
}
},
"required": [
+ "queryId",
+ "projectId",
"type",
- "payload"
+ "objectId",
+ "offset",
+ "limit"
],
- "title": "CanvasMaterializeCommandOperation",
+ "title": "AssetUsageQuery",
"type": "object"
},
- "CanvasMove": {
+ "AssetWriteText": {
"additionalProperties": false,
"properties": {
- "items": {
- "description": "Ordered entries in this collection.",
- "items": {
- "$ref": "#/$defs/CanvasMoveItem"
- },
- "maxItems": 500,
- "minItems": 1,
- "title": "Items",
- "type": "array"
+ "name": {
+ "description": "User-visible name.",
+ "maxLength": 255,
+ "minLength": 1,
+ "title": "Name",
+ "type": "string"
+ },
+ "text": {
+ "description": "UTF-8 text content or search query.",
+ "maxLength": 1048576,
+ "title": "Text",
+ "type": "string"
+ },
+ "previousAsset": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AssetRef"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Previous immutable version for a new text asset version."
}
},
"required": [
- "items"
+ "name",
+ "text",
+ "previousAsset"
],
- "title": "CanvasMove",
+ "title": "AssetWriteText",
"type": "object"
},
- "CanvasMoveCommand": {
+ "AssetWriteTextCommand": {
"additionalProperties": false,
- "description": "Move one or more canvas items.",
+ "description": "Write a text asset or a new version of an existing text asset.",
"properties": {
"commandId": {
"description": "Stable command ID for idempotent replay.",
@@ -17906,7 +18221,7 @@
"type": "string"
},
"type": {
- "const": "canvas.move",
+ "const": "asset.writeText",
"description": "Command discriminator.",
"title": "Type",
"type": "string"
@@ -17935,8 +18250,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/CanvasMove",
- "description": "Move one or more canvas items."
+ "$ref": "#/$defs/AssetWriteText",
+ "description": "Write a text asset or a new version of an existing text asset."
}
},
"required": [
@@ -17947,128 +18262,79 @@
"expectedPreview",
"payload"
],
- "title": "CanvasMoveCommand",
+ "title": "AssetWriteTextCommand",
"type": "object"
},
- "CanvasMoveCommandOperation": {
+ "AudioCanvasItem": {
"additionalProperties": false,
- "description": "Move one or more canvas items.",
"properties": {
- "type": {
- "const": "canvas.move",
- "description": "Operation discriminator.",
- "title": "Type",
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
"type": "string"
},
- "payload": {
- "$ref": "#/$defs/CanvasMove",
- "description": "Move one or more canvas items."
- }
- },
- "required": [
- "type",
- "payload"
- ],
- "title": "CanvasMoveCommandOperation",
- "type": "object"
- },
- "CanvasMoveItem": {
- "additionalProperties": false,
- "properties": {
- "itemId": {
- "description": "Canvas item ID.",
+ "projectId": {
+ "description": "Owning project ID.",
"format": "uuid",
- "title": "Itemid",
+ "title": "Projectid",
"type": "string"
},
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
- }
- },
- "required": [
- "itemId",
- "position"
- ],
- "title": "CanvasMoveItem",
- "type": "object"
- },
- "CanvasPresentationUpdate": {
- "additionalProperties": false,
- "properties": {
- "itemId": {
- "description": "Canvas item ID.",
- "format": "uuid",
- "title": "Itemid",
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "kind": {
+ "const": "audio",
+ "description": "Business object or media type.",
+ "title": "Kind",
"type": "string"
},
"title": {
- "anyOf": [
- {
- "maxLength": 255,
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
+ "default": "",
"description": "User-visible title.",
- "title": "Title"
+ "maxLength": 255,
+ "title": "Title",
+ "type": "string"
+ },
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
},
"width": {
- "anyOf": [
- {
- "exclusiveMinimum": 0,
- "type": "number"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
+ "default": 352,
"description": "Width in pixels.",
- "title": "Width"
+ "exclusiveMinimum": 0,
+ "title": "Width",
+ "type": "number"
},
"height": {
- "anyOf": [
- {
- "exclusiveMinimum": 0,
- "type": "number"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
+ "default": 198,
"description": "Height in pixels.",
- "title": "Height"
+ "exclusiveMinimum": 0,
+ "title": "Height",
+ "type": "number"
},
"zIndex": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
+ "default": 0,
"description": "Canvas stacking order.",
- "title": "Zindex"
+ "title": "Zindex",
+ "type": "integer"
},
"locked": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
+ "default": false,
"description": "Whether edits to this object are blocked.",
- "title": "Locked"
+ "title": "Locked",
+ "type": "boolean"
+ },
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
},
"parentId": {
"anyOf": [
@@ -18083,45 +18349,97 @@
"default": null,
"description": "Parent canvas group ID, or null for the root.",
"title": "Parentid"
+ },
+ "tags": {
+ "default": [],
+ "description": "User-defined search tags.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Tags",
+ "type": "array"
+ },
+ "binding": {
+ "description": "Business object displayed by this canvas item.",
+ "discriminator": {
+ "mapping": {
+ "empty": "#/$defs/EmptyBinding",
+ "generation": "#/$defs/GenerationBinding",
+ "material": "#/$defs/MaterialBinding"
+ },
+ "propertyName": "role"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/EmptyBinding"
+ },
+ {
+ "$ref": "#/$defs/MaterialBinding"
+ },
+ {
+ "$ref": "#/$defs/GenerationBinding"
+ }
+ ],
+ "title": "Binding"
+ },
+ "editors": {
+ "default": [],
+ "description": "Attached editable documents.",
+ "items": {
+ "$ref": "#/$defs/EditorRef"
+ },
+ "title": "Editors",
+ "type": "array"
}
},
"required": [
- "itemId",
+ "id",
+ "projectId",
+ "revision",
+ "kind",
"title",
+ "position",
"width",
"height",
"zIndex",
"locked",
- "parentId"
+ "visible",
+ "parentId",
+ "tags",
+ "binding",
+ "editors"
],
- "title": "CanvasPresentationUpdate",
+ "title": "AudioCanvasItem",
"type": "object"
},
- "CanvasPublishMedia": {
+ "AudioExecution": {
"additionalProperties": false,
"properties": {
- "itemId": {
- "description": "Canvas item ID.",
- "format": "uuid",
- "title": "Itemid",
+ "kind": {
+ "const": "audio",
+ "description": "Business object or media type.",
+ "title": "Kind",
"type": "string"
},
- "source": {
+ "voice": {
"anyOf": [
{
- "$ref": "#/$defs/AssetRef"
+ "type": "string"
},
{
"type": "null"
}
],
"default": null,
- "description": "Input source or recorded provenance."
+ "description": "Provider voice identifier or name.",
+ "title": "Voice"
},
- "sourceEditorId": {
+ "speaker": {
"anyOf": [
{
- "format": "uuid",
"type": "string"
},
{
@@ -18129,81 +18447,111 @@
}
],
"default": null,
- "description": "Source editable document ID.",
- "title": "Sourceeditorid"
+ "description": "Provider speaker identifier.",
+ "title": "Speaker"
},
- "document": {
- "description": "Editable document owned by this operation.",
- "discriminator": {
- "mapping": {
- "director": "#/$defs/DirectorDocument",
- "image_crop": "#/$defs/ImageCropDocument",
- "layers": "#/$defs/LayerDocument",
- "media_edit": "#/$defs/MediaEditDocument",
- "stack": "#/$defs/StackDocument",
- "subject": "#/$defs/SubjectDocument",
- "timeline": "#/$defs/TimelineDocument",
- "tool": "#/$defs/ToolDocument"
- },
- "propertyName": "kind"
- },
- "oneOf": [
+ "format": {
+ "description": "Audio container or codec format.",
+ "enum": [
+ "mp3",
+ "wav"
+ ],
+ "title": "Format",
+ "type": "string"
+ },
+ "sampleRate": {
+ "anyOf": [
{
- "$ref": "#/$defs/TimelineDocument"
+ "minimum": 1,
+ "type": "integer"
},
{
- "$ref": "#/$defs/SubjectDocument"
- },
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Audio samples per second.",
+ "title": "Samplerate"
+ },
+ "creationType": {
+ "default": "audio",
+ "description": "Speech or music creation mode.",
+ "enum": [
+ "audio",
+ "music"
+ ],
+ "title": "Creationtype",
+ "type": "string"
+ },
+ "instrumental": {
+ "default": false,
+ "description": "Legacy explicit instrumental choice retained for stored records.",
+ "title": "Instrumental",
+ "type": "boolean"
+ },
+ "maxDurationSeconds": {
+ "anyOf": [
{
- "$ref": "#/$defs/LayerDocument"
+ "maximum": 360,
+ "minimum": 8,
+ "type": "number"
},
{
- "$ref": "#/$defs/ImageCropDocument"
- },
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Maximum generated audio duration in seconds.",
+ "title": "Maxdurationseconds"
+ },
+ "scoreMode": {
+ "anyOf": [
{
- "$ref": "#/$defs/StackDocument"
+ "enum": [
+ "melody",
+ "full"
+ ],
+ "type": "string"
},
{
- "$ref": "#/$defs/ToolDocument"
- },
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Whether reference music supplies melody or full accompaniment.",
+ "title": "Scoremode"
+ },
+ "seed": {
+ "anyOf": [
{
- "$ref": "#/$defs/DirectorDocument"
+ "type": "integer"
},
{
- "$ref": "#/$defs/MediaEditDocument"
+ "type": "null"
}
],
- "title": "Document"
- },
- "outputs": {
- "description": "Ordered published media outputs.",
- "items": {
- "$ref": "#/$defs/MediaPublicationOutput"
- },
- "maxItems": 50,
- "minItems": 1,
- "title": "Outputs",
- "type": "array"
+ "default": null,
+ "description": "Random seed fixed when the job was accepted.",
+ "title": "Seed"
}
},
"required": [
- "itemId",
- "source",
- "sourceEditorId",
- "document",
- "outputs"
+ "kind",
+ "voice",
+ "speaker",
+ "format",
+ "sampleRate"
],
- "title": "CanvasPublishMedia",
+ "title": "AudioExecution",
"type": "object"
},
- "CanvasPublishMediaCommand": {
+ "AudioGenerationSpec": {
"additionalProperties": false,
- "description": "Publish edited media outputs with their editor snapshot.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
+ "id": {
+ "description": "Stable identity of this project-owned object.",
"format": "uuid",
- "title": "Commandid",
+ "title": "Id",
"type": "string"
},
"projectId": {
@@ -18212,25 +18560,27 @@
"title": "Projectid",
"type": "string"
},
- "type": {
- "const": "canvas.publishMedia",
- "description": "Command discriminator.",
- "title": "Type",
- "type": "string"
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
+ "purpose": {
+ "default": "draft",
+ "description": "Draft settings or executable generation configuration.",
+ "enum": [
+ "draft",
+ "generation"
+ ],
+ "title": "Purpose",
+ "type": "string"
},
- "expectedPreview": {
+ "modelConfigId": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
+ "format": "uuid",
"type": "string"
},
{
@@ -18238,144 +18588,113 @@
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "description": "Model configuration ID from the model catalog or user model selections.",
+ "title": "Modelconfigid"
},
- "payload": {
- "$ref": "#/$defs/CanvasPublishMedia",
- "description": "Publish edited media outputs with their editor snapshot."
- }
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "expectedVersions",
- "expectedPreview",
- "payload"
- ],
- "title": "CanvasPublishMediaCommand",
- "type": "object"
- },
- "CanvasReferenceSources": {
- "additionalProperties": false,
- "properties": {
- "followCurrent": {
- "$ref": "#/$defs/FollowingReferenceSource",
- "description": "Source fields for a follow_current reference."
+ "prompt": {
+ "default": "",
+ "description": "Generation prompt text.",
+ "maxLength": 20000,
+ "title": "Prompt",
+ "type": "string"
},
- "pinned": {
- "$ref": "#/$defs/PinnedReferenceSource",
- "description": "Source fields for a pinned reference retaining its canvas connection."
- }
- },
- "required": [
- "followCurrent",
- "pinned"
- ],
- "title": "CanvasReferenceSources",
- "type": "object"
- },
- "CanvasShow": {
- "additionalProperties": false,
- "properties": {
- "item": {
- "description": "Canvas display item to create or restore.",
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioCanvasItem",
- "external": "#/$defs/DirectorCanvasItem",
- "file": "#/$defs/FileCanvasItem",
- "group": "#/$defs/GroupCanvasItem",
- "image": "#/$defs/ImageCanvasItem",
- "stack": "#/$defs/StackCanvasItem",
- "subject": "#/$defs/SubjectCanvasItem",
- "text": "#/$defs/TextCanvasItem",
- "timeline": "#/$defs/TimelineCanvasItem",
- "tool": "#/$defs/ToolCanvasItem",
- "video": "#/$defs/VideoCanvasItem"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TextCanvasItem"
- },
- {
- "$ref": "#/$defs/ImageCanvasItem"
- },
- {
- "$ref": "#/$defs/VideoCanvasItem"
- },
- {
- "$ref": "#/$defs/AudioCanvasItem"
- },
- {
- "$ref": "#/$defs/FileCanvasItem"
- },
- {
- "$ref": "#/$defs/SubjectCanvasItem"
- },
- {
- "$ref": "#/$defs/TimelineCanvasItem"
- },
+ "promptContent": {
+ "anyOf": [
{
- "$ref": "#/$defs/StackCanvasItem"
+ "items": {
+ "discriminator": {
+ "mapping": {
+ "reference": "#/$defs/PromptReference",
+ "text": "#/$defs/PromptText"
+ },
+ "propertyName": "type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/PromptText"
+ },
+ {
+ "$ref": "#/$defs/PromptReference"
+ }
+ ]
+ },
+ "type": "array"
},
{
- "$ref": "#/$defs/ToolCanvasItem"
- },
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Structured prompt text and reference tokens.",
+ "title": "Promptcontent"
+ },
+ "currentResultId": {
+ "anyOf": [
{
- "$ref": "#/$defs/DirectorCanvasItem"
+ "format": "uuid",
+ "type": "string"
},
{
- "$ref": "#/$defs/GroupCanvasItem"
+ "type": "null"
}
],
- "title": "Item"
+ "default": null,
+ "description": "Currently adopted result ID.",
+ "title": "Currentresultid"
+ },
+ "kind": {
+ "const": "audio",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/$defs/AudioParameters",
+ "description": "Typed generation or editing parameters."
}
},
"required": [
- "item"
+ "id",
+ "projectId",
+ "revision",
+ "purpose",
+ "modelConfigId",
+ "prompt",
+ "promptContent",
+ "currentResultId",
+ "kind",
+ "parameters"
],
- "title": "CanvasShow",
+ "title": "AudioGenerationSpec",
"type": "object"
},
- "CanvasShowCommand": {
+ "AudioParameters": {
"additionalProperties": false,
- "description": "Create or restore a canvas display item.",
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ "creationType": {
+ "default": "audio",
+ "description": "Speech or music creation mode.",
+ "enum": [
+ "audio",
+ "music"
+ ],
+ "title": "Creationtype",
"type": "string"
},
- "type": {
- "const": "canvas.show",
- "description": "Command discriminator.",
- "title": "Type",
+ "mode": {
+ "default": "tts",
+ "description": "Operation mode within this contract variant.",
+ "enum": [
+ "tts",
+ "unified"
+ ],
+ "title": "Mode",
"type": "string"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
- },
- "expectedPreview": {
+ "voice": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
+ "maxLength": 200,
"type": "string"
},
{
@@ -18383,96 +18702,84 @@
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
- },
- "payload": {
- "$ref": "#/$defs/CanvasShow",
- "description": "Create or restore a canvas display item."
- }
- },
- "required": [
- "commandId",
- "projectId",
- "type",
- "expectedVersions",
- "expectedPreview",
- "payload"
- ],
- "title": "CanvasShowCommand",
- "type": "object"
- },
- "CanvasShowCommandOperation": {
- "additionalProperties": false,
- "description": "Create or restore a canvas display item.",
- "properties": {
- "type": {
- "const": "canvas.show",
- "description": "Operation discriminator.",
- "title": "Type",
- "type": "string"
+ "description": "Provider voice identifier or name; library voices retain provider naming.",
+ "title": "Voice"
},
- "payload": {
- "$ref": "#/$defs/CanvasShow",
- "description": "Create or restore a canvas display item."
- }
- },
- "required": [
- "type",
- "payload"
- ],
- "title": "CanvasShowCommandOperation",
- "type": "object"
- },
- "CanvasStatusQuery": {
- "additionalProperties": false,
- "properties": {
- "queryId": {
- "description": "Caller-supplied query ID.",
- "format": "uuid",
- "title": "Queryid",
- "type": "string"
+ "voiceSelection": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/VoiceSelection"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Connection-scoped voice selection; validated against the live registry before generation."
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "instrumental": {
+ "default": false,
+ "description": "Legacy explicit instrumental choice retained for stored records.",
+ "title": "Instrumental",
+ "type": "boolean"
},
- "type": {
- "const": "canvas.status",
- "description": "Read node status, current asset and reusable referenceSources.",
- "title": "Type",
+ "lyrics": {
+ "default": "",
+ "description": "Song lyrics; empty lyrics request instrumental music.",
+ "maxLength": 5000,
+ "title": "Lyrics",
"type": "string"
},
- "objectId": {
- "description": "Canvas item ID.",
- "format": "uuid",
- "title": "Objectid",
+ "durationSeconds": {
+ "anyOf": [
+ {
+ "maximum": 360,
+ "minimum": 8,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Maximum music duration in seconds.",
+ "title": "Durationseconds"
+ },
+ "scoreMode": {
+ "default": "melody",
+ "description": "Music with one audio reference: follow its transcribed melody, or melody and chords",
+ "enum": [
+ "melody",
+ "full"
+ ],
+ "title": "Scoremode",
"type": "string"
},
- "waitSeconds": {
- "default": 0,
- "description": "Wait for generation changes; zero returns immediately.",
- "maximum": 30,
- "minimum": 0,
- "title": "Waitseconds",
- "type": "number"
+ "durationFromReference": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Music with one audio reference: cap the length at the reference length (unset follows it) instead of durationSeconds",
+ "title": "Durationfromreference"
}
},
"required": [
- "queryId",
- "projectId",
- "type",
- "objectId",
- "waitSeconds"
+ "creationType",
+ "mode",
+ "voice"
],
- "title": "CanvasStatusQuery",
+ "title": "AudioParameters",
"type": "object"
},
- "CanvasUpdateCommand": {
+ "BatchCommand": {
"additionalProperties": false,
- "description": "Update canvas presentation, grouping or lock state.",
+ "description": "Apply multiple operations atomically; all succeed or none are committed.",
"properties": {
"commandId": {
"description": "Stable command ID for idempotent replay.",
@@ -18487,8 +18794,8 @@
"type": "string"
},
"type": {
- "const": "canvas.update",
- "description": "Command discriminator.",
+ "const": "creation.batch",
+ "description": "Batch command discriminator.",
"title": "Type",
"type": "string"
},
@@ -18516,8 +18823,8 @@
"title": "Expectedpreview"
},
"payload": {
- "$ref": "#/$defs/CanvasPresentationUpdate",
- "description": "Update canvas presentation, grouping or lock state."
+ "$ref": "#/$defs/BatchPayload",
+ "description": "Ordered operations committed atomically."
}
},
"required": [
@@ -18528,324 +18835,430 @@
"expectedPreview",
"payload"
],
- "title": "CanvasUpdateCommand",
+ "title": "BatchCommand",
"type": "object"
},
- "CanvasUpdateCommandOperation": {
+ "BatchPayload": {
"additionalProperties": false,
- "description": "Update canvas presentation, grouping or lock state.",
"properties": {
- "type": {
- "const": "canvas.update",
- "description": "Operation discriminator.",
- "title": "Type",
- "type": "string"
- },
- "payload": {
- "$ref": "#/$defs/CanvasPresentationUpdate",
- "description": "Update canvas presentation, grouping or lock state."
+ "operations": {
+ "description": "Ordered operations committed as one atomic transaction.",
+ "items": {
+ "discriminator": {
+ "mapping": {
+ "canvas.applyEdit": "#/$defs/CanvasApplyEditCommandOperation",
+ "canvas.attachEditor": "#/$defs/CanvasEditorAttachCommandOperation",
+ "canvas.configure": "#/$defs/CanvasConfigureCommandOperation",
+ "canvas.detachEditor": "#/$defs/CanvasEditorDetachCommandOperation",
+ "canvas.hide": "#/$defs/CanvasHideCommandOperation",
+ "canvas.materialize": "#/$defs/CanvasMaterializeCommandOperation",
+ "canvas.move": "#/$defs/CanvasMoveCommandOperation",
+ "canvas.show": "#/$defs/CanvasShowCommandOperation",
+ "canvas.update": "#/$defs/CanvasUpdateCommandOperation",
+ "director.apply": "#/$defs/DirectorApplyCommandOperation",
+ "director.camera.delete": "#/$defs/DirectorCameraDeleteCommandOperation",
+ "director.duration.set": "#/$defs/DirectorSetDurationCommandOperation",
+ "director.storyboard.delete": "#/$defs/DirectorStoryboardDeleteCommandOperation",
+ "director.storyboard.reorder": "#/$defs/DirectorStoryboardReorderCommandOperation",
+ "director.storyboard.resize": "#/$defs/DirectorStoryboardResizeCommandOperation",
+ "editor.create": "#/$defs/EditorCreateCommandOperation",
+ "editor.save": "#/$defs/EditorSaveCommandOperation",
+ "generationSpec.create": "#/$defs/SpecCreateCommandOperation",
+ "generationSpec.setPrompt": "#/$defs/SpecPromptCommandOperation",
+ "generationSpec.update": "#/$defs/SpecUpdateCommandOperation",
+ "reference.add": "#/$defs/ReferenceAddCommandOperation",
+ "reference.remove": "#/$defs/ReferenceRemoveCommandOperation",
+ "reference.restore": "#/$defs/ReferenceRestoreCommandOperation",
+ "reference.update": "#/$defs/ReferenceUpdateCommandOperation",
+ "result.select": "#/$defs/ResultSelectCommandOperation"
+ },
+ "propertyName": "type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/CanvasShowCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/CanvasMoveCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/CanvasUpdateCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/CanvasHideCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/CanvasMaterializeCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/CanvasApplyEditCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/CanvasConfigureCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/CanvasEditorAttachCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/CanvasEditorDetachCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/SpecCreateCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/SpecUpdateCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/SpecPromptCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/ReferenceAddCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/ReferenceUpdateCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/ReferenceRestoreCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/ReferenceRemoveCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/ResultSelectCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/EditorCreateCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/EditorSaveCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/DirectorApplyCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardReorderCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardResizeCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardDeleteCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/DirectorSetDurationCommandOperation"
+ },
+ {
+ "$ref": "#/$defs/DirectorCameraDeleteCommandOperation"
+ }
+ ]
+ },
+ "maxItems": 500,
+ "minItems": 1,
+ "title": "Operations",
+ "type": "array"
}
},
"required": [
- "type",
- "payload"
+ "operations"
],
- "title": "CanvasUpdateCommandOperation",
+ "title": "BatchPayload",
"type": "object"
},
- "ChangedObject": {
+ "CameraChannels": {
"additionalProperties": false,
"properties": {
- "version": {
- "$ref": "#/$defs/ObjectVersion",
- "description": "Version of the referenced record."
+ "position": {
+ "default": [],
+ "description": "Independent camera position channel.",
+ "items": {
+ "$ref": "#/$defs/CameraVectorFrame"
+ },
+ "title": "Position",
+ "type": "array"
},
- "change": {
- "description": "Kind of business object change.",
- "enum": [
- "created",
- "updated",
- "hidden",
- "deleted"
- ],
- "title": "Change",
- "type": "string"
+ "target": {
+ "default": [],
+ "description": "Independent camera target channel.",
+ "items": {
+ "$ref": "#/$defs/CameraVectorFrame"
+ },
+ "title": "Target",
+ "type": "array"
+ },
+ "up": {
+ "default": [],
+ "description": "Independent camera up-vector channel.",
+ "items": {
+ "$ref": "#/$defs/CameraVectorFrame"
+ },
+ "title": "Up",
+ "type": "array"
+ },
+ "focalLength": {
+ "default": [],
+ "description": "Independent camera focal-length channel.",
+ "items": {
+ "$ref": "#/$defs/CameraNumberFrame"
+ },
+ "title": "Focallength",
+ "type": "array"
}
},
"required": [
- "version",
- "change"
+ "position",
+ "target",
+ "up",
+ "focalLength"
],
- "title": "ChangedObject",
+ "title": "CameraChannels",
"type": "object"
},
- "CommandBase": {
+ "CameraFrame": {
"additionalProperties": false,
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
+ "id": {
+ "description": "Stable object ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
"type": "string"
},
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
- "type": "string"
+ "time": {
+ "description": "Keyframe time in seconds.",
+ "minimum": 0,
+ "title": "Time",
+ "type": "number"
},
- "type": {
- "description": "Operation or variant discriminator.",
- "title": "Type",
+ "value": {
+ "$ref": "#/$defs/StageCamera",
+ "description": "Keyframed transform or camera pose."
+ }
+ },
+ "required": [
+ "id",
+ "time",
+ "value"
+ ],
+ "title": "CameraFrame",
+ "type": "object"
+ },
+ "CameraNumberFrame": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable channel keyframe ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
"type": "string"
},
- "expectedVersions": {
- "default": [],
- "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Expectedversions",
- "type": "array"
+ "time": {
+ "description": "Keyframe time in seconds.",
+ "minimum": 0,
+ "title": "Time",
+ "type": "number"
},
- "expectedPreview": {
+ "value": {
+ "description": "Keyframed camera focal length.",
+ "exclusiveMinimum": 0,
+ "title": "Value",
+ "type": "number"
+ },
+ "transition": {
"anyOf": [
{
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
+ "$ref": "#/$defs/StageBezierTransition"
},
{
"type": "null"
}
],
"default": null,
- "description": "Fingerprint of the confirmed impact preview.",
- "title": "Expectedpreview"
+ "description": "Interpolation for the outgoing segment."
}
},
"required": [
- "commandId",
- "projectId",
- "type",
- "expectedVersions",
- "expectedPreview"
+ "id",
+ "time",
+ "value",
+ "transition"
],
- "title": "CommandBase",
+ "title": "CameraNumberFrame",
"type": "object"
},
- "CommandReceipt": {
+ "CameraRig": {
"additionalProperties": false,
"properties": {
- "commandId": {
- "description": "Stable command ID for idempotent replay.",
- "format": "uuid",
- "title": "Commandid",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
- "format": "uuid",
- "title": "Projectid",
+ "id": {
+ "description": "Stable object ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
"type": "string"
},
- "inputFingerprint": {
- "description": "Fingerprint of the fixed execution input.",
- "pattern": "^[0-9a-f]{64}$",
- "title": "Inputfingerprint",
+ "name": {
+ "description": "User-visible name.",
+ "maxLength": 255,
+ "title": "Name",
"type": "string"
},
- "status": {
- "description": "Current operation lifecycle state.",
+ "aspectRatio": {
+ "default": "16:9",
+ "description": "Camera output aspect ratio.",
"enum": [
- "applied",
- "accepted",
- "noop",
- "rejected"
+ "16:9",
+ "2.39:1",
+ "9:16",
+ "1:1",
+ "4:3",
+ "3:4"
],
- "title": "Status",
+ "title": "Aspectratio",
"type": "string"
},
- "changed": {
- "default": [],
- "description": "Business objects changed by the operation.",
- "items": {
- "$ref": "#/$defs/ObjectVersion"
- },
- "title": "Changed",
- "type": "array"
+ "pose": {
+ "$ref": "#/$defs/StageCamera",
+ "description": "Camera position and look-at target."
},
- "jobIds": {
+ "keyframes": {
"default": [],
- "description": "Generation jobs associated with this operation.",
+ "description": "Ordered animation keyframes.",
"items": {
- "format": "uuid",
- "type": "string"
+ "$ref": "#/$defs/CameraFrame"
},
- "title": "Jobids",
+ "title": "Keyframes",
"type": "array"
},
- "issues": {
- "default": [],
- "description": "Validation or execution issues.",
- "items": {
- "$ref": "#/$defs/ContractIssue"
- },
- "title": "Issues",
- "type": "array"
+ "channels": {
+ "$ref": "#/$defs/CameraChannels",
+ "description": "Independent authoritative camera channels."
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "aspectRatio",
+ "pose",
+ "keyframes",
+ "channels"
+ ],
+ "title": "CameraRig",
+ "type": "object"
+ },
+ "CameraVectorFrame": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable channel keyframe ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
+ "type": "string"
},
- "eventCursor": {
+ "time": {
+ "description": "Keyframe time in seconds.",
+ "minimum": 0,
+ "title": "Time",
+ "type": "number"
+ },
+ "value": {
+ "$ref": "#/$defs/Vector3",
+ "description": "Keyframed camera vector."
+ },
+ "transition": {
"anyOf": [
{
- "minimum": 0,
- "type": "integer"
+ "$ref": "#/$defs/StageBezierTransition"
},
{
"type": "null"
}
],
"default": null,
- "description": "Latest committed project event cursor.",
- "title": "Eventcursor"
+ "description": "Interpolation for the outgoing segment."
}
},
"required": [
- "commandId",
- "projectId",
- "inputFingerprint",
- "status",
- "changed",
- "jobIds",
- "issues",
- "eventCursor"
+ "id",
+ "time",
+ "value",
+ "transition"
],
- "title": "CommandReceipt",
+ "title": "CameraVectorFrame",
"type": "object"
},
- "ContainerBinding": {
+ "CanvasApplyEdit": {
"additionalProperties": false,
"properties": {
- "role": {
- "const": "container",
- "description": "Business role of this binding or reference.",
- "title": "Role",
+ "itemId": {
+ "description": "Canvas item ID.",
+ "format": "uuid",
+ "title": "Itemid",
+ "type": "string"
+ },
+ "source": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Input source or recorded provenance."
+ },
+ "asset": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Immutable asset version."
+ },
+ "editorId": {
+ "description": "Editable document ID.",
+ "format": "uuid",
+ "title": "Editorid",
"type": "string"
}
},
"required": [
- "role"
+ "itemId",
+ "source",
+ "asset",
+ "editorId"
],
- "title": "ContainerBinding",
- "type": "object"
- },
- "Contract": {
- "additionalProperties": false,
- "properties": {},
- "title": "Contract",
+ "title": "CanvasApplyEdit",
"type": "object"
},
- "ContractIssue": {
+ "CanvasApplyEditCommand": {
"additionalProperties": false,
+ "description": "Apply an editor result to a canvas item.",
"properties": {
- "code": {
- "description": "Stable error or issue code.",
- "enum": [
- "timeline_package_invalid",
- "timeline_package_too_large",
- "timeline_revision_missing",
- "timeline_import_missing",
- "timeline_import_conflict",
- "timeline_registration_rejected",
- "timeline_font_too_large",
- "timeline_font_unavailable",
- "timeline_font_unsupported",
- "timeline_font_invalid",
- "timeline_font_fingerprint",
- "timeline_font_coverage",
- "timeline_font_total_bytes",
- "timeline_font_unverified",
- "timeline_font_mime",
- "timeline_bundled_font_fingerprint",
- "timeline_bundled_font_unavailable",
- "invalid_input",
- "revision_conflict",
- "role_restricted",
- "missing_object",
- "reference_invalid",
- "image_quality_unsupported",
- "bigmodel_video_model",
- "bigmodel_video_output",
- "bigmodel_video_image",
- "bigmodel_video_frames",
- "bigmodel_video_prompt",
- "bigmodel_video_cancel",
- "kling_model",
- "kling_mode",
- "kling_image",
- "kling_frames",
- "kling_prompt",
- "kling_aspect",
- "kling_output",
- "kling_cancel",
- "capability_unsupported",
- "preview_expired",
- "storage_unavailable",
- "submission_unknown",
- "provider_error",
- "moss_speech_text",
- "moss_speech_voice",
- "moss_speech_reference",
- "moss_prompt_limit",
- "moss_image_size",
- "moss_image_reference",
- "moss_layout_reference",
- "bigmodel_image_size",
- "bigmodel_image_reference",
- "bigmodel_image_prompt",
- "minimax_image_reference",
- "minimax_image_count",
- "minimax_image_bytes",
- "minimax_speech_text",
- "minimax_speech_voice",
- "minimax_speech_reference",
- "minimax_speech_model",
- "zhipu_speech_text",
- "zhipu_speech_voice",
- "zhipu_speech_reference",
- "voice_library_unsupported",
- "voice_connection_changed",
- "voice_reference_required",
- "voice_transcript_required",
- "voice_transcript_too_long",
- "voice_description_too_long",
- "voice_not_found",
- "voice_delete_unsupported",
- "voice_consent_required",
- "voice_name_invalid",
- "voice_audio_invalid",
- "voice_format",
- "voice_size",
- "voice_duration",
- "voice_provider_protocol",
- "voice_provider_error",
- "voice_provider_timeout",
- "voice_model_unsupported",
- "voice_name_taken",
- "voice_provider_quota"
- ],
- "title": "Code",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
"type": "string"
},
- "message": {
- "description": "Human-readable issue description.",
- "maxLength": 500,
- "minLength": 1,
- "title": "Message",
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
"type": "string"
},
- "objectId": {
+ "type": {
+ "const": "canvas.applyEdit",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
"anyOf": [
{
- "format": "uuid",
+ "pattern": "^[0-9a-f]{64}$",
"type": "string"
},
{
@@ -18853,13 +19266,112 @@
}
],
"default": null,
- "description": "Target business object ID.",
- "title": "Objectid"
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "field": {
+ "payload": {
+ "$ref": "#/$defs/CanvasApplyEdit",
+ "description": "Apply an editor result to a canvas item."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "CanvasApplyEditCommand",
+ "type": "object"
+ },
+ "CanvasApplyEditCommandOperation": {
+ "additionalProperties": false,
+ "description": "Apply an editor result to a canvas item.",
+ "properties": {
+ "type": {
+ "const": "canvas.applyEdit",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasApplyEdit",
+ "description": "Apply an editor result to a canvas item."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "CanvasApplyEditCommandOperation",
+ "type": "object"
+ },
+ "CanvasConfigure": {
+ "additionalProperties": false,
+ "properties": {
+ "itemId": {
+ "description": "Canvas item ID.",
+ "format": "uuid",
+ "title": "Itemid",
+ "type": "string"
+ },
+ "specId": {
+ "description": "Generation configuration ID.",
+ "format": "uuid",
+ "title": "Specid",
+ "type": "string"
+ },
+ "preserveMaterial": {
+ "default": false,
+ "description": "Whether configuring generation retains current material.",
+ "title": "Preservematerial",
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "itemId",
+ "specId",
+ "preserveMaterial"
+ ],
+ "title": "CanvasConfigure",
+ "type": "object"
+ },
+ "CanvasConfigureCommand": {
+ "additionalProperties": false,
+ "description": "Bind a generation configuration to a canvas item.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "canvas.configure",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
"anyOf": [
{
- "maxLength": 200,
+ "pattern": "^[0-9a-f]{64}$",
"type": "string"
},
{
@@ -18867,28 +19379,79 @@
}
],
"default": null,
- "description": "Path of the field responsible for this issue.",
- "title": "Field"
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasConfigure",
+ "description": "Bind a generation configuration to a canvas item."
}
},
"required": [
- "code",
- "message",
- "objectId",
- "field"
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
],
- "title": "ContractIssue",
+ "title": "CanvasConfigureCommand",
"type": "object"
},
- "CreationContracts": {
+ "CanvasConfigureCommandOperation": {
"additionalProperties": false,
+ "description": "Bind a generation configuration to a canvas item.",
"properties": {
- "project": {
- "$ref": "#/$defs/ProjectSnapshot",
- "description": "Authoritative project snapshot schema."
+ "type": {
+ "const": "canvas.configure",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
},
- "canvasItem": {
- "description": "Canvas item schema.",
+ "payload": {
+ "$ref": "#/$defs/CanvasConfigure",
+ "description": "Bind a generation configuration to a canvas item."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "CanvasConfigureCommandOperation",
+ "type": "object"
+ },
+ "CanvasCreateGeneration": {
+ "additionalProperties": false,
+ "properties": {
+ "spec": {
+ "description": "New configuration with purpose=generation.",
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioGenerationSpec",
+ "image": "#/$defs/ImageGenerationSpec",
+ "text": "#/$defs/TextGenerationSpec",
+ "video": "#/$defs/VideoGenerationSpec"
+ },
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TextGenerationSpec"
+ },
+ {
+ "$ref": "#/$defs/ImageGenerationSpec"
+ },
+ {
+ "$ref": "#/$defs/VideoGenerationSpec"
+ },
+ {
+ "$ref": "#/$defs/AudioGenerationSpec"
+ }
+ ],
+ "title": "Spec"
+ },
+ "item": {
+ "description": "Visible item bound to spec.id with role=generation.",
"discriminator": {
"mapping": {
"audio": "#/$defs/AudioCanvasItem",
@@ -18940,442 +19503,3661 @@
"$ref": "#/$defs/GroupCanvasItem"
}
],
- "title": "Canvasitem"
+ "title": "Item"
},
- "generationSpec": {
- "description": "Generation configuration schema.",
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioGenerationSpec",
- "image": "#/$defs/ImageGenerationSpec",
- "text": "#/$defs/TextGenerationSpec",
- "video": "#/$defs/VideoGenerationSpec"
+ "references": {
+ "default": [],
+ "description": "Input references. Every canvas-derived reference must retain its source node: source.id for follow_current, sourceVersion for pinned. Never replace a canvas reference with an asset-only binding.",
+ "items": {
+ "description": "Generation input reference. Preserve source canvas identity for canvas-derived references, whether following or pinned.",
+ "discriminator": {
+ "mapping": {
+ "follow_current": "#/$defs/FollowingReference",
+ "pinned": "#/$defs/PinnedReference"
+ },
+ "propertyName": "binding"
},
- "propertyName": "kind"
+ "oneOf": [
+ {
+ "$ref": "#/$defs/PinnedReference"
+ },
+ {
+ "$ref": "#/$defs/FollowingReference"
+ }
+ ]
},
- "oneOf": [
- {
- "$ref": "#/$defs/TextGenerationSpec"
- },
- {
- "$ref": "#/$defs/ImageGenerationSpec"
- },
+ "title": "References",
+ "type": "array"
+ }
+ },
+ "required": [
+ "spec",
+ "item",
+ "references"
+ ],
+ "title": "CanvasCreateGeneration",
+ "type": "object"
+ },
+ "CanvasCreateGenerationCommand": {
+ "additionalProperties": false,
+ "description": "Create a visible generation node and references atomically, preserving canvas source connections, including pinned ones.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "canvas.createGeneration",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
{
- "$ref": "#/$defs/VideoGenerationSpec"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
- "$ref": "#/$defs/AudioGenerationSpec"
+ "type": "null"
}
],
- "title": "Generationspec"
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "reference": {
- "description": "Generation reference to create or update.",
- "discriminator": {
- "mapping": {
- "follow_current": "#/$defs/FollowingReference",
- "pinned": "#/$defs/PinnedReference"
- },
- "propertyName": "binding"
+ "payload": {
+ "$ref": "#/$defs/CanvasCreateGeneration",
+ "description": "Create a visible generation node and references atomically, preserving canvas source connections, including pinned ones."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "CanvasCreateGenerationCommand",
+ "type": "object"
+ },
+ "CanvasEditorAttach": {
+ "additionalProperties": false,
+ "properties": {
+ "itemId": {
+ "description": "Canvas item ID.",
+ "format": "uuid",
+ "title": "Itemid",
+ "type": "string"
+ },
+ "editorId": {
+ "description": "Editable document ID.",
+ "format": "uuid",
+ "title": "Editorid",
+ "type": "string"
+ }
+ },
+ "required": [
+ "itemId",
+ "editorId"
+ ],
+ "title": "CanvasEditorAttach",
+ "type": "object"
+ },
+ "CanvasEditorAttachCommand": {
+ "additionalProperties": false,
+ "description": "Attach an editor document to a canvas item.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "canvas.attachEditor",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
},
- "oneOf": [
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
{
- "$ref": "#/$defs/PinnedReference"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
- "$ref": "#/$defs/FollowingReference"
+ "type": "null"
}
],
- "title": "Reference"
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "editorDocument": {
- "description": "Editable document schema.",
- "discriminator": {
- "mapping": {
- "director": "#/$defs/DirectorDocument",
- "image_crop": "#/$defs/ImageCropDocument",
- "layers": "#/$defs/LayerDocument",
- "media_edit": "#/$defs/MediaEditDocument",
- "stack": "#/$defs/StackDocument",
- "subject": "#/$defs/SubjectDocument",
- "timeline": "#/$defs/TimelineDocument",
- "tool": "#/$defs/ToolDocument"
- },
- "propertyName": "kind"
- },
- "oneOf": [
- {
- "$ref": "#/$defs/TimelineDocument"
- },
- {
- "$ref": "#/$defs/SubjectDocument"
- },
- {
- "$ref": "#/$defs/LayerDocument"
- },
- {
- "$ref": "#/$defs/ImageCropDocument"
- },
- {
- "$ref": "#/$defs/StackDocument"
- },
- {
- "$ref": "#/$defs/ToolDocument"
- },
+ "payload": {
+ "$ref": "#/$defs/CanvasEditorAttach",
+ "description": "Attach an editor document to a canvas item."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "CanvasEditorAttachCommand",
+ "type": "object"
+ },
+ "CanvasEditorAttachCommandOperation": {
+ "additionalProperties": false,
+ "description": "Attach an editor document to a canvas item.",
+ "properties": {
+ "type": {
+ "const": "canvas.attachEditor",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasEditorAttach",
+ "description": "Attach an editor document to a canvas item."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "CanvasEditorAttachCommandOperation",
+ "type": "object"
+ },
+ "CanvasEditorDetachCommand": {
+ "additionalProperties": false,
+ "description": "Detach an editor document from a canvas item.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "canvas.detachEditor",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
{
- "$ref": "#/$defs/DirectorDocument"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
- "$ref": "#/$defs/MediaEditDocument"
+ "type": "null"
}
],
- "title": "Editordocument"
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "command": {
- "description": "Immutable command recorded in this commit.",
- "discriminator": {
- "mapping": {
- "artifact.publish": "#/$defs/ArtifactPublishCommand",
- "asset.delete": "#/$defs/AssetDeleteCommand",
- "asset.import": "#/$defs/AssetImportCommand",
- "asset.updateMetadata": "#/$defs/AssetMetadataCommand",
- "asset.writeText": "#/$defs/AssetWriteTextCommand",
- "canvas.applyEdit": "#/$defs/CanvasApplyEditCommand",
- "canvas.applyVersion": "#/$defs/NodeVersionApplyCommand",
- "canvas.attachEditor": "#/$defs/CanvasEditorAttachCommand",
- "canvas.configure": "#/$defs/CanvasConfigureCommand",
- "canvas.createGeneration": "#/$defs/CanvasCreateGenerationCommand",
- "canvas.detachEditor": "#/$defs/CanvasEditorDetachCommand",
- "canvas.hide": "#/$defs/CanvasHideCommand",
- "canvas.materialize": "#/$defs/CanvasMaterializeCommand",
- "canvas.move": "#/$defs/CanvasMoveCommand",
- "canvas.publishMedia": "#/$defs/CanvasPublishMediaCommand",
- "canvas.show": "#/$defs/CanvasShowCommand",
- "canvas.update": "#/$defs/CanvasUpdateCommand",
- "creation.batch": "#/$defs/BatchCommand",
- "editor.create": "#/$defs/EditorCreateCommand",
- "editor.save": "#/$defs/EditorSaveCommand",
- "generation.submit": "#/$defs/GenerationSubmitCommand",
- "generationSpec.create": "#/$defs/SpecCreateCommand",
- "generationSpec.restore": "#/$defs/SpecRestoreCommand",
- "generationSpec.setPrompt": "#/$defs/SpecPromptCommand",
- "generationSpec.update": "#/$defs/SpecUpdateCommand",
- "history.redo": "#/$defs/HistoryRedoCommand",
- "history.undo": "#/$defs/HistoryUndoCommand",
- "job.cancel": "#/$defs/JobCancelCommand",
- "job.checkpoint": "#/$defs/JobCheckpointCommand",
- "job.recover": "#/$defs/JobRecoverCommand",
- "project.create": "#/$defs/ProjectCreateCommand",
- "project.rename": "#/$defs/ProjectRenameCommand",
- "project.restore": "#/$defs/ProjectRestoreCommand",
- "project.trash": "#/$defs/ProjectTrashCommand",
- "reference.add": "#/$defs/ReferenceAddCommand",
- "reference.remove": "#/$defs/ReferenceRemoveCommand",
- "reference.restore": "#/$defs/ReferenceRestoreCommand",
- "reference.update": "#/$defs/ReferenceUpdateCommand",
- "result.select": "#/$defs/ResultSelectCommand",
- "timeline.publishRender": "#/$defs/TimelinePublishRenderCommand"
- },
- "propertyName": "type"
+ "payload": {
+ "$ref": "#/$defs/CanvasEditorAttach",
+ "description": "Detach an editor document from a canvas item."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "CanvasEditorDetachCommand",
+ "type": "object"
+ },
+ "CanvasEditorDetachCommandOperation": {
+ "additionalProperties": false,
+ "description": "Detach an editor document from a canvas item.",
+ "properties": {
+ "type": {
+ "const": "canvas.detachEditor",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasEditorAttach",
+ "description": "Detach an editor document from a canvas item."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "CanvasEditorDetachCommandOperation",
+ "type": "object"
+ },
+ "CanvasHide": {
+ "additionalProperties": false,
+ "properties": {
+ "itemId": {
+ "description": "Canvas item ID.",
+ "format": "uuid",
+ "title": "Itemid",
+ "type": "string"
+ }
+ },
+ "required": [
+ "itemId"
+ ],
+ "title": "CanvasHide",
+ "type": "object"
+ },
+ "CanvasHideCommand": {
+ "additionalProperties": false,
+ "description": "Remove a canvas item; preserves project contents. Remove all visible items to clear the canvas.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "canvas.hide",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
},
- "oneOf": [
- {
- "$ref": "#/$defs/ProjectCreateCommand"
- },
- {
- "$ref": "#/$defs/ProjectRenameCommand"
- },
- {
- "$ref": "#/$defs/ProjectTrashCommand"
- },
- {
- "$ref": "#/$defs/ProjectRestoreCommand"
- },
- {
- "$ref": "#/$defs/AssetImportCommand"
- },
- {
- "$ref": "#/$defs/ArtifactPublishCommand"
- },
- {
- "$ref": "#/$defs/AssetWriteTextCommand"
- },
- {
- "$ref": "#/$defs/AssetMetadataCommand"
- },
- {
- "$ref": "#/$defs/AssetDeleteCommand"
- },
- {
- "$ref": "#/$defs/CanvasCreateGenerationCommand"
- },
- {
- "$ref": "#/$defs/CanvasShowCommand"
- },
- {
- "$ref": "#/$defs/CanvasMoveCommand"
- },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
{
- "$ref": "#/$defs/CanvasUpdateCommand"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
- "$ref": "#/$defs/CanvasHideCommand"
- },
- {
- "$ref": "#/$defs/CanvasMaterializeCommand"
- },
- {
- "$ref": "#/$defs/CanvasApplyEditCommand"
- },
- {
- "$ref": "#/$defs/CanvasPublishMediaCommand"
- },
- {
- "$ref": "#/$defs/TimelinePublishRenderCommand"
- },
- {
- "$ref": "#/$defs/NodeVersionApplyCommand"
- },
- {
- "$ref": "#/$defs/CanvasConfigureCommand"
- },
- {
- "$ref": "#/$defs/CanvasEditorAttachCommand"
- },
- {
- "$ref": "#/$defs/CanvasEditorDetachCommand"
- },
- {
- "$ref": "#/$defs/SpecCreateCommand"
- },
- {
- "$ref": "#/$defs/SpecUpdateCommand"
- },
- {
- "$ref": "#/$defs/SpecRestoreCommand"
- },
- {
- "$ref": "#/$defs/SpecPromptCommand"
- },
- {
- "$ref": "#/$defs/ReferenceAddCommand"
- },
- {
- "$ref": "#/$defs/ReferenceUpdateCommand"
- },
- {
- "$ref": "#/$defs/ReferenceRestoreCommand"
- },
- {
- "$ref": "#/$defs/ReferenceRemoveCommand"
- },
- {
- "$ref": "#/$defs/GenerationSubmitCommand"
- },
- {
- "$ref": "#/$defs/JobCancelCommand"
- },
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasHide",
+ "description": "Remove a canvas item; preserves project contents. Remove all visible items to clear the canvas."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "CanvasHideCommand",
+ "type": "object"
+ },
+ "CanvasHideCommandOperation": {
+ "additionalProperties": false,
+ "description": "Remove a canvas item; preserves project contents. Remove all visible items to clear the canvas.",
+ "properties": {
+ "type": {
+ "const": "canvas.hide",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasHide",
+ "description": "Remove a canvas item; preserves project contents. Remove all visible items to clear the canvas."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "CanvasHideCommandOperation",
+ "type": "object"
+ },
+ "CanvasItemBase": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "kind": {
+ "description": "Business object or media type.",
+ "enum": [
+ "text",
+ "image",
+ "video",
+ "audio",
+ "file",
+ "group",
+ "timeline",
+ "subject",
+ "stack",
+ "tool",
+ "external"
+ ],
+ "title": "Kind",
+ "type": "string"
+ },
+ "title": {
+ "default": "",
+ "description": "User-visible title.",
+ "maxLength": 255,
+ "title": "Title",
+ "type": "string"
+ },
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
+ },
+ "width": {
+ "default": 352,
+ "description": "Width in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Width",
+ "type": "number"
+ },
+ "height": {
+ "default": 198,
+ "description": "Height in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Height",
+ "type": "number"
+ },
+ "zIndex": {
+ "default": 0,
+ "description": "Canvas stacking order.",
+ "title": "Zindex",
+ "type": "integer"
+ },
+ "locked": {
+ "default": false,
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
+ "type": "boolean"
+ },
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
+ },
+ "parentId": {
+ "anyOf": [
{
- "$ref": "#/$defs/JobRecoverCommand"
+ "format": "uuid",
+ "type": "string"
},
{
- "$ref": "#/$defs/JobCheckpointCommand"
- },
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Parent canvas group ID, or null for the root.",
+ "title": "Parentid"
+ },
+ "tags": {
+ "default": [],
+ "description": "User-defined search tags.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Tags",
+ "type": "array"
+ }
+ },
+ "required": [
+ "id",
+ "projectId",
+ "revision",
+ "kind",
+ "title",
+ "position",
+ "width",
+ "height",
+ "zIndex",
+ "locked",
+ "visible",
+ "parentId",
+ "tags"
+ ],
+ "title": "CanvasItemBase",
+ "type": "object"
+ },
+ "CanvasItemVersion": {
+ "additionalProperties": false,
+ "properties": {
+ "objectType": {
+ "const": "canvas_item",
+ "description": "Source canvas item type.",
+ "title": "Objecttype",
+ "type": "string"
+ },
+ "id": {
+ "description": "Stable object ID.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
+ },
+ "revision": {
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ }
+ },
+ "required": [
+ "objectType",
+ "id",
+ "revision"
+ ],
+ "title": "CanvasItemVersion",
+ "type": "object"
+ },
+ "CanvasMaterialize": {
+ "additionalProperties": false,
+ "properties": {
+ "itemId": {
+ "description": "Canvas item ID.",
+ "format": "uuid",
+ "title": "Itemid",
+ "type": "string"
+ },
+ "asset": {
+ "$ref": "#/$defs/AssetRef",
+ "description": "Immutable asset version."
+ },
+ "discardGenerationDraft": {
+ "default": false,
+ "description": "Whether material replacement discards the generation draft.",
+ "title": "Discardgenerationdraft",
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "itemId",
+ "asset",
+ "discardGenerationDraft"
+ ],
+ "title": "CanvasMaterialize",
+ "type": "object"
+ },
+ "CanvasMaterializeCommand": {
+ "additionalProperties": false,
+ "description": "Bind an asset to an empty or material canvas item.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "canvas.materialize",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasMaterialize",
+ "description": "Bind an asset to an empty or material canvas item."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "CanvasMaterializeCommand",
+ "type": "object"
+ },
+ "CanvasMaterializeCommandOperation": {
+ "additionalProperties": false,
+ "description": "Bind an asset to an empty or material canvas item.",
+ "properties": {
+ "type": {
+ "const": "canvas.materialize",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasMaterialize",
+ "description": "Bind an asset to an empty or material canvas item."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "CanvasMaterializeCommandOperation",
+ "type": "object"
+ },
+ "CanvasMove": {
+ "additionalProperties": false,
+ "properties": {
+ "items": {
+ "description": "Ordered entries in this collection.",
+ "items": {
+ "$ref": "#/$defs/CanvasMoveItem"
+ },
+ "maxItems": 500,
+ "minItems": 1,
+ "title": "Items",
+ "type": "array"
+ }
+ },
+ "required": [
+ "items"
+ ],
+ "title": "CanvasMove",
+ "type": "object"
+ },
+ "CanvasMoveCommand": {
+ "additionalProperties": false,
+ "description": "Move one or more canvas items.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "canvas.move",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasMove",
+ "description": "Move one or more canvas items."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "CanvasMoveCommand",
+ "type": "object"
+ },
+ "CanvasMoveCommandOperation": {
+ "additionalProperties": false,
+ "description": "Move one or more canvas items.",
+ "properties": {
+ "type": {
+ "const": "canvas.move",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasMove",
+ "description": "Move one or more canvas items."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "CanvasMoveCommandOperation",
+ "type": "object"
+ },
+ "CanvasMoveItem": {
+ "additionalProperties": false,
+ "properties": {
+ "itemId": {
+ "description": "Canvas item ID.",
+ "format": "uuid",
+ "title": "Itemid",
+ "type": "string"
+ },
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
+ }
+ },
+ "required": [
+ "itemId",
+ "position"
+ ],
+ "title": "CanvasMoveItem",
+ "type": "object"
+ },
+ "CanvasPresentationUpdate": {
+ "additionalProperties": false,
+ "properties": {
+ "itemId": {
+ "description": "Canvas item ID.",
+ "format": "uuid",
+ "title": "Itemid",
+ "type": "string"
+ },
+ "title": {
+ "anyOf": [
+ {
+ "maxLength": 255,
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "User-visible title.",
+ "title": "Title"
+ },
+ "width": {
+ "anyOf": [
+ {
+ "exclusiveMinimum": 0,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Width in pixels.",
+ "title": "Width"
+ },
+ "height": {
+ "anyOf": [
+ {
+ "exclusiveMinimum": 0,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Height in pixels.",
+ "title": "Height"
+ },
+ "zIndex": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Canvas stacking order.",
+ "title": "Zindex"
+ },
+ "locked": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked"
+ },
+ "parentId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Parent canvas group ID, or null for the root.",
+ "title": "Parentid"
+ }
+ },
+ "required": [
+ "itemId",
+ "title",
+ "width",
+ "height",
+ "zIndex",
+ "locked",
+ "parentId"
+ ],
+ "title": "CanvasPresentationUpdate",
+ "type": "object"
+ },
+ "CanvasPublishMedia": {
+ "additionalProperties": false,
+ "properties": {
+ "itemId": {
+ "description": "Canvas item ID.",
+ "format": "uuid",
+ "title": "Itemid",
+ "type": "string"
+ },
+ "source": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AssetRef"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Input source or recorded provenance."
+ },
+ "sourceEditorId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Source editable document ID.",
+ "title": "Sourceeditorid"
+ },
+ "document": {
+ "description": "Editable document owned by this operation.",
+ "discriminator": {
+ "mapping": {
+ "director": "#/$defs/DirectorDocument",
+ "image_crop": "#/$defs/ImageCropDocument",
+ "layers": "#/$defs/LayerDocument",
+ "media_edit": "#/$defs/MediaEditDocument",
+ "stack": "#/$defs/StackDocument",
+ "subject": "#/$defs/SubjectDocument",
+ "timeline": "#/$defs/TimelineDocument",
+ "tool": "#/$defs/ToolDocument"
+ },
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TimelineDocument"
+ },
+ {
+ "$ref": "#/$defs/SubjectDocument"
+ },
+ {
+ "$ref": "#/$defs/LayerDocument"
+ },
+ {
+ "$ref": "#/$defs/ImageCropDocument"
+ },
+ {
+ "$ref": "#/$defs/StackDocument"
+ },
+ {
+ "$ref": "#/$defs/ToolDocument"
+ },
+ {
+ "$ref": "#/$defs/DirectorDocument"
+ },
+ {
+ "$ref": "#/$defs/MediaEditDocument"
+ }
+ ],
+ "title": "Document"
+ },
+ "directorPlan": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/DirectorOutputPlan"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Frozen Director video output plan, when publishing a stage video."
+ },
+ "directorAcceptedAt": {
+ "anyOf": [
+ {
+ "minimum": 1,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Project event cursor fixed when the browser accepted a Director video render.",
+ "title": "Directoracceptedat"
+ },
+ "outputs": {
+ "description": "Ordered published media outputs.",
+ "items": {
+ "$ref": "#/$defs/MediaPublicationOutput"
+ },
+ "maxItems": 50,
+ "minItems": 1,
+ "title": "Outputs",
+ "type": "array"
+ }
+ },
+ "required": [
+ "itemId",
+ "source",
+ "sourceEditorId",
+ "document",
+ "directorPlan",
+ "outputs"
+ ],
+ "title": "CanvasPublishMedia",
+ "type": "object"
+ },
+ "CanvasPublishMediaCommand": {
+ "additionalProperties": false,
+ "description": "Publish edited media outputs with their editor snapshot.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "canvas.publishMedia",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasPublishMedia",
+ "description": "Publish edited media outputs with their editor snapshot."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "CanvasPublishMediaCommand",
+ "type": "object"
+ },
+ "CanvasReferenceSources": {
+ "additionalProperties": false,
+ "properties": {
+ "followCurrent": {
+ "$ref": "#/$defs/FollowingReferenceSource",
+ "description": "Source fields for a follow_current reference."
+ },
+ "pinned": {
+ "$ref": "#/$defs/PinnedReferenceSource",
+ "description": "Source fields for a pinned reference retaining its canvas connection."
+ }
+ },
+ "required": [
+ "followCurrent",
+ "pinned"
+ ],
+ "title": "CanvasReferenceSources",
+ "type": "object"
+ },
+ "CanvasShow": {
+ "additionalProperties": false,
+ "properties": {
+ "item": {
+ "description": "Canvas display item to create or restore.",
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioCanvasItem",
+ "external": "#/$defs/DirectorCanvasItem",
+ "file": "#/$defs/FileCanvasItem",
+ "group": "#/$defs/GroupCanvasItem",
+ "image": "#/$defs/ImageCanvasItem",
+ "stack": "#/$defs/StackCanvasItem",
+ "subject": "#/$defs/SubjectCanvasItem",
+ "text": "#/$defs/TextCanvasItem",
+ "timeline": "#/$defs/TimelineCanvasItem",
+ "tool": "#/$defs/ToolCanvasItem",
+ "video": "#/$defs/VideoCanvasItem"
+ },
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TextCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/ImageCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/VideoCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/AudioCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/FileCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/SubjectCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/TimelineCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/StackCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/ToolCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/DirectorCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/GroupCanvasItem"
+ }
+ ],
+ "title": "Item"
+ }
+ },
+ "required": [
+ "item"
+ ],
+ "title": "CanvasShow",
+ "type": "object"
+ },
+ "CanvasShowCommand": {
+ "additionalProperties": false,
+ "description": "Create or restore a canvas display item.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "canvas.show",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasShow",
+ "description": "Create or restore a canvas display item."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "CanvasShowCommand",
+ "type": "object"
+ },
+ "CanvasShowCommandOperation": {
+ "additionalProperties": false,
+ "description": "Create or restore a canvas display item.",
+ "properties": {
+ "type": {
+ "const": "canvas.show",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasShow",
+ "description": "Create or restore a canvas display item."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "CanvasShowCommandOperation",
+ "type": "object"
+ },
+ "CanvasStatusQuery": {
+ "additionalProperties": false,
+ "properties": {
+ "queryId": {
+ "description": "Caller-supplied query ID.",
+ "format": "uuid",
+ "title": "Queryid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "canvas.status",
+ "description": "Read node status, current asset and reusable referenceSources.",
+ "title": "Type",
+ "type": "string"
+ },
+ "objectId": {
+ "description": "Canvas item ID.",
+ "format": "uuid",
+ "title": "Objectid",
+ "type": "string"
+ },
+ "waitSeconds": {
+ "default": 0,
+ "description": "Wait for generation changes; zero returns immediately.",
+ "maximum": 30,
+ "minimum": 0,
+ "title": "Waitseconds",
+ "type": "number"
+ }
+ },
+ "required": [
+ "queryId",
+ "projectId",
+ "type",
+ "objectId",
+ "waitSeconds"
+ ],
+ "title": "CanvasStatusQuery",
+ "type": "object"
+ },
+ "CanvasUpdateCommand": {
+ "additionalProperties": false,
+ "description": "Update canvas presentation, grouping or lock state.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "canvas.update",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasPresentationUpdate",
+ "description": "Update canvas presentation, grouping or lock state."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "CanvasUpdateCommand",
+ "type": "object"
+ },
+ "CanvasUpdateCommandOperation": {
+ "additionalProperties": false,
+ "description": "Update canvas presentation, grouping or lock state.",
+ "properties": {
+ "type": {
+ "const": "canvas.update",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/CanvasPresentationUpdate",
+ "description": "Update canvas presentation, grouping or lock state."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "CanvasUpdateCommandOperation",
+ "type": "object"
+ },
+ "ChangedObject": {
+ "additionalProperties": false,
+ "properties": {
+ "version": {
+ "$ref": "#/$defs/ObjectVersion",
+ "description": "Version of the referenced record."
+ },
+ "change": {
+ "description": "Kind of business object change.",
+ "enum": [
+ "created",
+ "updated",
+ "hidden",
+ "deleted"
+ ],
+ "title": "Change",
+ "type": "string"
+ }
+ },
+ "required": [
+ "version",
+ "change"
+ ],
+ "title": "ChangedObject",
+ "type": "object"
+ },
+ "CommandBase": {
+ "additionalProperties": false,
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "description": "Operation or variant discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview"
+ ],
+ "title": "CommandBase",
+ "type": "object"
+ },
+ "CommandReceipt": {
+ "additionalProperties": false,
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "inputFingerprint": {
+ "description": "Fingerprint of the fixed execution input.",
+ "pattern": "^[0-9a-f]{64}$",
+ "title": "Inputfingerprint",
+ "type": "string"
+ },
+ "status": {
+ "description": "Current operation lifecycle state.",
+ "enum": [
+ "applied",
+ "accepted",
+ "noop",
+ "rejected"
+ ],
+ "title": "Status",
+ "type": "string"
+ },
+ "changed": {
+ "default": [],
+ "description": "Business objects changed by the operation.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Changed",
+ "type": "array"
+ },
+ "jobIds": {
+ "default": [],
+ "description": "Generation jobs associated with this operation.",
+ "items": {
+ "format": "uuid",
+ "type": "string"
+ },
+ "title": "Jobids",
+ "type": "array"
+ },
+ "issues": {
+ "default": [],
+ "description": "Validation or execution issues.",
+ "items": {
+ "$ref": "#/$defs/ContractIssue"
+ },
+ "title": "Issues",
+ "type": "array"
+ },
+ "directorDurations": {
+ "default": [],
+ "description": "Director main timeline results in operation order.",
+ "items": {
+ "$ref": "#/$defs/DirectorDurationResult"
+ },
+ "title": "Directordurations",
+ "type": "array"
+ },
+ "directorStoryboard": {
+ "default": [],
+ "description": "Storyboard outcomes in command operation order.",
+ "items": {
+ "$ref": "#/$defs/DirectorStoryboardResult"
+ },
+ "title": "Directorstoryboard",
+ "type": "array"
+ },
+ "eventCursor": {
+ "anyOf": [
+ {
+ "minimum": 0,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Latest committed project event cursor.",
+ "title": "Eventcursor"
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "inputFingerprint",
+ "status",
+ "changed",
+ "jobIds",
+ "issues",
+ "eventCursor"
+ ],
+ "title": "CommandReceipt",
+ "type": "object"
+ },
+ "ContainerBinding": {
+ "additionalProperties": false,
+ "properties": {
+ "role": {
+ "const": "container",
+ "description": "Business role of this binding or reference.",
+ "title": "Role",
+ "type": "string"
+ }
+ },
+ "required": [
+ "role"
+ ],
+ "title": "ContainerBinding",
+ "type": "object"
+ },
+ "Contract": {
+ "additionalProperties": false,
+ "properties": {},
+ "title": "Contract",
+ "type": "object"
+ },
+ "ContractIssue": {
+ "additionalProperties": false,
+ "properties": {
+ "code": {
+ "description": "Stable error or issue code.",
+ "enum": [
+ "timeline_package_invalid",
+ "timeline_package_too_large",
+ "timeline_revision_missing",
+ "timeline_import_missing",
+ "timeline_import_conflict",
+ "timeline_registration_rejected",
+ "timeline_font_too_large",
+ "timeline_font_unavailable",
+ "timeline_font_unsupported",
+ "timeline_font_invalid",
+ "timeline_font_fingerprint",
+ "timeline_font_coverage",
+ "timeline_font_total_bytes",
+ "timeline_font_unverified",
+ "timeline_font_mime",
+ "timeline_bundled_font_fingerprint",
+ "timeline_bundled_font_unavailable",
+ "storyboard_leading_gap",
+ "storyboard_internal_gap",
+ "storyboard_overlap",
+ "storyboard_exceeds_duration",
+ "storyboard_duration_invalid",
+ "storyboard_camera_unknown",
+ "storyboard_block_invalid",
+ "storyboard_block_exists",
+ "storyboard_exhausted",
+ "storyboard_order_invalid",
+ "storyboard_block_unknown",
+ "director_camera_unknown",
+ "director_camera_required",
+ "invalid_input",
+ "revision_conflict",
+ "role_restricted",
+ "missing_object",
+ "reference_invalid",
+ "image_quality_unsupported",
+ "bigmodel_video_model",
+ "bigmodel_video_output",
+ "bigmodel_video_image",
+ "bigmodel_video_frames",
+ "bigmodel_video_prompt",
+ "bigmodel_video_cancel",
+ "kling_model",
+ "kling_mode",
+ "kling_image",
+ "kling_frames",
+ "kling_prompt",
+ "kling_aspect",
+ "kling_output",
+ "kling_cancel",
+ "capability_unsupported",
+ "preview_expired",
+ "storage_unavailable",
+ "submission_unknown",
+ "provider_error",
+ "moss_speech_text",
+ "moss_speech_voice",
+ "moss_speech_reference",
+ "moss_prompt_limit",
+ "moss_image_size",
+ "moss_image_reference",
+ "moss_layout_reference",
+ "bigmodel_image_size",
+ "bigmodel_image_reference",
+ "bigmodel_image_prompt",
+ "minimax_image_reference",
+ "minimax_image_count",
+ "minimax_image_bytes",
+ "minimax_speech_text",
+ "minimax_speech_voice",
+ "minimax_speech_reference",
+ "minimax_speech_model",
+ "zhipu_speech_text",
+ "zhipu_speech_voice",
+ "zhipu_speech_reference",
+ "voice_library_unsupported",
+ "voice_connection_changed",
+ "voice_reference_required",
+ "voice_transcript_required",
+ "voice_transcript_too_long",
+ "voice_description_too_long",
+ "voice_not_found",
+ "voice_delete_unsupported",
+ "voice_consent_required",
+ "voice_name_invalid",
+ "voice_audio_invalid",
+ "voice_format",
+ "voice_size",
+ "voice_duration",
+ "voice_provider_protocol",
+ "voice_provider_error",
+ "voice_provider_timeout",
+ "voice_model_unsupported",
+ "voice_name_taken",
+ "voice_provider_quota"
+ ],
+ "title": "Code",
+ "type": "string"
+ },
+ "message": {
+ "description": "Human-readable issue description.",
+ "maxLength": 500,
+ "minLength": 1,
+ "title": "Message",
+ "type": "string"
+ },
+ "objectId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Target business object ID.",
+ "title": "Objectid"
+ },
+ "field": {
+ "anyOf": [
+ {
+ "maxLength": 200,
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Path of the field responsible for this issue.",
+ "title": "Field"
+ }
+ },
+ "required": [
+ "code",
+ "message",
+ "objectId",
+ "field"
+ ],
+ "title": "ContractIssue",
+ "type": "object"
+ },
+ "CreationContracts": {
+ "additionalProperties": false,
+ "properties": {
+ "project": {
+ "$ref": "#/$defs/ProjectSnapshot",
+ "description": "Authoritative project snapshot schema."
+ },
+ "canvasItem": {
+ "description": "Canvas item schema.",
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioCanvasItem",
+ "external": "#/$defs/DirectorCanvasItem",
+ "file": "#/$defs/FileCanvasItem",
+ "group": "#/$defs/GroupCanvasItem",
+ "image": "#/$defs/ImageCanvasItem",
+ "stack": "#/$defs/StackCanvasItem",
+ "subject": "#/$defs/SubjectCanvasItem",
+ "text": "#/$defs/TextCanvasItem",
+ "timeline": "#/$defs/TimelineCanvasItem",
+ "tool": "#/$defs/ToolCanvasItem",
+ "video": "#/$defs/VideoCanvasItem"
+ },
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TextCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/ImageCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/VideoCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/AudioCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/FileCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/SubjectCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/TimelineCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/StackCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/ToolCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/DirectorCanvasItem"
+ },
+ {
+ "$ref": "#/$defs/GroupCanvasItem"
+ }
+ ],
+ "title": "Canvasitem"
+ },
+ "generationSpec": {
+ "description": "Generation configuration schema.",
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioGenerationSpec",
+ "image": "#/$defs/ImageGenerationSpec",
+ "text": "#/$defs/TextGenerationSpec",
+ "video": "#/$defs/VideoGenerationSpec"
+ },
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TextGenerationSpec"
+ },
+ {
+ "$ref": "#/$defs/ImageGenerationSpec"
+ },
+ {
+ "$ref": "#/$defs/VideoGenerationSpec"
+ },
+ {
+ "$ref": "#/$defs/AudioGenerationSpec"
+ }
+ ],
+ "title": "Generationspec"
+ },
+ "reference": {
+ "description": "Generation reference to create or update.",
+ "discriminator": {
+ "mapping": {
+ "follow_current": "#/$defs/FollowingReference",
+ "pinned": "#/$defs/PinnedReference"
+ },
+ "propertyName": "binding"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/PinnedReference"
+ },
+ {
+ "$ref": "#/$defs/FollowingReference"
+ }
+ ],
+ "title": "Reference"
+ },
+ "editorDocument": {
+ "description": "Editable document schema.",
+ "discriminator": {
+ "mapping": {
+ "director": "#/$defs/DirectorDocument",
+ "image_crop": "#/$defs/ImageCropDocument",
+ "layers": "#/$defs/LayerDocument",
+ "media_edit": "#/$defs/MediaEditDocument",
+ "stack": "#/$defs/StackDocument",
+ "subject": "#/$defs/SubjectDocument",
+ "timeline": "#/$defs/TimelineDocument",
+ "tool": "#/$defs/ToolDocument"
+ },
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TimelineDocument"
+ },
+ {
+ "$ref": "#/$defs/SubjectDocument"
+ },
+ {
+ "$ref": "#/$defs/LayerDocument"
+ },
+ {
+ "$ref": "#/$defs/ImageCropDocument"
+ },
+ {
+ "$ref": "#/$defs/StackDocument"
+ },
+ {
+ "$ref": "#/$defs/ToolDocument"
+ },
+ {
+ "$ref": "#/$defs/DirectorDocument"
+ },
+ {
+ "$ref": "#/$defs/MediaEditDocument"
+ }
+ ],
+ "title": "Editordocument"
+ },
+ "command": {
+ "description": "Immutable command recorded in this commit.",
+ "discriminator": {
+ "mapping": {
+ "artifact.publish": "#/$defs/ArtifactPublishCommand",
+ "asset.delete": "#/$defs/AssetDeleteCommand",
+ "asset.import": "#/$defs/AssetImportCommand",
+ "asset.updateMetadata": "#/$defs/AssetMetadataCommand",
+ "asset.writeText": "#/$defs/AssetWriteTextCommand",
+ "canvas.applyEdit": "#/$defs/CanvasApplyEditCommand",
+ "canvas.applyVersion": "#/$defs/NodeVersionApplyCommand",
+ "canvas.attachEditor": "#/$defs/CanvasEditorAttachCommand",
+ "canvas.configure": "#/$defs/CanvasConfigureCommand",
+ "canvas.createGeneration": "#/$defs/CanvasCreateGenerationCommand",
+ "canvas.detachEditor": "#/$defs/CanvasEditorDetachCommand",
+ "canvas.hide": "#/$defs/CanvasHideCommand",
+ "canvas.materialize": "#/$defs/CanvasMaterializeCommand",
+ "canvas.move": "#/$defs/CanvasMoveCommand",
+ "canvas.publishMedia": "#/$defs/CanvasPublishMediaCommand",
+ "canvas.show": "#/$defs/CanvasShowCommand",
+ "canvas.update": "#/$defs/CanvasUpdateCommand",
+ "creation.batch": "#/$defs/BatchCommand",
+ "director.apply": "#/$defs/DirectorApplyCommand",
+ "director.camera.delete": "#/$defs/DirectorCameraDeleteCommand",
+ "director.duration.set": "#/$defs/DirectorSetDurationCommand",
+ "director.storyboard.append": "#/$defs/DirectorStoryboardAppendCommand",
+ "director.storyboard.delete": "#/$defs/DirectorStoryboardDeleteCommand",
+ "director.storyboard.reorder": "#/$defs/DirectorStoryboardReorderCommand",
+ "director.storyboard.resize": "#/$defs/DirectorStoryboardResizeCommand",
+ "editor.create": "#/$defs/EditorCreateCommand",
+ "editor.save": "#/$defs/EditorSaveCommand",
+ "generation.submit": "#/$defs/GenerationSubmitCommand",
+ "generationSpec.create": "#/$defs/SpecCreateCommand",
+ "generationSpec.restore": "#/$defs/SpecRestoreCommand",
+ "generationSpec.setPrompt": "#/$defs/SpecPromptCommand",
+ "generationSpec.update": "#/$defs/SpecUpdateCommand",
+ "history.redo": "#/$defs/HistoryRedoCommand",
+ "history.undo": "#/$defs/HistoryUndoCommand",
+ "job.cancel": "#/$defs/JobCancelCommand",
+ "job.checkpoint": "#/$defs/JobCheckpointCommand",
+ "job.recover": "#/$defs/JobRecoverCommand",
+ "project.create": "#/$defs/ProjectCreateCommand",
+ "project.rename": "#/$defs/ProjectRenameCommand",
+ "project.restore": "#/$defs/ProjectRestoreCommand",
+ "project.trash": "#/$defs/ProjectTrashCommand",
+ "reference.add": "#/$defs/ReferenceAddCommand",
+ "reference.remove": "#/$defs/ReferenceRemoveCommand",
+ "reference.restore": "#/$defs/ReferenceRestoreCommand",
+ "reference.update": "#/$defs/ReferenceUpdateCommand",
+ "result.select": "#/$defs/ResultSelectCommand",
+ "timeline.publishRender": "#/$defs/TimelinePublishRenderCommand"
+ },
+ "propertyName": "type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/ProjectCreateCommand"
+ },
+ {
+ "$ref": "#/$defs/ProjectRenameCommand"
+ },
+ {
+ "$ref": "#/$defs/ProjectTrashCommand"
+ },
+ {
+ "$ref": "#/$defs/ProjectRestoreCommand"
+ },
+ {
+ "$ref": "#/$defs/AssetImportCommand"
+ },
+ {
+ "$ref": "#/$defs/ArtifactPublishCommand"
+ },
+ {
+ "$ref": "#/$defs/AssetWriteTextCommand"
+ },
+ {
+ "$ref": "#/$defs/AssetMetadataCommand"
+ },
+ {
+ "$ref": "#/$defs/AssetDeleteCommand"
+ },
+ {
+ "$ref": "#/$defs/CanvasCreateGenerationCommand"
+ },
+ {
+ "$ref": "#/$defs/CanvasShowCommand"
+ },
+ {
+ "$ref": "#/$defs/CanvasMoveCommand"
+ },
+ {
+ "$ref": "#/$defs/CanvasUpdateCommand"
+ },
+ {
+ "$ref": "#/$defs/CanvasHideCommand"
+ },
+ {
+ "$ref": "#/$defs/CanvasMaterializeCommand"
+ },
+ {
+ "$ref": "#/$defs/CanvasApplyEditCommand"
+ },
+ {
+ "$ref": "#/$defs/CanvasPublishMediaCommand"
+ },
+ {
+ "$ref": "#/$defs/TimelinePublishRenderCommand"
+ },
+ {
+ "$ref": "#/$defs/NodeVersionApplyCommand"
+ },
+ {
+ "$ref": "#/$defs/CanvasConfigureCommand"
+ },
+ {
+ "$ref": "#/$defs/CanvasEditorAttachCommand"
+ },
+ {
+ "$ref": "#/$defs/CanvasEditorDetachCommand"
+ },
+ {
+ "$ref": "#/$defs/SpecCreateCommand"
+ },
+ {
+ "$ref": "#/$defs/SpecUpdateCommand"
+ },
+ {
+ "$ref": "#/$defs/SpecRestoreCommand"
+ },
+ {
+ "$ref": "#/$defs/SpecPromptCommand"
+ },
+ {
+ "$ref": "#/$defs/ReferenceAddCommand"
+ },
+ {
+ "$ref": "#/$defs/ReferenceUpdateCommand"
+ },
+ {
+ "$ref": "#/$defs/ReferenceRestoreCommand"
+ },
+ {
+ "$ref": "#/$defs/ReferenceRemoveCommand"
+ },
+ {
+ "$ref": "#/$defs/GenerationSubmitCommand"
+ },
+ {
+ "$ref": "#/$defs/JobCancelCommand"
+ },
+ {
+ "$ref": "#/$defs/JobRecoverCommand"
+ },
+ {
+ "$ref": "#/$defs/JobCheckpointCommand"
+ },
+ {
+ "$ref": "#/$defs/ResultSelectCommand"
+ },
+ {
+ "$ref": "#/$defs/EditorCreateCommand"
+ },
+ {
+ "$ref": "#/$defs/EditorSaveCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorApplyCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardAppendCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardReorderCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardResizeCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardDeleteCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorSetDurationCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorCameraDeleteCommand"
+ },
+ {
+ "$ref": "#/$defs/HistoryUndoCommand"
+ },
+ {
+ "$ref": "#/$defs/HistoryRedoCommand"
+ },
+ {
+ "$ref": "#/$defs/BatchCommand"
+ }
+ ],
+ "title": "Command"
+ },
+ "receipt": {
+ "$ref": "#/$defs/CommandReceipt",
+ "description": "Immutable command execution receipt."
+ },
+ "query": {
+ "description": "Read-only project query.",
+ "discriminator": {
+ "mapping": {
+ "asset.preview": "#/$defs/AssetPreviewQuery",
+ "asset.search": "#/$defs/AssetSearchQuery",
+ "asset.usage": "#/$defs/AssetUsageQuery",
+ "canvas.status": "#/$defs/CanvasStatusQuery",
+ "canvas.versions": "#/$defs/VersionsQuery",
+ "director.storyboard.get": "#/$defs/DirectorStoryboardQuery",
+ "generationSpec.versions": "#/$defs/VersionsQuery",
+ "job.get": "#/$defs/ObjectQuery",
+ "object.get": "#/$defs/ObjectQuery",
+ "project.get": "#/$defs/ProjectQuery"
+ },
+ "propertyName": "type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/ProjectQuery"
+ },
+ {
+ "$ref": "#/$defs/ObjectQuery"
+ },
+ {
+ "$ref": "#/$defs/VersionsQuery"
+ },
+ {
+ "$ref": "#/$defs/AssetSearchQuery"
+ },
+ {
+ "$ref": "#/$defs/AssetUsageQuery"
+ },
+ {
+ "$ref": "#/$defs/CanvasStatusQuery"
+ },
+ {
+ "$ref": "#/$defs/AssetPreviewQuery"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardQuery"
+ }
+ ],
+ "title": "Query"
+ },
+ "event": {
+ "$ref": "#/$defs/ProjectEvent",
+ "description": "Project change event, if emitted."
+ },
+ "job": {
+ "$ref": "#/$defs/Job",
+ "description": "Generation execution record."
+ },
+ "result": {
+ "$ref": "#/$defs/ResultVersion",
+ "description": "Generated result schema."
+ },
+ "snapshot": {
+ "$ref": "#/$defs/InputSnapshot",
+ "description": "Fixed generation input schema."
+ },
+ "executionParameters": {
+ "description": "Effective provider execution parameter schema.",
+ "discriminator": {
+ "mapping": {
+ "audio": "#/$defs/AudioExecution",
+ "image": "#/$defs/ImageExecution",
+ "text": "#/$defs/TextExecution",
+ "video": "#/$defs/VideoExecution"
+ },
+ "propertyName": "kind"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/TextExecution"
+ },
+ {
+ "$ref": "#/$defs/ImageExecution"
+ },
+ {
+ "$ref": "#/$defs/VideoExecution"
+ },
+ {
+ "$ref": "#/$defs/AudioExecution"
+ }
+ ],
+ "title": "Executionparameters"
+ },
+ "promptPart": {
+ "description": "Structured prompt token schema.",
+ "discriminator": {
+ "mapping": {
+ "reference": "#/$defs/PromptReference",
+ "text": "#/$defs/PromptText"
+ },
+ "propertyName": "type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/$defs/PromptText"
+ },
+ {
+ "$ref": "#/$defs/PromptReference"
+ }
+ ],
+ "title": "Promptpart"
+ },
+ "publicModel": {
+ "$ref": "#/$defs/ModelConfigPublic",
+ "description": "Public model connection schema."
+ },
+ "writeModel": {
+ "$ref": "#/$defs/ModelConfigWrite",
+ "description": "Model configuration input schema."
+ },
+ "capabilities": {
+ "$ref": "#/$defs/NodeCapabilities",
+ "description": "Available canvas item operations."
+ },
+ "viewState": {
+ "$ref": "#/$defs/ViewState",
+ "description": "Client-specific canvas view state."
+ },
+ "timelinePackageManifest": {
+ "$ref": "#/$defs/TimelinePackageManifest",
+ "description": "Native editable timeline bundle manifest."
+ },
+ "timelinePackageImport": {
+ "$ref": "#/$defs/TimelinePackageImportRequest",
+ "description": "Recoverable native bundle import request."
+ },
+ "timelinePackageReceipt": {
+ "$ref": "#/$defs/TimelinePackageImportReceipt",
+ "description": "Native bundle import progress and final receipt."
+ },
+ "upload": {
+ "$ref": "#/$defs/UploadInfo",
+ "description": "Staged upload schema."
+ }
+ },
+ "required": [
+ "project",
+ "canvasItem",
+ "generationSpec",
+ "reference",
+ "editorDocument",
+ "command",
+ "receipt",
+ "query",
+ "event",
+ "job",
+ "result",
+ "snapshot",
+ "executionParameters",
+ "promptPart",
+ "publicModel",
+ "writeModel",
+ "capabilities",
+ "viewState",
+ "timelinePackageManifest",
+ "timelinePackageImport",
+ "timelinePackageReceipt",
+ "upload"
+ ],
+ "title": "CreationContracts",
+ "type": "object"
+ },
+ "DirectorApply": {
+ "additionalProperties": false,
+ "properties": {
+ "document": {
+ "$ref": "#/$defs/DirectorDocumentWrite",
+ "description": "Authoritative Director Stage document applied atomically."
+ }
+ },
+ "required": [
+ "document"
+ ],
+ "title": "DirectorApply",
+ "type": "object"
+ },
+ "DirectorApplyCommand": {
+ "additionalProperties": false,
+ "description": "Apply an authoritative Director Stage document atomically.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "director.apply",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/DirectorApply",
+ "description": "Apply an authoritative Director Stage document atomically."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "DirectorApplyCommand",
+ "type": "object"
+ },
+ "DirectorApplyCommandOperation": {
+ "additionalProperties": false,
+ "description": "Apply an authoritative Director Stage document atomically.",
+ "properties": {
+ "type": {
+ "const": "director.apply",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/DirectorApply",
+ "description": "Apply an authoritative Director Stage document atomically."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "DirectorApplyCommandOperation",
+ "type": "object"
+ },
+ "DirectorCameraDelete": {
+ "additionalProperties": false,
+ "properties": {
+ "documentId": {
+ "description": "Director Stage document that owns the camera.",
+ "format": "uuid",
+ "title": "Documentid",
+ "type": "string"
+ },
+ "cameraId": {
+ "description": "Camera to delete with its Storyboard blocks.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Cameraid",
+ "type": "string"
+ }
+ },
+ "required": [
+ "documentId",
+ "cameraId"
+ ],
+ "title": "DirectorCameraDelete",
+ "type": "object"
+ },
+ "DirectorCameraDeleteCommand": {
+ "additionalProperties": false,
+ "description": "Delete a non-final Director Stage camera and its Storyboard blocks atomically.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "director.camera.delete",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
+ {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/DirectorCameraDelete",
+ "description": "Delete a non-final Director Stage camera and its Storyboard blocks atomically."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "DirectorCameraDeleteCommand",
+ "type": "object"
+ },
+ "DirectorCameraDeleteCommandOperation": {
+ "additionalProperties": false,
+ "description": "Delete a non-final Director Stage camera and its Storyboard blocks atomically.",
+ "properties": {
+ "type": {
+ "const": "director.camera.delete",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/DirectorCameraDelete",
+ "description": "Delete a non-final Director Stage camera and its Storyboard blocks atomically."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "DirectorCameraDeleteCommandOperation",
+ "type": "object"
+ },
+ "DirectorCanvasItem": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "kind": {
+ "const": "external",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "title": {
+ "default": "",
+ "description": "User-visible title.",
+ "maxLength": 255,
+ "title": "Title",
+ "type": "string"
+ },
+ "position": {
+ "$ref": "#/$defs/Point",
+ "description": "Position in the owning canvas or stage."
+ },
+ "width": {
+ "default": 352,
+ "description": "Width in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Width",
+ "type": "number"
+ },
+ "height": {
+ "default": 198,
+ "description": "Height in pixels.",
+ "exclusiveMinimum": 0,
+ "title": "Height",
+ "type": "number"
+ },
+ "zIndex": {
+ "default": 0,
+ "description": "Canvas stacking order.",
+ "title": "Zindex",
+ "type": "integer"
+ },
+ "locked": {
+ "default": false,
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
+ "type": "boolean"
+ },
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
+ },
+ "parentId": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Parent canvas group ID, or null for the root.",
+ "title": "Parentid"
+ },
+ "tags": {
+ "default": [],
+ "description": "User-defined search tags.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Tags",
+ "type": "array"
+ },
+ "binding": {
+ "$ref": "#/$defs/EditorBinding",
+ "description": "Business object displayed by this canvas item."
+ }
+ },
+ "required": [
+ "id",
+ "projectId",
+ "revision",
+ "kind",
+ "title",
+ "position",
+ "width",
+ "height",
+ "zIndex",
+ "locked",
+ "visible",
+ "parentId",
+ "tags",
+ "binding"
+ ],
+ "title": "DirectorCanvasItem",
+ "type": "object"
+ },
+ "DirectorData": {
+ "additionalProperties": false,
+ "properties": {
+ "background": {
+ "description": "Composition background color.",
+ "examples": [
+ "#000000"
+ ],
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "title": "Background",
+ "type": "string"
+ },
+ "grid": {
+ "default": true,
+ "description": "Whether to display the stage grid.",
+ "title": "Grid",
+ "type": "boolean"
+ },
+ "duration": {
+ "description": "Interval duration in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Duration",
+ "type": "number"
+ },
+ "fps": {
+ "default": 30,
+ "description": "Frames per second. 帧率。",
+ "enum": [
+ 24,
+ 25,
+ 30,
+ 50,
+ 60
+ ],
+ "title": "Fps",
+ "type": "integer"
+ },
+ "aspectRatio": {
+ "default": "16:9",
+ "description": "Output width-to-height ratio.",
+ "enum": [
+ "16:9",
+ "2.39:1",
+ "9:16",
+ "1:1",
+ "4:3",
+ "3:4"
+ ],
+ "title": "Aspectratio",
+ "type": "string"
+ },
+ "cameras": {
+ "description": "Editable stage cameras.",
+ "items": {
+ "$ref": "#/$defs/CameraRig"
+ },
+ "minItems": 1,
+ "title": "Cameras",
+ "type": "array"
+ },
+ "activeCameraId": {
+ "description": "Active stage camera ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Activecameraid",
+ "type": "string"
+ },
+ "cameraSource": {
+ "default": "camera",
+ "description": "Camera selection strategy.",
+ "enum": [
+ "camera",
+ "storyboard"
+ ],
+ "title": "Camerasource",
+ "type": "string"
+ },
+ "shots": {
+ "default": [],
+ "description": "Ordered camera shot intervals.",
+ "items": {
+ "$ref": "#/$defs/StageShot"
+ },
+ "title": "Shots",
+ "type": "array"
+ },
+ "objects": {
+ "default": [],
+ "description": "Editable stage objects.",
+ "items": {
+ "$ref": "#/$defs/StageObject"
+ },
+ "title": "Objects",
+ "type": "array"
+ },
+ "environment": {
+ "$ref": "#/$defs/StageEnvironment",
+ "description": "Authoritative environment reference and ground configuration. 权威环境引用和地面配置。"
+ },
+ "lights": {
+ "description": "The three retained stage lights. 舞台保留的三盏灯光。",
+ "items": {
+ "$ref": "#/$defs/StageLight"
+ },
+ "maxItems": 3,
+ "minItems": 3,
+ "title": "Lights",
+ "type": "array"
+ },
+ "stills": {
+ "default": [],
+ "description": "Captured still frames pinned as project image assets, oldest first.",
+ "items": {
+ "$ref": "#/$defs/AssetRef"
+ },
+ "title": "Stills",
+ "type": "array"
+ }
+ },
+ "required": [
+ "background",
+ "grid",
+ "duration",
+ "fps",
+ "aspectRatio",
+ "cameras",
+ "activeCameraId",
+ "cameraSource",
+ "shots",
+ "objects",
+ "environment",
+ "lights",
+ "stills"
+ ],
+ "title": "DirectorData",
+ "type": "object"
+ },
+ "DirectorDataWrite": {
+ "additionalProperties": false,
+ "description": "A Director Stage document entering the project through a command.\n\nIt has the same fields and dump as the stored ``DirectorData``. Shot relations are\nnot checked while the command is parsed: both HTTP and Agent entry points parse the\npayload before the application service runs, so checking here would reject the write\nwith a generic code before the write boundary could report the specific one. The\nstored model still validates the committed snapshot as the last line of defence.",
+ "properties": {
+ "background": {
+ "description": "Composition background color.",
+ "examples": [
+ "#000000"
+ ],
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "title": "Background",
+ "type": "string"
+ },
+ "grid": {
+ "default": true,
+ "description": "Whether to display the stage grid.",
+ "title": "Grid",
+ "type": "boolean"
+ },
+ "duration": {
+ "description": "Interval duration in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Duration",
+ "type": "number"
+ },
+ "fps": {
+ "default": 30,
+ "description": "Frames per second. 帧率。",
+ "enum": [
+ 24,
+ 25,
+ 30,
+ 50,
+ 60
+ ],
+ "title": "Fps",
+ "type": "integer"
+ },
+ "aspectRatio": {
+ "default": "16:9",
+ "description": "Output width-to-height ratio.",
+ "enum": [
+ "16:9",
+ "2.39:1",
+ "9:16",
+ "1:1",
+ "4:3",
+ "3:4"
+ ],
+ "title": "Aspectratio",
+ "type": "string"
+ },
+ "cameras": {
+ "description": "Editable stage cameras.",
+ "items": {
+ "$ref": "#/$defs/CameraRig"
+ },
+ "minItems": 1,
+ "title": "Cameras",
+ "type": "array"
+ },
+ "activeCameraId": {
+ "description": "Active stage camera ID.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Activecameraid",
+ "type": "string"
+ },
+ "cameraSource": {
+ "default": "camera",
+ "description": "Camera selection strategy.",
+ "enum": [
+ "camera",
+ "storyboard"
+ ],
+ "title": "Camerasource",
+ "type": "string"
+ },
+ "shots": {
+ "default": [],
+ "description": "Ordered camera shot intervals.",
+ "items": {
+ "$ref": "#/$defs/StageShot"
+ },
+ "title": "Shots",
+ "type": "array"
+ },
+ "objects": {
+ "default": [],
+ "description": "Editable stage objects.",
+ "items": {
+ "$ref": "#/$defs/StageObject"
+ },
+ "title": "Objects",
+ "type": "array"
+ },
+ "environment": {
+ "$ref": "#/$defs/StageEnvironment",
+ "description": "Authoritative environment reference and ground configuration. 权威环境引用和地面配置。"
+ },
+ "lights": {
+ "description": "The three retained stage lights. 舞台保留的三盏灯光。",
+ "items": {
+ "$ref": "#/$defs/StageLight"
+ },
+ "maxItems": 3,
+ "minItems": 3,
+ "title": "Lights",
+ "type": "array"
+ },
+ "stills": {
+ "default": [],
+ "description": "Captured still frames pinned as project image assets, oldest first.",
+ "items": {
+ "$ref": "#/$defs/AssetRef"
+ },
+ "title": "Stills",
+ "type": "array"
+ }
+ },
+ "required": [
+ "background",
+ "grid",
+ "duration",
+ "fps",
+ "aspectRatio",
+ "cameras",
+ "activeCameraId",
+ "cameraSource",
+ "shots",
+ "objects",
+ "environment",
+ "lights",
+ "stills"
+ ],
+ "title": "DirectorDataWrite",
+ "type": "object"
+ },
+ "DirectorDocument": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "schemaVersion": {
+ "const": 1,
+ "default": 1,
+ "description": "Record schema version.",
+ "title": "Schemaversion",
+ "type": "integer"
+ },
+ "inputConnections": {
+ "default": [],
+ "description": "Persisted connections to source assets.",
+ "items": {
+ "$ref": "#/$defs/EditorInputConnection"
+ },
+ "title": "Inputconnections",
+ "type": "array"
+ },
+ "kind": {
+ "const": "director",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "data": {
+ "$ref": "#/$defs/DirectorData",
+ "description": "Typed editable document contents."
+ }
+ },
+ "required": [
+ "id",
+ "projectId",
+ "revision",
+ "schemaVersion",
+ "inputConnections",
+ "kind",
+ "data"
+ ],
+ "title": "DirectorDocument",
+ "type": "object"
+ },
+ "DirectorDocumentWrite": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable identity of this project-owned object.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "revision": {
+ "default": 1,
+ "description": "Current object revision for optimistic concurrency.",
+ "minimum": 1,
+ "title": "Revision",
+ "type": "integer"
+ },
+ "schemaVersion": {
+ "const": 1,
+ "default": 1,
+ "description": "Record schema version.",
+ "title": "Schemaversion",
+ "type": "integer"
+ },
+ "inputConnections": {
+ "default": [],
+ "description": "Persisted connections to source assets.",
+ "items": {
+ "$ref": "#/$defs/EditorInputConnection"
+ },
+ "title": "Inputconnections",
+ "type": "array"
+ },
+ "kind": {
+ "const": "director",
+ "description": "Business object or media type.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "data": {
+ "$ref": "#/$defs/DirectorDataWrite",
+ "description": "Typed editable document contents."
+ }
+ },
+ "required": [
+ "id",
+ "projectId",
+ "revision",
+ "schemaVersion",
+ "inputConnections",
+ "kind",
+ "data"
+ ],
+ "title": "DirectorDocumentWrite",
+ "type": "object"
+ },
+ "DirectorDurationResult": {
+ "additionalProperties": false,
+ "properties": {
+ "documentId": {
+ "description": "Director Stage document whose main timeline was evaluated.",
+ "format": "uuid",
+ "title": "Documentid",
+ "type": "string"
+ },
+ "requestedDuration": {
+ "description": "Main timeline duration requested in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Requestedduration",
+ "type": "number"
+ },
+ "appliedDuration": {
+ "description": "Main timeline duration applied in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Appliedduration",
+ "type": "number"
+ },
+ "clampReason": {
+ "anyOf": [
{
- "$ref": "#/$defs/ResultSelectCommand"
+ "const": "storyboard_end",
+ "type": "string"
},
{
- "$ref": "#/$defs/EditorCreateCommand"
- },
+ "type": "null"
+ }
+ ],
+ "description": "Stable reason for a limited duration, or null.",
+ "title": "Clampreason"
+ }
+ },
+ "required": [
+ "documentId",
+ "requestedDuration",
+ "appliedDuration",
+ "clampReason"
+ ],
+ "title": "DirectorDurationResult",
+ "type": "object"
+ },
+ "DirectorOutputPlan": {
+ "additionalProperties": false,
+ "properties": {
+ "cameraSource": {
+ "description": "Camera selection strategy fixed for this render.",
+ "enum": [
+ "camera",
+ "storyboard"
+ ],
+ "title": "Camerasource",
+ "type": "string"
+ },
+ "cameraId": {
+ "anyOf": [
{
- "$ref": "#/$defs/EditorSaveCommand"
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
},
{
- "$ref": "#/$defs/HistoryUndoCommand"
- },
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Camera rig fixed for a camera render; omitted for storyboard renders.",
+ "title": "Cameraid"
+ },
+ "width": {
+ "description": "Expected output width in pixels.",
+ "minimum": 1,
+ "title": "Width",
+ "type": "integer"
+ },
+ "height": {
+ "description": "Expected output height in pixels.",
+ "minimum": 1,
+ "title": "Height",
+ "type": "integer"
+ },
+ "durationSeconds": {
+ "description": "Expected output duration in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Durationseconds",
+ "type": "number"
+ },
+ "frameRate": {
+ "description": "Expected output frames per second.",
+ "exclusiveMinimum": 0,
+ "title": "Framerate",
+ "type": "number"
+ }
+ },
+ "required": [
+ "cameraSource",
+ "cameraId",
+ "width",
+ "height",
+ "durationSeconds",
+ "frameRate"
+ ],
+ "title": "DirectorOutputPlan",
+ "type": "object"
+ },
+ "DirectorRenderEvidence": {
+ "additionalProperties": false,
+ "properties": {
+ "acceptedProjectCursor": {
+ "description": "Event cursor of the accepted project snapshot.",
+ "minimum": 1,
+ "title": "Acceptedprojectcursor",
+ "type": "integer"
+ },
+ "sourceEditorId": {
+ "description": "Editable Director Stage document fixed at acceptance.",
+ "format": "uuid",
+ "title": "Sourceeditorid",
+ "type": "string"
+ },
+ "sourceEditorRevision": {
+ "description": "Source stage revision fixed at acceptance.",
+ "minimum": 1,
+ "title": "Sourceeditorrevision",
+ "type": "integer"
+ },
+ "plan": {
+ "$ref": "#/$defs/DirectorOutputPlan",
+ "description": "The accepted camera strategy, output size, duration and frame rate."
+ }
+ },
+ "required": [
+ "acceptedProjectCursor",
+ "sourceEditorId",
+ "sourceEditorRevision",
+ "plan"
+ ],
+ "title": "DirectorRenderEvidence",
+ "type": "object"
+ },
+ "DirectorSetDuration": {
+ "additionalProperties": false,
+ "properties": {
+ "documentId": {
+ "description": "Director Stage document whose main timeline will change.",
+ "format": "uuid",
+ "title": "Documentid",
+ "type": "string"
+ },
+ "duration": {
+ "description": "Requested main timeline duration in seconds.",
+ "exclusiveMinimum": 0,
+ "title": "Duration",
+ "type": "number"
+ }
+ },
+ "required": [
+ "documentId",
+ "duration"
+ ],
+ "title": "DirectorSetDuration",
+ "type": "object"
+ },
+ "DirectorSetDurationCommand": {
+ "additionalProperties": false,
+ "description": "Set the Director Stage main timeline duration, preserving the Storyboard and animation.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "director.duration.set",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
{
- "$ref": "#/$defs/HistoryRedoCommand"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
- "$ref": "#/$defs/BatchCommand"
+ "type": "null"
}
],
- "title": "Command"
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "receipt": {
- "$ref": "#/$defs/CommandReceipt",
- "description": "Immutable command execution receipt."
+ "payload": {
+ "$ref": "#/$defs/DirectorSetDuration",
+ "description": "Set the Director Stage main timeline duration, preserving the Storyboard and animation."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "DirectorSetDurationCommand",
+ "type": "object"
+ },
+ "DirectorSetDurationCommandOperation": {
+ "additionalProperties": false,
+ "description": "Set the Director Stage main timeline duration, preserving the Storyboard and animation.",
+ "properties": {
+ "type": {
+ "const": "director.duration.set",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
},
- "query": {
- "description": "Read-only project query.",
- "discriminator": {
- "mapping": {
- "asset.preview": "#/$defs/AssetPreviewQuery",
- "asset.search": "#/$defs/AssetSearchQuery",
- "asset.usage": "#/$defs/AssetUsageQuery",
- "canvas.status": "#/$defs/CanvasStatusQuery",
- "canvas.versions": "#/$defs/VersionsQuery",
- "generationSpec.versions": "#/$defs/VersionsQuery",
- "job.get": "#/$defs/ObjectQuery",
- "object.get": "#/$defs/ObjectQuery",
- "project.get": "#/$defs/ProjectQuery"
- },
- "propertyName": "type"
+ "payload": {
+ "$ref": "#/$defs/DirectorSetDuration",
+ "description": "Set the Director Stage main timeline duration, preserving the Storyboard and animation."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "DirectorSetDurationCommandOperation",
+ "type": "object"
+ },
+ "DirectorStoryboardAppend": {
+ "additionalProperties": false,
+ "properties": {
+ "documentId": {
+ "description": "Director Stage document that receives the Storyboard block.",
+ "format": "uuid",
+ "title": "Documentid",
+ "type": "string"
+ },
+ "cameraId": {
+ "description": "Existing stage camera the new block references.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Cameraid",
+ "type": "string"
+ },
+ "blockId": {
+ "description": "Stable identity of the new Storyboard block; it must not be in use.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Blockid",
+ "type": "string"
+ }
+ },
+ "required": [
+ "documentId",
+ "cameraId",
+ "blockId"
+ ],
+ "title": "DirectorStoryboardAppend",
+ "type": "object"
+ },
+ "DirectorStoryboardAppendCommand": {
+ "additionalProperties": false,
+ "description": "Append an existing camera to the end of the continuous Director Stage Storyboard.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "director.storyboard.append",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
},
- "oneOf": [
- {
- "$ref": "#/$defs/ProjectQuery"
- },
- {
- "$ref": "#/$defs/ObjectQuery"
- },
- {
- "$ref": "#/$defs/VersionsQuery"
- },
- {
- "$ref": "#/$defs/AssetSearchQuery"
- },
- {
- "$ref": "#/$defs/AssetUsageQuery"
- },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
{
- "$ref": "#/$defs/CanvasStatusQuery"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
- "$ref": "#/$defs/AssetPreviewQuery"
+ "type": "null"
}
],
- "title": "Query"
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "event": {
- "$ref": "#/$defs/ProjectEvent",
- "description": "Project change event, if emitted."
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardAppend",
+ "description": "Append an existing camera to the end of the continuous Director Stage Storyboard."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "DirectorStoryboardAppendCommand",
+ "type": "object"
+ },
+ "DirectorStoryboardBlock": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable block identity.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Id",
+ "type": "string"
},
- "job": {
- "$ref": "#/$defs/Job",
- "description": "Generation execution record."
+ "cameraId": {
+ "description": "Stage camera the block references.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Cameraid",
+ "type": "string"
},
- "result": {
- "$ref": "#/$defs/ResultVersion",
- "description": "Generated result schema."
+ "order": {
+ "description": "Position in the stored Storyboard, starting at zero.",
+ "minimum": 0,
+ "title": "Order",
+ "type": "integer"
},
- "snapshot": {
- "$ref": "#/$defs/InputSnapshot",
- "description": "Fixed generation input schema."
+ "start": {
+ "description": "Block start in seconds, as stored.",
+ "minimum": 0,
+ "title": "Start",
+ "type": "number"
},
- "executionParameters": {
- "description": "Effective provider execution parameter schema.",
- "discriminator": {
- "mapping": {
- "audio": "#/$defs/AudioExecution",
- "image": "#/$defs/ImageExecution",
- "text": "#/$defs/TextExecution",
- "video": "#/$defs/VideoExecution"
- },
- "propertyName": "kind"
+ "duration": {
+ "description": "Block duration in seconds, as stored.",
+ "exclusiveMinimum": 0,
+ "title": "Duration",
+ "type": "number"
+ }
+ },
+ "required": [
+ "id",
+ "cameraId",
+ "order",
+ "start",
+ "duration"
+ ],
+ "title": "DirectorStoryboardBlock",
+ "type": "object"
+ },
+ "DirectorStoryboardDelete": {
+ "additionalProperties": false,
+ "properties": {
+ "documentId": {
+ "description": "Director Stage document that owns the Storyboard.",
+ "format": "uuid",
+ "title": "Documentid",
+ "type": "string"
+ },
+ "blockId": {
+ "description": "Storyboard block to delete.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Blockid",
+ "type": "string"
+ }
+ },
+ "required": [
+ "documentId",
+ "blockId"
+ ],
+ "title": "DirectorStoryboardDelete",
+ "type": "object"
+ },
+ "DirectorStoryboardDeleteCommand": {
+ "additionalProperties": false,
+ "description": "Delete a Storyboard block and shift later blocks without changing their durations.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "director.storyboard.delete",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
},
- "oneOf": [
- {
- "$ref": "#/$defs/TextExecution"
- },
- {
- "$ref": "#/$defs/ImageExecution"
- },
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
{
- "$ref": "#/$defs/VideoExecution"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
- "$ref": "#/$defs/AudioExecution"
+ "type": "null"
}
],
- "title": "Executionparameters"
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
+ },
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardDelete",
+ "description": "Delete a Storyboard block and shift later blocks without changing their durations."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "DirectorStoryboardDeleteCommand",
+ "type": "object"
+ },
+ "DirectorStoryboardDeleteCommandOperation": {
+ "additionalProperties": false,
+ "description": "Delete a Storyboard block and shift later blocks without changing their durations.",
+ "properties": {
+ "type": {
+ "const": "director.storyboard.delete",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardDelete",
+ "description": "Delete a Storyboard block and shift later blocks without changing their durations."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "DirectorStoryboardDeleteCommandOperation",
+ "type": "object"
+ },
+ "DirectorStoryboardQuery": {
+ "additionalProperties": false,
+ "properties": {
+ "queryId": {
+ "description": "Caller-supplied query ID.",
+ "format": "uuid",
+ "title": "Queryid",
+ "type": "string"
+ },
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "director.storyboard.get",
+ "description": "Read the stored Director Stage Storyboard and whether a block can be appended.",
+ "title": "Type",
+ "type": "string"
+ },
+ "objectId": {
+ "description": "Director Stage document ID.",
+ "format": "uuid",
+ "title": "Objectid",
+ "type": "string"
+ }
+ },
+ "required": [
+ "queryId",
+ "projectId",
+ "type",
+ "objectId"
+ ],
+ "title": "DirectorStoryboardQuery",
+ "type": "object"
+ },
+ "DirectorStoryboardReorder": {
+ "additionalProperties": false,
+ "properties": {
+ "documentId": {
+ "description": "Director Stage document that owns the Storyboard.",
+ "format": "uuid",
+ "title": "Documentid",
+ "type": "string"
+ },
+ "blockIds": {
+ "description": "Every Storyboard block ID exactly once, in the desired order.",
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ "title": "Blockids",
+ "type": "array"
+ }
+ },
+ "required": [
+ "documentId",
+ "blockIds"
+ ],
+ "title": "DirectorStoryboardReorder",
+ "type": "object"
+ },
+ "DirectorStoryboardReorderCommand": {
+ "additionalProperties": false,
+ "description": "Reorder the continuous Storyboard by block ID, preserving durations and camera references.",
+ "properties": {
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
+ "format": "uuid",
+ "title": "Commandid",
+ "type": "string"
},
- "promptPart": {
- "description": "Structured prompt token schema.",
- "discriminator": {
- "mapping": {
- "reference": "#/$defs/PromptReference",
- "text": "#/$defs/PromptText"
- },
- "propertyName": "type"
+ "projectId": {
+ "description": "Owning project ID.",
+ "format": "uuid",
+ "title": "Projectid",
+ "type": "string"
+ },
+ "type": {
+ "const": "director.storyboard.reorder",
+ "description": "Command discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
},
- "oneOf": [
+ "title": "Expectedversions",
+ "type": "array"
+ },
+ "expectedPreview": {
+ "anyOf": [
{
- "$ref": "#/$defs/PromptText"
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
},
{
- "$ref": "#/$defs/PromptReference"
+ "type": "null"
}
],
- "title": "Promptpart"
- },
- "publicModel": {
- "$ref": "#/$defs/ModelConfigPublic",
- "description": "Public model connection schema."
- },
- "writeModel": {
- "$ref": "#/$defs/ModelConfigWrite",
- "description": "Model configuration input schema."
- },
- "capabilities": {
- "$ref": "#/$defs/NodeCapabilities",
- "description": "Available canvas item operations."
- },
- "viewState": {
- "$ref": "#/$defs/ViewState",
- "description": "Client-specific canvas view state."
+ "default": null,
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "timelinePackageManifest": {
- "$ref": "#/$defs/TimelinePackageManifest",
- "description": "Native editable timeline bundle manifest."
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardReorder",
+ "description": "Reorder the continuous Storyboard by block ID, preserving durations and camera references."
+ }
+ },
+ "required": [
+ "commandId",
+ "projectId",
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "DirectorStoryboardReorderCommand",
+ "type": "object"
+ },
+ "DirectorStoryboardReorderCommandOperation": {
+ "additionalProperties": false,
+ "description": "Reorder the continuous Storyboard by block ID, preserving durations and camera references.",
+ "properties": {
+ "type": {
+ "const": "director.storyboard.reorder",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
},
- "timelinePackageImport": {
- "$ref": "#/$defs/TimelinePackageImportRequest",
- "description": "Recoverable native bundle import request."
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardReorder",
+ "description": "Reorder the continuous Storyboard by block ID, preserving durations and camera references."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
+ ],
+ "title": "DirectorStoryboardReorderCommandOperation",
+ "type": "object"
+ },
+ "DirectorStoryboardResize": {
+ "additionalProperties": false,
+ "properties": {
+ "documentId": {
+ "description": "Director Stage document that owns the Storyboard.",
+ "format": "uuid",
+ "title": "Documentid",
+ "type": "string"
},
- "timelinePackageReceipt": {
- "$ref": "#/$defs/TimelinePackageImportReceipt",
- "description": "Native bundle import progress and final receipt."
+ "blockId": {
+ "description": "Block that owns the boundary on its right.",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "title": "Blockid",
+ "type": "string"
},
- "upload": {
- "$ref": "#/$defs/UploadInfo",
- "description": "Staged upload schema."
+ "duration": {
+ "description": "New duration of that block in seconds; must leave the Storyboard continuous and within the timeline.",
+ "title": "Duration",
+ "type": "number"
}
},
"required": [
- "project",
- "canvasItem",
- "generationSpec",
- "reference",
- "editorDocument",
- "command",
- "receipt",
- "query",
- "event",
- "job",
- "result",
- "snapshot",
- "executionParameters",
- "promptPart",
- "publicModel",
- "writeModel",
- "capabilities",
- "viewState",
- "timelinePackageManifest",
- "timelinePackageImport",
- "timelinePackageReceipt",
- "upload"
+ "documentId",
+ "blockId",
+ "duration"
],
- "title": "CreationContracts",
+ "title": "DirectorStoryboardResize",
"type": "object"
},
- "DirectorCanvasItem": {
+ "DirectorStoryboardResizeCommand": {
"additionalProperties": false,
+ "description": "Resize the given block and shift all subsequent blocks, preserving their durations.",
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
+ "commandId": {
+ "description": "Stable command ID for idempotent replay.",
"format": "uuid",
- "title": "Id",
+ "title": "Commandid",
"type": "string"
},
"projectId": {
@@ -19384,66 +23166,25 @@
"title": "Projectid",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
- "minimum": 1,
- "title": "Revision",
- "type": "integer"
- },
- "kind": {
- "const": "external",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
- },
- "title": {
- "default": "",
- "description": "User-visible title.",
- "maxLength": 255,
- "title": "Title",
+ "type": {
+ "const": "director.storyboard.resize",
+ "description": "Command discriminator.",
+ "title": "Type",
"type": "string"
},
- "position": {
- "$ref": "#/$defs/Point",
- "description": "Position in the owning canvas or stage."
- },
- "width": {
- "default": 352,
- "description": "Width in pixels.",
- "exclusiveMinimum": 0,
- "title": "Width",
- "type": "number"
- },
- "height": {
- "default": 198,
- "description": "Height in pixels.",
- "exclusiveMinimum": 0,
- "title": "Height",
- "type": "number"
- },
- "zIndex": {
- "default": 0,
- "description": "Canvas stacking order.",
- "title": "Zindex",
- "type": "integer"
- },
- "locked": {
- "default": false,
- "description": "Whether edits to this object are blocked.",
- "title": "Locked",
- "type": "boolean"
- },
- "visible": {
- "default": true,
- "description": "Whether this object is displayed.",
- "title": "Visible",
- "type": "boolean"
+ "expectedVersions": {
+ "default": [],
+ "description": "Current versions of mutated existing objects; payload revision fields do not replace these.",
+ "items": {
+ "$ref": "#/$defs/ObjectVersion"
+ },
+ "title": "Expectedversions",
+ "type": "array"
},
- "parentId": {
+ "expectedPreview": {
"anyOf": [
{
- "format": "uuid",
+ "pattern": "^[0-9a-f]{64}$",
"type": "string"
},
{
@@ -19451,198 +23192,245 @@
}
],
"default": null,
- "description": "Parent canvas group ID, or null for the root.",
- "title": "Parentid"
- },
- "tags": {
- "default": [],
- "description": "User-defined search tags.",
- "items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "type": "string"
- },
- "title": "Tags",
- "type": "array"
+ "description": "Fingerprint of the confirmed impact preview.",
+ "title": "Expectedpreview"
},
- "binding": {
- "$ref": "#/$defs/EditorBinding",
- "description": "Business object displayed by this canvas item."
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardResize",
+ "description": "Resize the given block and shift all subsequent blocks, preserving their durations."
}
},
"required": [
- "id",
+ "commandId",
"projectId",
- "revision",
- "kind",
- "title",
- "position",
- "width",
- "height",
- "zIndex",
- "locked",
- "visible",
- "parentId",
- "tags",
- "binding"
+ "type",
+ "expectedVersions",
+ "expectedPreview",
+ "payload"
+ ],
+ "title": "DirectorStoryboardResizeCommand",
+ "type": "object"
+ },
+ "DirectorStoryboardResizeCommandOperation": {
+ "additionalProperties": false,
+ "description": "Resize the given block and shift all subsequent blocks, preserving their durations.",
+ "properties": {
+ "type": {
+ "const": "director.storyboard.resize",
+ "description": "Operation discriminator.",
+ "title": "Type",
+ "type": "string"
+ },
+ "payload": {
+ "$ref": "#/$defs/DirectorStoryboardResize",
+ "description": "Resize the given block and shift all subsequent blocks, preserving their durations."
+ }
+ },
+ "required": [
+ "type",
+ "payload"
],
- "title": "DirectorCanvasItem",
+ "title": "DirectorStoryboardResizeCommandOperation",
"type": "object"
},
- "DirectorData": {
+ "DirectorStoryboardResult": {
"additionalProperties": false,
"properties": {
- "background": {
- "description": "Composition background color.",
- "pattern": "^#[0-9a-fA-F]{6}$",
- "title": "Background",
- "type": "string"
- },
- "grid": {
- "default": true,
- "description": "Whether to display the stage grid.",
- "title": "Grid",
- "type": "boolean"
- },
- "duration": {
- "description": "Interval duration in seconds.",
- "exclusiveMinimum": 0,
- "title": "Duration",
- "type": "number"
+ "operationIndex": {
+ "description": "Zero-based position in the command or batch.",
+ "minimum": 0,
+ "title": "Operationindex",
+ "type": "integer"
},
- "aspectRatio": {
- "default": "16:9",
- "description": "Output width-to-height ratio.",
+ "operation": {
+ "description": "Storyboard or related operation evaluated.",
"enum": [
- "16:9",
- "9:16",
- "1:1",
- "4:3",
- "3:4"
+ "director.storyboard.append",
+ "director.storyboard.reorder",
+ "director.storyboard.resize",
+ "director.storyboard.delete",
+ "director.camera.delete",
+ "director.duration.set"
],
- "title": "Aspectratio",
+ "title": "Operation",
"type": "string"
},
- "cameras": {
- "description": "Editable stage cameras.",
+ "documentId": {
+ "description": "Director Stage document that owns the Storyboard.",
+ "format": "uuid",
+ "title": "Documentid",
+ "type": "string"
+ },
+ "version": {
+ "description": "Committed document revision for the enclosing transaction.",
+ "minimum": 1,
+ "title": "Version",
+ "type": "integer"
+ },
+ "blocks": {
+ "description": "Block identities, order and stored times after this operation, before subsequent batch operations.",
"items": {
- "$ref": "#/$defs/CameraRig"
+ "$ref": "#/$defs/DirectorStoryboardBlock"
},
- "minItems": 1,
- "title": "Cameras",
+ "title": "Blocks",
"type": "array"
},
- "activeCameraId": {
- "description": "Active stage camera ID.",
- "maxLength": 100,
- "minLength": 1,
- "pattern": "\\S",
- "title": "Activecameraid",
- "type": "string"
- },
- "cameraSource": {
- "default": "camera",
- "description": "Camera selection strategy.",
- "enum": [
- "camera",
- "storyboard"
- ],
- "title": "Camerasource",
- "type": "string"
- },
- "shots": {
- "default": [],
- "description": "Ordered camera shot intervals.",
+ "affectedBlockIds": {
+ "description": "New or changed surviving block IDs, in resulting order.",
"items": {
- "$ref": "#/$defs/StageShot"
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
},
- "title": "Shots",
+ "title": "Affectedblockids",
"type": "array"
},
- "objects": {
- "default": [],
- "description": "Editable stage objects.",
+ "removedBlockIds": {
+ "description": "Removed block IDs, in their previous order.",
"items": {
- "$ref": "#/$defs/StageObject"
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
},
- "title": "Objects",
+ "title": "Removedblockids",
"type": "array"
+ },
+ "blockId": {
+ "anyOf": [
+ {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Block explicitly targeted by the operation, when applicable.",
+ "title": "Blockid"
+ },
+ "cameraId": {
+ "anyOf": [
+ {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "\\S",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Camera explicitly targeted by the operation, when applicable.",
+ "title": "Cameraid"
+ },
+ "appendLimitReason": {
+ "anyOf": [
+ {
+ "const": "storyboard_tail",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Stable reason a new block is shorter than the default duration, or null.",
+ "title": "Appendlimitreason"
}
},
"required": [
- "background",
- "grid",
- "duration",
- "aspectRatio",
- "cameras",
- "activeCameraId",
- "cameraSource",
- "shots",
- "objects"
+ "operationIndex",
+ "operation",
+ "documentId",
+ "version",
+ "blocks",
+ "affectedBlockIds",
+ "removedBlockIds",
+ "blockId",
+ "cameraId",
+ "appendLimitReason"
],
- "title": "DirectorData",
+ "title": "DirectorStoryboardResult",
"type": "object"
},
- "DirectorDocument": {
+ "DirectorStoryboardState": {
"additionalProperties": false,
"properties": {
- "id": {
- "description": "Stable identity of this project-owned object.",
- "format": "uuid",
- "title": "Id",
- "type": "string"
- },
- "projectId": {
- "description": "Owning project ID.",
+ "documentId": {
+ "description": "Director Stage document that owns the Storyboard.",
"format": "uuid",
- "title": "Projectid",
+ "title": "Documentid",
"type": "string"
},
- "revision": {
- "default": 1,
- "description": "Current object revision for optimistic concurrency.",
+ "version": {
+ "description": "Current revision of the Director Stage document.",
"minimum": 1,
- "title": "Revision",
+ "title": "Version",
"type": "integer"
},
- "schemaVersion": {
- "const": 1,
- "default": 1,
- "description": "Record schema version.",
- "title": "Schemaversion",
- "type": "integer"
+ "storyboardEnd": {
+ "description": "End of the last block in seconds; zero when the Storyboard is empty.",
+ "minimum": 0,
+ "title": "Storyboardend",
+ "type": "number"
},
- "inputConnections": {
- "default": [],
- "description": "Persisted connections to source assets.",
+ "canAppend": {
+ "description": "Whether a block can be appended in the main-timeline time that remains.",
+ "title": "Canappend",
+ "type": "boolean"
+ },
+ "cannotAppendReason": {
+ "anyOf": [
+ {
+ "enum": [
+ "storyboard_leading_gap",
+ "storyboard_internal_gap",
+ "storyboard_overlap",
+ "storyboard_exceeds_duration",
+ "storyboard_duration_invalid",
+ "storyboard_camera_unknown",
+ "storyboard_block_invalid",
+ "storyboard_block_exists",
+ "storyboard_exhausted",
+ "storyboard_order_invalid",
+ "storyboard_block_unknown",
+ "director_camera_unknown",
+ "director_camera_required"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Stable reason no block can be appended; null when one can.",
+ "title": "Cannotappendreason"
+ },
+ "blocks": {
+ "description": "Storyboard blocks in stored order, reported as stored.",
"items": {
- "$ref": "#/$defs/EditorInputConnection"
+ "$ref": "#/$defs/DirectorStoryboardBlock"
},
- "title": "Inputconnections",
+ "title": "Blocks",
"type": "array"
- },
- "kind": {
- "const": "director",
- "description": "Business object or media type.",
- "title": "Kind",
- "type": "string"
- },
- "data": {
- "$ref": "#/$defs/DirectorData",
- "description": "Typed editable document contents."
}
},
"required": [
- "id",
- "projectId",
- "revision",
- "schemaVersion",
- "inputConnections",
- "kind",
- "data"
+ "documentId",
+ "version",
+ "storyboardEnd",
+ "canAppend",
+ "cannotAppendReason",
+ "blocks"
],
- "title": "DirectorDocument",
+ "title": "DirectorStoryboardState",
"type": "object"
},
"EditorBinding": {
@@ -20099,7 +23887,7 @@
"description": "Editable document owned by this operation.",
"discriminator": {
"mapping": {
- "director": "#/$defs/DirectorDocument",
+ "director": "#/$defs/DirectorDocumentWrite",
"image_crop": "#/$defs/ImageCropDocument",
"layers": "#/$defs/LayerDocument",
"media_edit": "#/$defs/MediaEditDocument",
@@ -20130,7 +23918,7 @@
"$ref": "#/$defs/ToolDocument"
},
{
- "$ref": "#/$defs/DirectorDocument"
+ "$ref": "#/$defs/DirectorDocumentWrite"
},
{
"$ref": "#/$defs/MediaEditDocument"
@@ -23522,6 +27310,20 @@
"description": "Video frames per second.",
"title": "Framerate"
},
+ "frameCount": {
+ "anyOf": [
+ {
+ "minimum": 1,
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Number of video frames reported by the media container.",
+ "title": "Framecount"
+ },
"hasAudio": {
"anyOf": [
{
@@ -23562,6 +27364,35 @@
"default": null,
"description": "Audio channel count.",
"title": "Channels"
+ },
+ "selfContained": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Whether a model container embeds all its buffers and images.",
+ "title": "Selfcontained"
+ },
+ "animationNames": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Animation clip names declared by a parsed model container, in document order.",
+ "title": "Animationnames"
}
},
"required": [
@@ -23573,7 +27404,9 @@
"frameRate",
"hasAudio",
"sampleRate",
- "channels"
+ "channels",
+ "selfContained",
+ "animationNames"
],
"title": "MediaMetadata",
"type": "object"
@@ -25509,6 +29342,9 @@
},
"color": {
"description": "Serialized display color.",
+ "examples": [
+ "#000000"
+ ],
"pattern": "^#[0-9a-fA-F]{6}$",
"title": "Color",
"type": "string"
@@ -26947,19 +30783,81 @@
}
},
"required": [
- "id",
- "projectId",
- "revision",
- "schemaVersion",
- "inputConnections",
+ "id",
+ "projectId",
+ "revision",
+ "schemaVersion",
+ "inputConnections",
+ "kind",
+ "data"
+ ],
+ "title": "StackDocument",
+ "type": "object"
+ },
+ "StageBezierTransition": {
+ "additionalProperties": false,
+ "properties": {
+ "kind": {
+ "const": "bezier",
+ "description": "Cubic Bezier interpolation for the outgoing segment.",
+ "title": "Kind",
+ "type": "string"
+ },
+ "controlPoints": {
+ "description": "Normalized x1, y1, x2 and y2 control points.",
+ "maxItems": 4,
+ "minItems": 4,
+ "prefixItems": [
+ {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ },
+ {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ },
+ {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ },
+ {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ ],
+ "title": "Controlpoints",
+ "type": "array"
+ }
+ },
+ "required": [
"kind",
- "data"
+ "controlPoints"
],
- "title": "StackDocument",
+ "title": "StageBezierTransition",
"type": "object"
},
"StageCamera": {
"additionalProperties": false,
+ "examples": [
+ {
+ "fov": 45,
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 1
+ },
+ "roll": 0,
+ "target": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ }
+ }
+ ],
"properties": {
"position": {
"$ref": "#/$defs/Vector3",
@@ -26975,16 +30873,137 @@
"exclusiveMinimum": 0,
"title": "Fov",
"type": "number"
+ },
+ "roll": {
+ "default": 0.0,
+ "description": "Roll around the view axis in radians.",
+ "maximum": 3.141592653589793,
+ "minimum": -3.141592653589793,
+ "title": "Roll",
+ "type": "number"
}
},
"required": [
"position",
"target",
- "fov"
+ "fov",
+ "roll"
],
"title": "StageCamera",
"type": "object"
},
+ "StageEnvironment": {
+ "additionalProperties": false,
+ "description": "The named environment used by the retained Director scene.",
+ "properties": {
+ "preset": {
+ "default": "studio",
+ "description": "Environment preset reference. 环境预设引用。",
+ "enum": [
+ "studio",
+ "warm-sunset",
+ "moonlit"
+ ],
+ "title": "Preset",
+ "type": "string"
+ },
+ "groundColor": {
+ "default": "#181818",
+ "description": "Ground plane color. 地面颜色。",
+ "examples": [
+ "#000000"
+ ],
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "title": "Groundcolor",
+ "type": "string"
+ },
+ "groundVisible": {
+ "default": true,
+ "description": "Whether the ground plane is visible. 是否显示地面。",
+ "title": "Groundvisible",
+ "type": "boolean"
+ },
+ "exposure": {
+ "default": 1.0,
+ "description": "Scene exposure from zero to four. 场景曝光范围为 0 到 4。",
+ "maximum": 4,
+ "minimum": 0,
+ "title": "Exposure",
+ "type": "number"
+ },
+ "backgroundAsset": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AssetRef"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Optional registered image asset used as the stage background. 可选的已登记图片背景素材。"
+ }
+ },
+ "required": [
+ "preset",
+ "groundColor",
+ "groundVisible",
+ "exposure",
+ "backgroundAsset"
+ ],
+ "title": "StageEnvironment",
+ "type": "object"
+ },
+ "StageLight": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Stable light role. 稳定灯光角色。",
+ "enum": [
+ "hemisphere",
+ "key",
+ "fill"
+ ],
+ "title": "Id",
+ "type": "string"
+ },
+ "color": {
+ "description": "Light color in #RRGGBB format. 灯光颜色。",
+ "examples": [
+ "#000000"
+ ],
+ "pattern": "^#[0-9a-fA-F]{6}$",
+ "title": "Color",
+ "type": "string"
+ },
+ "intensity": {
+ "description": "Light intensity from zero to ten. 灯光强度范围为 0 到 10。",
+ "maximum": 10,
+ "minimum": 0,
+ "title": "Intensity",
+ "type": "number"
+ },
+ "position": {
+ "$ref": "#/$defs/Vector3",
+ "description": "Light position in stage coordinates. 灯光在舞台坐标中的位置。"
+ },
+ "castShadow": {
+ "default": false,
+ "description": "Whether the light casts shadows. 是否投射阴影。",
+ "title": "Castshadow",
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "id",
+ "color",
+ "intensity",
+ "position",
+ "castShadow"
+ ],
+ "title": "StageLight",
+ "type": "object"
+ },
"StageMotion": {
"additionalProperties": false,
"properties": {
@@ -27049,7 +31068,17 @@
"enum": [
"person",
"box",
- "sphere"
+ "sphere",
+ "gltf",
+ "cylinder",
+ "cone",
+ "pyramid",
+ "torus",
+ "plane",
+ "capsule",
+ "disk",
+ "arc",
+ "halfCylinder"
],
"title": "Kind",
"type": "string"
@@ -27062,10 +31091,33 @@
},
"color": {
"description": "Serialized display color.",
+ "examples": [
+ "#000000"
+ ],
"pattern": "^#[0-9a-fA-F]{6}$",
"title": "Color",
"type": "string"
},
+ "visible": {
+ "default": true,
+ "description": "Whether this object is displayed.",
+ "title": "Visible",
+ "type": "boolean"
+ },
+ "locked": {
+ "default": false,
+ "description": "Whether edits to this object are blocked.",
+ "title": "Locked",
+ "type": "boolean"
+ },
+ "opacity": {
+ "default": 1,
+ "description": "Layer opacity from zero to one.",
+ "maximum": 1,
+ "minimum": 0,
+ "title": "Opacity",
+ "type": "number"
+ },
"keyframes": {
"default": [],
"description": "Ordered animation keyframes.",
@@ -27083,6 +31135,79 @@
},
"title": "Motionclips",
"type": "array"
+ },
+ "asset": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AssetRef"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Registered GLB or self-contained GLTF asset for an imported stage object."
+ },
+ "thumbnailAsset": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AssetRef"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Registered image asset used by the stage object card thumbnail."
+ },
+ "role": {
+ "anyOf": [
+ {
+ "enum": [
+ "character",
+ "scene"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Imported stage object role.",
+ "title": "Role"
+ },
+ "format": {
+ "anyOf": [
+ {
+ "enum": [
+ "glb",
+ "gltf"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Imported stage asset container format.",
+ "title": "Format"
+ },
+ "animationNames": {
+ "default": [],
+ "description": "Animation clip names discovered in the imported asset.",
+ "items": {
+ "type": "string"
+ },
+ "title": "Animationnames",
+ "type": "array"
+ },
+ "hasAnimation": {
+ "default": false,
+ "description": "Whether the imported asset contains animation clips.",
+ "title": "Hasanimation",
+ "type": "boolean"
}
},
"required": [
@@ -27093,8 +31218,17 @@
"kind",
"name",
"color",
+ "visible",
+ "locked",
+ "opacity",
"keyframes",
- "motionClips"
+ "motionClips",
+ "asset",
+ "thumbnailAsset",
+ "role",
+ "format",
+ "animationNames",
+ "hasAnimation"
],
"title": "StageObject",
"type": "object"
@@ -27164,6 +31298,54 @@
"title": "StageTransform",
"type": "object"
},
+ "StageTransformTransitions": {
+ "additionalProperties": false,
+ "properties": {
+ "position": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/StageBezierTransition"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Outgoing position interpolation."
+ },
+ "rotation": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/StageBezierTransition"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Outgoing rotation interpolation."
+ },
+ "scale": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/StageBezierTransition"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Outgoing scale interpolation."
+ }
+ },
+ "required": [
+ "position",
+ "rotation",
+ "scale"
+ ],
+ "title": "StageTransformTransitions",
+ "type": "object"
+ },
"SubjectCanvasItem": {
"additionalProperties": false,
"properties": {
@@ -27794,6 +31976,9 @@
},
"color": {
"description": "Serialized display color.",
+ "examples": [
+ "#000000"
+ ],
"pattern": "^#[0-9a-fA-F]{6}$",
"title": "Color",
"type": "string"
@@ -28706,6 +32891,9 @@
"properties": {
"color": {
"description": "Background color in #RRGGBB format.",
+ "examples": [
+ "#000000"
+ ],
"pattern": "^#[0-9a-fA-F]{6}$",
"title": "Color",
"type": "string"
@@ -28829,6 +33017,9 @@
"properties": {
"color": {
"description": "Stroke color in #RRGGBB format.",
+ "examples": [
+ "#000000"
+ ],
"pattern": "^#[0-9a-fA-F]{6}$",
"title": "Color",
"type": "string"
@@ -28860,6 +33051,9 @@
},
"color": {
"description": "Text color in #RRGGBB format.",
+ "examples": [
+ "#000000"
+ ],
"pattern": "^#[0-9a-fA-F]{6}$",
"title": "Color",
"type": "string"
@@ -29342,12 +33536,47 @@
"value": {
"$ref": "#/$defs/StageTransform",
"description": "Keyframed transform or camera pose."
+ },
+ "keyedChannels": {
+ "anyOf": [
+ {
+ "items": {
+ "enum": [
+ "position",
+ "rotation",
+ "scale"
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Transform properties explicitly keyed at this frame.",
+ "title": "Keyedchannels"
+ },
+ "transitions": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/StageTransformTransitions"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Per-property interpolation for the outgoing segment."
}
},
"required": [
"id",
"time",
- "value"
+ "value",
+ "keyedChannels",
+ "transitions"
],
"title": "TransformFrame",
"type": "object"
@@ -30621,6 +34850,13 @@
"canvas.show": "#/$defs/CanvasShowCommand",
"canvas.update": "#/$defs/CanvasUpdateCommand",
"creation.batch": "#/$defs/BatchCommand",
+ "director.apply": "#/$defs/DirectorApplyCommand",
+ "director.camera.delete": "#/$defs/DirectorCameraDeleteCommand",
+ "director.duration.set": "#/$defs/DirectorSetDurationCommand",
+ "director.storyboard.append": "#/$defs/DirectorStoryboardAppendCommand",
+ "director.storyboard.delete": "#/$defs/DirectorStoryboardDeleteCommand",
+ "director.storyboard.reorder": "#/$defs/DirectorStoryboardReorderCommand",
+ "director.storyboard.resize": "#/$defs/DirectorStoryboardResizeCommand",
"editor.create": "#/$defs/EditorCreateCommand",
"editor.save": "#/$defs/EditorSaveCommand",
"generation.submit": "#/$defs/GenerationSubmitCommand",
@@ -30758,6 +34994,27 @@
{
"$ref": "#/$defs/EditorSaveCommand"
},
+ {
+ "$ref": "#/$defs/DirectorApplyCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardAppendCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardReorderCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardResizeCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardDeleteCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorSetDurationCommand"
+ },
+ {
+ "$ref": "#/$defs/DirectorCameraDeleteCommand"
+ },
{
"$ref": "#/$defs/HistoryUndoCommand"
},
@@ -30783,6 +35040,7 @@
"asset.usage": "#/$defs/AssetUsageQuery",
"canvas.status": "#/$defs/CanvasStatusQuery",
"canvas.versions": "#/$defs/VersionsQuery",
+ "director.storyboard.get": "#/$defs/DirectorStoryboardQuery",
"generationSpec.versions": "#/$defs/VersionsQuery",
"job.get": "#/$defs/ObjectQuery",
"object.get": "#/$defs/ObjectQuery",
@@ -30811,6 +35069,9 @@
},
{
"$ref": "#/$defs/AssetPreviewQuery"
+ },
+ {
+ "$ref": "#/$defs/DirectorStoryboardQuery"
}
],
"title": "Query"
diff --git a/src/contracts/generated.ts b/src/contracts/generated.ts
index 8cf9b8972..c92df6331 100644
--- a/src/contracts/generated.ts
+++ b/src/contracts/generated.ts
@@ -66,6 +66,7 @@ export interface AssetProvenanceInput extends ContractInput {
readonly sourceItemId?: string | null;
readonly editorDocumentId?: string | null;
readonly editorRevision?: number | null;
+ readonly directorRender?: DirectorRenderEvidenceInput | null;
readonly sources?: ReadonlyArray;
readonly inputFingerprint?: string | null;
readonly agentRunId?: string | null;
@@ -147,7 +148,14 @@ export interface BatchCommandInput extends CommandBaseInput {
}
export interface BatchPayloadInput extends ContractInput {
- readonly operations: ReadonlyArray;
+ readonly operations: ReadonlyArray;
+}
+
+export interface CameraChannelsInput extends ContractInput {
+ readonly position?: ReadonlyArray;
+ readonly target?: ReadonlyArray;
+ readonly up?: ReadonlyArray;
+ readonly focalLength?: ReadonlyArray;
}
export interface CameraFrameInput extends ContractInput {
@@ -156,11 +164,27 @@ export interface CameraFrameInput extends ContractInput {
readonly value: StageCameraInput;
}
+export interface CameraNumberFrameInput extends ContractInput {
+ readonly id: string;
+ readonly time: number;
+ readonly value: number;
+ readonly transition?: StageBezierTransitionInput | null;
+}
+
export interface CameraRigInput extends ContractInput {
readonly id: string;
readonly name: string;
+ readonly aspectRatio?: "16:9" | "2.39:1" | "9:16" | "1:1" | "4:3" | "3:4";
readonly pose: StageCameraInput;
readonly keyframes?: ReadonlyArray;
+ readonly channels?: CameraChannelsInput;
+}
+
+export interface CameraVectorFrameInput extends ContractInput {
+ readonly id: string;
+ readonly time: number;
+ readonly value: Vector3Input;
+ readonly transition?: StageBezierTransitionInput | null;
}
export interface CanvasApplyEditInput extends ContractInput {
@@ -313,6 +337,8 @@ export interface CanvasPublishMediaInput extends ContractInput {
readonly source?: AssetRefInput | null;
readonly sourceEditorId?: string | null;
readonly document: TimelineDocumentInput | SubjectDocumentInput | LayerDocumentInput | ImageCropDocumentInput | StackDocumentInput | ToolDocumentInput | DirectorDocumentInput | MediaEditDocumentInput;
+ readonly directorPlan?: DirectorOutputPlanInput | null;
+ readonly directorAcceptedAt?: number | null;
readonly outputs: ReadonlyArray;
}
@@ -377,6 +403,8 @@ export interface CommandReceiptInput extends ContractInput {
readonly changed?: ReadonlyArray;
readonly jobIds?: ReadonlyArray;
readonly issues?: ReadonlyArray;
+ readonly directorDurations?: ReadonlyArray;
+ readonly directorStoryboard?: ReadonlyArray;
readonly eventCursor?: number | null;
}
@@ -388,7 +416,7 @@ export interface ContractInput {
}
export interface ContractIssueInput extends ContractInput {
- readonly code: "timeline_package_invalid" | "timeline_package_too_large" | "timeline_revision_missing" | "timeline_import_missing" | "timeline_import_conflict" | "timeline_registration_rejected" | "timeline_font_too_large" | "timeline_font_unavailable" | "timeline_font_unsupported" | "timeline_font_invalid" | "timeline_font_fingerprint" | "timeline_font_coverage" | "timeline_font_total_bytes" | "timeline_font_unverified" | "timeline_font_mime" | "timeline_bundled_font_fingerprint" | "timeline_bundled_font_unavailable" | "invalid_input" | "revision_conflict" | "role_restricted" | "missing_object" | "reference_invalid" | "image_quality_unsupported" | "bigmodel_video_model" | "bigmodel_video_output" | "bigmodel_video_image" | "bigmodel_video_frames" | "bigmodel_video_prompt" | "bigmodel_video_cancel" | "kling_model" | "kling_mode" | "kling_image" | "kling_frames" | "kling_prompt" | "kling_aspect" | "kling_output" | "kling_cancel" | "capability_unsupported" | "preview_expired" | "storage_unavailable" | "submission_unknown" | "provider_error" | "moss_speech_text" | "moss_speech_voice" | "moss_speech_reference" | "moss_prompt_limit" | "moss_image_size" | "moss_image_reference" | "moss_layout_reference" | "bigmodel_image_size" | "bigmodel_image_reference" | "bigmodel_image_prompt" | "minimax_image_reference" | "minimax_image_count" | "minimax_image_bytes" | "minimax_speech_text" | "minimax_speech_voice" | "minimax_speech_reference" | "minimax_speech_model" | "zhipu_speech_text" | "zhipu_speech_voice" | "zhipu_speech_reference" | "voice_library_unsupported" | "voice_connection_changed" | "voice_reference_required" | "voice_transcript_required" | "voice_transcript_too_long" | "voice_description_too_long" | "voice_not_found" | "voice_delete_unsupported" | "voice_consent_required" | "voice_name_invalid" | "voice_audio_invalid" | "voice_format" | "voice_size" | "voice_duration" | "voice_provider_protocol" | "voice_provider_error" | "voice_provider_timeout" | "voice_model_unsupported" | "voice_name_taken" | "voice_provider_quota";
+ readonly code: "timeline_package_invalid" | "timeline_package_too_large" | "timeline_revision_missing" | "timeline_import_missing" | "timeline_import_conflict" | "timeline_registration_rejected" | "timeline_font_too_large" | "timeline_font_unavailable" | "timeline_font_unsupported" | "timeline_font_invalid" | "timeline_font_fingerprint" | "timeline_font_coverage" | "timeline_font_total_bytes" | "timeline_font_unverified" | "timeline_font_mime" | "timeline_bundled_font_fingerprint" | "timeline_bundled_font_unavailable" | "storyboard_leading_gap" | "storyboard_internal_gap" | "storyboard_overlap" | "storyboard_exceeds_duration" | "storyboard_duration_invalid" | "storyboard_camera_unknown" | "storyboard_block_invalid" | "storyboard_block_exists" | "storyboard_exhausted" | "storyboard_order_invalid" | "storyboard_block_unknown" | "director_camera_unknown" | "director_camera_required" | "invalid_input" | "revision_conflict" | "role_restricted" | "missing_object" | "reference_invalid" | "image_quality_unsupported" | "bigmodel_video_model" | "bigmodel_video_output" | "bigmodel_video_image" | "bigmodel_video_frames" | "bigmodel_video_prompt" | "bigmodel_video_cancel" | "kling_model" | "kling_mode" | "kling_image" | "kling_frames" | "kling_prompt" | "kling_aspect" | "kling_output" | "kling_cancel" | "capability_unsupported" | "preview_expired" | "storage_unavailable" | "submission_unknown" | "provider_error" | "moss_speech_text" | "moss_speech_voice" | "moss_speech_reference" | "moss_prompt_limit" | "moss_image_size" | "moss_image_reference" | "moss_layout_reference" | "bigmodel_image_size" | "bigmodel_image_reference" | "bigmodel_image_prompt" | "minimax_image_reference" | "minimax_image_count" | "minimax_image_bytes" | "minimax_speech_text" | "minimax_speech_voice" | "minimax_speech_reference" | "minimax_speech_model" | "zhipu_speech_text" | "zhipu_speech_voice" | "zhipu_speech_reference" | "voice_library_unsupported" | "voice_connection_changed" | "voice_reference_required" | "voice_transcript_required" | "voice_transcript_too_long" | "voice_description_too_long" | "voice_not_found" | "voice_delete_unsupported" | "voice_consent_required" | "voice_name_invalid" | "voice_audio_invalid" | "voice_format" | "voice_size" | "voice_duration" | "voice_provider_protocol" | "voice_provider_error" | "voice_provider_timeout" | "voice_model_unsupported" | "voice_name_taken" | "voice_provider_quota";
readonly message: string;
readonly objectId?: string | null;
readonly field?: string | null;
@@ -400,9 +428,9 @@ export interface CreationContractsInput extends ContractInput {
readonly generationSpec: TextGenerationSpecInput | ImageGenerationSpecInput | VideoGenerationSpecInput | AudioGenerationSpecInput;
readonly reference: PinnedReferenceInput | FollowingReferenceInput;
readonly editorDocument: TimelineDocumentInput | SubjectDocumentInput | LayerDocumentInput | ImageCropDocumentInput | StackDocumentInput | ToolDocumentInput | DirectorDocumentInput | MediaEditDocumentInput;
- readonly command: ProjectCreateCommandInput | ProjectRenameCommandInput | ProjectTrashCommandInput | ProjectRestoreCommandInput | AssetImportCommandInput | ArtifactPublishCommandInput | AssetWriteTextCommandInput | AssetMetadataCommandInput | AssetDeleteCommandInput | CanvasCreateGenerationCommandInput | CanvasShowCommandInput | CanvasMoveCommandInput | CanvasUpdateCommandInput | CanvasHideCommandInput | CanvasMaterializeCommandInput | CanvasApplyEditCommandInput | CanvasPublishMediaCommandInput | TimelinePublishRenderCommandInput | NodeVersionApplyCommandInput | CanvasConfigureCommandInput | CanvasEditorAttachCommandInput | CanvasEditorDetachCommandInput | SpecCreateCommandInput | SpecUpdateCommandInput | SpecRestoreCommandInput | SpecPromptCommandInput | ReferenceAddCommandInput | ReferenceUpdateCommandInput | ReferenceRestoreCommandInput | ReferenceRemoveCommandInput | GenerationSubmitCommandInput | JobCancelCommandInput | JobRecoverCommandInput | JobCheckpointCommandInput | ResultSelectCommandInput | EditorCreateCommandInput | EditorSaveCommandInput | HistoryUndoCommandInput | HistoryRedoCommandInput | BatchCommandInput;
+ readonly command: ProjectCreateCommandInput | ProjectRenameCommandInput | ProjectTrashCommandInput | ProjectRestoreCommandInput | AssetImportCommandInput | ArtifactPublishCommandInput | AssetWriteTextCommandInput | AssetMetadataCommandInput | AssetDeleteCommandInput | CanvasCreateGenerationCommandInput | CanvasShowCommandInput | CanvasMoveCommandInput | CanvasUpdateCommandInput | CanvasHideCommandInput | CanvasMaterializeCommandInput | CanvasApplyEditCommandInput | CanvasPublishMediaCommandInput | TimelinePublishRenderCommandInput | NodeVersionApplyCommandInput | CanvasConfigureCommandInput | CanvasEditorAttachCommandInput | CanvasEditorDetachCommandInput | SpecCreateCommandInput | SpecUpdateCommandInput | SpecRestoreCommandInput | SpecPromptCommandInput | ReferenceAddCommandInput | ReferenceUpdateCommandInput | ReferenceRestoreCommandInput | ReferenceRemoveCommandInput | GenerationSubmitCommandInput | JobCancelCommandInput | JobRecoverCommandInput | JobCheckpointCommandInput | ResultSelectCommandInput | EditorCreateCommandInput | EditorSaveCommandInput | DirectorApplyCommandInput | DirectorStoryboardAppendCommandInput | DirectorStoryboardReorderCommandInput | DirectorStoryboardResizeCommandInput | DirectorStoryboardDeleteCommandInput | DirectorSetDurationCommandInput | DirectorCameraDeleteCommandInput | HistoryUndoCommandInput | HistoryRedoCommandInput | BatchCommandInput;
readonly receipt: CommandReceiptInput;
- readonly query: ProjectQueryInput | ObjectQueryInput | VersionsQueryInput | AssetSearchQueryInput | AssetUsageQueryInput | CanvasStatusQueryInput | AssetPreviewQueryInput;
+ readonly query: ProjectQueryInput | ObjectQueryInput | VersionsQueryInput | AssetSearchQueryInput | AssetUsageQueryInput | CanvasStatusQueryInput | AssetPreviewQueryInput | DirectorStoryboardQueryInput;
readonly event: ProjectEventInput;
readonly job: JobInput;
readonly result: ResultVersionInput;
@@ -419,6 +447,35 @@ export interface CreationContractsInput extends ContractInput {
readonly upload: UploadInfoInput;
}
+export interface DirectorApplyInput extends ContractInput {
+ readonly document: DirectorDocumentWriteInput;
+}
+
+export interface DirectorApplyCommandInput extends CommandBaseInput {
+ readonly type: "director.apply";
+ readonly payload: DirectorApplyInput;
+}
+
+export interface DirectorApplyCommandOperationInput {
+ readonly type: "director.apply";
+ readonly payload: DirectorApplyInput;
+}
+
+export interface DirectorCameraDeleteInput extends ContractInput {
+ readonly documentId: string;
+ readonly cameraId: string;
+}
+
+export interface DirectorCameraDeleteCommandInput extends CommandBaseInput {
+ readonly type: "director.camera.delete";
+ readonly payload: DirectorCameraDeleteInput;
+}
+
+export interface DirectorCameraDeleteCommandOperationInput {
+ readonly type: "director.camera.delete";
+ readonly payload: DirectorCameraDeleteInput;
+}
+
export interface DirectorCanvasItemInput extends EditorCanvasItemInput {
readonly kind: "external";
}
@@ -427,12 +484,19 @@ export interface DirectorDataInput extends ContractInput {
readonly background: string;
readonly grid?: boolean;
readonly duration: number;
- readonly aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4";
+ readonly fps?: 24 | 25 | 30 | 50 | 60;
+ readonly aspectRatio?: "16:9" | "2.39:1" | "9:16" | "1:1" | "4:3" | "3:4";
readonly cameras: ReadonlyArray;
readonly activeCameraId: string;
readonly cameraSource?: "camera" | "storyboard";
readonly shots?: ReadonlyArray;
readonly objects?: ReadonlyArray;
+ readonly environment?: StageEnvironmentInput;
+ readonly lights?: ReadonlyArray;
+ readonly stills?: ReadonlyArray;
+}
+
+export interface DirectorDataWriteInput extends DirectorDataInput {
}
export interface DirectorDocumentInput extends EditorDocumentBaseInput {
@@ -440,6 +504,141 @@ export interface DirectorDocumentInput extends EditorDocumentBaseInput {
readonly data: DirectorDataInput;
}
+export interface DirectorDocumentWriteInput extends EditorDocumentBaseInput {
+ readonly kind: "director";
+ readonly data: DirectorDataWriteInput;
+}
+
+export interface DirectorDurationResultInput extends ContractInput {
+ readonly documentId: string;
+ readonly requestedDuration: number;
+ readonly appliedDuration: number;
+ readonly clampReason: "storyboard_end" | null;
+}
+
+export interface DirectorOutputPlanInput extends ContractInput {
+ readonly cameraSource: "camera" | "storyboard";
+ readonly cameraId?: string | null;
+ readonly width: number;
+ readonly height: number;
+ readonly durationSeconds: number;
+ readonly frameRate: number;
+}
+
+export interface DirectorRenderEvidenceInput extends ContractInput {
+ readonly acceptedProjectCursor: number;
+ readonly sourceEditorId: string;
+ readonly sourceEditorRevision: number;
+ readonly plan: DirectorOutputPlanInput;
+}
+
+export interface DirectorSetDurationInput extends ContractInput {
+ readonly documentId: string;
+ readonly duration: number;
+}
+
+export interface DirectorSetDurationCommandInput extends CommandBaseInput {
+ readonly type: "director.duration.set";
+ readonly payload: DirectorSetDurationInput;
+}
+
+export interface DirectorSetDurationCommandOperationInput {
+ readonly type: "director.duration.set";
+ readonly payload: DirectorSetDurationInput;
+}
+
+export interface DirectorStoryboardAppendInput extends ContractInput {
+ readonly documentId: string;
+ readonly cameraId: string;
+ readonly blockId: string;
+}
+
+export interface DirectorStoryboardAppendCommandInput extends CommandBaseInput {
+ readonly type: "director.storyboard.append";
+ readonly payload: DirectorStoryboardAppendInput;
+}
+
+export interface DirectorStoryboardBlockInput extends ContractInput {
+ readonly id: string;
+ readonly cameraId: string;
+ readonly order: number;
+ readonly start: number;
+ readonly duration: number;
+}
+
+export interface DirectorStoryboardDeleteInput extends ContractInput {
+ readonly documentId: string;
+ readonly blockId: string;
+}
+
+export interface DirectorStoryboardDeleteCommandInput extends CommandBaseInput {
+ readonly type: "director.storyboard.delete";
+ readonly payload: DirectorStoryboardDeleteInput;
+}
+
+export interface DirectorStoryboardDeleteCommandOperationInput {
+ readonly type: "director.storyboard.delete";
+ readonly payload: DirectorStoryboardDeleteInput;
+}
+
+export interface DirectorStoryboardQueryInput extends QueryBaseInput {
+ readonly type: "director.storyboard.get";
+ readonly objectId: string;
+}
+
+export interface DirectorStoryboardReorderInput extends ContractInput {
+ readonly documentId: string;
+ readonly blockIds: ReadonlyArray;
+}
+
+export interface DirectorStoryboardReorderCommandInput extends CommandBaseInput {
+ readonly type: "director.storyboard.reorder";
+ readonly payload: DirectorStoryboardReorderInput;
+}
+
+export interface DirectorStoryboardReorderCommandOperationInput {
+ readonly type: "director.storyboard.reorder";
+ readonly payload: DirectorStoryboardReorderInput;
+}
+
+export interface DirectorStoryboardResizeInput extends ContractInput {
+ readonly documentId: string;
+ readonly blockId: string;
+ readonly duration: number;
+}
+
+export interface DirectorStoryboardResizeCommandInput extends CommandBaseInput {
+ readonly type: "director.storyboard.resize";
+ readonly payload: DirectorStoryboardResizeInput;
+}
+
+export interface DirectorStoryboardResizeCommandOperationInput {
+ readonly type: "director.storyboard.resize";
+ readonly payload: DirectorStoryboardResizeInput;
+}
+
+export interface DirectorStoryboardResultInput extends ContractInput {
+ readonly operationIndex: number;
+ readonly operation: "director.storyboard.append" | "director.storyboard.reorder" | "director.storyboard.resize" | "director.storyboard.delete" | "director.camera.delete" | "director.duration.set";
+ readonly documentId: string;
+ readonly version: number;
+ readonly blocks: ReadonlyArray;
+ readonly affectedBlockIds: ReadonlyArray;
+ readonly removedBlockIds: ReadonlyArray;
+ readonly blockId?: string | null;
+ readonly cameraId?: string | null;
+ readonly appendLimitReason?: "storyboard_tail" | null;
+}
+
+export interface DirectorStoryboardStateInput extends ContractInput {
+ readonly documentId: string;
+ readonly version: number;
+ readonly storyboardEnd: number;
+ readonly canAppend: boolean;
+ readonly cannotAppendReason?: "storyboard_leading_gap" | "storyboard_internal_gap" | "storyboard_overlap" | "storyboard_exceeds_duration" | "storyboard_duration_invalid" | "storyboard_camera_unknown" | "storyboard_block_invalid" | "storyboard_block_exists" | "storyboard_exhausted" | "storyboard_order_invalid" | "storyboard_block_unknown" | "director_camera_unknown" | "director_camera_required" | null;
+ readonly blocks: ReadonlyArray;
+}
+
export interface EditorBindingInput extends ContractInput {
readonly role: "editor";
readonly objectRef: EditorRefInput;
@@ -488,7 +687,7 @@ export interface EditorSaveCommandOperationInput {
}
export interface EditorWriteInput extends ContractInput {
- readonly document: TimelineDocumentInput | SubjectDocumentInput | LayerDocumentInput | ImageCropDocumentInput | StackDocumentInput | ToolDocumentInput | DirectorDocumentInput | MediaEditDocumentInput;
+ readonly document: TimelineDocumentInput | SubjectDocumentInput | LayerDocumentInput | ImageCropDocumentInput | StackDocumentInput | ToolDocumentInput | DirectorDocumentWriteInput | MediaEditDocumentInput;
}
export interface EmptyBindingInput extends ContractInput {
@@ -802,9 +1001,12 @@ export interface MediaMetadataInput extends ContractInput {
readonly height?: number | null;
readonly durationSeconds?: number | null;
readonly frameRate?: number | null;
+ readonly frameCount?: number | null;
readonly hasAudio?: boolean | null;
readonly sampleRate?: number | null;
readonly channels?: number | null;
+ readonly selfContained?: boolean | null;
+ readonly animationNames?: ReadonlyArray | null;
}
export interface MediaPublicationOutputInput extends ContractInput {
@@ -1183,10 +1385,32 @@ export interface StackDocumentInput extends EditorDocumentBaseInput {
readonly data: StackDataInput;
}
+export interface StageBezierTransitionInput extends ContractInput {
+ readonly kind: "bezier";
+ readonly controlPoints: readonly [number, number, number, number];
+}
+
export interface StageCameraInput extends ContractInput {
readonly position: Vector3Input;
readonly target: Vector3Input;
readonly fov: number;
+ readonly roll?: number;
+}
+
+export interface StageEnvironmentInput extends ContractInput {
+ readonly preset?: "studio" | "warm-sunset" | "moonlit";
+ readonly groundColor?: string;
+ readonly groundVisible?: boolean;
+ readonly exposure?: number;
+ readonly backgroundAsset?: AssetRefInput | null;
+}
+
+export interface StageLightInput extends ContractInput {
+ readonly id: "hemisphere" | "key" | "fill";
+ readonly color: string;
+ readonly intensity: number;
+ readonly position: Vector3Input;
+ readonly castShadow?: boolean;
}
export interface StageMotionInput extends ContractInput {
@@ -1197,11 +1421,20 @@ export interface StageMotionInput extends ContractInput {
export interface StageObjectInput extends StageTransformInput {
readonly id: string;
- readonly kind: "person" | "box" | "sphere";
+ readonly kind: "person" | "box" | "sphere" | "gltf" | "cylinder" | "cone" | "pyramid" | "torus" | "plane" | "capsule" | "disk" | "arc" | "halfCylinder";
readonly name: string;
readonly color: string;
+ readonly visible?: boolean;
+ readonly locked?: boolean;
+ readonly opacity?: number;
readonly keyframes?: ReadonlyArray;
readonly motionClips?: ReadonlyArray;
+ readonly asset?: AssetRefInput | null;
+ readonly thumbnailAsset?: AssetRefInput | null;
+ readonly role?: "character" | "scene" | null;
+ readonly format?: "glb" | "gltf" | null;
+ readonly animationNames?: ReadonlyArray;
+ readonly hasAnimation?: boolean;
}
export interface StageShotInput extends ContractInput {
@@ -1217,6 +1450,12 @@ export interface StageTransformInput extends ContractInput {
readonly scale: Vector3Input;
}
+export interface StageTransformTransitionsInput extends ContractInput {
+ readonly position?: StageBezierTransitionInput | null;
+ readonly rotation?: StageBezierTransitionInput | null;
+ readonly scale?: StageBezierTransitionInput | null;
+}
+
export interface SubjectCanvasItemInput extends EditorCanvasItemInput {
readonly kind: "subject";
}
@@ -1452,6 +1691,8 @@ export interface TransformFrameInput extends ContractInput {
readonly id: string;
readonly time: number;
readonly value: StageTransformInput;
+ readonly keyedChannels?: ReadonlyArray<"position" | "rotation" | "scale"> | null;
+ readonly transitions?: StageTransformTransitionsInput | null;
}
export interface UploadInfoInput extends ContractInput {
@@ -1568,7 +1809,7 @@ export type ReferenceInput = PinnedReferenceInput | FollowingReferenceInput;
export type EditorDocumentInput = TimelineDocumentInput | SubjectDocumentInput | LayerDocumentInput | ImageCropDocumentInput | StackDocumentInput | ToolDocumentInput | DirectorDocumentInput | MediaEditDocumentInput;
-export type CommandInput = ProjectCreateCommandInput | ProjectRenameCommandInput | ProjectTrashCommandInput | ProjectRestoreCommandInput | AssetImportCommandInput | ArtifactPublishCommandInput | AssetWriteTextCommandInput | AssetMetadataCommandInput | AssetDeleteCommandInput | CanvasCreateGenerationCommandInput | CanvasShowCommandInput | CanvasMoveCommandInput | CanvasUpdateCommandInput | CanvasHideCommandInput | CanvasMaterializeCommandInput | CanvasApplyEditCommandInput | CanvasPublishMediaCommandInput | TimelinePublishRenderCommandInput | NodeVersionApplyCommandInput | CanvasConfigureCommandInput | CanvasEditorAttachCommandInput | CanvasEditorDetachCommandInput | SpecCreateCommandInput | SpecUpdateCommandInput | SpecRestoreCommandInput | SpecPromptCommandInput | ReferenceAddCommandInput | ReferenceUpdateCommandInput | ReferenceRestoreCommandInput | ReferenceRemoveCommandInput | GenerationSubmitCommandInput | JobCancelCommandInput | JobRecoverCommandInput | JobCheckpointCommandInput | ResultSelectCommandInput | EditorCreateCommandInput | EditorSaveCommandInput | HistoryUndoCommandInput | HistoryRedoCommandInput | BatchCommandInput;
+export type CommandInput = ProjectCreateCommandInput | ProjectRenameCommandInput | ProjectTrashCommandInput | ProjectRestoreCommandInput | AssetImportCommandInput | ArtifactPublishCommandInput | AssetWriteTextCommandInput | AssetMetadataCommandInput | AssetDeleteCommandInput | CanvasCreateGenerationCommandInput | CanvasShowCommandInput | CanvasMoveCommandInput | CanvasUpdateCommandInput | CanvasHideCommandInput | CanvasMaterializeCommandInput | CanvasApplyEditCommandInput | CanvasPublishMediaCommandInput | TimelinePublishRenderCommandInput | NodeVersionApplyCommandInput | CanvasConfigureCommandInput | CanvasEditorAttachCommandInput | CanvasEditorDetachCommandInput | SpecCreateCommandInput | SpecUpdateCommandInput | SpecRestoreCommandInput | SpecPromptCommandInput | ReferenceAddCommandInput | ReferenceUpdateCommandInput | ReferenceRestoreCommandInput | ReferenceRemoveCommandInput | GenerationSubmitCommandInput | JobCancelCommandInput | JobRecoverCommandInput | JobCheckpointCommandInput | ResultSelectCommandInput | EditorCreateCommandInput | EditorSaveCommandInput | DirectorApplyCommandInput | DirectorStoryboardAppendCommandInput | DirectorStoryboardReorderCommandInput | DirectorStoryboardResizeCommandInput | DirectorStoryboardDeleteCommandInput | DirectorSetDurationCommandInput | DirectorCameraDeleteCommandInput | HistoryUndoCommandInput | HistoryRedoCommandInput | BatchCommandInput;
export type ExecutionParametersInput = TextExecutionInput | ImageExecutionInput | VideoExecutionInput | AudioExecutionInput;
@@ -1646,6 +1887,7 @@ export interface AssetProvenance extends Contract {
readonly sourceItemId: string | null;
readonly editorDocumentId: string | null;
readonly editorRevision: number | null;
+ readonly directorRender?: DirectorRenderEvidence | null;
readonly sources: ReadonlyArray;
readonly inputFingerprint: string | null;
readonly agentRunId: string | null;
@@ -1727,7 +1969,14 @@ export interface BatchCommand extends CommandBase {
}
export interface BatchPayload extends Contract {
- readonly operations: ReadonlyArray;
+ readonly operations: ReadonlyArray;
+}
+
+export interface CameraChannels extends Contract {
+ readonly position: ReadonlyArray;
+ readonly target: ReadonlyArray;
+ readonly up: ReadonlyArray;
+ readonly focalLength: ReadonlyArray;
}
export interface CameraFrame extends Contract {
@@ -1736,11 +1985,27 @@ export interface CameraFrame extends Contract {
readonly value: StageCamera;
}
+export interface CameraNumberFrame extends Contract {
+ readonly id: string;
+ readonly time: number;
+ readonly value: number;
+ readonly transition: StageBezierTransition | null;
+}
+
export interface CameraRig extends Contract {
readonly id: string;
readonly name: string;
+ readonly aspectRatio: "16:9" | "2.39:1" | "9:16" | "1:1" | "4:3" | "3:4";
readonly pose: StageCamera;
readonly keyframes: ReadonlyArray;
+ readonly channels: CameraChannels;
+}
+
+export interface CameraVectorFrame extends Contract {
+ readonly id: string;
+ readonly time: number;
+ readonly value: Vector3;
+ readonly transition: StageBezierTransition | null;
}
export interface CanvasApplyEdit extends Contract {
@@ -1893,6 +2158,8 @@ export interface CanvasPublishMedia extends Contract {
readonly source: AssetRef | null;
readonly sourceEditorId: string | null;
readonly document: TimelineDocument | SubjectDocument | LayerDocument | ImageCropDocument | StackDocument | ToolDocument | DirectorDocument | MediaEditDocument;
+ readonly directorPlan: DirectorOutputPlan | null;
+ readonly directorAcceptedAt?: number | null;
readonly outputs: ReadonlyArray;
}
@@ -1957,6 +2224,8 @@ export interface CommandReceipt extends Contract {
readonly changed: ReadonlyArray;
readonly jobIds: ReadonlyArray;
readonly issues: ReadonlyArray;
+ readonly directorDurations?: ReadonlyArray;
+ readonly directorStoryboard?: ReadonlyArray;
readonly eventCursor: number | null;
}
@@ -1968,7 +2237,7 @@ export interface Contract {
}
export interface ContractIssue extends Contract {
- readonly code: "timeline_package_invalid" | "timeline_package_too_large" | "timeline_revision_missing" | "timeline_import_missing" | "timeline_import_conflict" | "timeline_registration_rejected" | "timeline_font_too_large" | "timeline_font_unavailable" | "timeline_font_unsupported" | "timeline_font_invalid" | "timeline_font_fingerprint" | "timeline_font_coverage" | "timeline_font_total_bytes" | "timeline_font_unverified" | "timeline_font_mime" | "timeline_bundled_font_fingerprint" | "timeline_bundled_font_unavailable" | "invalid_input" | "revision_conflict" | "role_restricted" | "missing_object" | "reference_invalid" | "image_quality_unsupported" | "bigmodel_video_model" | "bigmodel_video_output" | "bigmodel_video_image" | "bigmodel_video_frames" | "bigmodel_video_prompt" | "bigmodel_video_cancel" | "kling_model" | "kling_mode" | "kling_image" | "kling_frames" | "kling_prompt" | "kling_aspect" | "kling_output" | "kling_cancel" | "capability_unsupported" | "preview_expired" | "storage_unavailable" | "submission_unknown" | "provider_error" | "moss_speech_text" | "moss_speech_voice" | "moss_speech_reference" | "moss_prompt_limit" | "moss_image_size" | "moss_image_reference" | "moss_layout_reference" | "bigmodel_image_size" | "bigmodel_image_reference" | "bigmodel_image_prompt" | "minimax_image_reference" | "minimax_image_count" | "minimax_image_bytes" | "minimax_speech_text" | "minimax_speech_voice" | "minimax_speech_reference" | "minimax_speech_model" | "zhipu_speech_text" | "zhipu_speech_voice" | "zhipu_speech_reference" | "voice_library_unsupported" | "voice_connection_changed" | "voice_reference_required" | "voice_transcript_required" | "voice_transcript_too_long" | "voice_description_too_long" | "voice_not_found" | "voice_delete_unsupported" | "voice_consent_required" | "voice_name_invalid" | "voice_audio_invalid" | "voice_format" | "voice_size" | "voice_duration" | "voice_provider_protocol" | "voice_provider_error" | "voice_provider_timeout" | "voice_model_unsupported" | "voice_name_taken" | "voice_provider_quota";
+ readonly code: "timeline_package_invalid" | "timeline_package_too_large" | "timeline_revision_missing" | "timeline_import_missing" | "timeline_import_conflict" | "timeline_registration_rejected" | "timeline_font_too_large" | "timeline_font_unavailable" | "timeline_font_unsupported" | "timeline_font_invalid" | "timeline_font_fingerprint" | "timeline_font_coverage" | "timeline_font_total_bytes" | "timeline_font_unverified" | "timeline_font_mime" | "timeline_bundled_font_fingerprint" | "timeline_bundled_font_unavailable" | "storyboard_leading_gap" | "storyboard_internal_gap" | "storyboard_overlap" | "storyboard_exceeds_duration" | "storyboard_duration_invalid" | "storyboard_camera_unknown" | "storyboard_block_invalid" | "storyboard_block_exists" | "storyboard_exhausted" | "storyboard_order_invalid" | "storyboard_block_unknown" | "director_camera_unknown" | "director_camera_required" | "invalid_input" | "revision_conflict" | "role_restricted" | "missing_object" | "reference_invalid" | "image_quality_unsupported" | "bigmodel_video_model" | "bigmodel_video_output" | "bigmodel_video_image" | "bigmodel_video_frames" | "bigmodel_video_prompt" | "bigmodel_video_cancel" | "kling_model" | "kling_mode" | "kling_image" | "kling_frames" | "kling_prompt" | "kling_aspect" | "kling_output" | "kling_cancel" | "capability_unsupported" | "preview_expired" | "storage_unavailable" | "submission_unknown" | "provider_error" | "moss_speech_text" | "moss_speech_voice" | "moss_speech_reference" | "moss_prompt_limit" | "moss_image_size" | "moss_image_reference" | "moss_layout_reference" | "bigmodel_image_size" | "bigmodel_image_reference" | "bigmodel_image_prompt" | "minimax_image_reference" | "minimax_image_count" | "minimax_image_bytes" | "minimax_speech_text" | "minimax_speech_voice" | "minimax_speech_reference" | "minimax_speech_model" | "zhipu_speech_text" | "zhipu_speech_voice" | "zhipu_speech_reference" | "voice_library_unsupported" | "voice_connection_changed" | "voice_reference_required" | "voice_transcript_required" | "voice_transcript_too_long" | "voice_description_too_long" | "voice_not_found" | "voice_delete_unsupported" | "voice_consent_required" | "voice_name_invalid" | "voice_audio_invalid" | "voice_format" | "voice_size" | "voice_duration" | "voice_provider_protocol" | "voice_provider_error" | "voice_provider_timeout" | "voice_model_unsupported" | "voice_name_taken" | "voice_provider_quota";
readonly message: string;
readonly objectId: string | null;
readonly field: string | null;
@@ -1980,9 +2249,9 @@ export interface CreationContracts extends Contract {
readonly generationSpec: TextGenerationSpec | ImageGenerationSpec | VideoGenerationSpec | AudioGenerationSpec;
readonly reference: PinnedReference | FollowingReference;
readonly editorDocument: TimelineDocument | SubjectDocument | LayerDocument | ImageCropDocument | StackDocument | ToolDocument | DirectorDocument | MediaEditDocument;
- readonly command: ProjectCreateCommand | ProjectRenameCommand | ProjectTrashCommand | ProjectRestoreCommand | AssetImportCommand | ArtifactPublishCommand | AssetWriteTextCommand | AssetMetadataCommand | AssetDeleteCommand | CanvasCreateGenerationCommand | CanvasShowCommand | CanvasMoveCommand | CanvasUpdateCommand | CanvasHideCommand | CanvasMaterializeCommand | CanvasApplyEditCommand | CanvasPublishMediaCommand | TimelinePublishRenderCommand | NodeVersionApplyCommand | CanvasConfigureCommand | CanvasEditorAttachCommand | CanvasEditorDetachCommand | SpecCreateCommand | SpecUpdateCommand | SpecRestoreCommand | SpecPromptCommand | ReferenceAddCommand | ReferenceUpdateCommand | ReferenceRestoreCommand | ReferenceRemoveCommand | GenerationSubmitCommand | JobCancelCommand | JobRecoverCommand | JobCheckpointCommand | ResultSelectCommand | EditorCreateCommand | EditorSaveCommand | HistoryUndoCommand | HistoryRedoCommand | BatchCommand;
+ readonly command: ProjectCreateCommand | ProjectRenameCommand | ProjectTrashCommand | ProjectRestoreCommand | AssetImportCommand | ArtifactPublishCommand | AssetWriteTextCommand | AssetMetadataCommand | AssetDeleteCommand | CanvasCreateGenerationCommand | CanvasShowCommand | CanvasMoveCommand | CanvasUpdateCommand | CanvasHideCommand | CanvasMaterializeCommand | CanvasApplyEditCommand | CanvasPublishMediaCommand | TimelinePublishRenderCommand | NodeVersionApplyCommand | CanvasConfigureCommand | CanvasEditorAttachCommand | CanvasEditorDetachCommand | SpecCreateCommand | SpecUpdateCommand | SpecRestoreCommand | SpecPromptCommand | ReferenceAddCommand | ReferenceUpdateCommand | ReferenceRestoreCommand | ReferenceRemoveCommand | GenerationSubmitCommand | JobCancelCommand | JobRecoverCommand | JobCheckpointCommand | ResultSelectCommand | EditorCreateCommand | EditorSaveCommand | DirectorApplyCommand | DirectorStoryboardAppendCommand | DirectorStoryboardReorderCommand | DirectorStoryboardResizeCommand | DirectorStoryboardDeleteCommand | DirectorSetDurationCommand | DirectorCameraDeleteCommand | HistoryUndoCommand | HistoryRedoCommand | BatchCommand;
readonly receipt: CommandReceipt;
- readonly query: ProjectQuery | ObjectQuery | VersionsQuery | AssetSearchQuery | AssetUsageQuery | CanvasStatusQuery | AssetPreviewQuery;
+ readonly query: ProjectQuery | ObjectQuery | VersionsQuery | AssetSearchQuery | AssetUsageQuery | CanvasStatusQuery | AssetPreviewQuery | DirectorStoryboardQuery;
readonly event: ProjectEvent;
readonly job: Job;
readonly result: ResultVersion;
@@ -1999,6 +2268,35 @@ export interface CreationContracts extends Contract {
readonly upload: UploadInfo;
}
+export interface DirectorApply extends Contract {
+ readonly document: DirectorDocumentWrite;
+}
+
+export interface DirectorApplyCommand extends CommandBase {
+ readonly type: "director.apply";
+ readonly payload: DirectorApply;
+}
+
+export interface DirectorApplyCommandOperation {
+ readonly type: "director.apply";
+ readonly payload: DirectorApply;
+}
+
+export interface DirectorCameraDelete extends Contract {
+ readonly documentId: string;
+ readonly cameraId: string;
+}
+
+export interface DirectorCameraDeleteCommand extends CommandBase {
+ readonly type: "director.camera.delete";
+ readonly payload: DirectorCameraDelete;
+}
+
+export interface DirectorCameraDeleteCommandOperation {
+ readonly type: "director.camera.delete";
+ readonly payload: DirectorCameraDelete;
+}
+
export interface DirectorCanvasItem extends EditorCanvasItem {
readonly kind: "external";
}
@@ -2007,12 +2305,19 @@ export interface DirectorData extends Contract {
readonly background: string;
readonly grid: boolean;
readonly duration: number;
- readonly aspectRatio: "16:9" | "9:16" | "1:1" | "4:3" | "3:4";
+ readonly fps: 24 | 25 | 30 | 50 | 60;
+ readonly aspectRatio: "16:9" | "2.39:1" | "9:16" | "1:1" | "4:3" | "3:4";
readonly cameras: ReadonlyArray;
readonly activeCameraId: string;
readonly cameraSource: "camera" | "storyboard";
readonly shots: ReadonlyArray;
readonly objects: ReadonlyArray;
+ readonly environment: StageEnvironment;
+ readonly lights: ReadonlyArray;
+ readonly stills: ReadonlyArray;
+}
+
+export interface DirectorDataWrite extends DirectorData {
}
export interface DirectorDocument extends EditorDocumentBase {
@@ -2020,6 +2325,141 @@ export interface DirectorDocument extends EditorDocumentBase {
readonly data: DirectorData;
}
+export interface DirectorDocumentWrite extends EditorDocumentBase {
+ readonly kind: "director";
+ readonly data: DirectorDataWrite;
+}
+
+export interface DirectorDurationResult extends Contract {
+ readonly documentId: string;
+ readonly requestedDuration: number;
+ readonly appliedDuration: number;
+ readonly clampReason: "storyboard_end" | null;
+}
+
+export interface DirectorOutputPlan extends Contract {
+ readonly cameraSource: "camera" | "storyboard";
+ readonly cameraId: string | null;
+ readonly width: number;
+ readonly height: number;
+ readonly durationSeconds: number;
+ readonly frameRate: number;
+}
+
+export interface DirectorRenderEvidence extends Contract {
+ readonly acceptedProjectCursor: number;
+ readonly sourceEditorId: string;
+ readonly sourceEditorRevision: number;
+ readonly plan: DirectorOutputPlan;
+}
+
+export interface DirectorSetDuration extends Contract {
+ readonly documentId: string;
+ readonly duration: number;
+}
+
+export interface DirectorSetDurationCommand extends CommandBase {
+ readonly type: "director.duration.set";
+ readonly payload: DirectorSetDuration;
+}
+
+export interface DirectorSetDurationCommandOperation {
+ readonly type: "director.duration.set";
+ readonly payload: DirectorSetDuration;
+}
+
+export interface DirectorStoryboardAppend extends Contract {
+ readonly documentId: string;
+ readonly cameraId: string;
+ readonly blockId: string;
+}
+
+export interface DirectorStoryboardAppendCommand extends CommandBase {
+ readonly type: "director.storyboard.append";
+ readonly payload: DirectorStoryboardAppend;
+}
+
+export interface DirectorStoryboardBlock extends Contract {
+ readonly id: string;
+ readonly cameraId: string;
+ readonly order: number;
+ readonly start: number;
+ readonly duration: number;
+}
+
+export interface DirectorStoryboardDelete extends Contract {
+ readonly documentId: string;
+ readonly blockId: string;
+}
+
+export interface DirectorStoryboardDeleteCommand extends CommandBase {
+ readonly type: "director.storyboard.delete";
+ readonly payload: DirectorStoryboardDelete;
+}
+
+export interface DirectorStoryboardDeleteCommandOperation {
+ readonly type: "director.storyboard.delete";
+ readonly payload: DirectorStoryboardDelete;
+}
+
+export interface DirectorStoryboardQuery extends QueryBase {
+ readonly type: "director.storyboard.get";
+ readonly objectId: string;
+}
+
+export interface DirectorStoryboardReorder extends Contract {
+ readonly documentId: string;
+ readonly blockIds: ReadonlyArray;
+}
+
+export interface DirectorStoryboardReorderCommand extends CommandBase {
+ readonly type: "director.storyboard.reorder";
+ readonly payload: DirectorStoryboardReorder;
+}
+
+export interface DirectorStoryboardReorderCommandOperation {
+ readonly type: "director.storyboard.reorder";
+ readonly payload: DirectorStoryboardReorder;
+}
+
+export interface DirectorStoryboardResize extends Contract {
+ readonly documentId: string;
+ readonly blockId: string;
+ readonly duration: number;
+}
+
+export interface DirectorStoryboardResizeCommand extends CommandBase {
+ readonly type: "director.storyboard.resize";
+ readonly payload: DirectorStoryboardResize;
+}
+
+export interface DirectorStoryboardResizeCommandOperation {
+ readonly type: "director.storyboard.resize";
+ readonly payload: DirectorStoryboardResize;
+}
+
+export interface DirectorStoryboardResult extends Contract {
+ readonly operationIndex: number;
+ readonly operation: "director.storyboard.append" | "director.storyboard.reorder" | "director.storyboard.resize" | "director.storyboard.delete" | "director.camera.delete" | "director.duration.set";
+ readonly documentId: string;
+ readonly version: number;
+ readonly blocks: ReadonlyArray;
+ readonly affectedBlockIds: ReadonlyArray;
+ readonly removedBlockIds: ReadonlyArray;
+ readonly blockId: string | null;
+ readonly cameraId: string | null;
+ readonly appendLimitReason: "storyboard_tail" | null;
+}
+
+export interface DirectorStoryboardState extends Contract {
+ readonly documentId: string;
+ readonly version: number;
+ readonly storyboardEnd: number;
+ readonly canAppend: boolean;
+ readonly cannotAppendReason: "storyboard_leading_gap" | "storyboard_internal_gap" | "storyboard_overlap" | "storyboard_exceeds_duration" | "storyboard_duration_invalid" | "storyboard_camera_unknown" | "storyboard_block_invalid" | "storyboard_block_exists" | "storyboard_exhausted" | "storyboard_order_invalid" | "storyboard_block_unknown" | "director_camera_unknown" | "director_camera_required" | null;
+ readonly blocks: ReadonlyArray;
+}
+
export interface EditorBinding extends Contract {
readonly role: "editor";
readonly objectRef: EditorRef;
@@ -2068,7 +2508,7 @@ export interface EditorSaveCommandOperation {
}
export interface EditorWrite extends Contract {
- readonly document: TimelineDocument | SubjectDocument | LayerDocument | ImageCropDocument | StackDocument | ToolDocument | DirectorDocument | MediaEditDocument;
+ readonly document: TimelineDocument | SubjectDocument | LayerDocument | ImageCropDocument | StackDocument | ToolDocument | DirectorDocumentWrite | MediaEditDocument;
}
export interface EmptyBinding extends Contract {
@@ -2382,9 +2822,12 @@ export interface MediaMetadata extends Contract {
readonly height: number | null;
readonly durationSeconds: number | null;
readonly frameRate: number | null;
+ readonly frameCount?: number | null;
readonly hasAudio: boolean | null;
readonly sampleRate: number | null;
readonly channels: number | null;
+ readonly selfContained: boolean | null;
+ readonly animationNames: ReadonlyArray | null;
}
export interface MediaPublicationOutput extends Contract {
@@ -2762,10 +3205,32 @@ export interface StackDocument extends EditorDocumentBase {
readonly data: StackData;
}
+export interface StageBezierTransition extends Contract {
+ readonly kind: "bezier";
+ readonly controlPoints: readonly [number, number, number, number];
+}
+
export interface StageCamera extends Contract {
readonly position: Vector3;
readonly target: Vector3;
readonly fov: number;
+ readonly roll: number;
+}
+
+export interface StageEnvironment extends Contract {
+ readonly preset: "studio" | "warm-sunset" | "moonlit";
+ readonly groundColor: string;
+ readonly groundVisible: boolean;
+ readonly exposure: number;
+ readonly backgroundAsset: AssetRef | null;
+}
+
+export interface StageLight extends Contract {
+ readonly id: "hemisphere" | "key" | "fill";
+ readonly color: string;
+ readonly intensity: number;
+ readonly position: Vector3;
+ readonly castShadow: boolean;
}
export interface StageMotion extends Contract {
@@ -2776,11 +3241,20 @@ export interface StageMotion extends Contract {
export interface StageObject extends StageTransform {
readonly id: string;
- readonly kind: "person" | "box" | "sphere";
+ readonly kind: "person" | "box" | "sphere" | "gltf" | "cylinder" | "cone" | "pyramid" | "torus" | "plane" | "capsule" | "disk" | "arc" | "halfCylinder";
readonly name: string;
readonly color: string;
+ readonly visible: boolean;
+ readonly locked: boolean;
+ readonly opacity: number;
readonly keyframes: ReadonlyArray;
readonly motionClips: ReadonlyArray;
+ readonly asset: AssetRef | null;
+ readonly thumbnailAsset: AssetRef | null;
+ readonly role: "character" | "scene" | null;
+ readonly format: "glb" | "gltf" | null;
+ readonly animationNames: ReadonlyArray;
+ readonly hasAnimation: boolean;
}
export interface StageShot extends Contract {
@@ -2796,6 +3270,12 @@ export interface StageTransform extends Contract {
readonly scale: Vector3;
}
+export interface StageTransformTransitions extends Contract {
+ readonly position: StageBezierTransition | null;
+ readonly rotation: StageBezierTransition | null;
+ readonly scale: StageBezierTransition | null;
+}
+
export interface SubjectCanvasItem extends EditorCanvasItem {
readonly kind: "subject";
}
@@ -3031,6 +3511,8 @@ export interface TransformFrame extends Contract {
readonly id: string;
readonly time: number;
readonly value: StageTransform;
+ readonly keyedChannels: ReadonlyArray<"position" | "rotation" | "scale"> | null;
+ readonly transitions: StageTransformTransitions | null;
}
export interface UploadInfo extends Contract {
@@ -3147,7 +3629,7 @@ export type Reference = PinnedReference | FollowingReference;
export type EditorDocument = TimelineDocument | SubjectDocument | LayerDocument | ImageCropDocument | StackDocument | ToolDocument | DirectorDocument | MediaEditDocument;
-export type Command = ProjectCreateCommand | ProjectRenameCommand | ProjectTrashCommand | ProjectRestoreCommand | AssetImportCommand | ArtifactPublishCommand | AssetWriteTextCommand | AssetMetadataCommand | AssetDeleteCommand | CanvasCreateGenerationCommand | CanvasShowCommand | CanvasMoveCommand | CanvasUpdateCommand | CanvasHideCommand | CanvasMaterializeCommand | CanvasApplyEditCommand | CanvasPublishMediaCommand | TimelinePublishRenderCommand | NodeVersionApplyCommand | CanvasConfigureCommand | CanvasEditorAttachCommand | CanvasEditorDetachCommand | SpecCreateCommand | SpecUpdateCommand | SpecRestoreCommand | SpecPromptCommand | ReferenceAddCommand | ReferenceUpdateCommand | ReferenceRestoreCommand | ReferenceRemoveCommand | GenerationSubmitCommand | JobCancelCommand | JobRecoverCommand | JobCheckpointCommand | ResultSelectCommand | EditorCreateCommand | EditorSaveCommand | HistoryUndoCommand | HistoryRedoCommand | BatchCommand;
+export type Command = ProjectCreateCommand | ProjectRenameCommand | ProjectTrashCommand | ProjectRestoreCommand | AssetImportCommand | ArtifactPublishCommand | AssetWriteTextCommand | AssetMetadataCommand | AssetDeleteCommand | CanvasCreateGenerationCommand | CanvasShowCommand | CanvasMoveCommand | CanvasUpdateCommand | CanvasHideCommand | CanvasMaterializeCommand | CanvasApplyEditCommand | CanvasPublishMediaCommand | TimelinePublishRenderCommand | NodeVersionApplyCommand | CanvasConfigureCommand | CanvasEditorAttachCommand | CanvasEditorDetachCommand | SpecCreateCommand | SpecUpdateCommand | SpecRestoreCommand | SpecPromptCommand | ReferenceAddCommand | ReferenceUpdateCommand | ReferenceRestoreCommand | ReferenceRemoveCommand | GenerationSubmitCommand | JobCancelCommand | JobRecoverCommand | JobCheckpointCommand | ResultSelectCommand | EditorCreateCommand | EditorSaveCommand | DirectorApplyCommand | DirectorStoryboardAppendCommand | DirectorStoryboardReorderCommand | DirectorStoryboardResizeCommand | DirectorStoryboardDeleteCommand | DirectorSetDurationCommand | DirectorCameraDeleteCommand | HistoryUndoCommand | HistoryRedoCommand | BatchCommand;
export type ExecutionParameters = TextExecution | ImageExecution | VideoExecution | AudioExecution;
diff --git a/src/i18n/messages/en-US/editors.ts b/src/i18n/messages/en-US/editors.ts
index ccab55bc8..fbc29c176 100644
--- a/src/i18n/messages/en-US/editors.ts
+++ b/src/i18n/messages/en-US/editors.ts
@@ -196,7 +196,7 @@ export const editors = {
"editors.stage.label.motionClip": "Motion clip",
"editors.stage.label.shot": "Shot",
"editors.stage.defaultCameraName": "Camera 1",
- "editors.stage.defaultPersonName": "Person 1",
+ "editors.stage.defaultPersonName": "Default Character",
"editors.stage.error.invalidTransform":
"The stage object position, rotation, or scale is invalid.",
"editors.stage.error.invalidCamera":
@@ -214,6 +214,10 @@ export const editors = {
"A keyframe references a missing or duplicate stage object.",
"editors.stage.error.invalidLegacyObject": "A legacy stage object is invalid.",
"editors.stage.error.jointMotionPerson": "Only people support joint motion.",
+ "editors.stage.error.importedSceneMotion":
+ "Scene assets cannot carry character motion clips.",
+ "editors.stage.error.importedMotionUnavailable":
+ "This imported character has no animation data.",
"editors.stage.error.invalidDocument":
"The local director preview format is invalid.",
"editors.stage.error.invalidObject":
@@ -225,6 +229,31 @@ export const editors = {
"editors.stage.error.shotCamera":
"A shot references a camera that does not exist.",
"editors.stage.error.cameraMissing": "The camera does not exist.",
+ "editors.stage.error.exportStoryboardEmpty":
+ "Exporting from the storyboard needs at least one shot.",
+ // Why the Storyboard is not continuous or cannot take another block. The stable codes
+ // never change; this is display copy only, worded like the backend storyboard_errors
+ // catalog so a precheck and a server rejection read the same.
+ "editors.stage.storyboard.reason.leadingGap":
+ "The Storyboard must start at 0; the first block cannot begin later.",
+ "editors.stage.storyboard.reason.internalGap":
+ "Storyboard blocks cannot leave gaps; start each block where the previous one ends.",
+ "editors.stage.storyboard.reason.overlap":
+ "Storyboard blocks cannot overlap; start each block where the previous one ends.",
+ "editors.stage.storyboard.reason.exceedsDuration":
+ "The Storyboard cannot end after the main timeline; shorten the blocks or lengthen the main timeline.",
+ "editors.stage.storyboard.reason.durationInvalid":
+ "Every Storyboard block needs a duration greater than 0; lengthen this block.",
+ "editors.stage.storyboard.reason.cameraUnknown":
+ "A Storyboard block references a camera that does not exist; choose an existing camera.",
+ "editors.stage.storyboard.reason.orderInvalid": "Include each Storyboard block ID exactly once in the desired order.",
+ "editors.stage.storyboard.reason.blockUnknown": "The Storyboard block to edit could not be found.",
+ "editors.stage.storyboard.reason.blockInvalid":
+ "A Storyboard block needs a non-empty identity.",
+ "editors.stage.storyboard.reason.blockExists":
+ "This Storyboard block identity is already in use; choose another one.",
+ "editors.stage.storyboard.reason.exhausted":
+ "No main-timeline time remains for another Storyboard block.",
"editors.layerDocument.defaultName": "Original image",
"editors.layerDocument.error.size":
@@ -291,64 +320,274 @@ export const editors = {
"editors.stage.ui.objectPerson": "Person",
"editors.stage.ui.objectBox": "Box",
"editors.stage.ui.objectSphere": "Sphere",
- "editors.stage.ui.degreesSuffix": " (degrees)",
+ "editors.stage.ui.objectCylinder": "Cylinder",
+ "editors.stage.ui.objectCone": "Cone",
+ "editors.stage.ui.objectPyramid": "Pyramid",
+ "editors.stage.ui.objectTorus": "Torus",
+ "editors.stage.ui.objectPlane": "Plane",
+ "editors.stage.ui.objectCapsule": "Capsule",
+ "editors.stage.ui.objectDisk": "Disk",
+ "editors.stage.ui.objectArc": "Arc",
+ "editors.stage.ui.objectHalfCylinder": "Half cylinder",
+ "editors.stage.ui.objectGltf": "Imported model",
+ "editors.stage.ui.importAsset": "Import GLB / GLTF",
+ "editors.stage.ui.assetRole": "Imported asset role",
+ "editors.stage.ui.assetCharacter": "Character",
+ "editors.stage.ui.assetScene": "Scene",
+ "editors.stage.ui.assetNotice":
+ "This character has no animation data; it still follows camera, storyboard, and transform keyframes.",
+ "editors.stage.ui.assetUnavailable":
+ "The imported asset is unavailable. Reopen the project or import it again.",
+ "editors.stage.ui.assetLoadFailed":
+ "Could not load “{name}”. The file may be corrupt or reference external resources.",
+ "editors.stage.ui.assetCorrupt":
+ "Could not read “{name}”: the GLB header is valid but the embedded JSON is missing or corrupt.",
+ "editors.stage.ui.assetTooLarge":
+ "“{name}” is larger than {size} MB. Use a smaller GLB or GLTF file.",
+ "editors.stage.ui.assetUnsupported":
+ "Only GLB and self-contained GLTF files are supported. FBX and external GLTF resources are not supported yet.",
+ "editors.stage.ui.assetImported":
+ "Imported {name} · {animationCount} animation clips",
+ "editors.stage.ui.assetImportedStatic": "Imported {name} · no animation data",
+ "editors.stage.ui.thumbnailFailed":
+ "{name} was imported, but its preview thumbnail could not be generated.",
"editors.stage.ui.editFailed": "The stage change failed.",
"editors.stage.ui.cameraName": "Camera {number}",
"editors.stage.ui.keepCamera": "Keep at least one camera.",
- "editors.stage.ui.cameraInUse":
- "A shot still uses this camera. Replace or delete that shot first.",
- "editors.stage.ui.webglInit": "WebGL could not start: {reason}",
+ "editors.stage.ui.webglInit": "WebGL could not start: {reason}. Make sure hardware acceleration is on (chrome://gpu shows the WebGL status) and restart the browser; if it still fails, close other tabs that use WebGL.",
"editors.stage.ui.webglLost":
"The WebGL context was lost. Save the stage data, reopen the editor, and continue.",
"editors.stage.ui.rendererNotReady": "The stage renderer is not ready yet.",
"editors.stage.ui.screenshotFailed": "The screenshot failed.",
"editors.stage.ui.importFailed": "The stage could not be imported.",
+ "editors.stage.ui.importForeignAssets":
+ "The stage file pins imported models that are not registered in this project: {names}. Open the stage in its original project, or import the model files here first.",
+ "editors.stage.ui.exportUnsavedImports":
+ "The stage file cannot carry imported models that exist only in this browser: {names}. Apply edits to save them to the project first.",
"editors.stage.ui.exportFailed": "The preview video export failed.",
"editors.stage.ui.motionTitle": "{title} · Motion preview",
"editors.stage.ui.addCanvasFailed": "Adding to the canvas failed.",
- "editors.stage.ui.title": "Director preview · {title}",
- "editors.stage.ui.subtitle":
- "Local 3D stage · camera and subject keyframes",
+ "editors.stage.ui.brand": "3D Director Stage",
+ "editors.stage.ui.unsavedTitle": "Unsaved stage changes",
+ "editors.stage.ui.keepEditing": "Keep editing",
+ "editors.stage.ui.discardClose": "Discard and close",
+ "editors.stage.ui.saveClose": "Save and close",
"editors.stage.ui.undo": "Undo",
"editors.stage.ui.redo": "Redo",
"editors.stage.ui.importJson": "Import stage JSON",
"editors.stage.ui.exportJson": "Export stage JSON",
- "editors.stage.ui.screenshot": "Download camera still",
+ "editors.stage.ui.screenshot": "Capture camera still",
+ "editors.stage.ui.stillSaving": "Saving photo…",
+ "editors.stage.ui.shotMaterials": "Shot materials",
+ "editors.stage.ui.shortcuts": "Shortcuts",
+ "editors.stage.ui.splitPreview": "Live preview {name}",
+ "editors.stage.ui.splitExit": "Exit split view",
+ "editors.stage.ui.splitRatioAria": "Split ratio",
+ "editors.stage.ui.leftPanelWidthAria": "Left Director Stage panel width",
+ "editors.stage.ui.rightPanelWidthAria": "Right Director Stage panel width",
+ "editors.stage.ui.timelineHeightAria": "Director Stage timeline height",
+ "editors.stage.ui.sliderAria": "{name} slider",
+ "editors.stage.ui.viewSettings": "View settings",
+ "editors.stage.ui.viewSettingsRail": "View settings overlay",
+ "editors.stage.ui.viewGround": "Ground",
+ "editors.stage.ui.viewGrid": "Grid",
+ "editors.stage.ui.viewMotionPaths": "Motion paths",
+ "editors.stage.ui.viewObjectNames": "Object names",
+ "editors.stage.ui.viewHeightGuides": "Object height guides",
+ "editors.stage.ui.viewIndicator": "View indicator",
+ "editors.stage.ui.focusObject": "Focus {name}",
+ "editors.stage.ui.placeHint": "Click the viewport to place {name} · Esc cancels",
+ "editors.stage.ui.assetPlacementHint": "Click a preview card, then click the viewport grid to place it.",
+ "editors.stage.ui.duplicateObject": "Duplicate",
+ "editors.stage.ui.helpTitle": "Director console controls",
+ "editors.stage.ui.helpViewNav": "View navigation",
+ "editors.stage.ui.helpOrbit": "Left-drag · orbit",
+ "editors.stage.ui.helpPan": "Right-drag · pan",
+ "editors.stage.ui.helpZoom": "Wheel · zoom",
+ "editors.stage.ui.helpMove": "Hold W/A/S/D to move · Q/E lower or raise · Shift sprints",
+ "editors.stage.ui.helpEditor": "Editor",
+ "editors.stage.ui.helpEscape": "Escape · close overlays or guarded-close the editor",
+ "editors.stage.ui.helpTab": "Tab · cycle focus inside the console",
+ "editors.stage.ui.closeHelp": "Close help",
+ "editors.stage.ui.closeDrawer": "Collapse shot materials",
+ "editors.stage.ui.selectAllStills": "Select all",
+ "editors.stage.ui.selectedStillsCount": {
+ one: "{count} selected",
+ other: "{count} selected",
+ },
+ "editors.stage.ui.stillName": "Capture_{number}",
+ "editors.stage.ui.duplicateSuffix": "{name} copy",
+ "editors.stage.ui.objectLocked": "The stage object is locked. Unlock it before editing or removing it.",
+ "editors.stage.ui.deleteTrackKeyframe": "Delete the {label} keyframe at {time} seconds",
+ "editors.stage.ui.stillEmpty":
+ "No shot materials yet; captures land here automatically.",
+ "editors.stage.ui.stillMissing": "Media unavailable",
+ "editors.stage.ui.previewStill": "Preview {name}",
+ "editors.stage.ui.closePreview": "Close preview",
+ "editors.stage.ui.deleteSelectedStills": "Delete selected",
+ "editors.stage.ui.downloadSelectedStills": "Download selected",
+ "editors.stage.ui.addStillsToCanvas": "Add to canvas",
+ "editors.stage.ui.stillsAddedToCanvas": "Added {count} still(s) to canvas.",
+ "editors.stage.ui.stillDownloadFailed": "The photo download failed.",
+ "editors.stage.ui.stillCaptured":
+ "Still captured. Applying registers it as a project image asset.",
"editors.stage.ui.renderMp4": "Render preview MP4",
"editors.stage.ui.renderProgress": "Rendering preview {percent}%",
"editors.stage.ui.cancelRender": "Cancel rendering",
"editors.stage.ui.renderDone":
- "Preview MP4 complete · {width}×{height} · 30 fps",
+ "Preview MP4 complete · {width}×{height} · {fps} fps",
+ "editors.stage.ui.exportVideo": "Export video",
+ "editors.stage.ui.exportSubtitle":
+ "Pick one camera to export the full dynamic preview.",
+ "editors.stage.ui.exportSourceLabel": "Camera source",
+ "editors.stage.ui.exportSourceStoryboard": "Storyboard",
+ "editors.stage.ui.exportAspectLabel": "Aspect",
+ "editors.stage.ui.exportDurationLabel": "Duration",
+ "editors.stage.ui.exportClarityLabel": "Quality",
+ "editors.stage.ui.exportClarityStandard": "Standard · 1280 px long edge",
+ "editors.stage.ui.exportClarityHigh": "High · 1920 px long edge",
+ "editors.stage.ui.exportFpsLabel": "Frame rate",
+ "editors.stage.ui.exportFpsOption": "{fps} FPS",
+ "editors.stage.ui.exportNoteStoryboard": "Uses hard cuts and ends at the last Storyboard block.",
+ "editors.stage.ui.exportNoteCamera":
+ "Uses {name} throughout, keeping that camera's moves and the subjects' motion.",
+ "editors.stage.ui.exportNoteClean":
+ "The output contains no guides, control points or editor interface.",
+ "editors.stage.ui.exportConfirm": "Export",
+ "editors.stage.ui.exportCancel": "Cancel",
"editors.stage.ui.downloadMp4": "Download preview MP4",
"editors.stage.ui.addedToCanvas": "Added to canvas",
"editors.stage.ui.addToCanvas": "Add preview video to canvas",
+ "editors.stage.ui.assetLibrary": "Assets",
+ "editors.stage.ui.assetSearchPlaceholder": "Search assets",
+ "editors.stage.ui.assetSearchAria": "Search stage assets",
+ "editors.stage.ui.objectTreeTitle": "Objects",
+ "editors.stage.ui.objectSearchPlaceholder": "Search objects",
+ "editors.stage.ui.objectSearchAria": "Search scene objects",
+ "editors.stage.ui.properties": "Properties",
"editors.stage.ui.sceneObjects": "Scene subjects",
+ "editors.stage.ui.tabCharacters": "Characters",
+ "editors.stage.ui.tabObjects": "Objects",
+ "editors.stage.ui.tabCameras": "Cameras",
+ "editors.stage.ui.tabBackground": "Background",
+ "editors.stage.ui.backgroundFilters": "Background categories",
+ "editors.stage.ui.backgroundFilter.all": "All",
+ "editors.stage.ui.backgroundFilter.panoramic": "Panoramic background",
+ "editors.stage.ui.backgroundFilter.flat": "Flat background",
+ "editors.stage.ui.backgroundMine": "Mine",
+ "editors.stage.ui.backgroundAdd": "Add background",
+ "editors.stage.ui.backgroundImporting": "Adding background…",
+ "editors.stage.ui.backgroundImported": "Added background “{name}”",
+ "editors.stage.ui.backgroundImportFailed": "Could not add background “{name}”",
+ "editors.stage.ui.backgroundCanvasImages": "Canvas images",
+ "editors.stage.ui.backgroundEmpty": "No backgrounds yet. Upload an image or choose one from the canvas images.",
+ "editors.stage.ui.backgroundNoMatches": "No backgrounds match the current search and category.",
+ "editors.stage.ui.cameraPreview": "Camera preview",
+ "editors.stage.ui.collapseCameraPreview": "Collapse camera preview",
+ "editors.stage.ui.expandCameraPreview": "Expand camera preview",
+ "editors.stage.ui.moveCameraPreview": "Move camera preview",
+ "editors.stage.ui.directorView": "Director view",
+ "editors.stage.ui.aspectMask": "Aspect mask",
+ "editors.stage.ui.cameraHint": "Choose a preset, then click a character or object in the viewport to place a new camera.",
+ "editors.stage.ui.cameraPresetPlacementHint": "Click a character or object in the viewport to place a new camera with this preset · Esc cancels.",
+ "editors.stage.ui.cameraPresetNeedsSubject": "The stage has no character or object yet. Add one before placing a camera preset.",
+ "editors.stage.ui.viewpoint": "Viewpoint",
+ "editors.stage.ui.viewfinder": "Viewfinder",
+ "editors.stage.ui.viewfinderFov": "Viewfinder FOV",
+ "editors.stage.ui.cameraPresets": "Camera presets",
+ "editors.stage.ui.preset.frontMedium": "Front medium",
+ "editors.stage.ui.preset.frontClose": "Front close-up",
+ "editors.stage.ui.preset.frontWide": "Front wide",
+ "editors.stage.ui.preset.sideTrack": "Side tracking",
+ "editors.stage.ui.preset.sideClose": "Side close-up",
+ "editors.stage.ui.preset.backMedium": "Back medium",
+ "editors.stage.ui.preset.overheadWide": "Overhead wide",
+ "editors.stage.ui.preset.highAngle": "High 45°",
+ "editors.stage.ui.preset.lowAngle": "Low angle",
+ "editors.stage.ui.preset.lowWide": "Low wide",
+ "editors.stage.ui.preset.overShoulder": "Over the shoulder",
+ "editors.stage.ui.preset.bird": "Bird's eye",
+ "editors.stage.ui.preset.dutch": "Dutch angle",
+ "editors.stage.ui.cameraMoves": "Camera moves",
+ "editors.stage.ui.savedChip": "Saved",
+ "editors.stage.ui.unsavedChip": "Unsaved",
"editors.stage.ui.background": "Background color",
+ "editors.stage.ui.environmentPreset": "Environment preset",
+ "editors.stage.ui.environmentPreset.custom": "Custom",
+ "editors.stage.ui.environmentPreset.studio": "Studio",
+ "editors.stage.ui.environmentPreset.warm-sunset": "Warm sunset",
+ "editors.stage.ui.environmentPreset.moonlit": "Moonlit",
+ "editors.stage.ui.backgroundAsset": "Background image",
+ "editors.stage.ui.backgroundAssetFallback": "Use background color",
+ "editors.stage.ui.backgroundAssetUnavailable": "Background image unavailable; using the background color fallback.",
+ "editors.stage.ui.groundColor": "Ground color",
+ "editors.stage.ui.groundVisible": "Show ground",
+ "editors.stage.ui.exposure": "Exposure",
+ "editors.stage.ui.light.hemisphere": "Hemisphere light",
+ "editors.stage.ui.light.key": "Key light",
+ "editors.stage.ui.light.fill": "Fill light",
+ "editors.stage.ui.lightColor": "{role} color",
+ "editors.stage.ui.lightIntensity": "{role} intensity",
+ "editors.stage.ui.lightPosition": "{role} position",
+ "editors.stage.ui.lightPositionAxis": "{role} position {axis}",
+ "editors.stage.ui.lightCastShadow": "{role} casts shadows",
"editors.stage.ui.grid": "Show ground grid",
- "editors.stage.ui.orbitHint": "Left-drag orbit · right-drag pan · wheel zoom",
+ "editors.stage.ui.orbitHint": "Left-drag orbit · right-drag pan · wheel zoom · hold WASD to move · Q/E lower or raise · Shift sprints",
+ "editors.stage.ui.shortcutHint":
+ "1/2/3 toggle the move, rotate and scale handles; G grounds the subject; arrow keys nudge (Shift for larger steps)",
+ "editors.stage.ui.resetView": "Reset view",
"editors.stage.ui.selectHint":
- "Click a subject to select it, then adjust its transform on the right.",
+ "Click a subject to select it, then drag the handles in the preview or adjust its transform on the right.",
+ "editors.stage.ui.gizmoSelect": "Select",
+ "editors.stage.ui.gizmoMove": "Move",
+ "editors.stage.ui.gizmoRotate": "Rotate",
+ "editors.stage.ui.gizmoScale": "Scale",
+ "editors.stage.ui.gizmoDropGround": "Drop to ground",
+ "editors.stage.ui.elevationValue": "{height} m",
+ "editors.stage.ui.elevationAria": "Height above ground {height} m",
+ "editors.stage.ui.gizmoModeAria": "Preview transform handles",
+ "editors.stage.ui.gizmoAnimatedHint":
+ "This subject has transform keyframes, so dragging records a pose keyframe at the playhead.",
"editors.stage.ui.stageAria": "Interactive 3D director stage",
"editors.stage.ui.pause": "Pause",
"editors.stage.ui.playAction": "Play motion and keyframes",
+ "editors.stage.ui.previewMode": "Preview mode",
+ "editors.stage.ui.previewModeStatic": "Static",
+ "editors.stage.ui.previewModeDynamic": "Dynamic",
"editors.stage.ui.time": "{time} / {duration} s",
"editors.stage.ui.totalDuration": "Total duration",
"editors.stage.ui.stageDurationAria": "Stage duration",
+ "editors.stage.ui.stageDurationClamped": "Requested {requested} s. Applied {applied} s to keep all Storyboard blocks.",
"editors.stage.ui.recordKeyframe": "Record a keyframe here",
+ "editors.stage.ui.addTrackKeyframe": "Add {label} keyframe at {time}s",
"editors.stage.ui.playheadAria": "Stage playhead",
- "editors.stage.ui.deleteKeyframe": "Delete keyframe at {frame} s",
- "editors.stage.ui.keyframeHint":
- "Adjust the camera or subject at the start and end, then record keyframes to preview.",
- "editors.stage.ui.storyboard": "Shot track",
- "editors.stage.ui.addShot": "Add current camera at playhead",
- "editors.stage.ui.shotHint":
- "Shots cannot overlap; gaps use the current camera. Switch “Storyboard cuts” to preview and export the same shot sequence.",
- "editors.stage.ui.shot": "Shot {number}",
- "editors.stage.ui.shotCameraAria": "Shot {number} camera",
- "editors.stage.ui.shotStartAria": "Shot {number} start",
- "editors.stage.ui.shotDurationAria": "Shot {number} duration",
- "editors.stage.ui.locate": "Locate",
- "editors.stage.ui.deleteShot": "Delete shot {number}",
+ "editors.stage.ui.timelineTitle": "Timeline",
+ "editors.stage.ui.timelineCurrentTime": "Current time",
+ "editors.stage.ui.timelinePlayheadAria": "Current time marker at {time} seconds",
+ "editors.stage.ui.timelineAria": "Director Stage timeline tracks",
+ "editors.stage.ui.timelineTime": "{time}s",
+ "editors.stage.ui.timelinePointAria": "{label} at {time} seconds",
+ "editors.stage.ui.timelineIntervalAria":
+ "{label} interval from {start} to {end} seconds",
+ "editors.stage.ui.transitionEditorAria": "{label} interval transition editor",
+ "editors.stage.ui.transitionEditorTitle": "{label} · {start}f → {end}f",
+ "editors.stage.ui.transitionFormula": "Value = start + k(t) × (end − start)",
+ "editors.stage.ui.transitionClose": "Close interval transition editor",
+ "editors.stage.ui.transitionLabel": "Transition",
+ "editors.stage.ui.transitionLinear": "Linear",
+ "editors.stage.ui.transitionBezier": "Bezier",
+ "editors.stage.ui.transitionControlPoints": "Bezier control points (x1, y1, x2, y2)",
+ "editors.stage.ui.transitionControlPoint": "Control point {point}",
+ "editors.stage.ui.trackShots": "Shots",
+ "editors.stage.ui.timelineCollapseGroup": "Collapse {label}",
+ "editors.stage.ui.timelineExpandGroup": "Expand {label}",
+ "editors.stage.ui.trackPosition": "Position",
+ "editors.stage.ui.trackRotation": "Rotation",
+ "editors.stage.ui.trackScale": "Scale",
+ "editors.stage.ui.trackMotion": "Motion",
+ "editors.stage.ui.trackTarget": "Target",
+ "editors.stage.ui.trackUp": "Up",
+ "editors.stage.ui.trackFocalLength": "Focal length",
"editors.stage.ui.transform": "Subject transform",
"editors.stage.ui.camera": "Camera",
"editors.stage.ui.name": "Name",
@@ -373,23 +612,31 @@ export const editors = {
"editors.stage.ui.cameraLabel": "Camera ·",
"editors.stage.ui.editCamera": "Edit camera",
"editors.stage.ui.cameraNameAria": "Camera name",
- "editors.stage.ui.copyCamera": "Duplicate as new camera",
"editors.stage.ui.deleteCamera": "Delete current camera",
"editors.stage.ui.outputAspect": "Output aspect",
"editors.stage.ui.outputAspectAria": "Director output aspect",
- "editors.stage.ui.source": "Preview and export source",
- "editors.stage.ui.sourceAria": "Director shot source",
- "editors.stage.ui.currentCamera": "Current camera, full duration",
- "editors.stage.ui.storyboardCut": "Storyboard cuts",
+ "editors.stage.ui.source": "Preview source",
+ "editors.stage.ui.sourceAria": "Director preview source",
+ "editors.stage.ui.storyboardCut": "Storyboard",
+ // The Storyboard track: its `+`, the camera chooser above it, the blocks and the preview.
+ "editors.stage.ui.storyboardAdd": "Add camera to Storyboard",
+ "editors.stage.ui.storyboardEditing": "Editing the Storyboard…",
+ "editors.stage.ui.storyboardAdding": "Adding a Storyboard block…",
+ "editors.stage.ui.storyboardEmpty": "Add a Storyboard block first.",
+ "editors.stage.ui.storyboardChooser": "Choose a camera for the Storyboard",
+ "editors.stage.ui.storyboardSearch": "Search cameras",
+ "editors.stage.ui.storyboardSearchEmpty": "No camera matches this search.",
+ "editors.stage.ui.storyboardDeleteBlock": "Delete Storyboard block",
+ "editors.stage.ui.storyboardBlockAria":
+ "Storyboard block {name} from {start} to {end} seconds",
"editors.stage.ui.cameraShort": "Camera",
"editors.stage.ui.target": "Target",
"editors.stage.ui.focal": "Focal length (35mm film, 16:9 equivalent)",
"editors.stage.ui.verticalFov": "Vertical field of view {value}°",
"editors.stage.ui.resetCamera": "Reset camera",
- "editors.stage.ui.footerHint":
- "Editing the camera or a subject writes a keyframe at the current time; preview, stills, and MP4 share the aspect and sampling. Storyboard cuts, segmented joint motion, and 30 fps MP4 export are supported. External skinned FBX/GLB characters and cloud director versions are not connected yet.",
"editors.stage.ui.importAria": "Import director stage",
"editors.stage.ui.startSeconds": "Start (s)",
"editors.stage.ui.durationSeconds": "Duration (s)",
+ "editors.stage.ui.locate": "Locate",
"editors.stage.ui.previewSuffix": "preview",
} as const;
diff --git a/src/i18n/messages/en-US/errors.ts b/src/i18n/messages/en-US/errors.ts
index 7d58efdc2..cb3228a9b 100644
--- a/src/i18n/messages/en-US/errors.ts
+++ b/src/i18n/messages/en-US/errors.ts
@@ -226,6 +226,9 @@ export const errors = {
"errors.backend.resultCandidate": "Result kept as a candidate",
"errors.backend.mediaEmpty": "The media has no readable content.",
"errors.backend.mediaReadFailed": "Could not read the media.",
+ "errors.backend.directorAssetMissing":
+ "The director stage contains an imported asset without a registered project asset.",
+ "errors.backend.directorStageTitle": "Director stage",
"errors.backend.unsupportedGeneration":
"This node does not support generation settings.",
"errors.backend.assemblyMissing":
@@ -240,6 +243,8 @@ export const errors = {
"The pinned reference version is missing or its content changed.",
"errors.backend.savingResult":
"The result is being saved. Try again shortly.",
+ "errors.backend.mediaPreparationPending":
+ "An earlier media publication is still preparing. Retry it before changing the output.",
"errors.backend.editSourceUnsaved": "The edit source has not been saved.",
"errors.backend.notDirectorStage":
"This is not a publishable director stage.",
diff --git a/src/i18n/messages/zh-CN/editors.ts b/src/i18n/messages/zh-CN/editors.ts
index d90be7290..61db535a4 100644
--- a/src/i18n/messages/zh-CN/editors.ts
+++ b/src/i18n/messages/zh-CN/editors.ts
@@ -185,7 +185,7 @@ export const editors = {
"editors.stage.label.motionClip": "动作片段",
"editors.stage.label.shot": "分镜",
"editors.stage.defaultCameraName": "摄像机 1",
- "editors.stage.defaultPersonName": "人物 1",
+ "editors.stage.defaultPersonName": "默认人物",
"editors.stage.error.invalidTransform": "舞台对象的位置、旋转或缩放无效。",
"editors.stage.error.invalidCamera": "摄像机位置、目标或视角无效。",
"editors.stage.error.invalidKeyframes": "关键帧列表无效。",
@@ -199,6 +199,8 @@ export const editors = {
"editors.stage.error.missingObject": "关键帧引用了缺失或重复的舞台对象。",
"editors.stage.error.invalidLegacyObject": "旧舞台对象无效。",
"editors.stage.error.jointMotionPerson": "只有人物支持关节动作。",
+ "editors.stage.error.importedSceneMotion": "场景素材不能携带角色动作片段。",
+ "editors.stage.error.importedMotionUnavailable": "此导入人物没有动画数据。",
"editors.stage.error.invalidDocument": "本地导演预演格式无效。",
"editors.stage.error.invalidObject": "舞台对象 ID、类型或颜色无效。",
"editors.stage.error.invalidMotionClip": "动作片段无效。",
@@ -206,6 +208,24 @@ export const editors = {
"editors.stage.error.cameraRequired": "至少保留一个摄像机,当前摄像机必须存在。",
"editors.stage.error.shotCamera": "分镜引用了不存在的摄像机。",
"editors.stage.error.cameraMissing": "摄像机不存在。",
+ "editors.stage.error.exportStoryboardEmpty": "按分镜编排导出时至少需要一个分镜。",
+ // Why the Storyboard is not continuous or cannot take another block. The stable codes
+ // never change and are not translated; this is display copy only, worded like the
+ // backend storyboard_errors catalog so a precheck and a server rejection read the same.
+ "editors.stage.storyboard.reason.leadingGap": "分镜必须从 0 秒开始,第一个分镜块之前不能留空。",
+ "editors.stage.storyboard.reason.internalGap":
+ "分镜块之间不能留有空隙,请让每个分镜块从前一个分镜块结束的位置开始。",
+ "editors.stage.storyboard.reason.overlap":
+ "分镜块之间不能重叠,请让每个分镜块从前一个分镜块结束的位置开始。",
+ "editors.stage.storyboard.reason.exceedsDuration":
+ "分镜的结束时间不能超过主时间轴时长,请缩短分镜块或延长主时间轴。",
+ "editors.stage.storyboard.reason.durationInvalid": "每个分镜块的时长都必须大于 0,请延长该分镜块。",
+ "editors.stage.storyboard.reason.cameraUnknown": "分镜块引用的机位不存在,请选择已有机位。",
+ "editors.stage.storyboard.reason.orderInvalid": "请在目标顺序中为每个分镜块提供且仅提供一个标识。",
+ "editors.stage.storyboard.reason.blockUnknown": "要编辑的分镜块不存在。",
+ "editors.stage.storyboard.reason.blockInvalid": "分镜块标识不能为空。",
+ "editors.stage.storyboard.reason.blockExists": "该分镜块标识已被使用,请换一个标识。",
+ "editors.stage.storyboard.reason.exhausted": "主时间轴已没有可用时长,无法再添加分镜块。",
"editors.layerDocument.defaultName": "原始图片",
"editors.layerDocument.error.size":
@@ -260,59 +280,264 @@ export const editors = {
"editors.stage.ui.objectPerson": "人物",
"editors.stage.ui.objectBox": "方块",
"editors.stage.ui.objectSphere": "球体",
- "editors.stage.ui.degreesSuffix": "(度)",
+ "editors.stage.ui.objectCylinder": "圆柱",
+ "editors.stage.ui.objectCone": "圆锥",
+ "editors.stage.ui.objectPyramid": "四棱锥",
+ "editors.stage.ui.objectTorus": "圆环",
+ "editors.stage.ui.objectPlane": "平面",
+ "editors.stage.ui.objectCapsule": "胶囊",
+ "editors.stage.ui.objectDisk": "圆盘",
+ "editors.stage.ui.objectArc": "半圆弧",
+ "editors.stage.ui.objectHalfCylinder": "半圆柱",
+ "editors.stage.ui.objectGltf": "导入模型",
+ "editors.stage.ui.importAsset": "导入 GLB / GLTF",
+ "editors.stage.ui.assetRole": "导入素材角色",
+ "editors.stage.ui.assetCharacter": "人物",
+ "editors.stage.ui.assetScene": "场景",
+ "editors.stage.ui.assetNotice":
+ "此人物没有动画数据,但仍会跟随摄像机、分镜和变换关键帧。",
+ "editors.stage.ui.assetUnavailable": "导入素材不可用,请重新打开工程或再次导入。",
+ "editors.stage.ui.assetLoadFailed":
+ "无法加载「{name}」。文件可能损坏,或引用了外部资源。",
+ "editors.stage.ui.assetCorrupt":
+ "无法读取「{name}」:GLB 头有效,但内嵌 JSON 缺失或已损坏。",
+ "editors.stage.ui.assetTooLarge":
+ "「{name}」超过 {size} MB,请使用更小的 GLB 或 GLTF 文件。",
+ "editors.stage.ui.assetUnsupported":
+ "目前仅支持 GLB 和自包含 GLTF;FBX 及外部 GLTF 资源暂不支持。",
+ "editors.stage.ui.assetImported": "已导入 {name} · {animationCount} 个动画片段",
+ "editors.stage.ui.assetImportedStatic": "已导入 {name} · 无动画数据",
+ "editors.stage.ui.thumbnailFailed":
+ "已导入{name},但无法生成预览缩略图。",
"editors.stage.ui.editFailed": "舞台修改失败。",
"editors.stage.ui.cameraName": "摄像机 {number}",
"editors.stage.ui.keepCamera": "至少保留一个摄像机。",
- "editors.stage.ui.cameraInUse": "此机位仍被分镜引用,请先更换或删除对应分镜。",
- "editors.stage.ui.webglInit": "无法初始化 WebGL:{reason}",
+ "editors.stage.ui.webglInit": "无法初始化 WebGL:{reason}。请确认浏览器已启用硬件加速(chrome://gpu 可查看 WebGL 状态)并重启浏览器后重试;仍失败时关闭其他占用 WebGL 的标签页。",
"editors.stage.ui.webglLost": "WebGL 上下文已丢失。可先保存舞台数据,重新打开编辑器后继续。",
"editors.stage.ui.rendererNotReady": "舞台渲染器尚未就绪。",
"editors.stage.ui.screenshotFailed": "截图失败。",
"editors.stage.ui.importFailed": "导入舞台失败。",
+ "editors.stage.ui.importForeignAssets":
+ "舞台文件引用了未在本工程登记的导入模型:{names}。请在原工程中打开,或先在此工程导入对应模型文件。",
+ "editors.stage.ui.exportUnsavedImports":
+ "舞台文件无法携带仅存在于当前浏览器的导入模型:{names}。请先应用编辑,将其保存为工程素材。",
"editors.stage.ui.exportFailed": "预演视频导出失败。",
"editors.stage.ui.motionTitle": "{title} · 动作预演",
"editors.stage.ui.addCanvasFailed": "加入画布失败。",
- "editors.stage.ui.title": "导演预演 · {title}",
- "editors.stage.ui.subtitle": "本地 3D 舞台 · 镜头与主体关键帧",
+ "editors.stage.ui.brand": "3D导演台",
+ "editors.stage.ui.unsavedTitle": "舞台有未保存的修改",
+ "editors.stage.ui.keepEditing": "继续编辑",
+ "editors.stage.ui.discardClose": "直接关闭",
+ "editors.stage.ui.saveClose": "保存并关闭",
"editors.stage.ui.undo": "撤销",
"editors.stage.ui.redo": "重做",
"editors.stage.ui.importJson": "导入舞台 JSON",
"editors.stage.ui.exportJson": "导出舞台 JSON",
- "editors.stage.ui.screenshot": "下载镜头截图",
+ "editors.stage.ui.screenshot": "捕获镜头定格",
+ "editors.stage.ui.stillSaving": "正在保存照片…",
+ "editors.stage.ui.shotMaterials": "镜头素材",
+ "editors.stage.ui.shortcuts": "快捷键",
+ "editors.stage.ui.splitPreview": "实时预览 {name}",
+ "editors.stage.ui.splitExit": "退出分屏",
+ "editors.stage.ui.splitRatioAria": "分屏比例",
+ "editors.stage.ui.leftPanelWidthAria": "导演台左侧面板宽度",
+ "editors.stage.ui.rightPanelWidthAria": "导演台右侧面板宽度",
+ "editors.stage.ui.timelineHeightAria": "导演台时间轴高度",
+ "editors.stage.ui.sliderAria": "{name} 滑杆",
+ "editors.stage.ui.viewSettings": "视图设置",
+ "editors.stage.ui.viewSettingsRail": "视图设置浮层",
+ "editors.stage.ui.viewGround": "地面",
+ "editors.stage.ui.viewGrid": "网格",
+ "editors.stage.ui.viewMotionPaths": "运动路径",
+ "editors.stage.ui.viewObjectNames": "对象名称",
+ "editors.stage.ui.viewHeightGuides": "对象高度参考线",
+ "editors.stage.ui.viewIndicator": "视角指示器",
+ "editors.stage.ui.focusObject": "聚焦 {name}",
+ "editors.stage.ui.placeHint": "在视口中单击放置{name} · Esc 取消",
+ "editors.stage.ui.assetPlacementHint": "点击预览卡片,再点击画面网格放置对象。",
+ "editors.stage.ui.duplicateObject": "复制",
+ "editors.stage.ui.helpTitle": "导演台操作",
+ "editors.stage.ui.helpViewNav": "视角导航",
+ "editors.stage.ui.helpOrbit": "左键拖拽 · 环绕",
+ "editors.stage.ui.helpPan": "右键拖拽 · 平移",
+ "editors.stage.ui.helpZoom": "滚轮 · 缩放",
+ "editors.stage.ui.helpMove": "按住 W/A/S/D 移动 · Q/E 下降或上升 · Shift 加速",
+ "editors.stage.ui.helpEditor": "编辑器",
+ "editors.stage.ui.helpEscape": "Escape · 关闭浮层或守卫关闭编辑器",
+ "editors.stage.ui.helpTab": "Tab · 在控制台内循环焦点",
+ "editors.stage.ui.closeHelp": "关闭帮助",
+ "editors.stage.ui.closeDrawer": "收起镜头素材",
+ "editors.stage.ui.selectAllStills": "全选",
+ "editors.stage.ui.selectedStillsCount": "已选择 {count} 张",
+ "editors.stage.ui.stillName": "Capture_{number}",
+ "editors.stage.ui.duplicateSuffix": "{name} 副本",
+ "editors.stage.ui.objectLocked": "舞台对象已锁定,请先解锁再编辑或删除。",
+ "editors.stage.ui.deleteTrackKeyframe": "删除{label}在 {time} 秒的关键帧",
+ "editors.stage.ui.stillEmpty": "暂无镜头素材,拍摄后自动入库。",
+ "editors.stage.ui.stillMissing": "素材暂不可用",
+ "editors.stage.ui.previewStill": "预览 {name}",
+ "editors.stage.ui.closePreview": "关闭预览",
+ "editors.stage.ui.deleteSelectedStills": "删除选中照片",
+ "editors.stage.ui.downloadSelectedStills": "下载选中照片",
+ "editors.stage.ui.addStillsToCanvas": "添加到画布",
+ "editors.stage.ui.stillsAddedToCanvas": "已添加 {count} 张到画布。",
+ "editors.stage.ui.stillDownloadFailed": "下载照片失败。",
+ "editors.stage.ui.stillCaptured": "已捕获定格,应用后登记为工程图片素材。",
"editors.stage.ui.renderMp4": "合成预演 MP4",
"editors.stage.ui.renderProgress": "正在合成预演 {percent}%",
"editors.stage.ui.cancelRender": "取消合成",
- "editors.stage.ui.renderDone": "预演 MP4 已完成 · {width}×{height} · 30 fps",
+ "editors.stage.ui.renderDone": "预演 MP4 已完成 · {width}×{height} · {fps} fps",
+ "editors.stage.ui.exportVideo": "导出视频",
+ "editors.stage.ui.exportSubtitle": "选择一个机位导出完整动态预演。",
+ "editors.stage.ui.exportSourceLabel": "机位来源",
+ "editors.stage.ui.exportSourceStoryboard": "分镜编排",
+ "editors.stage.ui.exportAspectLabel": "画幅",
+ "editors.stage.ui.exportDurationLabel": "时长",
+ "editors.stage.ui.exportClarityLabel": "清晰度",
+ "editors.stage.ui.exportClarityStandard": "标准 · 长边 1280 px",
+ "editors.stage.ui.exportClarityHigh": "高清 · 长边 1920 px",
+ "editors.stage.ui.exportFpsLabel": "帧率",
+ "editors.stage.ui.exportFpsOption": "{fps} FPS",
+ "editors.stage.ui.exportNoteStoryboard": "按分镜块硬切,导出到最后一个分镜块结束。",
+ "editors.stage.ui.exportNoteCamera":
+ "全程使用{name},保留该机位的运镜和角色动作。",
+ "editors.stage.ui.exportNoteClean":
+ "成片不包含辅助线、控制点或编辑界面。",
+ "editors.stage.ui.exportConfirm": "导出",
+ "editors.stage.ui.exportCancel": "取消",
"editors.stage.ui.downloadMp4": "下载预演 MP4",
"editors.stage.ui.addedToCanvas": "已加入画布",
"editors.stage.ui.addToCanvas": "将预演视频加入画布",
+ "editors.stage.ui.assetLibrary": "资产",
+ "editors.stage.ui.assetSearchPlaceholder": "搜索素材",
+ "editors.stage.ui.assetSearchAria": "搜索导演台素材",
+ "editors.stage.ui.objectTreeTitle": "对象",
+ "editors.stage.ui.objectSearchPlaceholder": "搜索对象",
+ "editors.stage.ui.objectSearchAria": "搜索场景对象",
+ "editors.stage.ui.properties": "属性",
"editors.stage.ui.sceneObjects": "场景主体",
+ "editors.stage.ui.tabCharacters": "角色",
+ "editors.stage.ui.tabObjects": "物体",
+ "editors.stage.ui.tabCameras": "机位",
+ "editors.stage.ui.tabBackground": "背景",
+ "editors.stage.ui.backgroundFilters": "背景分类",
+ "editors.stage.ui.backgroundFilter.all": "全部",
+ "editors.stage.ui.backgroundFilter.panoramic": "全景背景",
+ "editors.stage.ui.backgroundFilter.flat": "平面背景",
+ "editors.stage.ui.backgroundMine": "我的",
+ "editors.stage.ui.backgroundAdd": "添加背景",
+ "editors.stage.ui.backgroundImporting": "正在添加背景…",
+ "editors.stage.ui.backgroundImported": "已添加背景「{name}」",
+ "editors.stage.ui.backgroundImportFailed": "无法添加背景「{name}」",
+ "editors.stage.ui.backgroundCanvasImages": "画布图片",
+ "editors.stage.ui.backgroundEmpty": "暂无背景。上传图片或从画布图片中选择。",
+ "editors.stage.ui.backgroundNoMatches": "没有符合当前搜索和分类的背景。",
+ "editors.stage.ui.cameraPreview": "机位预览",
+ "editors.stage.ui.collapseCameraPreview": "折叠机位预览",
+ "editors.stage.ui.expandCameraPreview": "展开机位预览",
+ "editors.stage.ui.moveCameraPreview": "移动机位预览",
+ "editors.stage.ui.directorView": "导演视角",
+ "editors.stage.ui.aspectMask": "画幅遮罩",
+ "editors.stage.ui.cameraHint": "先点一个预设,再点击画面中的角色或物体,放置新的机位。",
+ "editors.stage.ui.cameraPresetPlacementHint": "点击画面中的角色或物体,按此预设放置新的机位 · Esc 取消。",
+ "editors.stage.ui.cameraPresetNeedsSubject": "舞台上还没有角色或物体,添加后才能按预设置放机位。",
+ "editors.stage.ui.viewpoint": "视点",
+ "editors.stage.ui.viewfinder": "取景器",
+ "editors.stage.ui.viewfinderFov": "取景器 FOV",
+ "editors.stage.ui.cameraPresets": "机位预设",
+ "editors.stage.ui.preset.frontMedium": "正面中景",
+ "editors.stage.ui.preset.frontClose": "正面特写",
+ "editors.stage.ui.preset.frontWide": "正面全景",
+ "editors.stage.ui.preset.sideTrack": "侧面跟拍",
+ "editors.stage.ui.preset.sideClose": "侧面近景",
+ "editors.stage.ui.preset.backMedium": "背面中景",
+ "editors.stage.ui.preset.overheadWide": "俯拍全景",
+ "editors.stage.ui.preset.highAngle": "45° 俯拍",
+ "editors.stage.ui.preset.lowAngle": "低角度仰拍",
+ "editors.stage.ui.preset.lowWide": "低角度广角",
+ "editors.stage.ui.preset.overShoulder": "过肩",
+ "editors.stage.ui.preset.bird": "鸟瞰",
+ "editors.stage.ui.preset.dutch": "荷兰角",
+ "editors.stage.ui.cameraMoves": "运镜预设",
+ "editors.stage.ui.savedChip": "已保存",
+ "editors.stage.ui.unsavedChip": "未保存",
"editors.stage.ui.background": "背景颜色",
+ "editors.stage.ui.environmentPreset": "环境预设",
+ "editors.stage.ui.environmentPreset.custom": "自定义",
+ "editors.stage.ui.environmentPreset.studio": "摄影棚",
+ "editors.stage.ui.environmentPreset.warm-sunset": "暖色夕阳",
+ "editors.stage.ui.environmentPreset.moonlit": "月夜",
+ "editors.stage.ui.backgroundAsset": "背景图片",
+ "editors.stage.ui.backgroundAssetFallback": "使用背景颜色",
+ "editors.stage.ui.backgroundAssetUnavailable": "背景图片不可用,已回退到背景颜色。",
+ "editors.stage.ui.groundColor": "地面颜色",
+ "editors.stage.ui.groundVisible": "显示地面",
+ "editors.stage.ui.exposure": "曝光",
+ "editors.stage.ui.light.hemisphere": "半球光",
+ "editors.stage.ui.light.key": "主光",
+ "editors.stage.ui.light.fill": "补光",
+ "editors.stage.ui.lightColor": "{role}颜色",
+ "editors.stage.ui.lightIntensity": "{role}强度",
+ "editors.stage.ui.lightPosition": "{role}位置",
+ "editors.stage.ui.lightPositionAxis": "{role}位置{axis}",
+ "editors.stage.ui.lightCastShadow": "{role}投射阴影",
"editors.stage.ui.grid": "显示地面网格",
- "editors.stage.ui.orbitHint": "左键环绕 · 右键平移 · 滚轮缩放",
- "editors.stage.ui.selectHint": "点击主体选择,再调整右侧变换。",
+ "editors.stage.ui.orbitHint": "左键环绕 · 右键平移 · 滚轮缩放 · 按住 WASD 移动 · Q/E 下降或上升 · Shift 加速",
+ "editors.stage.ui.shortcutHint":
+ "1/2/3 切换移动、旋转、缩放操作轴;G 让主体落地;方向键微移(Shift 加大步长)",
+ "editors.stage.ui.resetView": "重置视角",
+ "editors.stage.ui.selectHint":
+ "点击主体选择,然后在预览中拖动操作轴,或在右侧调整变换。",
+ "editors.stage.ui.gizmoSelect": "选择",
+ "editors.stage.ui.gizmoMove": "移动",
+ "editors.stage.ui.gizmoRotate": "旋转",
+ "editors.stage.ui.gizmoScale": "缩放",
+ "editors.stage.ui.gizmoDropGround": "落到地面",
+ "editors.stage.ui.elevationValue": "{height} 米",
+ "editors.stage.ui.elevationAria": "离地高度 {height} 米",
+ "editors.stage.ui.gizmoModeAria": "预览变换操作轴",
+ "editors.stage.ui.gizmoAnimatedHint":
+ "此主体已有变换关键帧,拖拽会在播放头记录姿势关键帧。",
"editors.stage.ui.stageAria": "可交互的三维导演舞台",
"editors.stage.ui.pause": "暂停",
"editors.stage.ui.playAction": "播放动作与关键帧",
+ "editors.stage.ui.previewMode": "预演模式",
+ "editors.stage.ui.previewModeStatic": "静态",
+ "editors.stage.ui.previewModeDynamic": "动态",
"editors.stage.ui.time": "{time} / {duration} 秒",
"editors.stage.ui.totalDuration": "总时长",
"editors.stage.ui.stageDurationAria": "舞台总时长",
+ "editors.stage.ui.stageDurationClamped": "请求时长 {requested} 秒。为保留全部分镜块,实际应用 {applied} 秒。",
"editors.stage.ui.recordKeyframe": "在此记录关键帧",
+ "editors.stage.ui.addTrackKeyframe": "在 {time} 秒为{label}添加关键帧",
"editors.stage.ui.playheadAria": "舞台播放位置",
- "editors.stage.ui.deleteKeyframe": "删除 {frame} 秒关键帧",
- "editors.stage.ui.keyframeHint":
- "在起点和终点分别调整镜头或主体,然后记录关键帧即可预演。",
- "editors.stage.ui.storyboard": "分镜轨道",
- "editors.stage.ui.addShot": "在播放头添加当前机位",
- "editors.stage.ui.shotHint":
- "镜头区间不能重叠;空白区间使用当前机位。切换“分镜硬切”可预览并导出同一镜头序列。",
- "editors.stage.ui.shot": "镜头 {number}",
- "editors.stage.ui.shotCameraAria": "镜头 {number} 机位",
- "editors.stage.ui.shotStartAria": "镜头 {number} 开始",
- "editors.stage.ui.shotDurationAria": "镜头 {number} 时长",
- "editors.stage.ui.locate": "定位",
- "editors.stage.ui.deleteShot": "删除镜头 {number}",
+ "editors.stage.ui.timelineTitle": "时间轴",
+ "editors.stage.ui.timelineCurrentTime": "当前时间",
+ "editors.stage.ui.timelinePlayheadAria": "当前时间标记,{time} 秒",
+ "editors.stage.ui.timelineAria": "导演舞台时间线轨道",
+ "editors.stage.ui.timelineTime": "{time} 秒",
+ "editors.stage.ui.timelinePointAria": "{label},{time} 秒",
+ "editors.stage.ui.timelineIntervalAria":
+ "{label} 从 {start} 秒到 {end} 秒的区间",
+ "editors.stage.ui.transitionEditorAria": "{label}区间变化编辑器",
+ "editors.stage.ui.transitionEditorTitle": "{label} · {start}f → {end}f",
+ "editors.stage.ui.transitionFormula": "值 = 起点 + k(t) ×(终点 − 起点)",
+ "editors.stage.ui.transitionClose": "关闭区间变化编辑器",
+ "editors.stage.ui.transitionLabel": "过渡",
+ "editors.stage.ui.transitionLinear": "线性",
+ "editors.stage.ui.transitionBezier": "贝塞尔",
+ "editors.stage.ui.transitionControlPoints": "贝塞尔控制点(x1, y1, x2, y2)",
+ "editors.stage.ui.transitionControlPoint": "控制点 {point}",
+ "editors.stage.ui.trackShots": "分镜",
+ "editors.stage.ui.timelineCollapseGroup": "收起{label}",
+ "editors.stage.ui.timelineExpandGroup": "展开{label}",
+ "editors.stage.ui.trackPosition": "位置",
+ "editors.stage.ui.trackRotation": "旋转",
+ "editors.stage.ui.trackScale": "缩放",
+ "editors.stage.ui.trackMotion": "动作",
+ "editors.stage.ui.trackTarget": "目标",
+ "editors.stage.ui.trackUp": "上方向",
+ "editors.stage.ui.trackFocalLength": "焦距",
"editors.stage.ui.transform": "主体变换",
"editors.stage.ui.camera": "摄像机",
"editors.stage.ui.name": "名称",
@@ -337,23 +562,30 @@ export const editors = {
"editors.stage.ui.cameraLabel": "摄像机 ·",
"editors.stage.ui.editCamera": "编辑机位",
"editors.stage.ui.cameraNameAria": "机位名称",
- "editors.stage.ui.copyCamera": "复制为新机位",
"editors.stage.ui.deleteCamera": "删除当前机位",
"editors.stage.ui.outputAspect": "输出画幅",
"editors.stage.ui.outputAspectAria": "导演输出画幅",
- "editors.stage.ui.source": "预览与导出来源",
- "editors.stage.ui.sourceAria": "导演镜头来源",
- "editors.stage.ui.currentCamera": "当前机位全程",
- "editors.stage.ui.storyboardCut": "分镜硬切",
+ "editors.stage.ui.source": "预览来源",
+ "editors.stage.ui.sourceAria": "导演预览来源",
+ "editors.stage.ui.storyboardCut": "分镜",
+ // The Storyboard track: its `+`, the camera chooser above it, the blocks and the preview.
+ "editors.stage.ui.storyboardAdd": "向分镜添加机位",
+ "editors.stage.ui.storyboardEditing": "正在编辑分镜…",
+ "editors.stage.ui.storyboardAdding": "正在添加分镜块…",
+ "editors.stage.ui.storyboardEmpty": "请先添加分镜块。",
+ "editors.stage.ui.storyboardChooser": "选择要添加到分镜的机位",
+ "editors.stage.ui.storyboardSearch": "搜索机位",
+ "editors.stage.ui.storyboardSearchEmpty": "没有匹配的机位。",
+ "editors.stage.ui.storyboardDeleteBlock": "删除分镜块",
+ "editors.stage.ui.storyboardBlockAria": "分镜块 {name},{start} 秒到 {end} 秒",
"editors.stage.ui.cameraShort": "机位",
"editors.stage.ui.target": "目标",
"editors.stage.ui.focal": "焦距(35mm 胶片,16:9 等效)",
"editors.stage.ui.verticalFov": "垂直视角 {value}°",
"editors.stage.ui.resetCamera": "重置镜头",
- "editors.stage.ui.footerHint":
- "修改机位或主体会写入当前时间的关键帧;预览、截图与 MP4 共用画幅和采样。支持分镜硬切、分段关节动作和 30 fps MP4 导出。外部 FBX/GLB 蒙皮角色与云端导演版本尚未接入。",
"editors.stage.ui.importAria": "导入导演舞台",
"editors.stage.ui.startSeconds": "开始(秒)",
"editors.stage.ui.durationSeconds": "时长(秒)",
+ "editors.stage.ui.locate": "定位",
"editors.stage.ui.previewSuffix": "预演",
} as const;
diff --git a/src/i18n/messages/zh-CN/errors.ts b/src/i18n/messages/zh-CN/errors.ts
index bdda4b443..8a1de6fb3 100644
--- a/src/i18n/messages/zh-CN/errors.ts
+++ b/src/i18n/messages/zh-CN/errors.ts
@@ -163,6 +163,9 @@ export const errors = {
"errors.backend.resultCandidate": "结果已保留为候选",
"errors.backend.mediaEmpty": "素材没有可读取的内容。",
"errors.backend.mediaReadFailed": "素材读取失败。",
+ "errors.backend.directorAssetMissing":
+ "导演台包含尚未登记为工程素材的导入资产。",
+ "errors.backend.directorStageTitle": "导演台",
"errors.backend.unsupportedGeneration": "该节点不支持生成配置。",
"errors.backend.assemblyMissing":
"装配连线对应的主体素材或时间线片段已不存在。",
@@ -173,6 +176,8 @@ export const errors = {
"errors.backend.materialReference": "素材节点不能直接接受生成参考。",
"errors.backend.fixedReferenceMissing": "固定参考版本已缺失或内容已改变。",
"errors.backend.savingResult": "结果正在保存,请稍候。",
+ "errors.backend.mediaPreparationPending":
+ "上一次媒体发布仍在准备中,请先重试后再更改输出。",
"errors.backend.editSourceUnsaved": "编辑来源尚未保存。",
"errors.backend.notDirectorStage": "不是可发布的导演舞台。",
"errors.backend.noRealMedia": "编辑来源没有真实素材。",
diff --git a/tests/browser/creation_server.py b/tests/browser/creation_server.py
index 63df50662..a49fb07f6 100644
--- a/tests/browser/creation_server.py
+++ b/tests/browser/creation_server.py
@@ -190,6 +190,71 @@ async def legacy_fixture(request: Request):
return dict(id=project_id, name=name, path=str(directory))
+@app.post('/api/creation-test-agent-storyboard')
+async def agent_storyboard(request: Request):
+ """Call the in-process Agent tool without starting a model conversation."""
+ from uuid import uuid4
+ from opendirector.agent.tools import AgentTools
+ from opendirector.domain.projects import identifier
+ from opendirector.infrastructure.creation_projects import CreationProjects
+ value = await request.json()
+ project_id = identifier(value['projectId'])
+ tool = value['tool']
+ if tool not in ('execute_command', 'query'):
+ raise ProjectError('Unknown fixture tool.', 400)
+ tools = AgentTools(CreationProjects(store), None, None)
+ return await tools.execute(
+ project_id, uuid4(), request.headers['X-OpenDirector-Session'],
+ 'storyboard-acceptance', tool, value['input'], [], None)
+
+
+@app.post('/api/creation-test-legacy-storyboard')
+async def legacy_storyboard(request: Request):
+ """Store gaps in a Director Stage's Storyboard the way a build without the
+ continuity rule saved it. Every write boundary refuses such a document today, so
+ this fixture is the only way a browser journey can hold a project with one and
+ check that the project still opens while that stage stays refused."""
+ from uuid import uuid4
+ from opendirector.domain.creation.commands import parse_command
+ from opendirector.domain.creation.project import ProjectSnapshot
+ from opendirector.domain.projects import identifier
+ from opendirector.infrastructure.creation_projects import CreationProjects
+ value = await request.json()
+ project_id, document_id = identifier(value['projectId']), identifier(value['documentId'])
+ item_id = identifier(value['itemId'])
+ shots = [dict(id=shot['id'], cameraId=shot['cameraId'], start=shot['start'], duration=shot['duration'])
+ for shot in value['shots']]
+
+ def written_by_an_older_service(before):
+ # No Storyboard rule runs when a snapshot is validated, so the store still
+ # accepts what a service without the continuity rule wrote.
+ data = before.model_dump(mode='json')
+ document = next(d for d in data['editorDocuments'] if d['id'] == document_id)
+ document['data']['shots'] = shots
+ # The store requires every changed object to advance its revision exactly once.
+ document['revision'] += 1
+ return ProjectSnapshot.model_validate(data)
+
+ # The command only names the canvas item; the mutator above is what the commit
+ # stores. Like any other write, it names the current version of each object it changes.
+ projects = CreationProjects(store)
+ snapshot = await asyncio.to_thread(projects.snapshot, project_id)
+ command = parse_command(dict(
+ commandId=uuid4(), projectId=project_id, type='canvas.update',
+ expectedVersions=[
+ dict(objectType='canvas_item', id=item_id,
+ revision=next(item.revision for item in snapshot.canvasItems if str(item.id) == item_id)),
+ dict(objectType='editor_document', id=document_id,
+ revision=next(document.revision for document in snapshot.editorDocuments
+ if str(document.id) == document_id))],
+ payload=dict(itemId=item_id)))
+ # A fixture is an external writer, so it needs no open browser session.
+ receipt = await asyncio.to_thread(projects.commit, command, written_by_an_older_service, source='external')
+ if receipt.status != 'applied':
+ raise ProjectError('The fixture could not store the legacy Storyboard.', 409)
+ return dict(status=receipt.status)
+
+
@app.post('/api/creation-test-gate')
async def gate(request: Request):
value = await request.json()
diff --git a/tests/browser/director_stage_animation.mjs b/tests/browser/director_stage_animation.mjs
new file mode 100644
index 000000000..33c4e92bc
--- /dev/null
+++ b/tests/browser/director_stage_animation.mjs
@@ -0,0 +1,250 @@
+/** Third-phase Director Stage acceptance: an animated GLB follows the stage
+ * timeline into the same sampled MP4. Runs against the isolated fixture. */
+import assert from "node:assert/strict";
+import { makeAnimatedGlb } from "./director_stage_fixture.mjs";
+const { chromium } = await import(
+ process.env.PLAYWRIGHT_MODULE ?? "playwright-core"
+);
+
+const base = process.env.CREATION_WEB_URL ?? "http://127.0.0.1:5179";
+const api = process.env.CREATION_API_URL ?? "http://127.0.0.1:8019";
+const headers = {
+ "X-OpenDirector-Request": "1",
+ "Content-Type": "application/json",
+};
+
+async function call(path, body) {
+ const response = await fetch(api + path, {
+ headers,
+ ...(body
+ ? { method: "POST", body: JSON.stringify(body) }
+ : {}),
+ });
+ assert.ok(response.ok, `${response.status}: ${await response.clone().text()}`);
+ return response.json();
+}
+
+assert.equal((await call("/api/creation-test-health")).isolated, true);
+
+const projectId = crypto.randomUUID();
+await call(`/api/creation/projects/${projectId}/commands`, {
+ commandId: crypto.randomUUID(),
+ projectId,
+ type: "project.create",
+ payload: { name: `Director animation ${projectId.slice(0, 8)}` },
+});
+
+const state = () => call(`/api/creation/projects/${projectId}`);
+const browser = await chromium.launch({
+ headless: true,
+ ...(process.env.CHROMIUM_PATH
+ ? { executablePath: process.env.CHROMIUM_PATH }
+ : {}),
+ args: ["--no-sandbox", "--enable-unsafe-swiftshader"],
+});
+const page = await browser.newPage({
+ locale: "en-US",
+ viewport: { width: 1700, height: 1100 },
+});
+await page.addInitScript(() =>
+ localStorage.setItem("opendirector.modelSetup.v1", "dismissed"),
+);
+page.setDefaultTimeout(20000);
+const errors = [];
+page.on("pageerror", (error) => errors.push(error.message));
+
+const until = async (predicate, label) => {
+ const deadline = Date.now() + 20000;
+ let snapshot;
+ while (Date.now() < deadline) {
+ snapshot = await state();
+ if (predicate(snapshot)) return snapshot;
+ await page.waitForTimeout(100);
+ }
+ throw new Error(`Timeout: ${label}; snapshot: ${JSON.stringify(snapshot)}`);
+};
+
+const directorDocument = (snapshot) =>
+ snapshot.editorDocuments.find(
+ (candidate) => candidate.kind === "director",
+ );
+
+try {
+ await page.goto(`${base}/ai-tool/ai-canvas/${projectId}?creation=unified`);
+ await page.getByText("Saved on this device", { exact: true }).waitFor();
+ await page
+ .getByRole("button", { name: "Add Director Stage", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor();
+ await until(
+ (snapshot) => directorDocument(snapshot)?.kind === "director",
+ "created director document",
+ );
+ const itemId = (await state()).canvasItems.find(
+ (item) => item.kind === "external",
+ ).id;
+
+ await page.getByLabel("Stage duration", { exact: true }).fill("2");
+ await page.getByLabel("Stage duration", { exact: true }).press("Enter");
+ await until((snapshot) => directorDocument(snapshot)?.data.duration === 2, "stage duration saved");
+ await page
+ .locator('input[type="file"][accept*=".glb"]')
+ .setInputFiles({
+ name: "walker.glb",
+ mimeType: "model/gltf-binary",
+ buffer: makeAnimatedGlb(),
+ });
+ await page
+ .getByText("Imported walker · 1 animation clips", { exact: true })
+ .waitFor();
+ await page
+ .getByRole("button", { name: "walker", exact: true })
+ .waitFor();
+
+ const playhead = page.getByRole("slider", { name: "Stage playhead", exact: true });
+ const viewport = page.getByRole("img", {
+ name: "Interactive 3D director stage",
+ exact: true,
+ });
+ await viewport.waitFor();
+ // Screenshots of the same pose differ by rasterization jitter alone, so
+ // compare decoded pixels: identical poses stay near zero, a rotated model
+ // does not. Byte equality is too strict for WebGL output.
+ const pixelDiff = async (a, b) =>
+ page.evaluate(async ([aSrc, bSrc]) => {
+ const load = (src) =>
+ new Promise((resolve, reject) => {
+ const image = new Image();
+ image.onload = () => resolve(image);
+ image.onerror = reject;
+ image.src = src;
+ });
+ const [first, second] = [await load(aSrc), await load(bSrc)];
+ const canvas = document.createElement("canvas");
+ canvas.width = first.width;
+ canvas.height = first.height;
+ const context = canvas.getContext("2d", { willReadFrequently: true });
+ context.drawImage(first, 0, 0);
+ const left = context.getImageData(0, 0, canvas.width, canvas.height).data;
+ context.clearRect(0, 0, canvas.width, canvas.height);
+ context.drawImage(second, 0, 0);
+ const right = context.getImageData(0, 0, canvas.width, canvas.height).data;
+ let max = 0,
+ total = 0;
+ for (let i = 0; i < left.length; i += 4) {
+ const channel = Math.max(
+ Math.abs(left[i] - right[i]),
+ Math.abs(left[i + 1] - right[i + 1]),
+ Math.abs(left[i + 2] - right[i + 2]),
+ );
+ max = Math.max(max, channel);
+ total += channel;
+ }
+ return { max, mean: total / (left.length / 4) };
+ }, [
+ `data:image/png;base64,${a.toString("base64")}`,
+ `data:image/png;base64,${b.toString("base64")}`,
+ ]);
+
+ await playhead.fill("1");
+ await page
+ .getByRole("button", { name: "Add motion at playhead", exact: true })
+ .click();
+ await page.getByLabel("Motion 1", { exact: true }).waitFor();
+ // Rest baseline with the clip already present: the viewport shows a
+ // persistent indicator on objects carrying a clip, so the pose comparison
+ // must not straddle that change. The clip spans [1, 2].
+ await playhead.fill("0.1");
+ await page.waitForTimeout(200);
+ const rest = await viewport.screenshot();
+ // 1.5 is inside the clip, 0.1 has left it again.
+ await playhead.fill("1.5");
+ await page.waitForTimeout(200);
+ const animated = await viewport.screenshot();
+ await playhead.fill("0.1");
+ await page.waitForTimeout(200);
+ const restored = await viewport.screenshot();
+ const animatedDiff = await pixelDiff(restored, animated);
+ assert.ok(
+ animatedDiff.mean > 0.2,
+ `playhead scrub animates the imported model (mean=${animatedDiff.mean})`,
+ );
+ const restoreDiff = await pixelDiff(restored, rest);
+ assert.ok(
+ restoreDiff.mean < 0.1 && restoreDiff.max <= 8,
+ `leaving the motion clip restores the authored rest pose (mean=${restoreDiff.mean}, max=${restoreDiff.max})`,
+ );
+
+ await page
+ .getByRole("button", { name: "Render preview MP4", exact: true })
+ .click();
+ // The render button opens the export dialog; the defaults (active camera,
+ // standard quality, 30 FPS) match what this flow used to render directly.
+ await page
+ .getByRole("dialog", { name: "Export video" })
+ .getByRole("button", { name: "Export", exact: true })
+ .click();
+ await page
+ .getByText("Preview MP4 complete · 1280×720 · 30 fps", { exact: true })
+ .waitFor({ timeout: 240000 });
+ // Applying saves and closes the stage editor in one step.
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor({ state: "detached" });
+
+ const committed = await until((snapshot) => {
+ const document = directorDocument(snapshot);
+ const imported = document?.data.objects.find(
+ (object) => object.kind === "gltf",
+ );
+ return (
+ imported?.animationNames?.length === 1 &&
+ imported?.motionClips?.length === 1
+ );
+ }, "committed animated stage document");
+ const document = directorDocument(committed);
+ const imported = document.data.objects.find((object) => object.kind === "gltf");
+ assert.deepEqual(imported.animationNames, ["Walk"]);
+ assert.equal(imported.hasAnimation, true);
+ assert.deepEqual(
+ { start: imported.motionClips[0].start, duration: imported.motionClips[0].duration },
+ { start: 1, duration: 1 },
+ );
+ assert.equal(imported.motionClips[0].motion.preset, "walk");
+ assert.ok(
+ committed.assets.some((asset) => asset.id === imported.asset.assetId),
+ "the animated model registers as a project asset",
+ );
+
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor({ state: "detached" });
+ assert.deepEqual(errors, []);
+ console.log(
+ JSON.stringify({
+ passed: true,
+ projectId,
+ itemId,
+ documentId: document.id,
+ checks: [
+ "animated GLB import discovers clips",
+ "motion clip binds the imported model",
+ "playhead scrub animates the preview",
+ "leaving the motion clip restores the authored rest pose",
+ "MP4 renders through the same sampling",
+ "animation metadata and motion clip persist",
+ "no page errors",
+ ],
+ }),
+ );
+} catch (error) {
+ console.error((await page.locator("body").innerText()).slice(-2500));
+ throw error;
+} finally {
+ await browser.close();
+}
diff --git a/tests/browser/director_stage_camera_preset.mjs b/tests/browser/director_stage_camera_preset.mjs
new file mode 100644
index 000000000..3144d5141
--- /dev/null
+++ b/tests/browser/director_stage_camera_preset.mjs
@@ -0,0 +1,395 @@
+/** Director Stage camera-preset placement acceptance.
+ * A preset is an armed interaction: the next viewport click on a scene object
+ * creates a new camera around that object's position and local facing.
+ * A new stage opens without a subject, so the journey brings its own: until a
+ * character has been placed every preset is disabled and the Cameras tab says
+ * why. Placing a camera is also the only way the interface adds one.
+ * DIRECTOR_STAGE_LOCALE runs the same flow in another UI language.
+ */
+import assert from "node:assert/strict";
+
+const { chromium } = await import(
+ process.env.PLAYWRIGHT_MODULE ?? "playwright-core"
+);
+
+const locale = process.env.DIRECTOR_STAGE_LOCALE ?? "en-US";
+const L = {
+ "en-US": {
+ saved: "Saved on this device",
+ addStage: "Add Director Stage",
+ apply: "Apply edits",
+ openStage: "Open Director Stage",
+ charactersTab: "Characters",
+ cameras: "Cameras",
+ addCamera: "Add camera",
+ copyCamera: "Duplicate as new camera",
+ editCamera: "Edit camera",
+ previewSource: "Director preview source",
+ frontMedium: "Front medium",
+ camera2: "Camera 2",
+ positionX: "Position X",
+ positionY: "Position Y",
+ positionZ: "Position Z",
+ rotationY: "Rotation Y",
+ presetNeedsSubject:
+ "The stage has no character or object yet. Add one before placing a camera preset.",
+ presetHint:
+ "Click a character or object in the viewport to place a new camera with this preset · Esc cancels.",
+ helpTitle: "Director console controls",
+ closeHelp: "Close help",
+ },
+ "zh-CN": {
+ saved: "已保存到本机",
+ addStage: "添加导演台",
+ apply: "应用编辑",
+ openStage: "打开导演台",
+ charactersTab: "角色",
+ cameras: "机位",
+ addCamera: "添加机位",
+ copyCamera: "复制为新机位",
+ editCamera: "编辑机位",
+ previewSource: "导演预览来源",
+ frontMedium: "正面中景",
+ camera2: "摄像机 2",
+ positionX: "位置 X",
+ positionY: "位置 Y",
+ positionZ: "位置 Z",
+ rotationY: "旋转 Y",
+ presetNeedsSubject: "舞台上还没有角色或物体,添加后才能按预设置放机位。",
+ presetHint: "点击画面中的角色或物体,按此预设放置新的机位 · Esc 取消。",
+ helpTitle: "导演台操作",
+ closeHelp: "关闭帮助",
+ },
+}[locale];
+assert.ok(L, `Unsupported DIRECTOR_STAGE_LOCALE: ${locale}`);
+
+const base = process.env.CREATION_WEB_URL ?? "http://127.0.0.1:5179";
+const api = process.env.CREATION_API_URL ?? "http://127.0.0.1:8019";
+const headers = {
+ "X-OpenDirector-Request": "1",
+ "Content-Type": "application/json",
+};
+
+async function call(path, body) {
+ const response = await fetch(api + path, {
+ headers,
+ ...(body ? { method: "POST", body: JSON.stringify(body) } : {}),
+ });
+ assert.ok(response.ok, `${response.status}: ${await response.clone().text()}`);
+ return response.json();
+}
+
+assert.equal((await call("/api/creation-test-health")).isolated, true);
+const projectId = crypto.randomUUID();
+await call(`/api/creation/projects/${projectId}/commands`, {
+ commandId: crypto.randomUUID(),
+ projectId,
+ type: "project.create",
+ payload: { name: `Director Stage camera preset ${projectId.slice(0, 8)}` },
+});
+
+const state = () => call(`/api/creation/projects/${projectId}`);
+const director = (snapshot) => {
+ const item = snapshot.canvasItems.find(
+ (candidate) => candidate.visible && candidate.kind === "external",
+ );
+ return snapshot.editorDocuments.find(
+ (candidate) => candidate.id === item?.binding?.objectRef?.id,
+ );
+};
+
+/** The view every stage opens with: the director's own, never a stage camera. */
+const DEFAULT_CAMERA = {
+ eye: { x: 8, y: 6, z: 10 },
+ target: { x: 0, y: 1, z: 0 },
+ fov: 45,
+};
+const sub3 = (a, b) => ({ x: a.x - b.x, y: a.y - b.y, z: a.z - b.z });
+const cross3 = (a, b) => ({
+ x: a.y * b.z - a.z * b.y,
+ y: a.z * b.x - a.x * b.z,
+ z: a.x * b.y - a.y * b.x,
+});
+const dot3 = (a, b) => a.x * b.x + a.y * b.y + a.z * b.z;
+const normalize3 = (a) => {
+ const length = Math.hypot(a.x, a.y, a.z);
+ return { x: a.x / length, y: a.y / length, z: a.z / length };
+};
+const VIEW_BASIS = (() => {
+ const forward = normalize3(sub3(DEFAULT_CAMERA.target, DEFAULT_CAMERA.eye));
+ const right = normalize3(cross3(forward, { x: 0, y: 1, z: 0 }));
+ return { forward, right, up: normalize3(cross3(right, forward)) };
+})();
+const projectToViewport = (point, box) => {
+ const view = sub3(point, DEFAULT_CAMERA.eye);
+ const depth = dot3(view, VIEW_BASIS.forward);
+ const halfHeight = depth * Math.tan((DEFAULT_CAMERA.fov * Math.PI) / 360);
+ const halfWidth = halfHeight * (box.width / box.height);
+ return {
+ x: box.x + ((dot3(view, VIEW_BASIS.right) / halfWidth + 1) / 2) * box.width,
+ y: box.y + ((1 - dot3(view, VIEW_BASIS.up) / halfHeight) / 2) * box.height,
+ };
+};
+
+const browser = await chromium.launch({
+ headless: true,
+ ...(process.env.CHROMIUM_PATH
+ ? { executablePath: process.env.CHROMIUM_PATH }
+ : {}),
+ args: ["--no-sandbox", "--enable-unsafe-swiftshader"],
+});
+const page = await browser.newPage({
+ locale,
+ viewport: { width: 1700, height: 1100 },
+ deviceScaleFactor: 2,
+});
+page.setDefaultTimeout(20_000);
+await page.addInitScript((value) => {
+ localStorage.setItem("opendirector.locale.v1", value);
+ localStorage.setItem("opendirector.modelSetup.v1", "dismissed");
+}, locale);
+const errors = [];
+page.on("pageerror", (error) => errors.push(error.message));
+
+const until = async (predicate, label) => {
+ const deadline = Date.now() + 20_000;
+ let snapshot;
+ while (Date.now() < deadline) {
+ snapshot = await state();
+ if (predicate(snapshot)) return snapshot;
+ await page.waitForTimeout(100);
+ }
+ throw new Error(`Timeout: ${label}; snapshot: ${JSON.stringify(snapshot)}`);
+};
+
+try {
+ await page.goto(`${base}/ai-tool/ai-canvas/${projectId}?creation=unified`);
+ await page.getByText(L.saved, { exact: true }).waitFor();
+ await page.getByRole("button", { name: L.addStage, exact: true }).click();
+ await page.getByRole("button", { name: L.apply, exact: true }).click();
+ await page
+ .getByRole("button", { name: L.apply, exact: true })
+ .waitFor({ state: "detached" });
+ await page.getByRole("button", { name: L.openStage, exact: true }).click();
+ await page.getByRole("button", { name: L.apply, exact: true }).waitFor();
+ const scene = page.locator(".cw-stage-scene");
+ await scene.locator("canvas:not(.cw-stage-pipcanvas)").waitFor();
+
+ // Placing a preset is the only way a camera is added: the Cameras tab holds the
+ // presets alone, with neither an add button nor a second camera list, and the
+ // inspector has no duplicate button.
+ const camerasTab = page.getByRole("tab", { name: L.cameras, exact: true });
+ await camerasTab.click();
+ assert.equal(
+ await page.getByRole("button", { name: L.addCamera, exact: true }).count(),
+ 0,
+ "the left camera panel does not duplicate the right-side camera controls",
+ );
+ assert.equal(
+ await page.locator(".cw-stage-camera-list").count(),
+ 0,
+ "the left camera panel does not render a second camera list",
+ );
+ assert.equal(
+ await page.getByRole("button", { name: L.copyCamera, exact: true }).count(),
+ 0,
+ "the inspector offers no other way to add a camera",
+ );
+
+ // A new stage has no subject for a preset to be placed on: every preset is
+ // disabled until one is placed, and the tab says why.
+ const presetButtons = page.locator(".cw-stage-preset-grid button");
+ const presets = await presetButtons.all();
+ assert.ok(presets.length > 1, "the Cameras tab offers several presets");
+ for (const button of presets)
+ assert.equal(
+ await button.isDisabled(),
+ true,
+ `a preset is disabled on a stage without a subject: ${await button.textContent()}`,
+ );
+ assert.equal(
+ await page.getByText(L.presetNeedsSubject, { exact: true }).isVisible(),
+ true,
+ "the Cameras tab says why no preset can be placed",
+ );
+
+ // Place a character. The first placement opens the console's help once.
+ await page
+ .getByRole("tab", { name: L.charactersTab, exact: true })
+ .click();
+ await page
+ .locator('.cw-stage-object-grid button[data-stage-placement-kind="person"]')
+ .first()
+ .click();
+ const sceneBox = await scene.boundingBox();
+ assert.ok(sceneBox, "stage viewport is visible to place a subject");
+ await page.mouse.click(
+ sceneBox.x + sceneBox.width * 0.45,
+ sceneBox.y + sceneBox.height * 0.7,
+ );
+ const help = page.getByRole("dialog", { name: L.helpTitle, exact: true });
+ if (await help.count()) {
+ await help.getByRole("button", { name: L.closeHelp, exact: true }).click();
+ }
+ await page.waitForFunction(
+ (label) => {
+ const field = document.querySelector(`[aria-label="${label}"]`);
+ return field instanceof HTMLInputElement && field.value !== "";
+ },
+ L.positionX,
+ );
+
+ // Seat the subject exactly where the expectations below are written: at the
+ // origin, turned a quarter to its left, so the assertion proves that the
+ // preset uses the object's local facing instead of world-space offsets.
+ const fill = async (label, value) => {
+ const field = page.getByLabel(label, { exact: true });
+ await field.fill(value);
+ await page.waitForFunction(
+ ({ label, value }) => {
+ const field = document.querySelector(`[aria-label="${label}"]`);
+ return (
+ field instanceof HTMLInputElement &&
+ Math.abs(Number(field.value) - Number(value)) < 0.01
+ );
+ },
+ { label, value },
+ );
+ };
+ await fill(L.positionX, "0");
+ await fill(L.positionY, "0");
+ await fill(L.positionZ, "0");
+ await fill(L.rotationY, "90");
+
+ // With a subject on the stage every preset can be placed again, and the
+ // reason is gone.
+ await camerasTab.click();
+ for (const button of presets)
+ assert.equal(
+ await button.isDisabled(),
+ false,
+ `a preset is enabled once the stage has a subject: ${await button.textContent()}`,
+ );
+ assert.equal(
+ await page.getByText(L.presetNeedsSubject, { exact: true }).count(),
+ 0,
+ "the reason goes once the stage has a subject",
+ );
+
+ const preset = page.getByRole("button", {
+ name: L.frontMedium,
+ exact: true,
+ });
+ await preset.click();
+ assert.equal(await preset.getAttribute("aria-pressed"), "true");
+ await page.getByText(L.presetHint, { exact: false }).waitFor();
+
+ // A click where no subject lies does not consume the armed preset, and Escape
+ // takes it back.
+ await page.mouse.click(
+ sceneBox.x + sceneBox.width * 0.3,
+ sceneBox.y + sceneBox.height * 0.78,
+ );
+ assert.equal(
+ await preset.getAttribute("aria-pressed"),
+ "true",
+ "a click on empty space leaves the preset armed",
+ );
+ await page.keyboard.press("Escape");
+ assert.equal(
+ await preset.getAttribute("aria-pressed"),
+ "false",
+ "Escape cancels an armed preset",
+ );
+ await preset.click();
+ assert.equal(await preset.getAttribute("aria-pressed"), "true");
+
+ const objectPoint = projectToViewport({ x: 0, y: 0.9, z: 0 }, sceneBox);
+ await page.mouse.click(objectPoint.x, objectPoint.y);
+ assert.equal(await preset.getAttribute("aria-pressed"), "false");
+
+ // The new camera is selected, and the preview shows it.
+ const cameraRows = page.locator(
+ ".cw-stage-camera-tree-row:not(.cw-stage-camera-tree-row-child)",
+ );
+ await cameraRows.filter({ hasText: L.camera2 }).waitFor();
+ assert.equal(await cameraRows.count(), 2, "preset click adds a second camera");
+ assert.equal(
+ await cameraRows.filter({ hasText: L.camera2 }).getByRole("button").first()
+ .getAttribute("aria-selected"),
+ "true",
+ "the placed camera is the one selected in the scene tree",
+ );
+ const placedId = await page
+ .getByRole("combobox", { name: L.editCamera, exact: true })
+ .inputValue();
+ assert.notEqual(placedId, "camera-1");
+ assert.equal(
+ await page
+ .locator(".cw-stage-pipframe")
+ .getByRole("combobox", { name: L.previewSource, exact: true })
+ .inputValue(),
+ `camera:${placedId}`,
+ "the camera preview shows the camera that was placed",
+ );
+
+ await page.getByRole("button", { name: L.apply, exact: true }).click();
+ await page
+ .getByRole("button", { name: L.apply, exact: true })
+ .waitFor({ state: "detached" });
+ const snapshot = await until(
+ (value) => director(value)?.data.cameras.length === 2,
+ "camera preset placement persisted",
+ );
+ const document = director(snapshot);
+ assert.ok(document);
+ const [original, placed] = document.data.cameras;
+ // The server's camera contract carries roll always, as the backend's own model
+ // form of the pose, zero included.
+ assert.deepEqual(original.pose, {
+ position: { x: 5, y: 3.5, z: 7 },
+ target: { x: 0, y: 1, z: 0 },
+ fov: 45,
+ roll: 0,
+ });
+ assert.ok(placed);
+ assert.equal(placed.id, placedId);
+ assert.equal(placed.name, L.camera2);
+ // Front medium stands six units in front of a person, 0.6 above the point it
+ // looks at, 1.3 up from the feet. Turned a quarter, "in front" is the +X side.
+ assert.ok(Math.abs(placed.pose.position.x - 6) < 0.01);
+ assert.ok(Math.abs(placed.pose.position.y - 1.9) < 0.01);
+ assert.ok(Math.abs(placed.pose.position.z) < 0.01);
+ assert.deepEqual(placed.pose.target, { x: 0, y: 1.3, z: 0 });
+ assert.equal(placed.pose.fov, 45);
+ assert.equal(placed.pose.roll, 0);
+ assert.equal(document.data.activeCameraId, placed.id);
+ assert.equal(document.data.cameraSource, "camera");
+ assert.deepEqual(errors, []);
+ console.log(
+ JSON.stringify({
+ passed: true,
+ projectId,
+ cameraId: placed.id,
+ checks: [
+ "the Cameras tab offers presets only: no add button, no second list, no duplicate",
+ "every preset is disabled, with the reason shown, on a stage without a subject",
+ "placing a subject enables the presets again and takes the reason away",
+ "a click on empty space leaves an armed preset armed",
+ "Escape cancels an armed preset",
+ "preset arms a two-step placement instead of editing the active camera",
+ "clicking a scene object creates a new camera",
+ "camera offset follows the object's local Y rotation",
+ "the placed camera is selected and the camera preview shows it",
+ "the original camera remains unchanged",
+ "placement persists after apply as the active camera",
+ "no page errors",
+ ],
+ }),
+ );
+} catch (error) {
+ console.error((await page.locator("body").innerText()).slice(-3000));
+ throw error;
+} finally {
+ await browser.close();
+}
diff --git a/tests/browser/director_stage_console.mjs b/tests/browser/director_stage_console.mjs
new file mode 100644
index 000000000..5d1c9635c
--- /dev/null
+++ b/tests/browser/director_stage_console.mjs
@@ -0,0 +1,499 @@
+/** Console-phase acceptance: controls cheat-sheet, split live preview and
+ * transform sliders over the fullscreen console. */
+import assert from "node:assert/strict";
+const { chromium } = await import(
+ process.env.PLAYWRIGHT_MODULE ?? "playwright-core"
+);
+
+const base = process.env.CREATION_WEB_URL ?? "http://127.0.0.1:5179";
+const api = process.env.CREATION_API_URL ?? "http://127.0.0.1:8019";
+const headers = {
+ "X-OpenDirector-Request": "1",
+ "Content-Type": "application/json",
+};
+
+async function call(path, body, extra = {}) {
+ const response = await fetch(api + path, {
+ headers: { ...headers, ...extra },
+ ...(body ? { method: "POST", body: JSON.stringify(body) } : {}),
+ });
+ assert.ok(response.ok, `${response.status}: ${await response.clone().text()}`);
+ return response.json();
+}
+
+assert.equal((await call("/api/creation-test-health")).isolated, true);
+
+/** The view every stage opens with. The viewport camera is the director's own and
+ * never a stage camera, so a point of the stage is put on screen from here. */
+const DIRECTOR_VIEW = {
+ eye: { x: 8, y: 6, z: 10 },
+ target: { x: 0, y: 1, z: 0 },
+ fov: 45,
+};
+const DIRECTOR_BASIS = (() => {
+ const sub = (a, b) => ({ x: a.x - b.x, y: a.y - b.y, z: a.z - b.z });
+ const cross = (a, b) => ({
+ x: a.y * b.z - a.z * b.y,
+ y: a.z * b.x - a.x * b.z,
+ z: a.x * b.y - a.y * b.x,
+ });
+ const dot = (a, b) => a.x * b.x + a.y * b.y + a.z * b.z;
+ const unit = (a) => {
+ const length = Math.hypot(a.x, a.y, a.z);
+ return { x: a.x / length, y: a.y / length, z: a.z / length };
+ };
+ const forward = unit(sub(DIRECTOR_VIEW.target, DIRECTOR_VIEW.eye));
+ const right = unit(cross(forward, { x: 0, y: 1, z: 0 }));
+ return { sub, dot, forward, right, up: cross(right, forward) };
+})();
+/** Where a point of the stage lies on screen in the director view, inside the box
+ * of the viewport. */
+const directorViewPoint = (point, box) => {
+ const view = DIRECTOR_BASIS.sub(point, DIRECTOR_VIEW.eye);
+ const halfHeight =
+ DIRECTOR_BASIS.dot(view, DIRECTOR_BASIS.forward) *
+ Math.tan((DIRECTOR_VIEW.fov * Math.PI) / 360);
+ return {
+ x: box.x + ((DIRECTOR_BASIS.dot(view, DIRECTOR_BASIS.right) / (halfHeight * (box.width / box.height)) + 1) / 2) * box.width,
+ y: box.y + ((1 - DIRECTOR_BASIS.dot(view, DIRECTOR_BASIS.up) / halfHeight) / 2) * box.height,
+ };
+};
+
+const projectId = crypto.randomUUID();
+await call(`/api/creation/projects/${projectId}/commands`, {
+ commandId: crypto.randomUUID(),
+ projectId,
+ type: "project.create",
+ payload: { name: `Console ${projectId.slice(0, 8)}` },
+});
+const state = () => call(`/api/creation/projects/${projectId}`);
+const browser = await chromium.launch({
+ headless: true,
+ ...(process.env.CHROMIUM_PATH
+ ? { executablePath: process.env.CHROMIUM_PATH }
+ : {}),
+ args: ["--no-sandbox", "--enable-unsafe-swiftshader"],
+});
+const page = await browser.newPage({
+ locale: "en-US",
+ viewport: { width: 1700, height: 1100 },
+});
+await page.addInitScript(() =>
+ localStorage.setItem("opendirector.modelSetup.v1", "dismissed"),
+);
+page.setDefaultTimeout(20000);
+const errors = [];
+page.on("pageerror", (error) => errors.push(error.message));
+
+const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
+const until = async (predicate, label) => {
+ const deadline = Date.now() + 20000;
+ let snapshot;
+ while (Date.now() < deadline) {
+ snapshot = await state();
+ if (predicate(snapshot)) return snapshot;
+ await sleep(100);
+ }
+ throw new Error(`Timeout: ${label}; snapshot: ${JSON.stringify(snapshot)}`);
+};
+const stageDoc = (snapshot) =>
+ snapshot.editorDocuments.find((candidate) => candidate.kind === "director");
+
+let itemId;
+try {
+ await page.goto(`${base}/ai-tool/ai-canvas/${projectId}?creation=unified`);
+ await page.getByText("Saved on this device", { exact: true }).waitFor();
+ await page
+ .getByRole("button", { name: "Add Director Stage", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor();
+ const created = await until(
+ (snapshot) => stageDoc(snapshot)?.kind === "director",
+ "created director document",
+ );
+ itemId = created.canvasItems.find((item) => item.kind === "external").id;
+
+ // The first completed placement opens the console controls once: arm,
+ // land the click, then the panel appears.
+ const scene = await page.locator(".cw-stage-scene").boundingBox();
+ assert.ok(scene);
+ await page
+ .locator('.cw-stage-object-grid button[data-stage-placement-kind="person"]')
+ .first()
+ .click();
+ await page.mouse.click(
+ scene.x + scene.width * 0.55,
+ scene.y + scene.height * 0.5,
+ );
+ const firstHelp = page.getByRole("dialog", { name: "Director console controls" });
+ await firstHelp.getByText("Left-drag · orbit").waitFor();
+ await firstHelp
+ .getByRole("button", { name: "Close help", exact: true })
+ .click();
+ assert.equal(
+ await page
+ .getByRole("dialog", { name: "Director console controls" })
+ .count(),
+ 0,
+ );
+ const objectHeading = page.locator(
+ ".cw-stage-right-tree-panel > .cw-stage-panel-heading",
+ );
+ const propertiesHeading = page.locator(
+ ".cw-stage-inspector > .cw-stage-panel-heading",
+ );
+ const objectHeadingBox = await objectHeading.boundingBox();
+ const propertiesHeadingBox = await propertiesHeading.boundingBox();
+ assert.ok(objectHeadingBox && propertiesHeadingBox);
+ assert.ok(
+ Math.abs(objectHeadingBox.x - propertiesHeadingBox.x) <= 1,
+ `object and properties headings share the same left edge: ${JSON.stringify({ objectHeadingBox, propertiesHeadingBox })}`,
+ );
+ const objectIconBox = await objectHeading
+ .locator(".cw-stage-panel-icon")
+ .boundingBox();
+ const propertiesIconBox = await propertiesHeading
+ .locator(".cw-stage-panel-icon")
+ .boundingBox();
+ assert.ok(objectIconBox && propertiesIconBox);
+ assert.ok(
+ Math.abs(
+ objectIconBox.x -
+ objectHeadingBox.x -
+ (propertiesIconBox.x - propertiesHeadingBox.x),
+ ) <= 1 &&
+ Math.abs(objectIconBox.width - propertiesIconBox.width) <= 1 &&
+ Math.abs(objectIconBox.height - propertiesIconBox.height) <= 1 &&
+ Math.abs(
+ objectIconBox.y -
+ objectHeadingBox.y -
+ (propertiesIconBox.y - propertiesHeadingBox.y),
+ ) <= 1,
+ `object and properties icons align: ${JSON.stringify({ objectIconBox, propertiesIconBox })}`,
+ );
+ // A second placement does not reopen it: the marker is one-shot.
+ await page
+ .locator('.cw-stage-object-grid button[data-stage-placement-kind="person"]')
+ .first()
+ .click();
+ await page.mouse.click(
+ scene.x + scene.width * 0.45,
+ scene.y + scene.height * 0.5,
+ );
+ await page.waitForTimeout(300);
+ assert.equal(
+ await page
+ .getByRole("dialog", { name: "Director console controls" })
+ .count(),
+ 0,
+ );
+ // The top-bar entry reopens the same panel; Escape owns the close.
+ await page
+ .getByRole("button", { name: "Shortcuts", exact: true })
+ .click();
+ const reopened = page.getByRole("dialog", { name: "Director console controls" });
+ await reopened.waitFor();
+ await reopened.hover();
+ await page.keyboard.press("Escape");
+ assert.equal(
+ await page
+ .getByRole("dialog", { name: "Director console controls" })
+ .count(),
+ 0,
+ "Escape closes the help panel without guard-closing the editor",
+ );
+ assert.equal(
+ await page.getByRole("button", { name: "Apply edits", exact: true }).count(),
+ 1,
+ "the editor itself stays open",
+ );
+
+ // Transform values use the compact Jiemeng-style drag rows and pair with
+ // exact inputs. Groups can collapse without losing their current values.
+ await page
+ .locator('.cw-stage-object-grid button[data-stage-placement-kind="person"]')
+ .first()
+ .click();
+ const positionGroup = page.getByRole("button", {
+ name: "Position",
+ exact: true,
+ });
+ await positionGroup.waitFor();
+ assert.equal(
+ await positionGroup.getAttribute("aria-expanded"),
+ "true",
+ "position group starts expanded",
+ );
+ await positionGroup.click();
+ assert.equal(
+ await page.getByLabel("Position X", { exact: true }).count(),
+ 0,
+ "position group collapses its controls",
+ );
+ await positionGroup.click();
+
+ const positionSlider = page.getByRole("slider", {
+ name: "Position X slider",
+ exact: true,
+ });
+ await positionSlider.waitFor();
+ assert.equal(
+ await page.getByRole("button", { name: "Rotation", exact: true }).count(),
+ 1,
+ "rotation groups do not append a redundant degrees suffix",
+ );
+ assert.equal(
+ await page
+ .getByRole("button", { name: "Rotation (degrees)", exact: true })
+ .count(),
+ 0,
+ "rotation groups omit the old degrees suffix",
+ );
+ assert.equal(
+ await positionSlider.evaluate((element) => getComputedStyle(element).cursor),
+ "ew-resize",
+ "position value uses a horizontal drag cursor",
+ );
+ const positionInput = page.getByLabel("Position X", { exact: true });
+ assert.equal(
+ await positionInput.getAttribute("step"),
+ "0.01",
+ "drag values expose hundredth precision",
+ );
+ assert.equal(
+ await positionSlider.getAttribute("aria-valuemin"),
+ "-20",
+ "position values expose a lower bound",
+ );
+ assert.equal(
+ await positionSlider.getAttribute("aria-valuemax"),
+ "20",
+ "position values expose an upper bound",
+ );
+ assert.equal(
+ await positionSlider
+ .locator(".cw-stage-drag-value-label")
+ .getAttribute("title"),
+ "Position X",
+ "the compact axis label keeps the complete field name available",
+ );
+ const numberBox = positionSlider.locator(".cw-stage-drag-value-number");
+ assert.equal(
+ await numberBox.evaluate((element) => getComputedStyle(element).minWidth),
+ "0px",
+ "the numeric value owns a shrinkable layout box",
+ );
+ assert.equal(
+ await positionInput.evaluate((element) => getComputedStyle(element).textAlign),
+ "right",
+ "numeric values stay right aligned",
+ );
+ const sliderBox = await positionSlider.boundingBox();
+ assert.ok(sliderBox, "position drag row is visible");
+ await positionInput.fill("-19.99");
+ assert.equal(
+ await positionInput.inputValue(),
+ "-19.99",
+ "long signed values keep both decimal places",
+ );
+ const longValueBox = await positionInput.boundingBox();
+ assert.ok(longValueBox, "long numeric value remains measurable");
+ assert.ok(
+ longValueBox.x + longValueBox.width <= sliderBox?.x + sliderBox?.width + 1,
+ "long numeric values stay inside the drag row",
+ );
+ await positionInput.fill("12345.67");
+ assert.equal(
+ await positionInput.inputValue(),
+ "20",
+ "values above the upper bound are clamped",
+ );
+ await positionInput.fill("-12345.67");
+ assert.equal(
+ await positionInput.inputValue(),
+ "-20",
+ "values below the lower bound are clamped",
+ );
+ await positionInput.fill("0.01");
+ assert.equal(
+ await positionInput.inputValue(),
+ "0.01",
+ "exact input accepts two decimal places",
+ );
+ const initialPositionX = Number(await positionInput.inputValue());
+ const inputBox = await positionInput.boundingBox();
+ assert.ok(inputBox, "position exact input is visible");
+ assert.ok(
+ Math.abs(sliderBox.width - inputBox.width) <= 2 &&
+ Math.abs(sliderBox.height - inputBox.height) <= 2 &&
+ Math.abs(sliderBox.x - inputBox.x) <= 1 &&
+ Math.abs(sliderBox.y - inputBox.y) <= 1,
+ `the exact input covers the drag row instead of producing a second-sized box: ${JSON.stringify({ inputBox, sliderBox })}`,
+ );
+ assert.equal(
+ await positionInput.evaluate((element) => getComputedStyle(element).outlineStyle),
+ "none",
+ "dragging the exact input does not render an inner focus outline",
+ );
+ await page.evaluate(() => {
+ window.__stageNativeDragStarts = 0;
+ document.addEventListener(
+ "dragstart",
+ () => {
+ window.__stageNativeDragStarts += 1;
+ },
+ true,
+ );
+ });
+ const dragY = inputBox.y + inputBox.height / 2;
+ await page.mouse.move(inputBox.x + inputBox.width / 2, dragY);
+ await page.mouse.down();
+ await page.mouse.move(inputBox.x + inputBox.width / 2 + 48, dragY, {
+ steps: 8,
+ });
+ await page.mouse.up();
+ const draggedPositionX = Number(await positionInput.inputValue());
+ assert.ok(
+ draggedPositionX > initialPositionX,
+ "dragging the value row updates the exact input immediately",
+ );
+ assert.equal(
+ await page.evaluate(() => window.__stageNativeDragStarts),
+ 0,
+ "dragging the input does not create a native duplicate drag box",
+ );
+ assert.equal(
+ draggedPositionX,
+ Number((initialPositionX + 0.06).toFixed(2)),
+ "dragging uses hundredth increments",
+ );
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor({ state: "detached" });
+ const saved = await until(
+ (snapshot) =>
+ stageDoc(snapshot)?.data.objects.some(
+ (object) => Math.abs(object.position.x - draggedPositionX) < 1e-6,
+ ),
+ "slider-driven position persists",
+ );
+ const movedId = saved.editorDocuments
+ .find((doc) => doc.kind === "director")
+ .data.objects.find(
+ (object) => Math.abs(object.position.x - draggedPositionX) < 1e-6,
+ ).id;
+
+ // Select a camera in the object tree before editing its inspector. The
+ // property panel follows the selected scene object rather than the asset
+ // library tab.
+ await page.locator(`.react-flow__node[data-id="${itemId}"]`).click();
+ await page
+ .getByRole("button", { name: "Open Director Stage", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor();
+ await page
+ .getByRole("tab", { name: "Cameras", exact: true })
+ .click();
+ await page
+ .getByRole("treeitem")
+ .getByRole("button", { name: "Camera 1", exact: true })
+ .click();
+ assert.equal(
+ await page.getByLabel("Camera name", { exact: true }).inputValue(),
+ "Camera 1",
+ "the inspector follows the camera selected in the tree",
+ );
+ // A camera is added by placing a preset on a subject: the preset is armed, the
+ // subject is clicked where the director's view shows it, and the new camera is
+ // the one selected. Selecting in the tree moves nothing else.
+ await page
+ .getByRole("treeitem")
+ .getByRole("button", { name: "Person 1", exact: true })
+ .click();
+ const subjectAxis = (axis) =>
+ page.getByLabel(`Position ${axis}`, { exact: true }).inputValue();
+ const subject = {
+ x: Number(await subjectAxis("X")),
+ y: Number(await subjectAxis("Y")),
+ z: Number(await subjectAxis("Z")),
+ };
+ const preset = page.getByRole("button", {
+ name: "Front medium",
+ exact: true,
+ });
+ await preset.click();
+ assert.equal(await preset.getAttribute("aria-pressed"), "true");
+ const sceneBox = await page.locator(".cw-stage-scene").boundingBox();
+ assert.ok(sceneBox);
+ const subjectPoint = directorViewPoint(
+ { x: subject.x, y: subject.y + 0.9, z: subject.z },
+ sceneBox,
+ );
+ await page.mouse.click(subjectPoint.x, subjectPoint.y);
+ assert.equal(await preset.getAttribute("aria-pressed"), "false");
+ assert.equal(
+ await page.getByLabel("Camera name", { exact: true }).inputValue(),
+ "Camera 2",
+ "placing a preset selects the new camera in the inspector",
+ );
+ const cameraPreview = page.getByRole("button", { name: "Camera preview", exact: true });
+ assert.equal(await cameraPreview.getAttribute("aria-expanded"), "true");
+ // The camera preview shows the camera that was placed: its selector is the same
+ // element the inspector shows.
+ assert.equal(
+ await page.locator(".cw-stage-pipframe select").inputValue(),
+ `camera:${await page
+ .getByRole("combobox", { name: "Edit camera", exact: true })
+ .inputValue()}`,
+ "the camera preview shows the placed camera",
+ );
+ await cameraPreview.click();
+ assert.equal(await cameraPreview.getAttribute("aria-expanded"), "false");
+ await cameraPreview.click();
+ assert.equal(await cameraPreview.getAttribute("aria-expanded"), "true");
+
+ // The preview selection is editor-local: the moved object stays as saved.
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor({ state: "detached" });
+ const final = await state();
+ assert.ok(
+ final.editorDocuments
+ .find((doc) => doc.kind === "director")
+ .data.objects.some((object) => object.id === movedId),
+ "the slider-moved object survives",
+ );
+ assert.deepEqual(errors, []);
+} catch (error) {
+ console.error((await page.locator("body").innerText()).slice(-2500));
+ throw error;
+} finally {
+ await browser.close();
+}
+console.log(
+ JSON.stringify({
+ passed: true,
+ projectId,
+ itemId,
+ checks: [
+ "first object add opens the console controls once",
+ "the top-bar shortcuts entry reopens the panel",
+ "Escape closes the help panel without closing the editor",
+ "transform sliders drive the exact inputs and persist",
+ "a tree row selects a camera and the inspector follows",
+ "a preset places a second camera and selects it",
+ "the camera preview shows the placed camera and collapses and expands in place",
+ "no page errors",
+ ],
+ }),
+);
diff --git a/tests/browser/director_stage_delivery.mjs b/tests/browser/director_stage_delivery.mjs
new file mode 100644
index 000000000..73bd6858d
--- /dev/null
+++ b/tests/browser/director_stage_delivery.mjs
@@ -0,0 +1,165 @@
+/** A stored editor delivery that the backend definitively refuses (422) must
+ * not replay forever: the Director Stage recovers on the next attempt. */
+import assert from "node:assert/strict";
+const { chromium } = await import(
+ process.env.PLAYWRIGHT_MODULE ?? "playwright-core"
+);
+
+const base = process.env.CREATION_WEB_URL ?? "http://127.0.0.1:5179";
+const api = process.env.CREATION_API_URL ?? "http://127.0.0.1:8019";
+const headers = {
+ "X-OpenDirector-Request": "1",
+ "Content-Type": "application/json",
+};
+async function call(path, body) {
+ const response = await fetch(api + path, {
+ headers,
+ ...(body ? { method: "POST", body: JSON.stringify(body) } : {}),
+ });
+ assert.ok(response.ok, `${response.status}: ${await response.clone().text()}`);
+ return response.json();
+}
+assert.equal((await call("/api/creation-test-health")).isolated, true);
+
+const projectId = crypto.randomUUID();
+await call(`/api/creation/projects/${projectId}/commands`, {
+ commandId: crypto.randomUUID(),
+ projectId,
+ type: "project.create",
+ payload: { name: `Stage delivery ${projectId.slice(0, 8)}` },
+});
+const state = () => call(`/api/creation/projects/${projectId}`);
+
+const browser = await chromium.launch({
+ headless: true,
+ ...(process.env.CHROMIUM_PATH ? { executablePath: process.env.CHROMIUM_PATH } : {}),
+ args: ["--no-sandbox", "--enable-unsafe-swiftshader"],
+});
+const page = await browser.newPage({
+ locale: "en-US",
+ viewport: { width: 1700, height: 1100 },
+});
+await page.addInitScript(() =>
+ localStorage.setItem("opendirector.modelSetup.v1", "dismissed"),
+);
+page.setDefaultTimeout(20000);
+const errors = [];
+page.on("pageerror", (error) => errors.push(error.message));
+
+const until = async (predicate, label) => {
+ const deadline = Date.now() + 20000;
+ let snapshot;
+ while (Date.now() < deadline) {
+ snapshot = await state();
+ if (predicate(snapshot)) return snapshot;
+ await page.waitForTimeout(100);
+ }
+ throw new Error(`Timeout: ${label}`);
+};
+
+try {
+ await page.goto(`${base}/ai-tool/ai-canvas/${projectId}?creation=unified`);
+ await page.getByText("Saved on this device", { exact: true }).waitFor();
+ await page.getByRole("button", { name: "Add Director Stage", exact: true }).click();
+ await page.getByRole("button", { name: "Apply edits", exact: true }).waitFor();
+ // Baseline save registers the editor document; the delivery key needs the item.
+ await page.getByRole("button", { name: "Apply edits", exact: true }).click();
+ const applied = await until(
+ (snapshot) => snapshot.editorDocuments.some((d) => d.kind === "director"),
+ "stage saved",
+ );
+ const itemId = applied.canvasItems.find((i) => i.kind === "external").id;
+ const documentId = applied.editorDocuments.find((d) => d.kind === "director").id;
+ await page.getByRole("button", { name: "Add Director Stage", exact: true }).waitFor();
+
+ // Poison the stored delivery the way a mid-transition failure leaves it: a
+ // prepared plan whose operations the backend now refuses at the HTTP
+ // boundary. A reload keeps the entry, exactly like a long-lived tab.
+ await page.evaluate(
+ ([projectId, itemId]) => {
+ sessionStorage.setItem(
+ `opendirector.editor.delivery:${projectId}:${itemId}`,
+ JSON.stringify({
+ id: crypto.randomUUID(),
+ key: JSON.stringify({ title: "Director Stage 1" }),
+ data: { title: "Director Stage 1" },
+ plan: {
+ operations: [
+ {
+ type: "editor.save",
+ payload: {
+ document: {
+ id: crypto.randomUUID(),
+ projectId,
+ kind: "director",
+ data: { legacyJunk: true },
+ },
+ },
+ },
+ ],
+ versions: [],
+ },
+ }),
+ );
+ },
+ [projectId, itemId],
+ );
+ await page.reload();
+ await page.getByText("Saved on this device", { exact: true }).waitFor();
+
+ await page.locator(`.react-flow__node[data-id="${itemId}"]`).click();
+ await page.getByRole("button", { name: "Open Director Stage", exact: true }).click();
+ await page.getByRole("button", { name: "Apply edits", exact: true }).waitFor();
+
+ // The refused delivery may cost one attempt — the reported error dialog —
+ // but never more: rendering must recover without discarding the edits.
+ const render = page.getByRole("button", { name: "Render preview MP4", exact: true });
+ await render.click();
+ const recovered = await page
+ .getByText("Preview MP4 complete · 1280×720 · 30 fps", { exact: true })
+ .waitFor({ timeout: 240000 })
+ .then(() => true, () => false);
+ if (!recovered) {
+ // The single refusal surfaced; the retry replans with current code.
+ await page.getByRole("alert").waitFor();
+ assert.equal(await render.isDisabled(), false, "editor stays operable");
+ await render.click();
+ await page
+ .getByText("Preview MP4 complete · 1280×720 · 30 fps", { exact: true })
+ .waitFor({ timeout: 240000 });
+ }
+
+ // Applying also recovers: the same stored delivery cannot block the commit.
+ await page.getByRole("button", { name: "Apply edits", exact: true }).click();
+ await page
+ .getByRole("button", { name: "Add Director Stage", exact: true })
+ .waitFor();
+ await until(
+ (snapshot) =>
+ snapshot.editorDocuments.some(
+ (d) => d.id === documentId && d.revision >= 2,
+ ),
+ "stage committed after recovery",
+ );
+
+ assert.deepEqual(errors, []);
+ console.log(
+ JSON.stringify({
+ passed: true,
+ projectId,
+ itemId,
+ documentId,
+ checks: [
+ "a refused stored delivery costs at most one attempt",
+ "the retry replans instead of replaying the refused operations",
+ "preview MP4 renders and apply recovers",
+ "no page errors",
+ ],
+ }),
+ );
+} catch (error) {
+ console.error((await page.locator("body").innerText()).slice(-2500));
+ throw error;
+} finally {
+ await browser.close();
+}
diff --git a/tests/browser/director_stage_entry.mjs b/tests/browser/director_stage_entry.mjs
new file mode 100644
index 000000000..2425f7a5c
--- /dev/null
+++ b/tests/browser/director_stage_entry.mjs
@@ -0,0 +1,938 @@
+/** Second-phase Director Stage acceptance: create, import GLB, edit, reopen, undo, and redo.
+ * DIRECTOR_STAGE_LOCALE runs the same flow in another UI language (default en-US). */
+import assert from "node:assert/strict";
+import { makeCorruptGlb, makeGlb } from "./director_stage_fixture.mjs";
+const { chromium } = await import(
+ process.env.PLAYWRIGHT_MODULE ?? "playwright-core"
+);
+
+const locale = process.env.DIRECTOR_STAGE_LOCALE ?? "en-US";
+const L = {
+ "en-US": {
+ saved: "Saved on this device",
+ addStage: "Add Director Stage",
+ apply: "Apply edits",
+ cameraName: "Camera name",
+ playhead: "Stage playhead",
+ timeline: "Director Stage timeline tracks",
+ previewMode: "Preview mode",
+ staticPreview: "Static",
+ dynamicPreview: "Dynamic",
+ positionX: "Position X",
+ recordKeyframe: "Record a keyframe here",
+ closeEditor: "Close editor",
+ transitionEditor: "Acceptance camera · Target interval transition editor",
+ transition: "Transition",
+ bezier: "Bezier",
+ controlX1: "Control point x1",
+ undo: "Undo",
+ redo: "Redo",
+ openStage: "Open Director Stage",
+ importAsset: "Import GLB / GLTF",
+ importJson: "Import stage JSON",
+ exportJson: "Export stage JSON",
+ background: "Background",
+ backgroundAsset: "Background image",
+ backgroundAll: "All",
+ backgroundPanoramic: "Panoramic background",
+ backgroundFlat: "Flat background",
+ backgroundAdd: "Add background",
+ backgroundCanvasImages: "Canvas images",
+ backgroundEmpty:
+ "No backgrounds yet. Upload an image or choose one from the canvas images.",
+ backgroundImported: "Added background “acceptance-background.png”",
+ environmentPreset: "Environment preset",
+ groundColor: "Ground color",
+ groundVisible: "Show ground",
+ exposure: "Exposure",
+ keyLight: "Key light",
+ keyIntensity: "Key light intensity",
+ noAnimationNote: "Character · Imported acceptance · no animation data",
+ corruptAssetNotice:
+ "Could not read “broken.glb”: the GLB header is valid but the embedded JSON is missing or corrupt.",
+ loadFailedNotice:
+ "Could not load “broken.glb”. The file may be corrupt or reference external resources.",
+ unsupportedAssetNotice:
+ "Only GLB and self-contained GLTF files are supported. FBX and external GLTF resources are not supported yet.",
+ exportUnsavedImportsNotice:
+ "The stage file cannot carry imported models that exist only in this browser: acceptance. Apply edits to save them to the project first.",
+ importForeignAssetsNotice:
+ "The stage file pins imported models that are not registered in this project: Foreign actor. Open the stage in its original project, or import the model files here first.",
+ },
+ "zh-CN": {
+ saved: "已保存到本机",
+ addStage: "添加导演台",
+ apply: "应用编辑",
+ cameraName: "机位名称",
+ playhead: "舞台播放位置",
+ timeline: "导演舞台时间线轨道",
+ previewMode: "预演模式",
+ staticPreview: "静态",
+ dynamicPreview: "动态",
+ positionX: "位置 X",
+ recordKeyframe: "在此记录关键帧",
+ closeEditor: "关闭编辑器",
+ transitionEditor: "Acceptance camera · 目标区间变化编辑器",
+ transition: "过渡",
+ bezier: "贝塞尔",
+ controlX1: "控制点 x1",
+ undo: "撤销",
+ redo: "重做",
+ openStage: "打开导演台",
+ importAsset: "导入 GLB / GLTF",
+ importJson: "导入舞台 JSON",
+ exportJson: "导出舞台 JSON",
+ background: "背景",
+ backgroundAsset: "背景图片",
+ backgroundAll: "全部",
+ backgroundPanoramic: "全景背景",
+ backgroundFlat: "平面背景",
+ backgroundAdd: "添加背景",
+ backgroundCanvasImages: "画布图片",
+ backgroundEmpty: "暂无背景。上传图片或从画布图片中选择。",
+ backgroundImported: "已添加背景「acceptance-background.png」",
+ environmentPreset: "环境预设",
+ groundColor: "地面颜色",
+ groundVisible: "显示地面",
+ exposure: "曝光",
+ keyLight: "主光",
+ keyIntensity: "主光强度",
+ noAnimationNote: "人物 · 已导入 acceptance · 无动画数据",
+ corruptAssetNotice:
+ "无法读取「broken.glb」:GLB 头有效,但内嵌 JSON 缺失或已损坏。",
+ loadFailedNotice:
+ "无法加载「broken.glb」。文件可能损坏,或引用了外部资源。",
+ unsupportedAssetNotice:
+ "目前仅支持 GLB 和自包含 GLTF;FBX 及外部 GLTF 资源暂不支持。",
+ exportUnsavedImportsNotice:
+ "舞台文件无法携带仅存在于当前浏览器的导入模型:acceptance。请先应用编辑,将其保存为工程素材。",
+ importForeignAssetsNotice:
+ "舞台文件引用了未在本工程登记的导入模型:Foreign actor。请在原工程中打开,或先在此工程导入对应模型文件。",
+ },
+}[locale];
+assert.ok(L, `Unsupported DIRECTOR_STAGE_LOCALE: ${locale}`);
+
+const base = process.env.CREATION_WEB_URL ?? "http://127.0.0.1:5179";
+const api = process.env.CREATION_API_URL ?? "http://127.0.0.1:8019";
+const headers = {
+ "X-OpenDirector-Request": "1",
+ "Content-Type": "application/json",
+};
+
+async function call(path, body) {
+ const response = await fetch(api + path, {
+ headers,
+ ...(body
+ ? { method: "POST", body: JSON.stringify(body) }
+ : {}),
+ });
+ assert.ok(response.ok, `${response.status}: ${await response.clone().text()}`);
+ return response.json();
+}
+
+assert.equal((await call("/api/creation-test-health")).isolated, true);
+
+const projectId = crypto.randomUUID();
+await call(`/api/creation/projects/${projectId}/commands`, {
+ commandId: crypto.randomUUID(),
+ projectId,
+ type: "project.create",
+ payload: { name: `Director Stage entry ${projectId.slice(0, 8)}` },
+});
+
+const state = () => call(`/api/creation/projects/${projectId}`);
+const browser = await chromium.launch({
+ headless: true,
+ ...(process.env.CHROMIUM_PATH
+ ? { executablePath: process.env.CHROMIUM_PATH }
+ : {}),
+ args: ["--no-sandbox", "--enable-unsafe-swiftshader"],
+});
+const page = await browser.newPage({
+ locale,
+ viewport: { width: 1700, height: 1100 },
+});
+await page.addInitScript((value) => {
+ localStorage.setItem("opendirector.modelSetup.v1", "dismissed");
+ localStorage.setItem("opendirector.locale.v1", value);
+}, locale);
+page.setDefaultTimeout(20000);
+const errors = [];
+page.on("pageerror", (error) => errors.push(error.message));
+
+const until = async (predicate, label) => {
+ const deadline = Date.now() + 20000;
+ let snapshot;
+ while (Date.now() < deadline) {
+ snapshot = await state();
+ if (predicate(snapshot)) return snapshot;
+ await page.waitForTimeout(100);
+ }
+ throw new Error(`Timeout: ${label}; snapshot: ${JSON.stringify(snapshot)}`);
+};
+
+const director = (snapshot, itemId) => {
+ const item = snapshot.canvasItems.find(
+ (candidate) =>
+ candidate.id === itemId ||
+ (itemId === undefined &&
+ candidate.visible &&
+ candidate.kind === "external"),
+ );
+ const document = item
+ ? snapshot.editorDocuments.find(
+ (candidate) => candidate.id === item.binding?.objectRef?.id,
+ )
+ : undefined;
+ return { item, document };
+};
+
+const keyframeCount = (document) =>
+ document.data.objects.reduce(
+ (count, object) => count + object.keyframes.length,
+ 0,
+ ) +
+ document.data.cameras.reduce(
+ (count, camera) => count + camera.keyframes.length,
+ 0,
+ );
+
+// A well-formed stage document pinning a model asset this project never
+// registered; import must refuse it by naming the object.
+const foreignStage = {
+ format: "opendirector-local-stage",
+ version: 2,
+ background: "#151923",
+ grid: true,
+ duration: 6,
+ aspectRatio: "16:9",
+ activeCameraId: "camera-1",
+ cameraSource: "camera",
+ shots: [],
+ cameras: [
+ {
+ id: "camera-1",
+ name: "Camera",
+ pose: {
+ position: { x: 5, y: 3.5, z: 7 },
+ target: { x: 0, y: 1, z: 0 },
+ fov: 45,
+ },
+ keyframes: [],
+ },
+ ],
+ objects: [
+ {
+ id: "foreign-actor",
+ kind: "gltf",
+ name: "Foreign actor",
+ color: "#b8c5ff",
+ role: "character",
+ format: "glb",
+ asset: {
+ assetId: crypto.randomUUID(),
+ revision: 1,
+ fingerprint: `sha256:${"c".repeat(64)}`,
+ kind: "file",
+ },
+ animationNames: ["Walk"],
+ hasAnimation: true,
+ position: { x: 0, y: 0, z: 0 },
+ rotation: { x: 0, y: 0, z: 0 },
+ scale: { x: 1, y: 1, z: 1 },
+ keyframes: [],
+ motionClips: [],
+ },
+ ],
+};
+
+try {
+ await page.goto(`${base}/ai-tool/ai-canvas/${projectId}?creation=unified`);
+ await page.getByText(L.saved, { exact: true }).waitFor();
+
+ const addStage = page.getByRole("button", {
+ name: L.addStage,
+ exact: true,
+ });
+ await addStage.waitFor();
+ assert.equal(await addStage.isEnabled(), true);
+ await addStage.click();
+
+ await page
+ .getByRole("button", { name: L.apply, exact: true })
+ .waitFor();
+ const created = await until((snapshot) => {
+ const result = director(snapshot);
+ return result.item?.kind === "external" && result.document?.kind === "director";
+ }, "created external item and director document");
+ const createdRefs = director(created);
+ assert.ok(createdRefs.item);
+ assert.ok(createdRefs.document);
+ assert.equal(createdRefs.item.binding.objectRef.kind, "director");
+ assert.equal(createdRefs.document.kind, "director");
+ const itemId = createdRefs.item.id;
+ const documentId = createdRefs.document.id;
+ // Stages start empty; the subject identity below comes from the imported
+ // model object later in this flow.
+ assert.equal(createdRefs.document.data.objects.length, 0);
+ assert.equal(keyframeCount(createdRefs.document), 0);
+
+ // Environment controls edit the persisted document through the same local
+ // history/apply path as camera and object edits.
+ await page.getByRole("tab", { name: L.background, exact: true }).click();
+ await page.getByRole("button", { name: L.backgroundAll, exact: true }).waitFor();
+ assert.equal(
+ await page.getByRole("button", { name: L.backgroundPanoramic, exact: true }).count(),
+ 1,
+ );
+ assert.equal(
+ await page.getByRole("button", { name: L.backgroundFlat, exact: true }).count(),
+ 1,
+ );
+ assert.equal(await page.getByText(L.backgroundCanvasImages, { exact: true }).count(), 1);
+ assert.equal(await page.getByText(L.backgroundEmpty, { exact: true }).count(), 1);
+ assert.equal(await page.getByLabel(L.backgroundAsset, { exact: true }).inputValue(), "");
+ await page.getByLabel(L.backgroundAdd, { exact: true }).setInputFiles({
+ name: "acceptance-background.png",
+ mimeType: "image/png",
+ buffer: Buffer.from(
+ "iVBORw0KGgoAAAANSUhEUgAAAAIAAAABCAIAAAB7QOjdAAAAD0lEQVR4nGPUCKhgYGAAAARuAPJNZv30AAAAAElFTkSuQmCC",
+ "base64",
+ ),
+ });
+ await page.getByText(L.backgroundImported, { exact: true }).waitFor();
+ const backgroundImported = await until(
+ (snapshot) => snapshot.assets.some(
+ (asset) => asset.name === "acceptance-background.png" && asset.kind === "image",
+ ),
+ "imported background image asset",
+ );
+ const backgroundAsset = backgroundImported.assets.find(
+ (asset) => asset.name === "acceptance-background.png" && asset.kind === "image",
+ );
+ assert.ok(backgroundAsset);
+ assert.equal(
+ await page.getByLabel(L.backgroundAsset, { exact: true }).inputValue(),
+ backgroundAsset.id,
+ );
+ await page.getByLabel(L.environmentPreset, { exact: true }).selectOption("moonlit");
+ assert.equal(await page.getByLabel(L.environmentPreset, { exact: true }).inputValue(), "moonlit");
+ assert.equal(await page.getByLabel(L.exposure, { exact: true }).inputValue(), "0.8");
+ await page.getByRole("button", { name: L.keyLight, exact: true }).click();
+ assert.equal(await page.getByLabel(L.keyIntensity, { exact: true }).inputValue(), "2.4");
+ await page.getByLabel(L.groundColor, { exact: true }).fill("#405060");
+ await page.getByLabel(L.groundVisible, { exact: true }).uncheck();
+ await page.getByLabel(L.exposure, { exact: true }).fill("2.25");
+ await page.getByLabel(L.keyIntensity, { exact: true }).fill("4.2");
+ await page.getByRole("button", { name: L.apply, exact: true }).click();
+ const environmentCommitted = await until((snapshot) => {
+ const result = director(snapshot, itemId);
+ return (
+ result.document?.data.environment?.groundColor === "#405060" &&
+ result.document.data.environment.groundVisible === false &&
+ result.document.data.environment.preset === "moonlit" &&
+ result.document.data.environment.exposure === 2.25 &&
+ result.document.data.lights.find((light) => light.id === "key")?.intensity === 4.2
+ );
+ }, "persisted ground and key light edits");
+ const savedEnvironment = director(environmentCommitted, itemId).document.data;
+ assert.equal(savedEnvironment.environment.groundColor, "#405060");
+ assert.equal(savedEnvironment.environment.groundVisible, false);
+ assert.equal(savedEnvironment.environment.exposure, 2.25);
+ assert.equal(savedEnvironment.environment.preset, "moonlit");
+ assert.equal(savedEnvironment.environment.backgroundAsset.assetId, backgroundAsset.id);
+ assert.equal(savedEnvironment.lights.find((light) => light.id === "key").intensity, 4.2);
+
+ await page.locator(`.react-flow__node[data-id="${itemId}"]`).click();
+ await page.getByRole("button", { name: L.openStage, exact: true }).click();
+ await page.getByRole("button", { name: L.apply, exact: true }).waitFor();
+ await page.getByRole("tab", { name: L.background, exact: true }).click();
+ assert.equal(await page.getByLabel(L.groundColor, { exact: true }).inputValue(), "#405060");
+ assert.equal(await page.getByLabel(L.groundVisible, { exact: true }).isChecked(), false);
+ assert.equal(await page.getByLabel(L.exposure, { exact: true }).inputValue(), "2.25");
+ assert.equal(
+ await page.getByLabel(L.backgroundAsset, { exact: true }).inputValue(),
+ backgroundAsset.id,
+ );
+ await page.getByRole("button", { name: L.keyLight, exact: true }).click();
+ assert.equal(await page.getByLabel(L.keyIntensity, { exact: true }).inputValue(), "4.2");
+
+ // Corrupt GLB JSON, plain non-GLB bytes, external GLTF, and GLB with
+ // external references are rejected with localized notices before anything
+ // reaches the project.
+ await page
+ .locator('input[type="file"][accept*=".glb"]')
+ .setInputFiles({
+ name: "broken.glb",
+ mimeType: "model/gltf-binary",
+ buffer: makeCorruptGlb(),
+ });
+ await page.getByText(L.corruptAssetNotice, { exact: true }).waitFor();
+ await page
+ .locator('input[type="file"][accept*=".glb"]')
+ .setInputFiles({
+ name: "broken.glb",
+ mimeType: "model/gltf-binary",
+ buffer: Buffer.from("not a glb at all"),
+ });
+ await page.getByText(L.loadFailedNotice, { exact: true }).waitFor();
+ await page
+ .locator('input[type="file"][accept*=".glb"]')
+ .setInputFiles({
+ name: "external.gltf",
+ mimeType: "model/gltf+json",
+ buffer: Buffer.from(
+ JSON.stringify({
+ asset: { version: "2.0" },
+ buffers: [{ uri: "scene.bin", byteLength: 4 }],
+ }),
+ ),
+ });
+ await page.getByText(L.unsupportedAssetNotice, { exact: true }).waitFor();
+ await page
+ .locator('input[type="file"][accept*=".glb"]')
+ .setInputFiles({
+ name: "external.glb",
+ mimeType: "model/gltf-binary",
+ buffer: makeGlb({ images: [{ uri: "texture.png" }] }),
+ });
+ await page.getByText(L.unsupportedAssetNotice, { exact: true }).waitFor();
+ await page
+ .locator('input[type="file"][accept*=".glb"]')
+ .setInputFiles({
+ name: "acceptance.glb",
+ mimeType: "model/gltf-binary",
+ buffer: makeGlb(),
+ });
+ await page
+ .locator(".cw-stage-right-tree")
+ .getByRole("button", { name: "acceptance", exact: true })
+ .waitFor();
+ await page.getByText(L.noAnimationNote, { exact: true }).waitFor();
+
+ // The export carries no model bytes, so it must name imports that exist
+ // only as browser URLs instead of writing unopenable objects.
+ await page
+ .getByRole("button", { name: L.exportJson, exact: true })
+ .click();
+ await page
+ .getByText(L.exportUnsavedImportsNotice, { exact: true })
+ .waitFor();
+ // Stage JSON imports reject objects pinning assets this project never
+ // registered, keeping the in-progress stage untouched.
+ await page
+ .locator('input[type="file"][accept^="application/json"]')
+ .setInputFiles({
+ name: "foreign.stage.json",
+ mimeType: "application/json",
+ buffer: Buffer.from(JSON.stringify(foreignStage)),
+ });
+ await page
+ .getByText(L.importForeignAssetsNotice, { exact: true })
+ .waitFor();
+ await page
+ .locator(".cw-stage-right-tree")
+ .getByRole("button", { name: "acceptance", exact: true })
+ .waitFor();
+
+ const previewMode = page.getByRole("group", { name: L.previewMode, exact: true });
+ await previewMode.getByRole("button", { name: L.staticPreview, exact: true }).waitFor();
+ assert.equal(
+ await previewMode.getByRole("button", { name: L.staticPreview, exact: true }).getAttribute("aria-pressed"),
+ "true",
+ );
+ const timeline = page.getByTestId("director-stage-timeline");
+ assert.equal(await timeline.count(), 0);
+ await previewMode.getByRole("button", { name: L.dynamicPreview, exact: true }).click();
+ await timeline.waitFor();
+ assert.equal(await timeline.getAttribute("aria-label"), L.timeline);
+ // The imported model is the stage's only subject; its identity drives the
+ // object-track and undo checks below.
+ const importedGroupRow = timeline.locator(
+ '.cw-stage-track-group-row[data-track-group-kind="object"]',
+ );
+ await importedGroupRow.waitFor();
+ const objectId = await importedGroupRow.getAttribute("data-source-id");
+ assert.ok(objectId, "the imported model object owns an object track group");
+ assert.equal(
+ await page.locator('[data-testid="director-stage-active-state"]').count(),
+ 0,
+ );
+ assert.equal(await page.locator(".cw-stage-keyframe-editor").count(), 0);
+ assert.equal(await page.locator(".cw-stage-storyboard").count(), 0);
+ const ruler = timeline.locator(".cw-stage-track-ruler");
+ const majorTicks = ruler.locator('[data-tick-kind="major"]');
+ const minorTicks = ruler.locator('[data-tick-kind="minor"]');
+ assert.ok((await majorTicks.count()) >= 2);
+ assert.ok((await minorTicks.count()) > (await majorTicks.count()));
+ assert.equal(
+ await ruler.locator(".cw-stage-track-ruler-label").count(),
+ await majorTicks.count(),
+ );
+ const rulerLane = timeline.locator(".cw-stage-track-lane").first();
+ const rulerLaneBox = await rulerLane.boundingBox();
+ const firstMajorBox = await majorTicks.first().boundingBox();
+ const lastMajorBox = await majorTicks.last().boundingBox();
+ const rulerCaptionBox = await ruler.locator(".cw-stage-track-ruler-caption").boundingBox();
+ const firstLabelBox = await majorTicks
+ .first()
+ .locator(".cw-stage-track-ruler-label")
+ .boundingBox();
+ const lastLabelBox = await majorTicks
+ .last()
+ .locator(".cw-stage-track-ruler-label")
+ .boundingBox();
+ assert.ok(
+ rulerLaneBox &&
+ firstMajorBox &&
+ lastMajorBox &&
+ rulerCaptionBox &&
+ firstLabelBox &&
+ lastLabelBox,
+ );
+ assert.ok(Math.abs(firstMajorBox.x - rulerLaneBox.x) <= 1);
+ assert.ok(Math.abs(lastMajorBox.x - rulerLaneBox.x - rulerLaneBox.width) <= 1);
+ assert.ok(
+ Math.abs(firstLabelBox.y - rulerCaptionBox.y) < 0.5,
+ "the first time value shares the current-time row",
+ );
+ assert.ok(
+ Math.abs(lastLabelBox.y - rulerCaptionBox.y) < 0.5,
+ "the last time value shares the current-time row",
+ );
+ const majorGridLines = timeline.locator('[data-grid-kind="major"]');
+ const minorGridLines = timeline.locator('[data-grid-kind="minor"]');
+ assert.equal(await majorGridLines.count(), await majorTicks.count());
+ assert.equal(await minorGridLines.count(), await minorTicks.count());
+ const firstGridBox = await majorGridLines.first().boundingBox();
+ const lastGridBox = await majorGridLines.last().boundingBox();
+ assert.ok(firstGridBox && lastGridBox);
+ assert.ok(Math.abs(firstGridBox.x - rulerLaneBox.x) <= 1);
+ assert.ok(Math.abs(lastGridBox.x - rulerLaneBox.x - rulerLaneBox.width) <= 1);
+ const objectGroup = timeline.locator(
+ `.cw-stage-track-group-row[data-track-group-kind="object"][data-source-id="${objectId}"]`,
+ );
+ await objectGroup.waitFor();
+ assert.equal(await objectGroup.locator(".cw-stage-track-group-label").count(), 1);
+ assert.ok(
+ (await objectGroup.locator(".cw-stage-track-group-label").innerText()).length > 0,
+ "dynamic timeline names the current scene object",
+ );
+ const objectTracks = timeline.locator(
+ `.cw-stage-track-row[data-source-id="${objectId}"]`,
+ );
+ const objectGroupToggle = objectGroup.getByRole("button");
+ const timelineChevron = objectGroup.locator(".cw-stage-track-group-chevron");
+ const treeChevron = page.locator(".cw-stage-tree-chevron").first();
+ for (const chevron of [timelineChevron, treeChevron]) {
+ await chevron.waitFor();
+ const style = await chevron.evaluate((element) => {
+ const pseudo = getComputedStyle(element, "::before");
+ return {
+ borderRightWidth: pseudo.borderRightWidth,
+ borderBottomWidth: pseudo.borderBottomWidth,
+ };
+ });
+ assert.notEqual(style.borderRightWidth, "0px");
+ assert.notEqual(style.borderBottomWidth, "0px");
+ }
+ assert.equal(await objectGroupToggle.getAttribute("aria-expanded"), "true");
+ assert.equal(await objectTracks.count(), 4);
+ const expandedTimelineBox = await timeline.boundingBox();
+ assert.ok(expandedTimelineBox);
+ await objectGroupToggle.click();
+ assert.equal(await objectGroupToggle.getAttribute("aria-expanded"), "false");
+ assert.equal(await objectTracks.count(), 0);
+ const collapsedTimelineBox = await timeline.boundingBox();
+ assert.ok(collapsedTimelineBox);
+ assert.ok(
+ collapsedTimelineBox.height < expandedTimelineBox.height,
+ "collapsing an object group shrinks the track area",
+ );
+ await objectGroupToggle.click();
+ assert.equal(await objectGroupToggle.getAttribute("aria-expanded"), "true");
+ assert.equal(await objectTracks.count(), 4);
+ const restoredTimelineBox = await timeline.boundingBox();
+ assert.ok(restoredTimelineBox);
+ assert.ok(
+ Math.abs(restoredTimelineBox.height - expandedTimelineBox.height) <= 1,
+ "expanding an object group restores the track area height",
+ );
+
+ const inspector = page.locator(".cw-stage-inspector");
+ await page
+ .locator(".cw-stage-right-tree")
+ .getByRole("button", { name: "acceptance", exact: true })
+ .click();
+ assert.equal(await inspector.getByLabel(L.cameraName, { exact: true }).count(), 0);
+ const cameraTreeItem = page
+ .locator(".cw-stage-right-tree [role=group]")
+ .last()
+ .locator('[role="treeitem"] button')
+ .first();
+ await cameraTreeItem.click();
+ await page.getByLabel(L.cameraName, { exact: true }).waitFor();
+
+ await page.getByLabel(L.cameraName, { exact: true }).fill("Acceptance camera");
+ await page.getByRole("slider", { name: L.playhead, exact: true }).fill("5");
+ const cameraTargetTrack = timeline.locator(
+ '.cw-stage-track-row[data-track-kind="camera-channel"]',
+ ).nth(1);
+ const cameraTargetAdd = cameraTargetTrack.locator(".cw-stage-track-add");
+ const cameraTargetGlyph = cameraTargetAdd.locator(".cw-stage-track-add-glyph");
+ assert.equal(await cameraTargetAdd.getAttribute("aria-pressed"), "false");
+ assert.equal(
+ await cameraTargetGlyph.evaluate((element) => getComputedStyle(element).backgroundColor),
+ await cameraTargetTrack.locator(".cw-stage-track-label").evaluate(
+ (element) => getComputedStyle(element).backgroundColor,
+ ),
+ );
+ const addBox = await cameraTargetAdd.boundingBox();
+ const glyphBox = await cameraTargetGlyph.boundingBox();
+ assert.ok(addBox);
+ assert.ok(glyphBox);
+ assert.equal(addBox.width, 18);
+ assert.equal(addBox.height, 18);
+ assert.ok(
+ Math.abs(addBox.x + addBox.width / 2 - glyphBox.x - glyphBox.width / 2) <= 0.5,
+ "keyframe diamond is horizontally centered in its button",
+ );
+ assert.ok(
+ Math.abs(addBox.y + addBox.height / 2 - glyphBox.y - glyphBox.height / 2) <= 0.5,
+ "keyframe diamond is vertically centered in its button",
+ );
+ assert.equal(
+ await cameraTargetAdd.evaluate((element) => getComputedStyle(element).backgroundColor),
+ "rgba(0, 0, 0, 0)",
+ );
+ await cameraTargetAdd.hover();
+ await page.waitForTimeout(180);
+ assert.equal(
+ await cameraTargetAdd.evaluate((element) => getComputedStyle(element).backgroundColor),
+ "rgb(48, 48, 48)",
+ );
+ assert.equal(
+ await timeline.getByTestId("director-stage-ruler-playhead").evaluate(
+ (element) => getComputedStyle(element).cursor,
+ ),
+ "ew-resize",
+ );
+ assert.equal(
+ await cameraTargetTrack.locator(".cw-stage-track-label").evaluate(
+ (element) => getComputedStyle(element, "::before").display,
+ ),
+ "none",
+ );
+ const rulerPlayhead = timeline.getByTestId("director-stage-ruler-playhead");
+ assert.equal(await rulerPlayhead.evaluate((element) => element.tagName), "SPAN");
+ assert.equal(
+ await timeline.locator(".cw-stage-track-playhead").evaluate(
+ (element) => getComputedStyle(element).width,
+ ),
+ "2px",
+ );
+ const rulerPlayheadBox = await rulerPlayhead.boundingBox();
+ const rulerScaleBox = await timeline.locator(".cw-stage-track-ruler-scale").boundingBox();
+ assert.ok(rulerPlayheadBox);
+ assert.ok(rulerScaleBox);
+ await page.mouse.move(
+ rulerPlayheadBox.x + rulerPlayheadBox.width / 2,
+ rulerPlayheadBox.y + rulerPlayheadBox.height / 2,
+ );
+ await page.mouse.down();
+ await page.mouse.move(
+ rulerScaleBox.x + rulerScaleBox.width / 2,
+ rulerPlayheadBox.y + rulerPlayheadBox.height / 2,
+ { steps: 3 },
+ );
+ await page.mouse.up();
+ assert.equal(
+ await page.getByRole("slider", { name: L.playhead, exact: true }).inputValue(),
+ "3",
+ );
+ await page.getByRole("slider", { name: L.playhead, exact: true }).fill("5");
+ await cameraTargetAdd.click();
+ assert.equal(await cameraTargetAdd.getAttribute("aria-pressed"), "true");
+ assert.equal(
+ await cameraTargetGlyph.evaluate((element) => getComputedStyle(element).backgroundColor),
+ "rgb(217, 217, 217)",
+ );
+ await cameraTargetTrack.getByRole("button", {
+ name: /Acceptance camera.*Target.*5\.00 seconds|Acceptance camera.*目标.*5\.00 秒/,
+ }).waitFor();
+ await page.getByRole("slider", { name: L.playhead, exact: true }).fill("3");
+ assert.equal(await cameraTargetAdd.getAttribute("aria-pressed"), "false");
+ await cameraTargetAdd.click();
+ assert.equal(await cameraTargetAdd.getAttribute("aria-pressed"), "true");
+ const cameraTargetIntervals = cameraTargetTrack.locator(
+ '[data-testid="director-stage-track-interval"]',
+ );
+ await cameraTargetIntervals.first().waitFor();
+ assert.equal(await cameraTargetIntervals.count(), 1);
+ const cameraTargetInterval = cameraTargetIntervals.first();
+ const intervalBox = await cameraTargetInterval.boundingBox();
+ assert.ok(intervalBox);
+ assert.ok(intervalBox.width > 0, "keyframe interval is visible");
+ assert.ok(
+ Math.abs(
+ Number.parseFloat(
+ await cameraTargetInterval.evaluate((element) => getComputedStyle(element).height),
+ ) - 3,
+ ) <= 0.1,
+ "keyframe interval is three pixels thick",
+ );
+ assert.ok(
+ Math.abs(
+ Number.parseFloat(
+ await cameraTargetInterval.evaluate((element) => getComputedStyle(element).top),
+ ) - 8,
+ ) <= 0.1,
+ "keyframe interval is centered in its track",
+ );
+ assert.equal(await cameraTargetInterval.evaluate((element) => element.tagName), "BUTTON");
+ assert.equal(await cameraTargetInterval.getAttribute("aria-pressed"), "false");
+ await cameraTargetInterval.click();
+ assert.equal(await cameraTargetInterval.getAttribute("aria-pressed"), "true");
+ await page.waitForTimeout(180);
+ assert.equal(
+ await cameraTargetInterval.evaluate((element) => getComputedStyle(element).backgroundColor),
+ "rgb(217, 217, 217)",
+ );
+ const transitionEditor = page.getByRole("dialog", {
+ name: L.transitionEditor,
+ exact: true,
+ });
+ await transitionEditor.waitFor();
+ const transitionEditorBox = await transitionEditor.boundingBox();
+ assert.ok(transitionEditorBox);
+ assert.ok(
+ transitionEditorBox.y + transitionEditorBox.height < intervalBox.y,
+ "transition editor is anchored above its selected interval",
+ );
+ assert.equal(
+ await transitionEditor.evaluate((element) => getComputedStyle(element).backgroundColor),
+ "rgb(41, 41, 41)",
+ );
+ const transitionSelect = transitionEditor.getByLabel(L.transition, { exact: true });
+ assert.equal(await transitionSelect.inputValue(), "linear");
+ const linearPath = await transitionEditor.locator(".cw-stage-transition-curve").getAttribute("d");
+ await transitionSelect.selectOption("bezier");
+ assert.equal(await transitionSelect.inputValue(), "bezier");
+ await transitionEditor.getByLabel(L.controlX1, { exact: true }).fill("0.8");
+ assert.equal(await transitionEditor.getByLabel(L.controlX1, { exact: true }).inputValue(), "0.8");
+ assert.notEqual(
+ await transitionEditor.locator(".cw-stage-transition-curve").getAttribute("d"),
+ linearPath,
+ );
+ assert.equal(await cameraTargetInterval.locator(".cw-stage-track-interval-curve").count(), 1);
+ if (process.env.DIRECTOR_STAGE_SCREENSHOT) {
+ await page.screenshot({ path: process.env.DIRECTOR_STAGE_SCREENSHOT });
+ }
+ await page.getByRole("slider", { name: L.playhead, exact: true }).fill("5");
+ assert.equal(await cameraTargetAdd.getAttribute("aria-pressed"), "true");
+ await page
+ .getByRole("slider", { name: L.playhead, exact: true })
+ .press("Home");
+ await page.getByRole("slider", { name: L.playhead, exact: true }).fill("1");
+ const heldTime = await page.getByRole("slider", { name: L.playhead, exact: true }).inputValue();
+ await previewMode.getByRole("button", { name: L.dynamicPreview, exact: true }).click();
+ await new Promise((resolve) => setTimeout(resolve, 350));
+ assert.equal(
+ await page.getByRole("slider", { name: L.playhead, exact: true }).inputValue(),
+ heldTime,
+ "switching to dynamic mode must not start playback",
+ );
+ await previewMode.getByRole("button", { name: L.staticPreview, exact: true }).click();
+ assert.equal(await timeline.count(), 0);
+ await new Promise((resolve) => setTimeout(resolve, 100));
+ assert.equal(await timeline.count(), 0);
+ await previewMode.getByRole("button", { name: L.dynamicPreview, exact: true }).click();
+ await timeline.waitFor();
+ await page
+ .getByRole("slider", { name: L.playhead, exact: true })
+ .press("End");
+ await page
+ .locator(".cw-stage-right-tree")
+ .getByRole("button", { name: "acceptance", exact: true })
+ .click();
+ await page.getByLabel(L.positionX, { exact: true }).fill("2");
+ await page
+ .getByRole("button", { name: L.recordKeyframe, exact: true })
+ .click();
+ const positionPoint = timeline.getByRole("button", {
+ name: /Acceptance camera.*Position.*6\.00 seconds|Acceptance camera.*位置.*6\.00 秒/,
+ });
+ await positionPoint.waitFor();
+ await page.getByRole("button", { name: L.apply, exact: true }).click();
+
+ const committed = await until((snapshot) => {
+ const result = director(snapshot, itemId);
+ return (
+ result.item?.id === itemId &&
+ result.document?.id === documentId &&
+ result.document.data.cameras[0].name === "Acceptance camera" &&
+ keyframeCount(result.document) >= 2 &&
+ result.document.data.cameras[0].channels.position.some((frame) => frame.time === 6) &&
+ result.document.data.cameras[0].channels.target.some((frame) => frame.time === 6) &&
+ result.document.data.cameras[0].channels.target.some(
+ (frame) => frame.time === 3 && frame.transition?.kind === "bezier" &&
+ frame.transition.controlPoints[0] === 0.8,
+ )
+ );
+ }, "edited director document with keyframes");
+ const committedRefs = director(committed, itemId);
+ assert.equal(committedRefs.document.data.objects[0].id, objectId);
+ const imported = committedRefs.document.data.objects.find(
+ (object) => object.kind === "gltf",
+ );
+ assert.ok(imported);
+ assert.equal(imported.role, "character");
+ assert.equal(imported.format, "glb");
+ assert.equal(imported.asset.kind, "file");
+ assert.ok(
+ committed.assets.some((asset) => asset.id === imported.asset.assetId),
+ );
+ const importedObjectId = imported.id;
+ const importedAssetId = imported.asset.assetId;
+ assert.ok(
+ committedRefs.document.data.objects[0].keyframes.some(
+ (frame) => frame.time === 6,
+ ),
+ );
+ assert.ok(
+ committedRefs.document.data.cameras[0].keyframes.some(
+ (frame) => frame.time === 6,
+ ),
+ );
+
+ // Applying saves and closes the stage editor in one step.
+ // The toolbar undo carries an aria-label; the stage modal's undo is plain text.
+ const undo = page
+ .locator(".cw-undo-controls")
+ .getByRole("button", { name: L.undo, exact: true });
+ await undo.waitFor();
+ assert.equal(await undo.isEnabled(), true);
+ await undo.click();
+ const undone = await until((snapshot) => {
+ const result = director(snapshot, itemId);
+ return (
+ result.item?.id === itemId &&
+ result.document?.id === documentId &&
+ result.document.data.cameras[0].name !== "Acceptance camera" &&
+ keyframeCount(result.document) === 0
+ );
+ }, "undo restores the original director document without changing identity");
+ assert.equal(
+ director(undone, itemId).document.data.objects.length,
+ 0,
+ "undo restores the stage before the model draft was applied",
+ );
+ assert.equal(
+ director(undone, itemId).document.data.objects.some(
+ (object) => object.id === importedObjectId,
+ ),
+ false,
+ );
+
+ const redo = page.getByLabel(L.redo, { exact: true });
+ const redoDeadline = Date.now() + 20000;
+ while (!(await redo.isEnabled())) {
+ if (Date.now() > redoDeadline) throw new Error("redo never became enabled");
+ await page.waitForTimeout(100);
+ }
+ await redo.click();
+ const redone = await until((snapshot) => {
+ const result = director(snapshot, itemId);
+ return (
+ result.item?.id === itemId &&
+ result.document?.id === documentId &&
+ result.document.data.cameras[0].name === "Acceptance camera" &&
+ keyframeCount(result.document) >= 2
+ );
+ }, "redo restores the edited director document without changing identity");
+ assert.equal(director(redone, itemId).document.data.objects[0].id, objectId);
+ const redoneImported = director(redone, itemId).document.data.objects.find(
+ (object) => object.id === importedObjectId,
+ );
+ assert.equal(redoneImported.asset.assetId, importedAssetId);
+
+ await page.locator(`.react-flow__node[data-id="${itemId}"]`).click();
+ await page
+ .getByRole("button", { name: L.openStage, exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: L.apply, exact: true })
+ .waitFor();
+ await page
+ .locator(".cw-stage-right-tree [role=group]")
+ .last()
+ .locator('[role="treeitem"] button')
+ .first()
+ .click();
+ assert.equal(
+ await page.getByLabel(L.cameraName, { exact: true }).inputValue(),
+ "Acceptance camera",
+ );
+ await page
+ .locator(".cw-stage-left")
+ .getByRole("button", { name: "acceptance", exact: true })
+ .waitFor();
+ await previewMode.getByRole("button", { name: L.dynamicPreview, exact: true }).click();
+ await timeline.waitFor();
+ const reopenedTargetTrack = timeline.locator(
+ '.cw-stage-track-row[data-track-kind="camera-channel"]',
+ ).nth(1);
+ await reopenedTargetTrack.locator('[data-testid="director-stage-track-interval"]').first().click();
+ const reopenedTransitionEditor = page.getByRole("dialog", {
+ name: L.transitionEditor,
+ exact: true,
+ });
+ await reopenedTransitionEditor.waitFor();
+ assert.equal(
+ await reopenedTransitionEditor.getByLabel(L.transition, { exact: true }).inputValue(),
+ "bezier",
+ );
+ assert.equal(
+ await reopenedTransitionEditor.getByLabel(L.controlX1, { exact: true }).inputValue(),
+ "0.8",
+ );
+ await reopenedTargetTrack.locator(".cw-stage-track-point").first().waitFor();
+ assert.deepEqual(director(await state(), itemId).document, director(redone, itemId).document);
+ await page
+ .getByRole("button", { name: L.closeEditor, exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: L.apply, exact: true })
+ .waitFor({ state: "detached" });
+ assert.deepEqual(errors, []);
+ console.log(
+ JSON.stringify({
+ passed: true,
+ projectId,
+ itemId,
+ documentId,
+ objectId,
+ checks: [
+ "shared creation toolbar entry",
+ "automatic editor opening",
+ "external node projects to director document",
+ "corrupt GLB JSON is reported as corruption, not a load failure",
+ "GLB import previews before save and registers a file asset",
+ "stage JSON export names imports that are not saved yet",
+ "stage JSON import rejects foreign pinned assets",
+ "imported asset identity survives undo, redo, and reopen",
+ "keyframes persist and reopen",
+ "timeline tracks are visible, localized, and locate the playhead",
+ "interval transition curves persist and reopen",
+ "undo preserves node and document identities",
+ "redo restores the edited document and keyframes",
+ "no page errors",
+ ],
+ }),
+ );
+} catch (error) {
+ console.error((await page.locator("body").innerText()).slice(-2500));
+ throw error;
+} finally {
+ await browser.close();
+}
diff --git a/tests/browser/director_stage_fixture.mjs b/tests/browser/director_stage_fixture.mjs
new file mode 100644
index 000000000..17b507d4f
--- /dev/null
+++ b/tests/browser/director_stage_fixture.mjs
@@ -0,0 +1,274 @@
+/** GLB and image fixtures for Director Stage browser checks. */
+import { execFileSync } from "node:child_process";
+import { Buffer } from "node:buffer";
+import { fileURLToPath } from "node:url";
+import { writeFileSync } from "node:fs";
+import { deflateSync } from "node:zlib";
+
+function baseDocument() {
+ return {
+ asset: { version: "2.0" },
+ scene: 0,
+ scenes: [{ nodes: [0] }],
+ nodes: [{ mesh: 0 }],
+ meshes: [
+ {
+ primitives: [
+ {
+ attributes: { POSITION: 0 },
+ indices: 1,
+ },
+ ],
+ },
+ ],
+ buffers: [{ byteLength: 42 }],
+ bufferViews: [
+ { buffer: 0, byteOffset: 0, byteLength: 36 },
+ { buffer: 0, byteOffset: 36, byteLength: 6 },
+ ],
+ accessors: [
+ {
+ bufferView: 0,
+ componentType: 5126,
+ count: 3,
+ type: "VEC3",
+ min: [0, 0, 0],
+ max: [1, 1, 0],
+ },
+ { bufferView: 1, componentType: 5123, count: 3, type: "SCALAR" },
+ ],
+ };
+}
+
+function baseBinary() {
+ const binary = Buffer.alloc(44);
+ binary.writeFloatLE(0, 0);
+ binary.writeFloatLE(0, 4);
+ binary.writeFloatLE(0, 8);
+ binary.writeFloatLE(1, 12);
+ binary.writeFloatLE(0, 16);
+ binary.writeFloatLE(0, 20);
+ binary.writeFloatLE(0, 24);
+ binary.writeFloatLE(1, 28);
+ binary.writeFloatLE(0, 32);
+ binary.writeUInt16LE(0, 36);
+ binary.writeUInt16LE(1, 38);
+ binary.writeUInt16LE(2, 40);
+ return binary;
+}
+
+const chunk = (type, data) => {
+ const header = Buffer.alloc(8);
+ header.writeUInt32LE(data.length, 0);
+ header.writeUInt32LE(type, 4);
+ return Buffer.concat([header, data]);
+};
+
+function glbOf(document, binary) {
+ const json = Buffer.from(JSON.stringify(document));
+ const jsonChunk = Buffer.concat([
+ json,
+ Buffer.alloc((4 - (json.length % 4)) % 4, 0x20),
+ ]);
+ const body = Buffer.concat([
+ chunk(0x4e4f534a, jsonChunk),
+ chunk(0x004e4942, binary),
+ ]);
+ const header = Buffer.alloc(12);
+ header.writeUInt32LE(0x46546c67, 0);
+ header.writeUInt32LE(2, 4);
+ header.writeUInt32LE(12 + body.length, 8);
+ return Buffer.concat([header, body]);
+}
+
+export function makeGlb(overrides = {}) {
+ return glbOf({ ...baseDocument(), ...overrides }, baseBinary());
+}
+
+/** A valid GLB container whose embedded JSON chunk cannot be parsed; the
+ * browser probe must report corruption instead of external resources. */
+export function makeCorruptGlb() {
+ const json = Buffer.from("not json at all");
+ const jsonChunk = Buffer.concat([
+ json,
+ Buffer.alloc((4 - (json.length % 4)) % 4, 0x20),
+ ]);
+ const body = chunk(0x4e4f534a, jsonChunk);
+ const header = Buffer.alloc(12);
+ header.writeUInt32LE(0x46546c67, 0);
+ header.writeUInt32LE(2, 4);
+ header.writeUInt32LE(12 + body.length, 8);
+ return Buffer.concat([header, body]);
+}
+
+/** A one-triangle GLB whose "Walk" clip rotates the node 90 degrees in one second. */
+export function makeAnimatedGlb() {
+ const base = baseDocument();
+ const document = {
+ ...base,
+ buffers: [{ byteLength: 84 }],
+ bufferViews: [
+ ...base.bufferViews,
+ { buffer: 0, byteOffset: 44, byteLength: 8 },
+ { buffer: 0, byteOffset: 52, byteLength: 32 },
+ ],
+ accessors: [
+ ...base.accessors,
+ {
+ bufferView: 2,
+ componentType: 5126,
+ count: 2,
+ type: "SCALAR",
+ min: [0],
+ max: [1],
+ },
+ { bufferView: 3, componentType: 5126, count: 2, type: "VEC4" },
+ ],
+ animations: [
+ {
+ name: "Walk",
+ channels: [{ sampler: 0, target: { node: 0, path: "rotation" } }],
+ samplers: [{ input: 2, output: 3, interpolation: "LINEAR" }],
+ },
+ ],
+ };
+ const binary = Buffer.alloc(84);
+ baseBinary().copy(binary, 0);
+ binary.writeFloatLE(0, 44);
+ binary.writeFloatLE(1, 48);
+ const half = Math.SQRT1_2;
+ binary.writeFloatLE(0, 52);
+ binary.writeFloatLE(0, 56);
+ binary.writeFloatLE(0, 60);
+ binary.writeFloatLE(1, 64);
+ binary.writeFloatLE(0, 68);
+ binary.writeFloatLE(0, 72);
+ binary.writeFloatLE(half, 76);
+ binary.writeFloatLE(half, 80);
+ return glbOf(document, binary);
+}
+
+/** A GLB whose one mesh is a square of `size` units to a side, centred where the
+ * object stands and facing +Z, in a plain diffuse colour given as linear red, green
+ * and blue. It is lit from both sides, so a camera on its +Z side sees it as that
+ * colour, and how much of the picture it fills is set by `size` alone. */
+export function makePanelGlb(size = 3, colour = [0.8, 0.05, 0.05]) {
+ const half = size / 2;
+ const positions = [-half, -half, 0, half, -half, 0, half, half, 0, -half, half, 0];
+ // Four vertices at three floats, four normals at three floats, six corners.
+ const [positionsAt, normalsAt, indicesAt] = [0, 48, 96];
+ const binary = Buffer.alloc(indicesAt + 12);
+ positions.forEach((value, index) => binary.writeFloatLE(value, positionsAt + index * 4));
+ for (let vertex = 0; vertex < 4; vertex += 1)
+ binary.writeFloatLE(1, normalsAt + vertex * 12 + 8);
+ [0, 1, 2, 0, 2, 3].forEach((vertex, index) =>
+ binary.writeUInt16LE(vertex, indicesAt + index * 2),
+ );
+ return glbOf(
+ {
+ ...baseDocument(),
+ buffers: [{ byteLength: binary.length }],
+ bufferViews: [
+ { buffer: 0, byteOffset: positionsAt, byteLength: 48, target: 34962 },
+ { buffer: 0, byteOffset: normalsAt, byteLength: 48, target: 34962 },
+ { buffer: 0, byteOffset: indicesAt, byteLength: 12, target: 34963 },
+ ],
+ accessors: [
+ {
+ bufferView: 0,
+ componentType: 5126,
+ count: 4,
+ type: "VEC3",
+ min: [-half, -half, 0],
+ max: [half, half, 0],
+ },
+ { bufferView: 1, componentType: 5126, count: 4, type: "VEC3" },
+ { bufferView: 2, componentType: 5123, count: 6, type: "SCALAR" },
+ ],
+ materials: [
+ {
+ pbrMetallicRoughness: {
+ baseColorFactor: [...colour, 1],
+ metallicFactor: 0,
+ roughnessFactor: 1,
+ },
+ doubleSided: true,
+ },
+ ],
+ meshes: [
+ {
+ primitives: [
+ { attributes: { POSITION: 0, NORMAL: 1 }, indices: 2, material: 0 },
+ ],
+ },
+ ],
+ },
+ binary,
+ );
+}
+
+/** A PNG of one plain colour, `width` by `height`, for a background an image makes. */
+export function makePng(width, height, [red, green, blue]) {
+ const row = Buffer.alloc(1 + width * 3);
+ for (let x = 0; x < width; x += 1) row.set([red, green, blue], 1 + x * 3);
+ const crc = (bytes) => {
+ let value = 0xffffffff;
+ for (const byte of bytes) {
+ value ^= byte;
+ for (let bit = 0; bit < 8; bit += 1)
+ value = (value >>> 1) ^ (0xedb88320 & -(value & 1));
+ }
+ return (value ^ 0xffffffff) >>> 0;
+ };
+ const section = (type, data) => {
+ const head = Buffer.alloc(4);
+ head.writeUInt32BE(data.length);
+ const body = Buffer.concat([Buffer.from(type, "latin1"), data]);
+ const tail = Buffer.alloc(4);
+ tail.writeUInt32BE(crc(body));
+ return Buffer.concat([head, body, tail]);
+ };
+ const header = Buffer.alloc(13);
+ header.writeUInt32BE(width, 0);
+ header.writeUInt32BE(height, 4);
+ // Eight bits to a channel, three channels, no interlace.
+ header[8] = 8;
+ header[9] = 2;
+ return Buffer.concat([
+ Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]),
+ section("IHDR", header),
+ section(
+ "IDAT",
+ deflateSync(Buffer.concat(Array.from({ length: height }, () => row))),
+ ),
+ section("IEND", Buffer.alloc(0)),
+ ]);
+}
+
+/** Inspect the downloaded bytes with independent media tools. */
+export function probeMp4(path) {
+ const probe = JSON.parse(execFileSync("ffprobe", [
+ "-v", "error", "-count_frames", "-show_streams", "-show_format",
+ "-of", "json", path,
+ ]));
+ const pixels = execFileSync("ffmpeg", [
+ "-v", "error", "-i", path, "-vf", "scale=1:1",
+ "-fps_mode", "passthrough", "-pix_fmt", "rgb24", "-f", "rawvideo", "-",
+ ]);
+ return {
+ duration: Number(probe.format.duration),
+ stream: probe.streams[0],
+ colors: Array.from({ length: pixels.length / 3 }, (_, index) =>
+ [...pixels.subarray(index * 3, index * 3 + 3)]),
+ };
+}
+
+if (process.argv[1] === fileURLToPath(import.meta.url)) {
+ const destination = process.argv[2];
+ if (!destination) throw new Error("Usage: node director_stage_fixture.mjs [--animated]");
+ writeFileSync(
+ destination,
+ process.argv.includes("--animated") ? makeAnimatedGlb() : makeGlb(),
+ );
+ console.log(destination);
+}
diff --git a/tests/browser/director_stage_gizmo.mjs b/tests/browser/director_stage_gizmo.mjs
new file mode 100644
index 000000000..2337ef955
--- /dev/null
+++ b/tests/browser/director_stage_gizmo.mjs
@@ -0,0 +1,852 @@
+/** Director Stage gizmo acceptance: preview dragging repositions a
+ * keyframe-free subject through base transforms only, and once the subject
+ * carries transform keyframes the same drag poses it at the playhead through
+ * the keyframe writer the numeric fields use.
+ * DIRECTOR_STAGE_LOCALE runs the same flow in another UI language. */
+import assert from "node:assert/strict";
+const { chromium } = await import(
+ process.env.PLAYWRIGHT_MODULE ?? "playwright-core"
+);
+
+const locale = process.env.DIRECTOR_STAGE_LOCALE ?? "en-US";
+const L = {
+ "en-US": {
+ saved: "Saved on this device",
+ addStage: "Add Director Stage",
+ apply: "Apply edits",
+ positionX: "Position X",
+ positionY: "Position Y",
+ positionZ: "Position Z",
+ camera: "Camera 1",
+ viewpoint: "Viewpoint",
+ cameraX: "Camera X",
+ targetX: "Target X",
+ object: "Subject",
+ rotationX: "Rotation X",
+ undo: "Undo",
+ redo: "Redo",
+ previewMode: "Preview mode",
+ dynamicPreview: "Dynamic",
+ selectGizmo: "Select",
+ dropGround: "Drop to ground",
+ elevationUnit: " m",
+ elevationValue: "{height} m",
+ elevationAria: "Height above ground {height} m",
+ playhead: "Stage playhead",
+ recordKeyframe: "Record a keyframe here",
+ openStage: "Open Director Stage",
+ },
+ "zh-CN": {
+ saved: "已保存到本机",
+ addStage: "添加导演台",
+ apply: "应用编辑",
+ positionX: "位置 X",
+ positionY: "位置 Y",
+ positionZ: "位置 Z",
+ // The seed stage is imported as it is written, so its camera keeps the
+ // name the file gives it in either language.
+ camera: "Camera 1",
+ viewpoint: "视点",
+ cameraX: "机位 X",
+ targetX: "目标 X",
+ object: "Subject",
+ rotationX: "旋转 X",
+ undo: "撤销",
+ redo: "重做",
+ previewMode: "预演模式",
+ dynamicPreview: "动态",
+ selectGizmo: "选择",
+ dropGround: "落到地面",
+ elevationUnit: " 米",
+ elevationValue: "{height} 米",
+ elevationAria: "离地高度 {height} 米",
+ playhead: "舞台播放位置",
+ recordKeyframe: "在此记录关键帧",
+ openStage: "打开导演台",
+ },
+}[locale];
+assert.ok(L, `Unsupported DIRECTOR_STAGE_LOCALE: ${locale}`);
+
+const base = process.env.CREATION_WEB_URL ?? "http://127.0.0.1:5179";
+const api = process.env.CREATION_API_URL ?? "http://127.0.0.1:8019";
+const headers = {
+ "X-OpenDirector-Request": "1",
+ "Content-Type": "application/json",
+};
+
+async function call(path, body) {
+ const response = await fetch(api + path, {
+ headers,
+ ...(body
+ ? { method: "POST", body: JSON.stringify(body) }
+ : {}),
+ });
+ assert.ok(response.ok, `${response.status}: ${await response.clone().text()}`);
+ return response.json();
+}
+
+assert.equal((await call("/api/creation-test-health")).isolated, true);
+
+const projectId = crypto.randomUUID();
+await call(`/api/creation/projects/${projectId}/commands`, {
+ commandId: crypto.randomUUID(),
+ projectId,
+ type: "project.create",
+ payload: { name: `Director Stage gizmo ${projectId.slice(0, 8)}` },
+});
+
+const state = () => call(`/api/creation/projects/${projectId}`);
+const browser = await chromium.launch({
+ headless: true,
+ ...(process.env.CHROMIUM_PATH
+ ? { executablePath: process.env.CHROMIUM_PATH }
+ : {}),
+ args: ["--no-sandbox", "--enable-unsafe-swiftshader"],
+});
+const page = await browser.newPage({
+ locale,
+ viewport: { width: 1700, height: 1100 },
+});
+await page.addInitScript((value) => {
+ localStorage.setItem("opendirector.locale.v1", value);
+ localStorage.setItem("opendirector.modelSetup.v1", "dismissed");
+}, locale);
+page.setDefaultTimeout(20000);
+const errors = [];
+page.on("pageerror", (error) => errors.push(error.message));
+
+const until = async (predicate, label) => {
+ const deadline = Date.now() + 20000;
+ let snapshot;
+ while (Date.now() < deadline) {
+ snapshot = await state();
+ if (predicate(snapshot)) return snapshot;
+ await page.waitForTimeout(100);
+ }
+ throw new Error(`Timeout: ${label}; snapshot: ${JSON.stringify(snapshot)}`);
+};
+
+const director = (snapshot, itemId) => {
+ const item = snapshot.canvasItems.find((candidate) => candidate.id === itemId);
+ const document = snapshot.editorDocuments.find(
+ (candidate) => candidate.id === item?.binding?.objectRef?.id,
+ );
+ return { item, document };
+};
+
+const keyframeCount = (document) =>
+ document.data.objects.reduce(
+ (count, object) => count + object.keyframes.length,
+ 0,
+ ) +
+ document.data.cameras.reduce(
+ (count, camera) => count + camera.keyframes.length,
+ 0,
+ );
+
+/** Grabs the translate X handle of the placement gizmo. Project the handle
+ * from the director camera instead of relying on a fixed screen offset; the
+ * latter silently regresses when the director view is not the stage camera. */
+const xHandlePoint = async () => {
+ const box = await page
+ .locator(".cw-stage-scene")
+ .boundingBox();
+ assert.ok(box, "stage viewport is visible");
+ const center = projectToViewport(0, 0, 0, box);
+ const ahead = projectToViewport(1, 0, 0, box);
+ const direction = { x: ahead.x - center.x, y: ahead.y - center.y };
+ const length = Math.hypot(direction.x, direction.y);
+ return {
+ from: {
+ x: center.x + (direction.x / length) * box.width * 0.03,
+ y: center.y + (direction.y / length) * box.width * 0.03,
+ },
+ by: box.width * 0.11,
+ direction: { x: direction.x / length, y: direction.y / length },
+ };
+};
+
+/** Drags the X translate handle rightwards along its own screen axis. */
+const dragXHandle = async () => {
+ const { from, by, direction } = await xHandlePoint();
+ await page.mouse.move(from.x, from.y);
+ await page.mouse.down();
+ await page.mouse.move(
+ from.x + direction.x * by,
+ from.y + direction.y * by,
+ { steps: 12 },
+ );
+ await page.mouse.up();
+};
+
+const positionX = () => page.getByLabel(L.positionX, { exact: true });
+
+/** Director view every fresh stage opens with. The projection helper below
+ * mirrors the render camera's look-at math. */
+const DEFAULT_CAMERA = {
+ eye: { x: 8, y: 6, z: 10 },
+ target: { x: 0, y: 1, z: 0 },
+ fov: 45,
+};
+const sub3 = (a, b) => ({ x: a.x - b.x, y: a.y - b.y, z: a.z - b.z });
+const cross3 = (a, b) => ({
+ x: a.y * b.z - a.z * b.y,
+ y: a.z * b.x - a.x * b.z,
+ z: a.x * b.y - a.y * b.x,
+});
+const dot3 = (a, b) => a.x * b.x + a.y * b.y + a.z * b.z;
+const normalize3 = (a) => {
+ const length = Math.hypot(a.x, a.y, a.z);
+ return { x: a.x / length, y: a.y / length, z: a.z / length };
+};
+const VIEW_BASIS = (() => {
+ const forward = normalize3(sub3(DEFAULT_CAMERA.target, DEFAULT_CAMERA.eye));
+ const right = normalize3(cross3(forward, { x: 0, y: 1, z: 0 }));
+ return { forward, right, up: normalize3(cross3(right, forward)) };
+})();
+
+/** Projects a world point to viewport pixels under the default camera, so a
+ * drag can find the gizmo of a subject that no longer sits at the origin. */
+const projectToViewport = (px, py, pz, box) => {
+ const view = sub3({ x: px, y: py, z: pz }, DEFAULT_CAMERA.eye);
+ const depth = dot3(view, VIEW_BASIS.forward);
+ const halfH = depth * Math.tan((DEFAULT_CAMERA.fov * Math.PI) / 360);
+ const halfW = halfH * (box.width / box.height);
+ return {
+ x: box.x + ((dot3(view, VIEW_BASIS.right) / halfW + 1) / 2) * box.width,
+ y: box.y + ((1 - dot3(view, VIEW_BASIS.up) / halfH) / 2) * box.height,
+ };
+};
+
+/** Drags the X translate handle of a subject at an arbitrary base position:
+ * projects the base position and its +X offset to get the arrow's screen
+ * direction at that depth, then pulls along it like dragXHandle does. */
+const dragXHandleAt = async (position) => {
+ const box = await page.locator(".cw-stage-scene").boundingBox();
+ assert.ok(box, "stage viewport is visible");
+ const center = projectToViewport(
+ position.x,
+ position.y,
+ position.z,
+ box,
+ );
+ const ahead = projectToViewport(position.x + 1, position.y, position.z, box);
+ const dx = ahead.x - center.x,
+ dy = ahead.y - center.y;
+ const length = Math.hypot(dx, dy);
+ const from = {
+ x: center.x + (dx / length) * box.width * 0.03,
+ y: center.y + (dy / length) * box.width * 0.03,
+ };
+ const by = box.width * 0.11;
+ await page.mouse.move(from.x, from.y);
+ await page.mouse.down();
+ await page.mouse.move(from.x + (dx / length) * by, from.y + (dy / length) * by, {
+ steps: 12,
+ });
+ await page.mouse.up();
+};
+
+const fieldNumber = (label) =>
+ page.getByLabel(label, { exact: true }).inputValue().then(Number);
+
+/** Of the pixels within `radius` of `center`, how many are bright and neutral.
+ * Every pixel is counted: the director view the stage opens with stands farther
+ * from the subject than the stage camera it was once seen through, and the lit
+ * part below the ground is then only a few pixels wide. */
+const neutralPixelsNear = async (screenshot, center, radius) =>
+ page.evaluate(
+ ({ dataUrl, center, radius }) =>
+ new Promise((resolve, reject) => {
+ const image = new Image();
+ image.onload = () => {
+ const canvas = document.createElement("canvas");
+ canvas.width = image.naturalWidth;
+ canvas.height = image.naturalHeight;
+ const context = canvas.getContext("2d");
+ if (!context) return reject(new Error("2D canvas is unavailable"));
+ context.drawImage(image, 0, 0);
+ const pixels = context.getImageData(
+ 0,
+ 0,
+ canvas.width,
+ canvas.height,
+ ).data;
+ const scale = canvas.width / window.innerWidth;
+ const x = center.x * scale;
+ const y = center.y * scale;
+ const r = radius * scale;
+ let count = 0;
+ for (
+ let py = Math.max(0, Math.floor(y - r));
+ py < Math.min(canvas.height, Math.ceil(y + r));
+ py += 1
+ ) {
+ for (
+ let px = Math.max(0, Math.floor(x - r));
+ px < Math.min(canvas.width, Math.ceil(x + r));
+ px += 1
+ ) {
+ const offset = (py * canvas.width + px) * 4;
+ const red = pixels[offset];
+ const green = pixels[offset + 1];
+ const blue = pixels[offset + 2];
+ const brightest = Math.max(red, green, blue);
+ const darkest = Math.min(red, green, blue);
+ if (brightest > 160 && brightest - darkest < 35) count++;
+ }
+ }
+ resolve(count);
+ };
+ image.onerror = () => reject(new Error("screenshot decode failed"));
+ image.src = dataUrl;
+ }),
+ {
+ dataUrl: `data:image/png;base64,${screenshot.toString("base64")}`,
+ center,
+ radius,
+ },
+ );
+
+const waitForFieldValue = (label, value) =>
+ page.waitForFunction(
+ ({ label, value }) => {
+ const field = document.querySelector(`[aria-label="${label}"]`);
+ return (
+ field instanceof HTMLInputElement &&
+ Math.abs(Number(field.value) - value) < 0.01
+ );
+ },
+ { label, value },
+ );
+
+try {
+ await page.goto(`${base}/ai-tool/ai-canvas/${projectId}?creation=unified`);
+ await page.getByText(L.saved, { exact: true }).waitFor();
+
+ const addStage = page.getByRole("button", { name: L.addStage, exact: true });
+ await addStage.waitFor();
+ await addStage.click();
+ await page
+ .getByRole("button", { name: L.apply, exact: true })
+ .waitFor();
+
+ // Wait for the stage surface before checking the mutually exclusive
+ // transform tool state and starting the first drag.
+ await page.locator(".cw-stage-scene canvas:not(.cw-stage-pipcanvas)").waitFor();
+ const selectGizmo = page.locator('.cw-stage-gizmo button[data-tool="select"]');
+ const moveGizmo = page.locator('.cw-stage-gizmo button[data-tool="translate"]');
+ const rotateGizmo = page.locator('.cw-stage-gizmo button[data-tool="rotate"]');
+ const scaleGizmo = page.locator('.cw-stage-gizmo button[data-tool="scale"]');
+ const dropGround = page.locator('.cw-stage-gizmo button[data-tool="drop-ground"]');
+ assert.equal((await selectGizmo.textContent()).trim(), L.selectGizmo);
+ assert.equal((await dropGround.textContent()).trim(), L.dropGround);
+ assert.equal(await selectGizmo.getAttribute("aria-pressed"), "false");
+ assert.equal(await moveGizmo.getAttribute("aria-pressed"), "true");
+ assert.equal(await rotateGizmo.getAttribute("aria-pressed"), "false");
+ assert.equal(await scaleGizmo.getAttribute("aria-pressed"), "false");
+ await rotateGizmo.click();
+ assert.equal(await moveGizmo.getAttribute("aria-pressed"), "false");
+ assert.equal(await rotateGizmo.getAttribute("aria-pressed"), "true");
+ assert.equal(await scaleGizmo.getAttribute("aria-pressed"), "false");
+ await moveGizmo.click();
+ await selectGizmo.click();
+ assert.equal(await selectGizmo.getAttribute("aria-pressed"), "true");
+ assert.equal(await moveGizmo.getAttribute("aria-pressed"), "false");
+ await moveGizmo.click();
+ const viewportMetrics = await page.evaluate(() => {
+ const canvas = document.querySelector(
+ ".cw-stage-scene canvas:not(.cw-stage-pipcanvas)",
+ );
+ const rect = canvas?.getBoundingClientRect();
+ return canvas instanceof HTMLCanvasElement && rect
+ ? {
+ width: rect.width,
+ height: rect.height,
+ bufferWidth: canvas.width / window.devicePixelRatio,
+ bufferHeight: canvas.height / window.devicePixelRatio,
+ }
+ : null;
+ });
+ assert.ok(viewportMetrics, "the stage canvas has a measurable viewport");
+ assert.ok(
+ Math.abs(viewportMetrics.bufferWidth - viewportMetrics.width) < 1 &&
+ Math.abs(viewportMetrics.bufferHeight - viewportMetrics.height) < 1,
+ `the WebGL buffer follows the visible viewport (${JSON.stringify(viewportMetrics)})`,
+ );
+
+ // Stages start empty; import a minimal single-subject stage so the gizmo
+ // flow runs against the same origin-seated, keyframe-free subject the
+ // built-in default used to provide. Importing keeps the draft's history
+ // to this one entry, so the later one-undo expectations still hold.
+ await page
+ .locator('input[type="file"][accept^="application/json"]')
+ .setInputFiles({
+ name: "seed.stage.json",
+ mimeType: "application/json",
+ buffer: Buffer.from(
+ JSON.stringify({
+ format: "opendirector-local-stage",
+ version: 2,
+ background: "#151923",
+ grid: true,
+ duration: 6,
+ fps: 30,
+ aspectRatio: "16:9",
+ activeCameraId: "camera-1",
+ cameraSource: "camera",
+ shots: [],
+ cameras: [
+ {
+ id: "camera-1",
+ name: "Camera 1",
+ pose: {
+ position: { x: 5, y: 3.5, z: 7 },
+ target: { x: 0, y: 1, z: 0 },
+ fov: 45,
+ },
+ keyframes: [],
+ },
+ ],
+ objects: [
+ {
+ id: "seed-subject",
+ kind: "person",
+ name: "Subject",
+ color: "#a09af9",
+ position: { x: 0, y: 0, z: 0 },
+ rotation: { x: 0, y: 0, z: 0 },
+ scale: { x: 1, y: 1, z: 1 },
+ visible: true,
+ locked: false,
+ opacity: 1,
+ keyframes: [],
+ motionClips: [],
+ },
+ ],
+ }),
+ ),
+ });
+ await waitForFieldValue(L.positionY, 0);
+
+ const positionY = page.getByLabel(L.positionY, { exact: true });
+
+ // How far the selected subject stands above the ground is read from its
+ // lowest rendered point, in DOM over the frame. The seed seats the subject's
+ // origin on the ground, and the built-in person's feet start a little above
+ // that origin: the same few centimetres drop-to-ground takes back.
+ const elevationValue = page.locator(".cw-stage-elevation-value");
+ const elevationText = () => elevationValue.textContent().then((text) => text.trim());
+ const elevationNumber = async () => {
+ const text = await elevationText();
+ assert.ok(
+ text.endsWith(L.elevationUnit),
+ `the readout names its unit (${text})`,
+ );
+ const value = text.slice(0, -L.elevationUnit.length);
+ assert.ok(/^\d+\.\d\d$/.test(value), `the readout keeps two decimals (${text})`);
+ return Number(value);
+ };
+ const waitForElevation = (shown) =>
+ page.waitForFunction(
+ (shown) => {
+ const layer = document.querySelector(".cw-stage-elevation");
+ const label = document.querySelector(".cw-stage-elevation-value");
+ return (
+ layer instanceof HTMLElement &&
+ label instanceof HTMLElement &&
+ (getComputedStyle(layer).display !== "none" &&
+ getComputedStyle(label).display !== "none") === shown
+ );
+ },
+ shown,
+ );
+ await waitForElevation(true);
+ const seated = await elevationNumber();
+ assert.ok(
+ seated > 0.03 && seated < 0.06,
+ `a subject seated by its origin reads the height of its feet (${seated})`,
+ );
+ assert.equal(await elevationText(), L.elevationValue.replace("{height}", seated.toFixed(2)));
+ assert.equal(
+ await elevationValue.getAttribute("aria-label"),
+ L.elevationAria.replace("{height}", seated.toFixed(2)),
+ );
+
+ const stageBox = await page.locator(".cw-stage-scene").boundingBox();
+ assert.ok(stageBox, "stage viewport is visible for underground placement");
+ const undergroundCenter = projectToViewport(0, -0.45, 0, stageBox);
+ const baseline = await page.locator(".cw-stage-scene").screenshot();
+ const baselinePixels = await neutralPixelsNear(
+ baseline,
+ undergroundCenter,
+ Math.min(stageBox.width, stageBox.height) * 0.02,
+ );
+ await positionY.fill("-1");
+ await waitForFieldValue(L.positionY, -1);
+ // Below the ground the translucent ground says so; there is no height to read.
+ await waitForElevation(false);
+ await dropGround.click();
+ const groundedY = await page.waitForFunction(
+ (label) => {
+ const field = document.querySelector(`[aria-label="${label}"]`);
+ if (!(field instanceof HTMLInputElement)) return false;
+ const value = Number(field.value);
+ return Number.isFinite(value) && value < -0.01 ? value : false;
+ },
+ L.positionY,
+ );
+ assert.ok(
+ Number(groundedY) < -0.01,
+ `drop-to-ground uses the rendered bottom (got ${groundedY})`,
+ );
+ assert.equal(await dropGround.isDisabled(), false);
+ await positionY.fill("-1");
+ await waitForFieldValue(L.positionY, -1);
+ await page.waitForTimeout(200);
+ const underground = await page.locator(".cw-stage-scene").screenshot();
+ const undergroundPixels = await neutralPixelsNear(
+ underground,
+ undergroundCenter,
+ Math.min(stageBox.width, stageBox.height) * 0.02,
+ );
+ assert.ok(
+ undergroundPixels > baselinePixels + 12,
+ `the below-ground portion remains visible (${baselinePixels} -> ${undergroundPixels} neutral pixels)`,
+ );
+ await positionY.fill("0");
+ await waitForFieldValue(L.positionY, 0);
+ await waitForElevation(true);
+ assert.ok(
+ Math.abs((await elevationNumber()) - seated) < 0.006,
+ "the readout comes back with the lift",
+ );
+ // Dropped, the subject reads nothing; lifted by a known amount, it reads that
+ // amount and the feet's height together, which is what another drop takes back.
+ await dropGround.click();
+ await waitForElevation(false);
+ const lift = 1.26;
+ await positionY.fill(String(lift));
+ await waitForFieldValue(L.positionY, lift);
+ await waitForElevation(true);
+ const lifted = await elevationNumber();
+ assert.ok(
+ Math.abs(lifted - lift - seated) < 0.011,
+ `a lifted subject reads its height above the ground (${lifted}, lifted ${lift} from the ground with feet ${seated})`,
+ );
+ assert.equal(await elevationText(), L.elevationValue.replace("{height}", lifted.toFixed(2)));
+ assert.equal(
+ await elevationValue.getAttribute("aria-label"),
+ L.elevationAria.replace("{height}", lifted.toFixed(2)),
+ );
+ await dropGround.click();
+ await waitForElevation(false);
+ await positionY.fill("0");
+ await waitForFieldValue(L.positionY, 0);
+ await waitForElevation(true);
+ await page.waitForTimeout(150);
+
+ // Camera helpers are scene entities, not tree-only controls. Clicking the
+ // projected camera endpoint must select the camera from the director view.
+ const cameraBox = await page.locator(".cw-stage-scene").boundingBox();
+ assert.ok(cameraBox, "stage viewport is visible for camera selection");
+ const cameraEndpoint = projectToViewport(5, 3.5, 7, cameraBox);
+ await page.mouse.click(cameraEndpoint.x, cameraEndpoint.y);
+ await page.waitForFunction(() =>
+ document.querySelector(
+ ".cw-stage-camera-tree-row:not(.cw-stage-camera-tree-row-child) button[aria-selected=\"true\"]",
+ ) !== null,
+ );
+ assert.match(
+ await page
+ .locator(
+ ".cw-stage-camera-tree-row:not(.cw-stage-camera-tree-row-child) button[aria-selected=\"true\"]",
+ )
+ .textContent(),
+ new RegExp(L.camera),
+ "clicking the camera body selects its camera endpoint",
+ );
+
+ // Cameras and viewpoints are independent scene selections. Both expose
+ // only translation, while ordinary subjects keep all three gizmo modes.
+ const stageTree = page.locator(".cw-stage-tree");
+ await stageTree.getByRole("button", { name: L.camera, exact: true }).click();
+ assert.equal(await moveGizmo.getAttribute("aria-pressed"), "true");
+ await rotateGizmo.click();
+ assert.equal(await moveGizmo.getAttribute("aria-pressed"), "true");
+ assert.equal(await rotateGizmo.getAttribute("aria-pressed"), "false");
+ await stageTree
+ .getByRole("button", { name: L.viewpoint, exact: true })
+ .click();
+ assert.equal(await moveGizmo.getAttribute("aria-pressed"), "true");
+
+ // Moving the viewpoint is a stage edit, not a director-view navigation.
+ // The readout belongs to the orbit camera and must remain unchanged while
+ // the camera output's target changes.
+ const directorReadout = page.locator(".cw-stage-viewreadout");
+ await directorReadout.waitFor();
+ const beforeViewpointMove = await directorReadout.textContent();
+ await page.getByLabel(L.targetX, { exact: true }).fill("2");
+ await page.waitForTimeout(120);
+ assert.equal(
+ await directorReadout.textContent(),
+ beforeViewpointMove,
+ "viewpoint edits do not move the director view",
+ );
+ await page.getByLabel(L.targetX, { exact: true }).fill("0");
+ await stageTree.getByRole("button", { name: L.object, exact: true }).click();
+ await moveGizmo.click();
+
+ await dragXHandle();
+ const dragged = Number(await positionX().inputValue());
+ // A miss would orbit the camera instead; the persisted-pose assertions
+ // below would catch that, but fail fast here with the observed value.
+ assert.ok(
+ dragged > 0.5,
+ `gizmo drag moved the subject along X (got ${dragged})`,
+ );
+
+ // Placement edits are ordinary history entries: one undo restores the
+ // original position without touching any other subject data. The canvas
+ // toolbar undo carries an aria-label; scope to the modal's plain-text one.
+ const modalUndo = page
+ .locator(".cw-stage-console")
+ .getByRole("button", { name: L.undo, exact: true });
+ await modalUndo.click();
+ await page.waitForFunction(
+ (label) => {
+ const field = document.querySelector(`[aria-label="${label}"]`);
+ return field instanceof HTMLInputElement &&
+ Math.abs(Number(field.value)) < 0.01;
+ },
+ L.positionX,
+ );
+ const undone = Number(await positionX().inputValue());
+ assert.ok(Math.abs(undone) < 0.01, `undo restored X (got ${undone})`);
+
+ // Undo-and-apply persists the un-dragged pose with only the t=0 anchor the
+ // numeric-field parking authored; the drag itself adds no frame. The camera
+ // carries one frame as well: the viewpoint edit above keyed its target at the
+ // playhead, back where it started.
+ await page.getByRole("button", { name: L.apply, exact: true }).click();
+ const appliedUndo = await until((snapshot) => {
+ const result = director(snapshot, snapshot.canvasItems.find(
+ (candidate) => candidate.visible && candidate.kind === "external",
+ )?.id);
+ // Wait for the applied draft itself: the freshly created document also
+ // exists before the apply and stages no longer seed a default subject.
+ return (
+ result.document?.kind === "director" &&
+ result.document.data.objects.length === 1 &&
+ keyframeCount(result.document) === 2
+ );
+ }, "stage document persisted after undo apply");
+ const undoItemId = appliedUndo.canvasItems.find(
+ (candidate) => candidate.visible && candidate.kind === "external",
+ ).id;
+ const undoDocument = director(appliedUndo, undoItemId).document;
+ assert.equal(undoDocument.data.objects[0].keyframes.length, 1);
+ assert.equal(
+ undoDocument.data.cameras[0].keyframes.length,
+ 1,
+ "the camera holds the viewpoint's frame and no other",
+ );
+ assert.ok(
+ Math.abs(undoDocument.data.objects[0].position.x) < 0.01,
+ "undo apply persisted the original X",
+ );
+
+ // Reopen and drag again: the placement persists as a base transform, and a
+ // recorded keyframe then keeps the subject draggable, posing it at the
+ // playhead, with no camera-pose side effects.
+ await page.locator(`.react-flow__node[data-id="${undoItemId}"]`).click();
+ await page.getByRole("button", { name: L.openStage, exact: true }).click();
+ await page
+ .getByRole("button", { name: L.apply, exact: true })
+ .waitFor();
+ // Select the rotate tool explicitly. Its ring turns the subject around the
+ // X axis without touching its position, and the upper-left arc carries no
+ // translate arrows. It runs before the translate drag while the subject
+ // still sits at the world origin, where the gizmo center is fixed.
+ await rotateGizmo.click();
+ const ringBox = await page.locator(".cw-stage-scene").boundingBox();
+ const ringCenter = {
+ x: ringBox.x + ringBox.width / 2,
+ y: ringBox.y + ringBox.height * 0.625,
+ };
+ const radial = { x: -0.5, y: -0.866 };
+ const ringPx = Math.min(ringBox.width, ringBox.height) * 0.053;
+ const grab = {
+ x: ringCenter.x + radial.x * ringPx,
+ y: ringCenter.y + radial.y * ringPx,
+ };
+ await page.mouse.move(grab.x, grab.y);
+ await page.mouse.down();
+ await page.mouse.move(grab.x + 0.866 * 80, grab.y - 0.5 * 80, { steps: 12 });
+ await page.mouse.up();
+ const turned = Number(
+ await page.getByLabel(L.rotationX, { exact: true }).inputValue(),
+ );
+ assert.ok(
+ Math.abs(turned) > 30,
+ `rotate drag turned the subject (got ${turned})`,
+ );
+ assert.ok(
+ Math.abs(Number(await positionX().inputValue())) < 0.01,
+ "rotation left the placement position unchanged",
+ );
+
+ await moveGizmo.click();
+ await dragXHandle();
+ const draggedAgain = Number(await positionX().inputValue());
+ assert.ok(
+ draggedAgain > 0.5,
+ `second gizmo drag moved the subject along X (got ${draggedAgain})`,
+ );
+
+ // A keyframed subject must stay draggable: with the playhead at 0, record a
+ // frame first, then drag the X handle again. The pose lands in the frame at
+ // the playhead through the same writer as the numeric fields.
+ const previewMode = page.getByRole("group", { name: L.previewMode, exact: true });
+ await previewMode.getByRole("button", { name: L.dynamicPreview, exact: true }).click();
+ await page.getByTestId("director-stage-timeline").waitFor();
+ await page.locator(".cw-stage-transport").getByRole("button").first().click();
+ await page.getByRole("slider", { name: L.playhead, exact: true }).press("Home");
+ await page
+ .getByRole("button", { name: L.recordKeyframe, exact: true })
+ .click();
+ await page.locator(".cw-stage-track-point.is-keyframe").first().waitFor();
+ // Read the base transform fresh after recording and project it to the
+ // moved gizmo; the timeline itself is the source of the keyframe state.
+ const posedPosition = {
+ x: await fieldNumber(L.positionX),
+ y: await fieldNumber(L.positionY),
+ z: await fieldNumber(L.positionZ),
+ };
+ await dragXHandleAt(posedPosition);
+ const posedDragged = await fieldNumber(L.positionX);
+ assert.ok(
+ posedDragged > posedPosition.x + 0.1,
+ `drag on the keyframed subject moved the pose along X (got ${posedDragged})`,
+ );
+ // The pose drag is one history entry: one undo restores the pose the record
+ // button captured, and redo re-applies the dragged pose.
+ await modalUndo.click();
+ await waitForFieldValue(L.positionX, posedPosition.x);
+ await page
+ .locator(".cw-stage-console")
+ .getByRole("button", { name: L.redo, exact: true })
+ .click();
+ await waitForFieldValue(L.positionX, posedDragged);
+
+ // Orbiting is a director-view inspection gesture, not a camera edit. The
+ // camera and viewpoint gizmos are the only controls allowed to author the
+ // camera pose. The camera is selected, so its endpoints are on read in the
+ // inspector and its gizmo is in the scene.
+ await stageTree.getByRole("button", { name: L.camera, exact: true }).click();
+ const beforeOrbitCameraX = await fieldNumber(L.cameraX);
+ const beforeOrbitTargetX = await fieldNumber(L.targetX);
+ const beforeOrbitReadout = await page
+ .locator(".cw-stage-viewreadout")
+ .textContent();
+ const orbitBox = await page.locator(".cw-stage-scene").boundingBox();
+ assert.ok(orbitBox, "stage viewport is visible for orbit regression");
+ // An open stretch of the viewport, above the timeline and clear of the view
+ // readout at its foot and of the camera preview in the corner.
+ const orbitY = orbitBox.y + orbitBox.height * 0.3;
+ await page.mouse.move(orbitBox.x + orbitBox.width * 0.6, orbitY);
+ await page.mouse.down();
+ await page.mouse.move(orbitBox.x + orbitBox.width * 0.5, orbitY, {
+ steps: 8,
+ });
+ await page.mouse.up();
+ await page.waitForTimeout(100);
+ assert.ok(
+ Math.abs((await fieldNumber(L.cameraX)) - beforeOrbitCameraX) < 0.01,
+ "orbiting leaves the camera endpoint unchanged",
+ );
+ assert.ok(
+ Math.abs((await fieldNumber(L.targetX)) - beforeOrbitTargetX) < 0.01,
+ "orbiting leaves the viewpoint endpoint unchanged",
+ );
+ // The orbit did move the director's own view: its readout is not what it was.
+ assert.notEqual(
+ await page.locator(".cw-stage-viewreadout").textContent(),
+ beforeOrbitReadout,
+ "the drag turned the director's view",
+ );
+
+ await page.getByRole("button", { name: L.apply, exact: true }).click();
+ const applied = await until((snapshot) => {
+ const result = director(snapshot, undoItemId);
+ return (
+ result.document?.kind === "director" &&
+ result.document.data.objects[0].position.x > 0.5 &&
+ Math.abs(result.document.data.objects[0].rotation.x) > 0.5 &&
+ result.document.data.objects[0].keyframes.length === 1
+ );
+ }, "dragged placement, rotation and pose keyframe persisted after apply");
+ const document = director(applied, undoItemId).document;
+ const subject = document.data.objects[0];
+ // The drags authored no frames of their own: the recorded frame at 0 is
+ // still the only one, and the pose drag overwrote its value in place while
+ // the base transform carries the same dragged pose.
+ assert.equal(subject.keyframes.length, 1);
+ assert.ok(
+ Math.abs(subject.keyframes[0].time) < 1e-9,
+ "pose frame sits at the playhead time",
+ );
+ assert.ok(
+ Math.abs(subject.keyframes[0].value.position.x - subject.position.x) <
+ 0.01,
+ "pose keyframe holds the dragged position",
+ );
+ assert.ok(
+ Math.abs(subject.position.x - posedDragged) < 0.01,
+ "base transform carries the dragged pose",
+ );
+ const pose = document.data.cameras[0].pose;
+ // The server's camera contract carries roll always, zero included.
+ assert.deepEqual(pose, {
+ position: { x: 5, y: 3.5, z: 7 },
+ target: { x: 0, y: 1, z: 0 },
+ fov: 45,
+ roll: 0,
+ });
+ assert.equal(
+ document.data.cameras[0].keyframes.length,
+ 1,
+ "drags authored no camera keyframes beyond the recorded frame",
+ );
+
+ // Apply already closed the editor; the modal is gone from the canvas.
+ await page
+ .getByRole("button", { name: L.apply, exact: true })
+ .waitFor({ state: "detached" });
+ assert.deepEqual(errors, []);
+ console.log(
+ JSON.stringify({
+ passed: true,
+ projectId,
+ itemId: undoItemId,
+ checks: [
+ "translate drag moves the selected subject",
+ "one undo restores the placement",
+ "rotate ring turns the subject in place",
+ "placement and rotation persist as base transforms",
+ "drags author no keyframes beyond the recorded frame",
+ "dragging after a recorded keyframe poses at the playhead",
+ "one undo reverts the pose drag",
+ "camera and viewpoint selections force translate-only gizmos",
+ "orbiting the director view does not edit camera endpoints",
+ "dragging leaves the camera pose untouched",
+ "no page errors",
+ ],
+ }),
+ );
+} catch (error) {
+ console.error((await page.locator("body").innerText()).slice(-2500));
+ throw error;
+} finally {
+ await browser.close();
+}
diff --git a/tests/browser/director_stage_interaction.mjs b/tests/browser/director_stage_interaction.mjs
new file mode 100644
index 000000000..71f850971
--- /dev/null
+++ b/tests/browser/director_stage_interaction.mjs
@@ -0,0 +1,470 @@
+/** Batch-5 acceptance: view settings, scene tree, two-step placement,
+ * default keyboard camera movement and the anchored action bar over the
+ * fullscreen console. */
+import assert from "node:assert/strict";
+const { chromium } = await import(
+ process.env.PLAYWRIGHT_MODULE ?? "playwright-core"
+);
+
+const base = process.env.CREATION_WEB_URL ?? "http://127.0.0.1:5179";
+const api = process.env.CREATION_API_URL ?? "http://127.0.0.1:8019";
+const headers = {
+ "X-OpenDirector-Request": "1",
+ "Content-Type": "application/json",
+};
+
+async function call(path, body, extra = {}) {
+ const response = await fetch(api + path, {
+ headers: { ...headers, ...extra },
+ ...(body ? { method: "POST", body: JSON.stringify(body) } : {}),
+ });
+ assert.ok(
+ response.ok,
+ `${response.status}: ${await response.clone().text()}`,
+ );
+ return response.json();
+}
+
+assert.equal((await call("/api/creation-test-health")).isolated, true);
+
+const projectId = crypto.randomUUID();
+await call(`/api/creation/projects/${projectId}/commands`, {
+ commandId: crypto.randomUUID(),
+ projectId,
+ type: "project.create",
+ payload: { name: `Interact ${projectId.slice(0, 8)}` },
+});
+const state = () => call(`/api/creation/projects/${projectId}`);
+const browser = await chromium.launch({
+ headless: true,
+ ...(process.env.CHROMIUM_PATH
+ ? { executablePath: process.env.CHROMIUM_PATH }
+ : {}),
+ args: ["--no-sandbox", "--enable-unsafe-swiftshader"],
+});
+const page = await browser.newPage({
+ locale: "en-US",
+ viewport: { width: 1700, height: 1100 },
+});
+await page.addInitScript(() =>
+ localStorage.setItem("opendirector.modelSetup.v1", "dismissed"),
+);
+page.setDefaultTimeout(20000);
+const errors = [];
+page.on("pageerror", (error) => errors.push(error.message));
+
+const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
+const until = async (predicate, label) => {
+ const deadline = Date.now() + 20000;
+ let snapshot;
+ while (Date.now() < deadline) {
+ snapshot = await state();
+ if (predicate(snapshot)) return snapshot;
+ await sleep(100);
+ }
+ throw new Error(`Timeout: ${label}; snapshot: ${JSON.stringify(snapshot)}`);
+};
+const stageDoc = (snapshot) =>
+ snapshot.editorDocuments.find((candidate) => candidate.kind === "director");
+const sceneBox = async () => {
+ const box = await page.locator(".cw-stage-scene").boundingBox();
+ assert.ok(box);
+ return box;
+};
+const DEFAULT_CAMERA = {
+ eye: { x: 8, y: 6, z: 10 },
+ target: { x: 0, y: 1, z: 0 },
+ fov: 45,
+};
+const sub3 = (a, b) => ({ x: a.x - b.x, y: a.y - b.y, z: a.z - b.z });
+const cross3 = (a, b) => ({
+ x: a.y * b.z - a.z * b.y,
+ y: a.z * b.x - a.x * b.z,
+ z: a.x * b.y - a.y * b.x,
+});
+const normalize3 = (a) => {
+ const length = Math.hypot(a.x, a.y, a.z);
+ return { x: a.x / length, y: a.y / length, z: a.z / length };
+};
+const groundPointAt = (box, xFraction, yFraction) => {
+ const forward = normalize3(sub3(DEFAULT_CAMERA.target, DEFAULT_CAMERA.eye));
+ const right = normalize3(cross3(forward, { x: 0, y: 1, z: 0 }));
+ const up = normalize3(cross3(right, forward));
+ const nx = xFraction * 2 - 1;
+ const ny = 1 - yFraction * 2;
+ const halfHeight = Math.tan((DEFAULT_CAMERA.fov * Math.PI) / 360);
+ const halfWidth = halfHeight * (box.width / box.height);
+ const direction = normalize3({
+ x: forward.x + right.x * halfWidth * nx + up.x * halfHeight * ny,
+ y: forward.y + right.y * halfWidth * nx + up.y * halfHeight * ny,
+ z: forward.z + right.z * halfWidth * nx + up.z * halfHeight * ny,
+ });
+ const distance = -DEFAULT_CAMERA.eye.y / direction.y;
+ return {
+ x: DEFAULT_CAMERA.eye.x + direction.x * distance,
+ z: DEFAULT_CAMERA.eye.z + direction.z * distance,
+ };
+};
+
+let itemId;
+try {
+ await page.goto(`${base}/ai-tool/ai-canvas/${projectId}?creation=unified`);
+ await page.getByText("Saved on this device", { exact: true }).waitFor();
+ await page
+ .getByRole("button", { name: "Add Director Stage", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor();
+ const created = await until(
+ (snapshot) => stageDoc(snapshot)?.kind === "director",
+ "created director document",
+ );
+ itemId = created.canvasItems.find((item) => item.kind === "external").id;
+
+ // Two-step placement arms instead of adding, and Esc disarms.
+ assert.equal(
+ await page.getByRole("button", { name: "+ Person", exact: true }).count(),
+ 0,
+ "characters are placed from preview cards, not direct add buttons",
+ );
+ await page
+ .locator('.cw-stage-object-grid button[data-stage-placement-kind="person"]')
+ .first()
+ .click();
+ await page.locator(".cw-stage-placehint").waitFor();
+ await page.keyboard.press("Escape");
+ assert.equal(await page.locator(".cw-stage-placehint").count(), 0);
+
+ // Arming again and clicking the scene lands the object there; the
+ // first completed placement opens the console controls once.
+ await page
+ .locator('.cw-stage-object-grid button[data-stage-placement-kind="person"]')
+ .first()
+ .click();
+ const box = await sceneBox();
+ await page.mouse.click(box.x + box.width * 0.62, box.y + box.height * 0.55);
+ const help = page.getByRole("dialog", { name: "Director console controls" });
+ await help.waitFor();
+ await help.getByRole("button", { name: "Close help", exact: true }).click();
+
+ // Built-in objects use the same preview-card placement flow; the former
+ // direct + Box controls are intentionally gone.
+ await page.getByRole("tab", { name: "Objects", exact: true }).click();
+ assert.equal(
+ await page.getByRole("button", { name: "+ Box", exact: true }).count(),
+ 0,
+ "objects are placed from preview cards, not direct add buttons",
+ );
+ const boxCard = page.locator(
+ '.cw-stage-object-grid button[data-stage-placement-kind="box"]',
+ );
+ assert.equal(await boxCard.count(), 1, "the Box preview card is available");
+ await boxCard.click();
+ const objectPlacementBox = await sceneBox();
+ await page.mouse.click(
+ objectPlacementBox.x + objectPlacementBox.width * 0.38,
+ objectPlacementBox.y + objectPlacementBox.height * 0.55,
+ );
+ await until(
+ (snapshot) => stageDoc(snapshot) === undefined || true,
+ "placement pending",
+ );
+ await page.getByRole("button", { name: "Apply edits", exact: true }).click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor({ state: "detached" });
+ const placed = await until(
+ (snapshot) => (stageDoc(snapshot)?.data.objects ?? []).length === 2,
+ "the placed person and object persist",
+ );
+ const landed = stageDoc(placed).data.objects[0];
+ assert.ok(
+ landed.position.x > 0.5 || Math.abs(landed.position.z) > 0.5,
+ `the object landed at the clicked spot (${landed.position.x}, ${landed.position.z})`,
+ );
+ assert.ok(
+ landed.position.y < -0.01,
+ `the placed character is grounded by its rendered bottom (y=${landed.position.y})`,
+ );
+ assert.equal(stageDoc(placed).data.objects[1].kind, "box");
+
+ // The scene tree groups subjects with collapsing heads.
+ await page.locator(`.react-flow__node[data-id="${itemId}"]`).click();
+ await page
+ .getByRole("button", { name: "Open Director Stage", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor();
+ const tooltipPolicy = await page
+ .locator('.cw-domain-overlay[role="dialog"] button')
+ .evaluateAll((buttons) => {
+ const isIconOnly = (button) =>
+ button.hasAttribute("data-icon") ||
+ button.classList.contains("cw-stage-row-action") ||
+ button.classList.contains("cw-stage-tab") ||
+ button.classList.contains("cw-stage-transport-play") ||
+ button.classList.contains("cw-stage-record-keyframe") ||
+ button.classList.contains("cw-stage-track-add") ||
+ button.classList.contains("cw-stage-storyboard-add") ||
+ button.classList.contains("cw-stage-track-interval") ||
+ button.classList.contains("cw-stage-track-point");
+ return {
+ missingIconTooltips: buttons
+ .filter((button) => isIconOnly(button) && !button.title.trim())
+ .map((button) => button.outerHTML),
+ redundantTextTooltips: buttons
+ .filter(
+ (button) =>
+ !isIconOnly(button) &&
+ button.title.trim() &&
+ button.textContent?.trim(),
+ )
+ .map((button) => button.textContent.trim()),
+ };
+ });
+ assert.deepEqual(
+ tooltipPolicy.missingIconTooltips,
+ [],
+ "non-obvious icon controls expose a hover tooltip",
+ );
+ assert.deepEqual(
+ tooltipPolicy.redundantTextTooltips,
+ [],
+ "text-labelled controls do not duplicate their label as a hover tooltip",
+ );
+ const tree = page.locator(".cw-stage-tree");
+ assert.equal(
+ await tree
+ .locator(".cw-stage-tree-row")
+ .getByText("Person 1", { exact: true })
+ .count(),
+ 1,
+ "the built-in character uses the default display name",
+ );
+ const environmentInspector = page.getByTestId(
+ "director-stage-environment-inspector",
+ );
+ const environmentScene = await sceneBox();
+ await page.mouse.click(
+ environmentScene.x + environmentScene.width * 0.5,
+ environmentScene.y + environmentScene.height * 0.15,
+ );
+ await environmentInspector.waitFor();
+ await page.getByLabel("Environment preset", { exact: true }).waitFor();
+ const treeScroll = page.locator(".cw-stage-tree-scroll");
+ const inspectorScroll = page.locator(".cw-stage-inspector-scroll");
+ const treeScrollBox = await treeScroll.boundingBox();
+ const inspectorScrollBox = await inspectorScroll.boundingBox();
+ assert.ok(
+ treeScrollBox &&
+ inspectorScrollBox &&
+ Math.abs(
+ treeScrollBox.x +
+ treeScrollBox.width -
+ (inspectorScrollBox.x + inspectorScrollBox.width),
+ ) < 1,
+ "object and property scroll areas share the same right edge",
+ );
+ assert.equal(
+ await environmentInspector
+ .getByLabel("Environment preset", { exact: true })
+ .count(),
+ 1,
+ "empty viewport selection exposes environment properties",
+ );
+ assert.equal(
+ await environmentInspector
+ .getByRole("slider", { name: "Exposure slider", exact: true })
+ .count(),
+ 1,
+ "environment scalar controls use the shared draggable value rows",
+ );
+ const keyLight = environmentInspector.getByRole("button", { name: "Key light", exact: true });
+ assert.equal(await keyLight.getAttribute("aria-expanded"), "false");
+ await keyLight.click();
+ assert.equal(
+ await environmentInspector
+ .getByRole("slider", { name: "Key light intensity slider", exact: true })
+ .count(),
+ 1,
+ "light scalar controls use the shared draggable value rows",
+ );
+ const environmentPreset = environmentInspector.getByLabel(
+ "Environment preset",
+ { exact: true },
+ );
+ await environmentPreset.selectOption("studio");
+ const backgroundColor = environmentInspector.getByLabel("Background color", {
+ exact: true,
+ });
+ assert.equal(
+ await backgroundColor.inputValue(),
+ "#0d0d0d",
+ "environment inspector exposes the current background color",
+ );
+ const backgroundRow = backgroundColor.locator(
+ "xpath=ancestor::label[contains(@class, 'cw-inspector-property-row')]",
+ );
+ const backgroundLabelBox = await backgroundRow
+ .locator(".cw-inspector-property-label")
+ .boundingBox();
+ const backgroundControlBox = await backgroundRow
+ .locator(".cw-inspector-color-control")
+ .boundingBox();
+ assert.ok(
+ backgroundLabelBox &&
+ backgroundControlBox &&
+ backgroundControlBox.x > backgroundLabelBox.x &&
+ Math.abs(backgroundControlBox.y - backgroundLabelBox.y) < 12,
+ "environment properties align their label and control well in one row",
+ );
+ assert.equal(
+ await backgroundRow.getByText("#0D0D0D", { exact: true }).count(),
+ 1,
+ "color properties pair the swatch with a readable color value",
+ );
+ await environmentInspector
+ .getByLabel("Ground color", { exact: true })
+ .fill("#405060");
+ assert.equal(
+ await environmentPreset.inputValue(),
+ "custom",
+ "manual environment edits are labeled as custom rather than a stale preset",
+ );
+ await environmentInspector
+ .getByLabel("Show ground", { exact: true })
+ .uncheck();
+ await environmentInspector
+ .getByLabel("Key light intensity", { exact: true })
+ .fill("4.2");
+ await environmentInspector
+ .getByLabel("Show ground grid", { exact: true })
+ .uncheck();
+ assert.equal(
+ await environmentInspector
+ .getByLabel("Show ground", { exact: true })
+ .isChecked(),
+ false,
+ "the no-selection inspector updates the persisted ground visibility",
+ );
+ assert.equal(
+ await environmentInspector
+ .getByLabel("Key light intensity", { exact: true })
+ .inputValue(),
+ "4.2",
+ "the no-selection inspector updates stage lights",
+ );
+ await tree.getByRole("group").filter({ hasText: "Characters (1)" }).waitFor();
+ await tree
+ .getByRole("treeitem", { name: "Person 1", exact: false })
+ .getByRole("button")
+ .first()
+ .click();
+ assert.equal(
+ await environmentInspector.count(),
+ 0,
+ "selecting an object restores object properties",
+ );
+ await tree
+ .getByRole("treeitem", { name: "Person 1", exact: false })
+ .getByRole("button", { name: "Focus Person 1", exact: true })
+ .click();
+ await tree
+ .getByRole("group")
+ .filter({ hasText: "Characters (1)" })
+ .getByRole("button", { name: /Characters \(1\)/, exact: false })
+ .click();
+ assert.equal(
+ await tree
+ .getByRole("group")
+ .filter({ hasText: "Characters (1)" })
+ .getByRole("treeitem")
+ .count(),
+ 0,
+ "the group head collapses its rows",
+ );
+
+ // The anchored action bar duplicates and deletes the selection.
+ await tree
+ .getByRole("group")
+ .filter({ hasText: "Characters (1)" })
+ .getByRole("button", { name: /Characters \(1\)/, exact: false })
+ .click();
+ await tree
+ .getByRole("treeitem", { name: "Person 1", exact: false })
+ .locator("button")
+ .first()
+ .click();
+ const actionBar = page.locator(".cw-stage-actionbar");
+ await actionBar.waitFor();
+ await actionBar
+ .getByRole("button", { name: "Duplicate", exact: true })
+ .click();
+ await tree.getByRole("group").filter({ hasText: "Characters (2)" }).waitFor();
+ await actionBar
+ .getByRole("button", { name: "Delete this subject", exact: true })
+ .click();
+ await tree.getByRole("group").filter({ hasText: "Characters (1)" }).waitFor();
+
+ // View settings toggle the indicator and the name labels.
+ await page
+ .getByRole("button", { name: "View settings overlay", exact: true })
+ .click();
+ const menu = page.locator(".cw-stage-viewmenu");
+ await menu.waitFor();
+ assert.equal(await page.locator(".cw-stage-viewinfo").isVisible(), true);
+ await menu.getByLabel("View indicator", { exact: true }).uncheck();
+ await page.waitForTimeout(300);
+ assert.equal(await page.locator(".cw-stage-viewinfo").isVisible(), false);
+ await menu.getByLabel("View indicator", { exact: true }).check();
+ await menu.getByLabel("Object names", { exact: true }).uncheck();
+ await page.waitForTimeout(300);
+ assert.equal(await page.locator(".cw-stage-name").first().isVisible(), false);
+ await menu.getByLabel("Object names", { exact: true }).check();
+ await page.keyboard.press("Escape");
+
+ // Keyboard camera movement is always available; the old mode toggle is
+ // intentionally gone. Holding a movement key changes the rendered view.
+ assert.equal(
+ await page.getByRole("button", { name: "Roam view", exact: true }).count(),
+ 0,
+ "camera movement does not require a roam-mode button",
+ );
+ const scene = await sceneBox();
+ const canvas = page.locator(".cw-stage-scene canvas").first();
+ const before = await canvas.evaluate((element) => element.toDataURL());
+ await page.mouse.click(scene.x + scene.width / 2, scene.y + scene.height / 2);
+ await page.keyboard.down("d");
+ await page.waitForTimeout(250);
+ await page.keyboard.up("d");
+ const after = await canvas.evaluate((element) => element.toDataURL());
+ assert.notEqual(after, before, "holding D moves the default viewport camera");
+ assert.deepEqual(errors, []);
+} catch (error) {
+ console.error((await page.locator("body").innerText()).slice(-2500));
+ throw error;
+} finally {
+ await browser.close();
+}
+console.log(
+ JSON.stringify({
+ passed: true,
+ projectId,
+ itemId,
+ checks: [
+ "arming a preset shows the hint and Escape disarms",
+ "preview cards place characters and built-in objects",
+ "a viewport click lands the object and opens the first-time help",
+ "the scene tree groups subjects and collapses",
+ "empty viewport selection exposes environment properties",
+ "object selection restores object properties",
+ "tree focus selects without dirtying the camera",
+ "the anchored action bar duplicates and deletes",
+ "view settings toggle the indicator and name labels",
+ "WASD/QE move the default viewport camera without a roam toggle",
+ "no page errors",
+ ],
+ }),
+);
diff --git a/tests/browser/director_stage_layout.mjs b/tests/browser/director_stage_layout.mjs
new file mode 100644
index 000000000..0a3d6b131
--- /dev/null
+++ b/tests/browser/director_stage_layout.mjs
@@ -0,0 +1,213 @@
+/** First-phase Director Stage acceptance: resize the left and right panels
+ * and the dynamic timeline with pointer and keyboard input. */
+import assert from "node:assert/strict";
+const { chromium } = await import(
+ process.env.PLAYWRIGHT_MODULE ?? "playwright-core",
+);
+
+const base = process.env.CREATION_WEB_URL ?? "http://127.0.0.1:5179";
+const api = process.env.CREATION_API_URL ?? "http://127.0.0.1:8019";
+const headers = {
+ "X-OpenDirector-Request": "1",
+ "Content-Type": "application/json",
+};
+
+async function call(path, body) {
+ const response = await fetch(api + path, {
+ headers,
+ ...(body ? { method: "POST", body: JSON.stringify(body) } : {}),
+ });
+ assert.ok(response.ok, `${response.status}: ${await response.clone().text()}`);
+ return response.json();
+}
+
+assert.equal((await call("/api/creation-test-health")).isolated, true);
+
+const projectId = crypto.randomUUID();
+await call(`/api/creation/projects/${projectId}/commands`, {
+ commandId: crypto.randomUUID(),
+ projectId,
+ type: "project.create",
+ payload: { name: `Director Stage layout ${projectId.slice(0, 8)}` },
+});
+const state = () => call(`/api/creation/projects/${projectId}`);
+const browser = await chromium.launch({
+ headless: true,
+ ...(process.env.CHROMIUM_PATH
+ ? { executablePath: process.env.CHROMIUM_PATH }
+ : {}),
+ args: ["--no-sandbox", "--enable-unsafe-swiftshader"],
+});
+const page = await browser.newPage({
+ locale: "en-US",
+ viewport: { width: 1700, height: 1100 },
+});
+await page.addInitScript(() => {
+ localStorage.setItem("opendirector.modelSetup.v1", "dismissed");
+});
+page.setDefaultTimeout(20000);
+const errors = [];
+page.on("pageerror", (error) => errors.push(error.message));
+
+const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
+const stageDocument = (snapshot) =>
+ snapshot.editorDocuments.find((candidate) => candidate.kind === "director");
+const until = async (predicate, label) => {
+ const deadline = Date.now() + 20000;
+ let snapshot;
+ while (Date.now() < deadline) {
+ snapshot = await state();
+ if (predicate(snapshot)) return snapshot;
+ await sleep(100);
+ }
+ throw new Error(`Timeout: ${label}; snapshot: ${JSON.stringify(snapshot)}`);
+};
+
+const value = (locator) => locator.getAttribute("aria-valuenow");
+const numericValue = async (locator) => Number(await value(locator));
+const drag = async (locator, dx, dy) => {
+ const box = await locator.boundingBox();
+ assert.ok(box);
+ const x = box.x + box.width / 2;
+ const y = box.y + box.height / 2;
+ await page.mouse.move(x, y);
+ await page.mouse.down();
+ await page.mouse.move(x + dx, y + dy, { steps: 5 });
+ await page.mouse.up();
+};
+
+let itemId;
+try {
+ await page.goto(`${base}/ai-tool/ai-canvas/${projectId}?creation=unified`);
+ await page.getByText("Saved on this device", { exact: true }).waitFor();
+ await page
+ .getByRole("button", { name: "Add Director Stage", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor();
+ const created = await until(
+ (snapshot) => stageDocument(snapshot)?.kind === "director",
+ "created director document",
+ );
+ itemId = created.canvasItems.find((item) => item.kind === "external").id;
+
+ const left = page.getByTestId("director-stage-left-resizer");
+ const right = page.getByTestId("director-stage-right-resizer");
+ assert.equal(await numericValue(left), 196);
+ assert.equal(await numericValue(right), 232);
+
+ await left.focus();
+ await left.press("ArrowRight");
+ assert.equal(await numericValue(left), 204);
+ await right.focus();
+ await right.press("ArrowLeft");
+ assert.equal(await numericValue(right), 240);
+
+ const leftBeforeDrag = await numericValue(left);
+ await drag(left, 40, 0);
+ assert.ok(
+ (await numericValue(left)) > leftBeforeDrag,
+ "left panel grows when its separator moves right",
+ );
+
+ const rightBeforeDrag = await numericValue(right);
+ await drag(right, -40, 0);
+ assert.ok(
+ (await numericValue(right)) > rightBeforeDrag,
+ "right panel grows when its separator moves left",
+ );
+
+ await page
+ .getByRole("group", { name: "Preview mode", exact: true })
+ .getByRole("button", { name: "Dynamic", exact: true })
+ .click();
+ const timeline = page.getByTestId("director-stage-timeline-resizer");
+ await timeline.waitFor();
+ assert.equal(await numericValue(timeline), 176);
+ await timeline.focus();
+ await timeline.press("ArrowUp");
+ assert.equal(await numericValue(timeline), 184);
+ const timelineBeforeDrag = await numericValue(timeline);
+ await drag(timeline, 0, -32);
+ assert.ok(
+ (await numericValue(timeline)) > timelineBeforeDrag,
+ "timeline grows when its top edge moves upward",
+ );
+
+ const leftPanel = page.locator(".cw-stage-left");
+ const rightPanel = page.locator(".cw-stage-right");
+ const footer = page.locator(".cw-stage-bottom");
+ const consoleBox = await page.locator(".cw-stage-console").boundingBox();
+ const leftPanelBox = await leftPanel.boundingBox();
+ const rightPanelBox = await rightPanel.boundingBox();
+ const leftResizerBox = await left.boundingBox();
+ const rightResizerBox = await right.boundingBox();
+ const footerBox = await footer.boundingBox();
+ assert.ok(
+ consoleBox &&
+ leftPanelBox &&
+ rightPanelBox &&
+ leftResizerBox &&
+ rightResizerBox &&
+ footerBox,
+ );
+ assert.ok(
+ Math.abs(leftPanelBox.y + leftPanelBox.height - footerBox.y) < 2,
+ "left panel ends at the dynamic timeline",
+ );
+ assert.ok(
+ Math.abs(rightPanelBox.y + rightPanelBox.height - footerBox.y) < 2,
+ "right panel ends at the dynamic timeline",
+ );
+ assert.ok(
+ Math.abs(leftResizerBox.y + leftResizerBox.height - footerBox.y) < 2,
+ "left separator highlight ends at the dynamic timeline",
+ );
+ assert.ok(
+ Math.abs(rightResizerBox.y + rightResizerBox.height - footerBox.y) < 2,
+ "right separator highlight ends at the dynamic timeline",
+ );
+ assert.ok((await leftPanel.boundingBox()).width > 196);
+ assert.ok((await rightPanel.boundingBox()).width > 232);
+ assert.ok((await footer.boundingBox()).height > 176);
+
+ // Layout is session-only. Applying and reopening the same document starts
+ // from the default layout and does not write view dimensions to the project.
+ await page.getByRole("button", { name: "Apply edits", exact: true }).click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor({ state: "detached" });
+ await page.locator(`.react-flow__node[data-id="${itemId}"]`).click();
+ await page
+ .getByRole("button", { name: "Open Director Stage", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor();
+ assert.equal(await numericValue(page.getByTestId("director-stage-left-resizer")), 196);
+ assert.equal(await numericValue(page.getByTestId("director-stage-right-resizer")), 232);
+
+ assert.deepEqual(errors, []);
+} catch (error) {
+ console.error((await page.locator("body").innerText()).slice(-2500));
+ throw error;
+} finally {
+ await browser.close();
+}
+
+console.log(
+ JSON.stringify({
+ passed: true,
+ projectId,
+ itemId,
+ checks: [
+ "left and right panel keyboard resizing",
+ "left and right panel pointer resizing",
+ "dynamic timeline keyboard and pointer resizing",
+ "layout geometry follows the announced values",
+ "layout resets on editor reopen and is not persisted",
+ "no page errors",
+ ],
+ }),
+);
diff --git a/tests/browser/director_stage_output.mjs b/tests/browser/director_stage_output.mjs
new file mode 100644
index 000000000..6512a0119
--- /dev/null
+++ b/tests/browser/director_stage_output.mjs
@@ -0,0 +1,566 @@
+/** Fourth-phase Director Stage acceptance: captured stills and preview MP4s
+ * become tracked project assets that the timeline can reference. */
+import assert from "node:assert/strict";
+const { chromium } = await import(
+ process.env.PLAYWRIGHT_MODULE ?? "playwright-core"
+);
+
+const base = process.env.CREATION_WEB_URL ?? "http://127.0.0.1:5179";
+const api = process.env.CREATION_API_URL ?? "http://127.0.0.1:8019";
+const headers = {
+ "X-OpenDirector-Request": "1",
+ "Content-Type": "application/json",
+};
+
+async function call(path, body, extra = {}) {
+ const response = await fetch(api + path, {
+ headers: { ...headers, ...extra },
+ ...(body
+ ? { method: "POST", body: JSON.stringify(body) }
+ : {}),
+ });
+ assert.ok(response.ok, `${response.status}: ${await response.clone().text()}`);
+ return response.json();
+}
+
+assert.equal((await call("/api/creation-test-health")).isolated, true);
+
+const projectId = crypto.randomUUID();
+await call(`/api/creation/projects/${projectId}/commands`, {
+ commandId: crypto.randomUUID(),
+ projectId,
+ type: "project.create",
+ payload: { name: `Director output ${projectId.slice(0, 8)}` },
+});
+
+const state = () => call(`/api/creation/projects/${projectId}`);
+const browser = await chromium.launch({
+ headless: true,
+ ...(process.env.CHROMIUM_PATH
+ ? { executablePath: process.env.CHROMIUM_PATH }
+ : {}),
+ args: ["--no-sandbox", "--enable-unsafe-swiftshader"],
+});
+const page = await browser.newPage({
+ locale: "en-US",
+ viewport: { width: 1700, height: 1100 },
+ // Still capture must stay at encoder resolution on high-DPI displays;
+ // run once with CREATION_DEVICE_SCALE_FACTOR=2 to verify.
+ ...(process.env.CREATION_DEVICE_SCALE_FACTOR
+ ? {
+ deviceScaleFactor: Number(process.env.CREATION_DEVICE_SCALE_FACTOR),
+ }
+ : {}),
+});
+await page.addInitScript(() => {
+ localStorage.setItem("opendirector.modelSetup.v1", "dismissed");
+ localStorage.setItem("opendirector.locale.v1", "en-US");
+});
+page.setDefaultTimeout(20000);
+const errors = [];
+page.on("pageerror", (error) => errors.push(error.message));
+
+const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
+const until = async (predicate, label) => {
+ const deadline = Date.now() + 20000;
+ let snapshot;
+ while (Date.now() < deadline) {
+ snapshot = await state();
+ if (predicate(snapshot)) return snapshot;
+ await sleep(100);
+ }
+ throw new Error(`Timeout: ${label}; snapshot: ${JSON.stringify(snapshot)}`);
+};
+
+const stageDoc = (snapshot) =>
+ snapshot.editorDocuments.find((candidate) => candidate.kind === "director");
+const imageAssets = (snapshot) =>
+ snapshot.assets.filter((asset) => asset.kind === "image");
+const browserSessions = new Set();
+page.on("request", (request) => {
+ const value = request.headers()["x-opendirector-session"];
+ if (value) browserSessions.add(value);
+});
+const apply = async () => {
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor({ state: "detached" });
+};
+const openStage = async (itemId) => {
+ await page.locator(`.react-flow__node[data-id="${itemId}"]`).click();
+ await page
+ .getByRole("button", { name: "Open Director Stage", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor();
+};
+
+const timelineId = crypto.randomUUID();
+const clipId = crypto.randomUUID();
+let firstStill, secondStill, videoRef, videoAsset, itemId;
+try {
+ await page.goto(`${base}/ai-tool/ai-canvas/${projectId}?creation=unified`);
+ await page.getByText("Saved on this device", { exact: true }).waitFor();
+ await page
+ .getByRole("button", { name: "Add Director Stage", exact: true })
+ .click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor();
+ const created = await until(
+ (snapshot) => stageDoc(snapshot)?.kind === "director",
+ "created director document",
+ );
+ itemId = created.canvasItems.find((item) => item.kind === "external").id;
+ // Stages start empty; import the same minimal single-subject stage the
+ // gizmo journey does, so the reopened stage below has a selected subject
+ // whose Position X can be edited. The seed lands before the first apply,
+ // so the subject is part of the persisted document. It keeps the default
+ // duration, which the step below then changes to 1.
+ await page
+ .locator('input[type="file"][accept^="application/json"]')
+ .setInputFiles({
+ name: "seed.stage.json",
+ mimeType: "application/json",
+ buffer: Buffer.from(
+ JSON.stringify({
+ format: "opendirector-local-stage",
+ version: 2,
+ background: "#151923",
+ grid: true,
+ duration: 6,
+ fps: 30,
+ aspectRatio: "16:9",
+ activeCameraId: "camera-1",
+ cameraSource: "camera",
+ shots: [],
+ cameras: [
+ {
+ id: "camera-1",
+ name: "Camera 1",
+ pose: {
+ position: { x: 5, y: 3.5, z: 7 },
+ target: { x: 0, y: 1, z: 0 },
+ fov: 45,
+ },
+ keyframes: [],
+ },
+ ],
+ objects: [
+ {
+ id: "seed-subject",
+ kind: "person",
+ name: "Subject",
+ color: "#a09af9",
+ position: { x: 0, y: 0, z: 0 },
+ rotation: { x: 0, y: 0, z: 0 },
+ scale: { x: 1, y: 1, z: 1 },
+ visible: true,
+ locked: false,
+ opacity: 1,
+ keyframes: [],
+ motionClips: [],
+ },
+ ],
+ }),
+ ),
+ });
+ await page.getByLabel("Position X", { exact: true }).waitFor();
+ // The console opens in static mode; the timeline transport with the stage
+ // duration lives in dynamic mode.
+ await page
+ .getByRole("button", { name: "Dynamic", exact: true })
+ .click();
+ await page.getByLabel("Stage duration", { exact: true }).fill("1");
+ await page.getByLabel("Stage duration", { exact: true }).press("Enter");
+ await until((snapshot) => stageDoc(snapshot)?.data.duration === 1, "stage duration saved");
+
+ const capture = page.getByRole("button", {
+ name: "Capture camera still",
+ exact: true,
+ });
+ const readyDeadline = Date.now() + 20000;
+ while (!(await capture.isEnabled())) {
+ if (Date.now() > readyDeadline) throw new Error("stage renderer not ready");
+ await page.waitForTimeout(100);
+ }
+ await apply();
+
+ const captured = await until(
+ (snapshot) => stageDoc(snapshot)?.data.stills?.length === 1,
+ "first apply registers a captured still",
+ );
+ firstStill = stageDoc(captured).data.stills[0];
+ assert.equal(firstStill.kind, "image");
+ const firstImage = captured.assets.find(
+ (asset) => asset.id === firstStill.assetId,
+ );
+ assert.ok(firstImage, "the still is a real project asset");
+ assert.equal(firstImage.metadata.mimeType, "image/png");
+ assert.equal(firstImage.metadata.width, 1280);
+ assert.equal(firstImage.metadata.height, 720);
+
+ // The drawer reopens the collection: preview, selection and the
+ // add-to-canvas channel all act on the pinned still.
+ await openStage(itemId);
+ // The viewfinder is a pressed button, not a checkbox.
+ const viewfinder = page.getByRole("button", {
+ name: "Viewfinder",
+ exact: true,
+ });
+ await viewfinder.click();
+ assert.equal(await viewfinder.getAttribute("aria-pressed"), "true");
+ await page.waitForTimeout(150);
+ assert.equal(
+ await page.locator(".cw-stage-gizmo").isVisible(),
+ false,
+ "viewfinder hides director gizmos",
+ );
+ // Every name layer the viewport holds is hidden; the development server mounts
+ // the viewport twice and leaves one empty layer behind.
+ assert.equal(
+ await page.locator(".cw-stage-names").evaluateAll((elements) =>
+ elements.every((element) => getComputedStyle(element).display === "none"),
+ ),
+ true,
+ "viewfinder hides director labels",
+ );
+ await viewfinder.click();
+ assert.equal(await viewfinder.getAttribute("aria-pressed"), "false");
+ await page
+ .getByRole("button", { name: /^Shot materials/, exact: false })
+ .click();
+ const drawer = page.getByRole("region", { name: "Shot materials" });
+ await drawer.getByText("Capture_01", { exact: true }).waitFor();
+ await drawer.getByText("16:9", { exact: true }).waitFor();
+ await drawer
+ .getByRole("button", { name: "Preview Capture_01", exact: true })
+ .click();
+ const lightbox = page.getByRole("dialog", { name: "Capture_01" });
+ await lightbox.locator("img").waitFor();
+ await lightbox
+ .getByRole("button", { name: "Close preview", exact: true })
+ .click();
+ await drawer.getByLabel("Capture_01", { exact: true }).check();
+ await drawer.getByText("1 selected", { exact: true }).waitFor();
+ await drawer
+ .getByRole("button", { name: "Add to canvas", exact: true })
+ .click();
+ // Publishing saves the stage first; wait for the completion notice so
+ // the apply below never races the publication.
+ await page
+ .getByText("Added 1 still(s) to canvas.", { exact: true })
+ .waitFor({ timeout: 60000 });
+ const stillPublished = await until(
+ (snapshot) =>
+ snapshot.canvasItems.some(
+ (item) => item.kind === "image" && item.binding.role === "material",
+ ),
+ "the pinned still publishes an image node",
+ );
+ const stillItem = stillPublished.canvasItems.find(
+ (item) => item.kind === "image" && item.binding.role === "material",
+ );
+ // The publication imports the still bytes fresh: a distinct asset with
+ // the pinned still's content fingerprint.
+ assert.equal(
+ stillItem.binding.objectRef.fingerprint,
+ firstStill.fingerprint,
+ );
+ // The publication imported its own copy; applying without a new capture
+ // must not import anything beyond that.
+ const assetsBeforeApply = imageAssets(await state()).length;
+ await apply();
+ const unchanged = await until(
+ (snapshot) => stageDoc(snapshot)?.data.stills?.length === 1,
+ "apply without capture keeps the pinned still",
+ );
+ assert.equal(imageAssets(unchanged).length, assetsBeforeApply);
+ assert.deepEqual(
+ stageDoc(unchanged).data.stills.map((still) => still.assetId),
+ [firstStill.assetId],
+ );
+
+ await openStage(itemId);
+ await page.getByLabel("Position X", { exact: true }).fill("2");
+ await capture.click();
+ await page
+ .getByText(
+ "Still captured. Applying registers it as a project image asset.",
+ { exact: true },
+ )
+ .waitFor();
+ await apply();
+ const recaptured = await until(
+ (snapshot) =>
+ imageAssets(snapshot).length === imageAssets(unchanged).length + 1,
+ "an explicit capture registers a second still",
+ );
+ const stillList = stageDoc(recaptured).data.stills;
+ assert.equal(stillList.length, 2);
+ secondStill = stillList[1];
+ assert.notEqual(secondStill.assetId, firstStill.assetId);
+ assert.ok(
+ recaptured.assets.some((asset) => asset.id === firstStill.assetId),
+ "the earlier still stays registered instead of being overwritten",
+ );
+
+ // Deleting from the drawer drops the pin but keeps the asset registered.
+ await openStage(itemId);
+ await page
+ .getByRole("button", { name: /^Shot materials/, exact: false })
+ .click();
+ const deleteDrawer = page.getByRole("region", { name: "Shot materials" });
+ await deleteDrawer.getByText("Capture_02", { exact: true }).waitFor();
+ await deleteDrawer.getByLabel("Capture_01", { exact: true }).check();
+ await deleteDrawer
+ .getByRole("button", { name: "Delete selected", exact: true })
+ .click();
+ await apply();
+ const deleted = await until(
+ (snapshot) => stageDoc(snapshot)?.data.stills?.length === 1,
+ "a drawer deletion removes only the selected pin",
+ );
+ assert.equal(stageDoc(deleted).data.stills[0].assetId, secondStill.assetId);
+ assert.ok(
+ deleted.assets.some((asset) => asset.id === firstStill.assetId),
+ "the deleted still's asset stays registered",
+ );
+
+ // Export dialog: source, linked duration, quality and frame rate.
+ await openStage(itemId);
+ await page
+ .getByRole("button", { name: "Render preview MP4", exact: true })
+ .click();
+ const exportDialog = page.getByRole("dialog", { name: "Export video" });
+ await exportDialog
+ .getByText("Pick one camera to export the full dynamic preview.", {
+ exact: true,
+ })
+ .waitFor();
+ // No shots yet: per-camera options only, duration follows the document.
+ assert.equal(
+ await exportDialog.getByRole("option", { name: "Storyboard" }).count(),
+ 0,
+ );
+ await exportDialog.getByText("00:01.0").waitFor();
+ await exportDialog.getByLabel("Frame rate").selectOption("25");
+ await exportDialog
+ .getByRole("button", { name: "Export", exact: true })
+ .click();
+ await page
+ .getByText("Preview MP4 complete · 1280×720 · 25 fps", { exact: true })
+ .waitFor({ timeout: 240000 });
+ await page
+ .getByRole("button", { name: "Add preview video to canvas", exact: true })
+ .click();
+ const published = await until(
+ (snapshot) =>
+ snapshot.canvasItems.some(
+ (item) => item.kind === "video" && item.binding.role === "material",
+ ),
+ "the preview MP4 publishes an output node",
+ );
+ const outputItem = published.canvasItems.find(
+ (item) => item.kind === "video" && item.binding.role === "material",
+ );
+ videoRef = outputItem.binding.objectRef;
+ videoAsset = published.assets.find((asset) => asset.id === videoRef.assetId);
+ assert.ok(videoAsset, "the MP4 output pins a real project asset");
+ assert.equal(videoAsset.kind, "video");
+ assert.equal(videoAsset.metadata.mimeType, "video/mp4");
+ assert.ok(videoAsset.metadata.durationSeconds >= 0.9);
+
+ // A second export from the same session must render and publish again:
+ // the drawer keeps preparing fresh documents instead of reusing the
+ // previous render's frozen state. (Storyboard-shot authoring has no UI in
+ // this build, so the source stays per-camera.)
+ await page
+ .getByRole("button", { name: "Render preview MP4", exact: true })
+ .click();
+ const secondDialog = page.getByRole("dialog", { name: "Export video" });
+ await secondDialog.getByText("00:01.0").waitFor();
+ assert.equal(
+ await secondDialog.getByRole("option", { name: "Storyboard" }).count(),
+ 0,
+ );
+ await secondDialog.getByLabel("Frame rate").selectOption("25");
+ await secondDialog
+ .getByRole("button", { name: "Export", exact: true })
+ .click();
+ await page
+ .getByText("Preview MP4 complete · 1280×720 · 25 fps", { exact: true })
+ .waitFor({ timeout: 240000 });
+ await page
+ .getByRole("button", { name: "Add preview video to canvas", exact: true })
+ .click();
+ await until(
+ (snapshot) =>
+ snapshot.canvasItems.filter(
+ (item) => item.kind === "video" && item.binding.role === "material",
+ ).length === 2,
+ "the second export publishes another output node",
+ );
+
+ // Captures made after a render must still publish: the drawer always
+ // prepares fresh instead of reusing the render's frozen document.
+ await capture.click();
+ await page
+ .getByText(
+ "Still captured. Applying registers it as a project image asset.",
+ { exact: true },
+ )
+ .waitFor();
+ await page
+ .getByRole("button", { name: /^Shot materials/, exact: false })
+ .click();
+ // Drawer names are positional: after the deletion the remaining still
+ // renumbers to Capture_01, so the fresh capture lands as Capture_02.
+ const lateDrawer = page.getByRole("region", { name: "Shot materials" });
+ await lateDrawer.getByText("Capture_02", { exact: true }).waitFor();
+ await lateDrawer.getByLabel("Capture_02", { exact: true }).check();
+ await lateDrawer
+ .getByRole("button", { name: "Add to canvas", exact: true })
+ .click();
+ await page
+ .getByText("Added 1 still(s) to canvas.", { exact: true })
+ .waitFor({ timeout: 60000 });
+
+ await page.reload({ waitUntil: "domcontentloaded" });
+ await page.getByText("Saved on this device", { exact: true }).waitFor();
+ const reopened = await state();
+ assert.equal(stageDoc(reopened).data.stills[0].assetId, secondStill.assetId);
+ assert.ok(
+ reopened.canvasItems.some((item) => item.id === outputItem.id),
+ "the published output node survives reload",
+ );
+ await openStage(itemId);
+ await apply();
+ assert.deepEqual(errors, []);
+} catch (error) {
+ console.error((await page.locator("body").innerText()).slice(-2500));
+ throw error;
+} finally {
+ await browser.close();
+}
+
+// The browser lease outlives page close; release it before opening a
+// session of our own to reference the published output from a timeline.
+for (const id of browserSessions) {
+ const response = await fetch(`${api}/api/creation/sessions/${id}`, {
+ method: "DELETE",
+ headers,
+ });
+ assert.ok(
+ response.ok,
+ `release ${id}: ${response.status} ${await response.text()}`,
+ );
+}
+const sessionId = crypto.randomUUID();
+const session = { "X-OpenDirector-Session": sessionId };
+await call(`/api/creation/projects/${projectId}/open`, {}, session);
+const resource = {
+ asset: videoRef,
+ title: "Director shot",
+ durationSeconds: videoAsset.metadata.durationSeconds,
+};
+await call(
+ `/api/creation/projects/${projectId}/commands`,
+ {
+ commandId: crypto.randomUUID(),
+ projectId,
+ type: "creation.batch",
+ payload: {
+ operations: [
+ {
+ type: "editor.create",
+ payload: {
+ document: {
+ id: timelineId,
+ projectId,
+ revision: 1,
+ kind: "timeline",
+ inputConnections: [],
+ data: {
+ fps: 30,
+ width: 1280,
+ height: 720,
+ importedAssets: [resource],
+ tracks: [
+ {
+ id: "visual",
+ kind: "visual",
+ title: "Visual",
+ clips: [
+ {
+ id: clipId,
+ resource,
+ inPoint: 0,
+ outPoint: videoAsset.metadata.durationSeconds,
+ },
+ ],
+ },
+ ],
+ },
+ },
+ },
+ },
+ {
+ type: "canvas.show",
+ payload: {
+ item: {
+ id: crypto.randomUUID(),
+ projectId,
+ kind: "timeline",
+ title: "Director timeline",
+ binding: {
+ role: "editor",
+ objectRef: { id: timelineId, kind: "timeline" },
+ },
+ },
+ },
+ },
+ ],
+ },
+ },
+ session,
+);
+await fetch(`${api}/api/creation/sessions/${sessionId}`, { method: "DELETE" });
+const final = await until(
+ (snapshot) => snapshot.editorDocuments.some((doc) => doc.id === timelineId),
+ "timeline referencing the director output",
+);
+const timeline = final.editorDocuments.find((doc) => doc.id === timelineId);
+assert.equal(
+ timeline.data.tracks[0].clips[0].resource.asset.assetId,
+ videoAsset.id,
+);
+console.log(
+ JSON.stringify({
+ passed: true,
+ projectId,
+ itemId,
+ stillAssetIds: [firstStill.assetId, secondStill.assetId],
+ videoAssetId: videoAsset.id,
+ timelineId,
+ checks: [
+ "first apply auto-captures a 1280x720 still asset",
+ "the drawer previews, selects and publishes the pinned still to the canvas",
+ "viewfinder hides director-only DOM overlays",
+ "an explicit capture appends a second still and keeps the old one registered",
+ "a drawer deletion removes only the selected pin",
+ "the export dialog offers per-camera sources and a linked duration",
+ "the export dialog renders at the chosen frame rate",
+ "a second export from the same session renders and publishes again",
+ "captures made after a render still publish through a fresh prepare",
+ "preview MP4 publishes an output node with a real video asset",
+ "timeline clip references the published assetId",
+ "stage, stills, output and timeline survive reload",
+ "no page errors",
+ ],
+ }),
+);
diff --git a/tests/browser/director_stage_pointer_alignment.mjs b/tests/browser/director_stage_pointer_alignment.mjs
new file mode 100644
index 000000000..9ff834577
--- /dev/null
+++ b/tests/browser/director_stage_pointer_alignment.mjs
@@ -0,0 +1,518 @@
+import assert from "node:assert/strict";
+const { chromium } = await import(
+ process.env.PLAYWRIGHT_MODULE ?? "playwright-core"
+);
+
+const base = process.env.CREATION_WEB_URL ?? "http://127.0.0.1:5179";
+const api = process.env.CREATION_API_URL ?? "http://127.0.0.1:8019";
+const headers = {
+ "X-OpenDirector-Request": "1",
+ "Content-Type": "application/json",
+};
+async function call(path, body) {
+ const response = await fetch(api + path, {
+ headers,
+ ...(body ? { method: "POST", body: JSON.stringify(body) } : {}),
+ });
+ assert.ok(
+ response.ok,
+ `${response.status}: ${await response.clone().text()}`,
+ );
+ return response.json();
+}
+
+assert.equal((await call("/api/creation-test-health")).isolated, true);
+const projectId = crypto.randomUUID();
+await call(`/api/creation/projects/${projectId}/commands`, {
+ commandId: crypto.randomUUID(),
+ projectId,
+ type: "project.create",
+ payload: { name: `Pointer alignment ${projectId.slice(0, 8)}` },
+});
+const state = () => call(`/api/creation/projects/${projectId}`);
+const stageDoc = (snapshot) =>
+ snapshot.editorDocuments.find((candidate) => candidate.kind === "director");
+const browser = await chromium.launch({
+ headless: true,
+ ...(process.env.CHROMIUM_PATH
+ ? { executablePath: process.env.CHROMIUM_PATH }
+ : {}),
+ args: ["--no-sandbox", "--enable-unsafe-swiftshader"],
+});
+const page = await browser.newPage({
+ locale: "en-US",
+ viewport: { width: 1700, height: 1100 },
+ deviceScaleFactor: 2,
+});
+page.setDefaultTimeout(20000);
+await page.addInitScript(() =>
+ localStorage.setItem("opendirector.modelSetup.v1", "dismissed"),
+);
+const until = async (predicate, label) => {
+ const deadline = Date.now() + 20000;
+ let snapshot;
+ while (Date.now() < deadline) {
+ snapshot = await state();
+ if (predicate(snapshot)) return snapshot;
+ await page.waitForTimeout(100);
+ }
+ throw new Error(`Timeout: ${label}; snapshot: ${JSON.stringify(snapshot)}`);
+};
+const sub3 = (a, b) => ({ x: a.x - b.x, y: a.y - b.y, z: a.z - b.z });
+const cross3 = (a, b) => ({
+ x: a.y * b.z - a.z * b.y,
+ y: a.z * b.x - a.x * b.z,
+ z: a.x * b.y - a.y * b.x,
+});
+const normalize3 = (a) => {
+ const length = Math.hypot(a.x, a.y, a.z);
+ return { x: a.x / length, y: a.y / length, z: a.z / length };
+};
+const camera = {
+ eye: { x: 8, y: 6, z: 10 },
+ target: { x: 0, y: 1, z: 0 },
+ fov: 45,
+};
+const groundPointAt = (box, xFraction, yFraction) => {
+ const forward = normalize3(sub3(camera.target, camera.eye));
+ const right = normalize3(cross3(forward, { x: 0, y: 1, z: 0 }));
+ const up = normalize3(cross3(right, forward));
+ const nx = xFraction * 2 - 1;
+ const ny = 1 - yFraction * 2;
+ const halfHeight = Math.tan((camera.fov * Math.PI) / 360);
+ const halfWidth = halfHeight * (box.width / box.height);
+ const direction = normalize3({
+ x: forward.x + right.x * halfWidth * nx + up.x * halfHeight * ny,
+ y: forward.y + right.y * halfWidth * nx + up.y * halfHeight * ny,
+ z: forward.z + right.z * halfWidth * nx + up.z * halfHeight * ny,
+ });
+ const distance = -camera.eye.y / direction.y;
+ return {
+ x: camera.eye.x + direction.x * distance,
+ z: camera.eye.z + direction.z * distance,
+ };
+};
+const projectPointAt = (box, point) => {
+ const forward = normalize3(sub3(camera.target, camera.eye));
+ const right = normalize3(cross3(forward, { x: 0, y: 1, z: 0 }));
+ const up = normalize3(cross3(right, forward));
+ const view = sub3(point, camera.eye);
+ const depth = view.x * forward.x + view.y * forward.y + view.z * forward.z;
+ const halfHeight = depth * Math.tan((camera.fov * Math.PI) / 360);
+ const halfWidth = halfHeight * (box.width / box.height);
+ return {
+ x:
+ box.x +
+ (((view.x * right.x + view.y * right.y + view.z * right.z) / halfWidth +
+ 1) *
+ box.width) /
+ 2,
+ y:
+ box.y +
+ ((1 - (view.x * up.x + view.y * up.y + view.z * up.z) / halfHeight) *
+ box.height) /
+ 2,
+ };
+};
+const coloredPixelsNear = async (screenshot, center, radius) =>
+ page.evaluate(
+ ({ dataUrl, center, radius }) =>
+ new Promise((resolve, reject) => {
+ const image = new Image();
+ image.onload = () => {
+ const canvas = document.createElement("canvas");
+ canvas.width = image.naturalWidth;
+ canvas.height = image.naturalHeight;
+ const context = canvas.getContext("2d");
+ if (!context) return reject(new Error("2D canvas is unavailable"));
+ context.drawImage(image, 0, 0);
+ const pixels = context.getImageData(
+ 0,
+ 0,
+ canvas.width,
+ canvas.height,
+ ).data;
+ const scale = canvas.width / window.innerWidth;
+ const x = center.x * scale;
+ const y = center.y * scale;
+ const r = radius * scale;
+ let count = 0;
+ for (
+ let py = Math.max(0, Math.floor(y - r));
+ py < Math.min(canvas.height, Math.ceil(y + r));
+ py += 2
+ ) {
+ for (
+ let px = Math.max(0, Math.floor(x - r));
+ px < Math.min(canvas.width, Math.ceil(x + r));
+ px += 2
+ ) {
+ const offset = (py * canvas.width + px) * 4;
+ const red = pixels[offset];
+ const green = pixels[offset + 1];
+ const blue = pixels[offset + 2];
+ if (
+ (red > 180 && green < 80 && blue < 80) ||
+ (green > 180 && red < 80 && blue < 80) ||
+ (blue > 180 && red < 80 && green < 100)
+ )
+ count++;
+ }
+ }
+ resolve(count);
+ };
+ image.onerror = () => reject(new Error("screenshot decode failed"));
+ image.src = dataUrl;
+ }),
+ {
+ dataUrl: `data:image/png;base64,${screenshot.toString("base64")}`,
+ center,
+ radius,
+ },
+ );
+
+try {
+ await page.goto(`${base}/ai-tool/ai-canvas/${projectId}?creation=unified`);
+ await page.getByText("Saved on this device", { exact: true }).waitFor();
+ await page
+ .getByRole("button", { name: "Add Director Stage", exact: true })
+ .click();
+ await page.getByRole("button", { name: "Apply edits", exact: true }).waitFor();
+ const box = await page.locator(".cw-stage-scene").boundingBox();
+ assert.ok(box);
+ const clicks = [
+ [0.37, 0.53],
+ [0.58, 0.59],
+ [0.69, 0.66],
+ ];
+ for (const [x, y] of clicks) {
+ await page
+ .locator('.cw-stage-object-grid button[data-stage-placement-kind="person"]')
+ .first()
+ .click();
+ await page.mouse.click(box.x + box.width * x, box.y + box.height * y);
+ if (
+ await page
+ .getByRole("dialog", { name: "Director console controls" })
+ .count()
+ )
+ await page
+ .getByRole("dialog", { name: "Director console controls" })
+ .getByRole("button", { name: "Close help", exact: true })
+ .click();
+ }
+ const first = groundPointAt(box, ...clicks[0]);
+ const firstCenter = projectPointAt(box, { x: first.x, y: 0.9, z: first.z });
+ await page.mouse.click(firstCenter.x, firstCenter.y);
+ assert.equal(
+ await page
+ .locator(".cw-stage-right-tree .cw-stage-tree-row")
+ .filter({ hasText: "Person 1" })
+ .locator("button")
+ .first()
+ .getAttribute("aria-selected"),
+ "true",
+ "clicking the visible object center selects the object under the cursor",
+ );
+ await page.waitForTimeout(500);
+ const handleCenter = projectPointAt(box, { x: first.x, y: 0, z: first.z });
+ const handleAhead = projectPointAt(box, { x: first.x + 1, y: 0, z: first.z });
+ const handleDirection = {
+ x: handleAhead.x - handleCenter.x,
+ y: handleAhead.y - handleCenter.y,
+ };
+ const handleLength = Math.hypot(handleDirection.x, handleDirection.y);
+ const handleStart = {
+ x: handleCenter.x + (handleDirection.x / handleLength) * box.width * 0.03,
+ y: handleCenter.y + (handleDirection.y / handleLength) * box.width * 0.03,
+ };
+ const beforeDrag = Number(
+ await page.getByLabel("Position X", { exact: true }).inputValue(),
+ );
+ await page.mouse.move(handleStart.x, handleStart.y);
+ await page.mouse.down();
+ await page.mouse.move(
+ handleStart.x + (handleDirection.x / handleLength) * box.width * 0.08,
+ handleStart.y + (handleDirection.y / handleLength) * box.width * 0.08,
+ { steps: 12 },
+ );
+ await page.mouse.up();
+ const afterDrag = Number(
+ await page.getByLabel("Position X", { exact: true }).inputValue(),
+ );
+ assert.ok(
+ afterDrag > beforeDrag + 0.1,
+ `the visible X gizmo follows Person 1 after selection (before ${beforeDrag}, after ${afterDrag})`,
+ );
+ await page
+ .locator(".cw-stage-console")
+ .getByRole("button", { name: "Undo", exact: true })
+ .click();
+ await page.waitForFunction(
+ ({ label, value }) => {
+ const field = document.querySelector(`[aria-label="${label}"]`);
+ return (
+ field instanceof HTMLInputElement &&
+ Math.abs(Number(field.value) - value) < 0.01
+ );
+ },
+ { label: "Position X", value: beforeDrag },
+ );
+ // How far the selected subject stands above the ground is drawn in DOM over
+ // the WebGL frame. At 2x it has to land where the frame lands, follow the
+ // drag while the pointer is still down, and take no pointer itself.
+ const positionY = page.getByLabel("Position Y", { exact: true });
+ const readElevation = () =>
+ page.evaluate(() => {
+ const layer = document.querySelector(".cw-stage-elevation");
+ const label = document.querySelector(".cw-stage-elevation-value");
+ const ring = document.querySelector(".cw-stage-elevation-ring");
+ const rect = (element) => {
+ if (!element) return null;
+ const bounds = element.getBoundingClientRect();
+ return { x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height };
+ };
+ return {
+ shown:
+ layer instanceof HTMLElement &&
+ getComputedStyle(layer).display !== "none",
+ text: (label?.textContent ?? "").trim(),
+ aria: label?.getAttribute("aria-label") ?? null,
+ layer: rect(layer),
+ label: rect(label),
+ ring: rect(ring),
+ lines: [...document.querySelectorAll(".cw-stage-elevation-line")].map(
+ (line) => ({
+ shown: getComputedStyle(line).display !== "none",
+ from: {
+ x: Number(line.getAttribute("x1")),
+ y: Number(line.getAttribute("y1")),
+ },
+ to: {
+ x: Number(line.getAttribute("x2")),
+ y: Number(line.getAttribute("y2")),
+ },
+ }),
+ ),
+ };
+ });
+ const waitForElevation = (shown) =>
+ page.waitForFunction(
+ (shown) => {
+ const layer = document.querySelector(".cw-stage-elevation");
+ return (
+ layer instanceof HTMLElement &&
+ (getComputedStyle(layer).display !== "none") === shown
+ );
+ },
+ shown,
+ );
+ const metres = (text) => Number(text.replace(/[^\d.]/g, ""));
+ const near = (actual, expected, tolerance, what) =>
+ assert.ok(
+ Math.hypot(actual.x - expected.x, actual.y - expected.y) <= tolerance,
+ `${what}: (${actual.x.toFixed(1)}, ${actual.y.toFixed(1)}) against (${expected.x.toFixed(1)}, ${expected.y.toFixed(1)})`,
+ );
+ await waitForElevation(false);
+
+ // The Y arrow runs up from where the X arrow starts.
+ const liftAhead = projectPointAt(box, { x: first.x, y: 1, z: first.z });
+ const liftDirection = { x: liftAhead.x - handleCenter.x, y: liftAhead.y - handleCenter.y };
+ const liftLength = Math.hypot(liftDirection.x, liftDirection.y);
+ const liftStart = {
+ x: handleCenter.x + (liftDirection.x / liftLength) * box.width * 0.03,
+ y: handleCenter.y + (liftDirection.y / liftLength) * box.width * 0.03,
+ };
+ const liftBy = {
+ x: (liftDirection.x / liftLength) * box.width * 0.08,
+ y: (liftDirection.y / liftLength) * box.width * 0.08,
+ };
+ const beforeLift = Number(await positionY.inputValue());
+ await page.mouse.move(liftStart.x, liftStart.y);
+ await page.mouse.down();
+ await page.mouse.move(liftStart.x + liftBy.x, liftStart.y + liftBy.y, {
+ steps: 12,
+ });
+ // Read before the pointer is let go: nothing is saved yet, and the readout
+ // has to be on the drag's live transform all the same.
+ const during = await readElevation();
+ await page.mouse.up();
+ const afterLift = Number(await positionY.inputValue());
+ assert.ok(afterLift > beforeLift + 0.1, `the visible Y gizmo lifts Person 1 (before ${beforeLift}, after ${afterLift})`);
+ assert.ok(during.shown && metres(during.text) > 0.1, `the readout follows the lift while the pointer is down (${JSON.stringify(during.text)})`);
+
+ await page.waitForFunction(
+ ({ height }) =>
+ document.querySelector(".cw-stage-elevation-value")?.textContent?.trim() ===
+ `${height} m`,
+ { height: metres(during.text).toFixed(2) },
+ );
+ const lifted = await readElevation();
+ // The feet of a person placed on the ground sit a few centimetres above its
+ // origin, which is what the position field shows.
+ assert.ok(
+ Math.abs(metres(lifted.text) - (afterLift - beforeLift)) < 0.02,
+ `the readout is the height above the ground (${lifted.text}; the field moved from ${beforeLift} to ${afterLift})`,
+ );
+ assert.equal(lifted.aria, `Height above ground ${metres(lifted.text).toFixed(2)} m`);
+
+ // Geometry in CSS pixels, where the frame's own projection puts the ground
+ // point and the subject's lowest point.
+ const height = metres(lifted.text);
+ const ground = projectPointAt(box, { x: first.x, y: 0, z: first.z });
+ const feet = projectPointAt(box, { x: first.x, y: height, z: first.z });
+ const origin = { x: lifted.layer.x, y: lifted.layer.y };
+ const at = (point) => ({ x: point.x + origin.x, y: point.y + origin.y });
+ assert.equal(lifted.lines.length, 2);
+ assert.ok(lifted.lines[0].shown && lifted.lines[1].shown, "a long line frames its value");
+ near(at(lifted.lines[0].from), ground, 5, "the line starts on the ground under the subject");
+ near(at(lifted.lines[1].to), feet, 5, "the line ends at the subject's lowest point");
+ const gapMiddle = at({
+ x: (lifted.lines[0].to.x + lifted.lines[1].from.x) / 2,
+ y: (lifted.lines[0].to.y + lifted.lines[1].from.y) / 2,
+ });
+ const labelMiddle = {
+ x: lifted.label.x + lifted.label.width / 2,
+ y: lifted.label.y + lifted.label.height / 2,
+ };
+ const lineMiddle = {
+ x: (at(lifted.lines[0].from).x + at(lifted.lines[1].to).x) / 2,
+ y: (at(lifted.lines[0].from).y + at(lifted.lines[1].to).y) / 2,
+ };
+ near(gapMiddle, labelMiddle, 1.5, "the value sits in the line's gap");
+ near(labelMiddle, lineMiddle, 5.5, "the value sits halfway along the line");
+ const gap = Math.hypot(
+ lifted.lines[1].from.x - lifted.lines[0].to.x,
+ lifted.lines[1].from.y - lifted.lines[0].to.y,
+ );
+ assert.ok(
+ Math.abs(gap - (lifted.label.height + 6)) < 1.5,
+ `the gap is the value's height and a little air (${gap} for a value ${lifted.label.height} high)`,
+ );
+ near(
+ { x: lifted.ring.x + lifted.ring.width / 2, y: lifted.ring.y + lifted.ring.height / 2 },
+ ground,
+ 5,
+ "the ring marks where the subject would land",
+ );
+ assert.ok(
+ Math.abs(lifted.ring.width - 12) < 1,
+ `the ring keeps a twelve-pixel diameter (${lifted.ring.width})`,
+ );
+ const under = await page.evaluate(
+ ({ x, y }) => {
+ const hit = document.elementFromPoint(x, y);
+ return { tag: hit?.tagName ?? null, over: Boolean(hit?.closest(".cw-stage-scene")) };
+ },
+ labelMiddle,
+ );
+ assert.deepEqual(
+ under,
+ { tag: "CANVAS", over: true },
+ "the readout takes no pointer: the frame is what lies under the value",
+ );
+ // ELEVATION_SHOT names a file for a picture of the readout at 2x.
+ if (process.env.ELEVATION_SHOT)
+ await page.screenshot({
+ path: process.env.ELEVATION_SHOT,
+ clip: {
+ x: ground.x - box.width * 0.12,
+ y: feet.y - box.height * 0.12,
+ width: box.width * 0.24,
+ height: box.height * 0.36,
+ },
+ });
+
+ // The viewfinder shows a camera's picture; the readout belongs to the
+ // orbit view and comes back with it.
+ const viewfinderButton = page.getByRole("button", {
+ name: "Viewfinder",
+ exact: true,
+ });
+ await viewfinderButton.click();
+ await page.locator(".cw-stage-fovbar").waitFor();
+ await waitForElevation(false);
+ await viewfinderButton.click();
+ await page.locator(".cw-stage-fovbar").waitFor({ state: "detached" });
+ await waitForElevation(true);
+
+ // An export shows its progress in place of the gizmo and the readout, and
+ // gives the readout back when it ends, here by being cancelled. Sixty frames
+ // a second keep it running long enough to be seen and cancelled.
+ await page
+ .getByRole("button", { name: "Render preview MP4", exact: true })
+ .click();
+ const exportDialog = page.getByRole("dialog", { name: "Export video" });
+ await exportDialog.waitFor();
+ await exportDialog.getByLabel("Frame rate").selectOption("60");
+ await exportDialog
+ .getByRole("button", { name: "Export", exact: true })
+ .click();
+ const rendering = page.locator(".cw-render-status");
+ await rendering.waitFor();
+ await waitForElevation(false);
+ await rendering
+ .getByRole("button", { name: "Cancel rendering", exact: true })
+ .click();
+ await rendering.waitFor({ state: "detached" });
+ await waitForElevation(true);
+
+ await page
+ .locator(".cw-stage-console")
+ .getByRole("button", { name: "Undo", exact: true })
+ .click();
+ await page.waitForFunction(
+ ({ label, value }) => {
+ const field = document.querySelector(`[aria-label="${label}"]`);
+ return (
+ field instanceof HTMLInputElement &&
+ Math.abs(Number(field.value) - value) < 0.01
+ );
+ },
+ { label: "Position Y", value: beforeLift },
+ );
+ await waitForElevation(false);
+
+ const screenshot = await page.screenshot();
+ const gizmoPixels = await coloredPixelsNear(
+ screenshot,
+ projectPointAt(box, { x: first.x, y: 0, z: first.z }),
+ box.width * 0.24,
+ );
+ assert.ok(
+ gizmoPixels > 100,
+ `the rendered gizmo is in the selected object's viewport region (colored pixels ${gizmoPixels})`,
+ );
+ await page.getByRole("button", { name: "Apply edits", exact: true }).click();
+ await page
+ .getByRole("button", { name: "Apply edits", exact: true })
+ .waitFor({ state: "detached" });
+ const snapshot = await until(
+ (candidate) => (stageDoc(candidate)?.data.objects ?? []).length === 3,
+ "three placed people",
+ );
+ const objects = stageDoc(snapshot).data.objects;
+ for (const [index, [x, y]] of clicks.entries()) {
+ const expected = groundPointAt(box, x, y);
+ const actual = objects[index].position;
+ const distance = Math.hypot(actual.x - expected.x, actual.z - expected.z);
+ assert.ok(
+ distance < 0.05,
+ `click ${index} landed at (${actual.x}, ${actual.z}), expected (${expected.x}, ${expected.z}), error ${distance}`,
+ );
+ }
+ console.log(
+ JSON.stringify({
+ passed: true,
+ projectId,
+ objects,
+ checks: [
+ "the readout follows a Y drag while the pointer is down and reads the height above the ground after it",
+ "at 2x the line, its value and the ring land where the frame's projection puts them",
+ "the readout takes no pointer, leaves with the viewfinder, and comes back after an export",
+ ],
+ }),
+ );
+} finally {
+ await browser.close();
+}
diff --git a/tests/browser/director_stage_storyboard.mjs b/tests/browser/director_stage_storyboard.mjs
new file mode 100644
index 000000000..d9271063e
--- /dev/null
+++ b/tests/browser/director_stage_storyboard.mjs
@@ -0,0 +1,5487 @@
+/** Director Stage acceptance for Storyboard creation, presentation and preview.
+ *
+ * Runs only against an isolated creation server with real project storage and model
+ * stubs (no real model is called). One project is created through the isolated API.
+ * It covers the camera chooser above `+`, the add through the shared
+ * `director.storyboard.append` command, block selection, the playhead, undo and redo,
+ * save and reopen, and the same inputs through the HTTP command endpoint. Preview
+ * checks compare rendered frames and exercise thumbnail refresh and narrow blocks.
+ * A drag to another place is followed with real pointer gestures: the cursors, the one
+ * block that is carried, everything that stays still meanwhile, the line that says where
+ * the block would be let in, at the end of the Storyboard when it would be last, what
+ * each way of ending the drag leaves, where the playhead goes once the block is let go,
+ * and what a save the server refuses puts back.
+ * DIRECTOR_STAGE_LOCALE reruns the flow in another UI language (default en-US). */
+import assert from "node:assert/strict";
+import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import { makePanelGlb, makePng, probeMp4 } from "./director_stage_fixture.mjs";
+const { chromium } = await import(
+ process.env.PLAYWRIGHT_MODULE ?? "playwright-core"
+);
+
+const verifyMp4 = process.argv.includes("--verify-mp4");
+const locale = process.env.DIRECTOR_STAGE_LOCALE ?? "en-US";
+/** Where the Director Stage window is written as PNGs for a visual check, when a
+ * directory is named for it. Nothing is written without it. */
+const screenshotDir = process.env.DIRECTOR_STAGE_STORYBOARD_SCREENSHOT_DIR;
+const L = {
+ "en-US": {
+ saved: "Saved on this device",
+ addStage: "Add Director Stage",
+ apply: "Apply edits",
+ closeEditor: "Close editor",
+ discardClose: "Discard and close",
+ timeline: "Director Stage timeline tracks",
+ previewMode: "Preview mode",
+ dynamicPreview: "Dynamic",
+ playhead: "Stage playhead",
+ stageDuration: "Stage duration",
+ durationClamped: "Requested 3 s. Applied 5 s to keep all Storyboard blocks.",
+ cameraName: "Camera name",
+ defaultCamera: "Camera 1",
+ secondCamera: "Camera 2",
+ renamedCamera: "Wide",
+ camerasTab: "Cameras",
+ presetFrontMedium: "Front medium",
+ charactersTab: "Characters",
+ helpTitle: "Director console controls",
+ closeHelp: "Close help",
+ openStage: "Open Director Stage",
+ undo: "Undo",
+ redo: "Redo",
+ storyboardAdd: "Add camera to Storyboard",
+ storyboardChooser: "Choose a camera for the Storyboard",
+ storyboardSearch: "Search cameras",
+ storyboardSearchEmpty: "No camera matches this search.",
+ storyboardAdding: "Adding a Storyboard block…",
+ storyboardEditing: "Editing the Storyboard…",
+ storyboardBlock: "Storyboard block {name} from {start} to {end} seconds",
+ reasonExhausted:
+ "No main-timeline time remains for another Storyboard block.",
+ reasonLeadingGap:
+ "The Storyboard must start at 0; the first block cannot begin later.",
+ reasonInternalGap:
+ "Storyboard blocks cannot leave gaps; start each block where the previous one ends.",
+ revisionConflict:
+ "This item changed since it was loaded. Reload it and try again.",
+ // The preview source.
+ previewSource: "Director preview source",
+ previewStoryboard: "Storyboard",
+ storyboardEmpty: "Add a Storyboard block first.",
+ editCamera: "Edit camera",
+ renamedAway: "Reverse",
+ onMarker: "On marker",
+ away: "Away",
+ position: "Position",
+ recordKeyframe: "Record a keyframe here",
+ pause: "Pause",
+ renderMp4: "Render preview MP4",
+ exportSourceLabel: "Camera source",
+ exportSourceStoryboard: "Storyboard",
+ exportVideo: "Export video",
+ exportFps: "Frame rate",
+ exportConfirm: "Export",
+ exportNote: "Uses hard cuts and ends at the last Storyboard block.",
+ downloadMp4: "Download preview MP4",
+ publishMp4: "Add preview video to canvas",
+ exportCancel: "Cancel",
+ splitPreview: "Live preview {name}",
+ splitExit: "Exit split view",
+ viewfinder: "Viewfinder",
+ viewfinderFov: "Viewfinder FOV",
+ cameraPreview: "Camera preview",
+ deleteCamera: "Delete current camera",
+ deleteBlock: "Delete Storyboard block",
+ playAction: "Play motion and keyframes",
+ shotMaterials: "Shot materials",
+ closeDrawer: "Collapse shot materials",
+ cameraShort: "Camera",
+ target: "Target",
+ focal: "Focal length (35mm film, 16:9 equivalent)",
+ screenshot: "Capture camera still",
+ deleteSelectedStills: "Delete selected",
+ stillEmpty: "No shot materials yet; captures land here automatically.",
+ // What a load puts into the scene.
+ objectsTab: "Objects",
+ backgroundTab: "Background",
+ onModel: "On the model",
+ backgroundAdd: "Add background",
+ backgroundAsset: "Background image",
+ backgroundImported: "Added background “{name}”",
+ backgroundUnavailable:
+ "Background image unavailable; using the background color fallback.",
+ modelLoadFailed:
+ "Could not load “{name}”. The file may be corrupt or reference external resources.",
+ },
+ "zh-CN": {
+ saved: "已保存到本机",
+ addStage: "添加导演台",
+ apply: "应用编辑",
+ closeEditor: "关闭编辑器",
+ discardClose: "直接关闭",
+ timeline: "导演舞台时间线轨道",
+ previewMode: "预演模式",
+ dynamicPreview: "动态",
+ playhead: "舞台播放位置",
+ stageDuration: "舞台总时长",
+ durationClamped: "请求时长 3 秒。为保留全部分镜块,实际应用 5 秒。",
+ cameraName: "机位名称",
+ defaultCamera: "摄像机 1",
+ secondCamera: "摄像机 2",
+ renamedCamera: "广角",
+ camerasTab: "机位",
+ presetFrontMedium: "正面中景",
+ charactersTab: "角色",
+ helpTitle: "导演台操作",
+ closeHelp: "关闭帮助",
+ openStage: "打开导演台",
+ undo: "撤销",
+ redo: "重做",
+ storyboardAdd: "向分镜添加机位",
+ storyboardChooser: "选择要添加到分镜的机位",
+ storyboardSearch: "搜索机位",
+ storyboardSearchEmpty: "没有匹配的机位。",
+ storyboardAdding: "正在添加分镜块…",
+ storyboardEditing: "正在编辑分镜…",
+ storyboardBlock: "分镜块 {name},{start} 秒到 {end} 秒",
+ reasonExhausted: "主时间轴已没有可用时长,无法再添加分镜块。",
+ reasonLeadingGap: "分镜必须从 0 秒开始,第一个分镜块之前不能留空。",
+ reasonInternalGap: "分镜块之间不能留有空隙,请让每个分镜块从前一个分镜块结束的位置开始。",
+ // The backend raises this conflict with an English sentence as its Chinese copy
+ // (validate_command); the journey asserts what the page shows today.
+ revisionConflict: "Object changed; reread before modifying",
+ // The preview source.
+ previewSource: "导演预览来源",
+ previewStoryboard: "分镜",
+ storyboardEmpty: "请先添加分镜块。",
+ editCamera: "编辑机位",
+ renamedAway: "反打",
+ onMarker: "看向标记",
+ away: "看向别处",
+ position: "位置",
+ recordKeyframe: "在此记录关键帧",
+ pause: "暂停",
+ renderMp4: "合成预演 MP4",
+ exportSourceLabel: "机位来源",
+ exportSourceStoryboard: "分镜编排",
+ exportVideo: "导出视频",
+ exportFps: "帧率",
+ exportConfirm: "导出",
+ exportNote: "按分镜块硬切,导出到最后一个分镜块结束。",
+ downloadMp4: "下载预演 MP4",
+ publishMp4: "将预演视频加入画布",
+ exportCancel: "取消",
+ splitPreview: "实时预览 {name}",
+ splitExit: "退出分屏",
+ viewfinder: "取景器",
+ viewfinderFov: "取景器 FOV",
+ cameraPreview: "机位预览",
+ deleteCamera: "删除当前机位",
+ deleteBlock: "删除分镜块",
+ playAction: "播放动作与关键帧",
+ shotMaterials: "镜头素材",
+ closeDrawer: "收起镜头素材",
+ cameraShort: "机位",
+ target: "目标",
+ focal: "焦距(35mm 胶片,16:9 等效)",
+ screenshot: "捕获镜头定格",
+ deleteSelectedStills: "删除选中照片",
+ stillEmpty: "暂无镜头素材,拍摄后自动入库。",
+ // 加载给场景带来的内容。
+ objectsTab: "物体",
+ backgroundTab: "背景",
+ onModel: "看向模型",
+ backgroundAdd: "添加背景",
+ backgroundAsset: "背景图片",
+ backgroundImported: "已添加背景「{name}」",
+ backgroundUnavailable: "背景图片不可用,已回退到背景颜色。",
+ modelLoadFailed: "无法加载「{name}」。文件可能损坏,或引用了外部资源。",
+ },
+}[locale];
+assert.ok(L, `Unsupported DIRECTOR_STAGE_LOCALE: ${locale}`);
+
+const base = process.env.CREATION_WEB_URL ?? "http://127.0.0.1:5179";
+const api = process.env.CREATION_API_URL ?? "http://127.0.0.1:8019";
+const headers = {
+ "X-OpenDirector-Request": "1",
+ "Content-Type": "application/json",
+};
+
+/** Fill a catalog sentence's `{name}` placeholders. */
+const text = (template, values) =>
+ template.replace(/\{(\w+)\}/g, (_, key) => values[key]);
+
+async function call(path, body, extraHeaders) {
+ const response = await fetch(api + path, {
+ headers: { ...headers, ...extraHeaders },
+ ...(body ? { method: "POST", body: JSON.stringify(body) } : {}),
+ });
+ assert.ok(
+ response.ok,
+ `${path}: ${response.status}: ${await response.clone().text()}`,
+ );
+ return response.json();
+}
+
+assert.equal((await call("/api/creation-test-health")).isolated, true);
+
+const projectId = crypto.randomUUID();
+await call(`/api/creation/projects/${projectId}/commands`, {
+ commandId: crypto.randomUUID(),
+ projectId,
+ type: "project.create",
+ payload: { name: `Director Stage storyboard ${projectId.slice(0, 8)}` },
+});
+
+const state = () => call(`/api/creation/projects/${projectId}`);
+
+/** Send one command the way an external caller does; a rejection is a result, not a failure. */
+async function send(type, payload, expectedVersions) {
+ const response = await fetch(
+ `${api}/api/creation/projects/${projectId}/commands`,
+ {
+ method: "POST",
+ headers: {
+ ...headers,
+ ...(browserSession ? { "X-OpenDirector-Session": browserSession } : {}),
+ },
+ body: JSON.stringify({
+ commandId: crypto.randomUUID(),
+ projectId,
+ type,
+ payload,
+ ...(expectedVersions ? { expectedVersions } : {}),
+ }),
+ },
+ );
+ assert.ok(
+ response.ok,
+ `${type}: ${response.status}: ${await response.clone().text()}`,
+ );
+ return response.json();
+}
+
+const agentTool = (tool, input) =>
+ call(
+ "/api/creation-test-agent-storyboard",
+ { projectId, tool, input },
+ { "X-OpenDirector-Session": browserSession },
+ );
+const agentCommand = (type, payload, expectedVersions) =>
+ agentTool("execute_command", { type, payload, expectedVersions });
+
+const browser = await chromium.launch({
+ headless: true,
+ ...(process.env.CHROMIUM_PATH
+ ? { executablePath: process.env.CHROMIUM_PATH }
+ : {}),
+ args: ["--no-sandbox", "--enable-unsafe-swiftshader"],
+});
+const page = await browser.newPage({
+ locale,
+ viewport: { width: 1700, height: 1100 },
+});
+await page.addInitScript((value) => {
+ localStorage.setItem("opendirector.modelSetup.v1", "dismissed");
+ localStorage.setItem("opendirector.locale.v1", value);
+}, locale);
+/** Work that asks for idle time can be held back, so a step can see a block wait for
+ * its thumbnail before the picture is made. A held callback runs when it is let in.
+ * With nothing held, every call reaches the browser as it was. */
+await page.addInitScript(() => {
+ const request = window.requestIdleCallback?.bind(window);
+ const cancel = window.cancelIdleCallback?.bind(window);
+ const held = [];
+ window.__storyboardHoldIdle = false;
+ window.requestIdleCallback = (callback, options) => {
+ if (!window.__storyboardHoldIdle)
+ return request
+ ? request(callback, options)
+ : window.setTimeout(callback, 0);
+ const at = held.length;
+ held.push(() =>
+ (request ?? ((task) => window.setTimeout(task, 0)))(callback, options),
+ );
+ // Negative, so a held callback is never mistaken for the browser's own.
+ return -at - 1;
+ };
+ window.cancelIdleCallback = (id) => {
+ if (id >= 0) cancel?.(id);
+ else held[-id - 1] = null;
+ };
+ window.__storyboardReleaseIdle = () => {
+ // Let in what was held, and hold nothing more: work that follows asks on its own.
+ window.__storyboardHoldIdle = false;
+ for (const run of held.splice(0)) run?.();
+ };
+});
+/** An imported model's bytes reach the open editor as a `blob:` URL, which no network
+ * hold can reach: the document's projection has already fetched them. While
+ * `__storyboardHoldModel` is set, a read of a `blob:` URL waits until
+ * `__storyboardReleaseModel()` is called; with `__storyboardFailModel` set first, the
+ * read fails instead. With nothing held, every call reaches the browser as it was. */
+await page.addInitScript(() => {
+ const read = window.fetch;
+ const held = [];
+ window.__storyboardHoldModel = false;
+ window.__storyboardFailModel = false;
+ window.__storyboardModelReads = 0;
+ window.fetch = (input, init) => {
+ const url = typeof input === "string" ? input : input.url;
+ if (!window.__storyboardHoldModel || !url.startsWith("blob:"))
+ return read(input, init);
+ window.__storyboardModelReads += 1;
+ return new Promise((resolve, reject) => {
+ held.push(() =>
+ window.__storyboardFailModel
+ ? reject(new TypeError("Failed to fetch"))
+ : resolve(read(input, init)),
+ );
+ });
+ };
+ window.__storyboardReleaseModel = () => {
+ window.__storyboardHoldModel = false;
+ for (const go of held.splice(0)) go();
+ };
+});
+page.setDefaultTimeout(20000);
+const errors = [];
+page.on("pageerror", (error) => errors.push(error.message));
+/** The session the page holds the project with. A command sent while the page is
+ * open must name that same session: a project is open in one session at a time. */
+let browserSession;
+page.on("request", (request) => {
+ browserSession = request.headers()["x-opendirector-session"] ?? browserSession;
+});
+
+const until = async (predicate, label) => {
+ const deadline = Date.now() + 20000;
+ let snapshot;
+ while (Date.now() < deadline) {
+ snapshot = await state();
+ if (predicate(snapshot)) return snapshot;
+ await page.waitForTimeout(100);
+ }
+ const stored = snapshot.editorDocuments
+ .filter((document) => document.kind === "director")
+ .map((document) => storedBlocks(document));
+ throw new Error(`Timeout: ${label}; stored Storyboards: ${JSON.stringify(stored)}`);
+};
+
+/** The Director Stage bound to one canvas item: the item and its stored document. */
+const director = (snapshot, itemId) => {
+ const item = snapshot.canvasItems.find(
+ (candidate) =>
+ candidate.id === itemId ||
+ (itemId === undefined &&
+ candidate.visible &&
+ candidate.kind === "external"),
+ );
+ const document = item
+ ? snapshot.editorDocuments.find(
+ (candidate) => candidate.id === item.binding?.objectRef?.id,
+ )
+ : undefined;
+ return { item, document };
+};
+
+/** (camera, start, duration) per block: what a reader of the stored Storyboard sees. */
+const storedBlocks = (document) =>
+ (document.data.shots ?? []).map((shot) => [
+ shot.cameraId,
+ shot.start,
+ shot.duration,
+ ]);
+const storedIds = (document) => (document.data.shots ?? []).map((shot) => shot.id);
+/** The view every stage opens with. The viewport camera is the director's own and
+ * never a stage camera, so a point of the stage is put on screen from here rather
+ * than from the document. */
+const DIRECTOR_VIEW = {
+ eye: { x: 8, y: 6, z: 10 },
+ target: { x: 0, y: 1, z: 0 },
+ fov: 45,
+};
+const difference = (a, b) => ({ x: a.x - b.x, y: a.y - b.y, z: a.z - b.z });
+const cross = (a, b) => ({
+ x: a.y * b.z - a.z * b.y,
+ y: a.z * b.x - a.x * b.z,
+ z: a.x * b.y - a.y * b.x,
+});
+const dot = (a, b) => a.x * b.x + a.y * b.y + a.z * b.z;
+const unit = (a) => {
+ const length = Math.hypot(a.x, a.y, a.z);
+ return { x: a.x / length, y: a.y / length, z: a.z / length };
+};
+const DIRECTOR_BASIS = (() => {
+ const forward = unit(difference(DIRECTOR_VIEW.target, DIRECTOR_VIEW.eye));
+ const right = unit(cross(forward, { x: 0, y: 1, z: 0 }));
+ return { forward, right, up: cross(right, forward) };
+})();
+/** Where a point of the stage lies on screen in the director view, inside the box
+ * of the viewport canvas. */
+const directorViewPoint = (point, box) => {
+ const view = difference(point, DIRECTOR_VIEW.eye);
+ const halfHeight =
+ dot(view, DIRECTOR_BASIS.forward) * Math.tan((DIRECTOR_VIEW.fov * Math.PI) / 360);
+ return {
+ x: box.x + ((dot(view, DIRECTOR_BASIS.right) / (halfHeight * (box.width / box.height)) + 1) / 2) * box.width,
+ y: box.y + ((1 - dot(view, DIRECTOR_BASIS.up) / halfHeight) / 2) * box.height,
+ };
+};
+/** The version a command must name for a stored document. */
+const version = (document) => ({
+ objectType: "editor_document",
+ id: document.id,
+ revision: document.revision,
+});
+/** A stored document as a command payload: the same content without output-only fields. */
+const payloadOf = (document) => {
+ const { schemaVersion, ...payload } = structuredClone(document);
+ return payload;
+};
+/** Holds back the reply to every command of one type until it is let go, so the page
+ * is seen while such a command is in flight. `reached` comes true once one has
+ * arrived here and waits, `release()` lets its reply go on, and `released` comes true
+ * once it has. The route stays until the caller removes it. */
+const holdReplies = async (type) => {
+ let release, reportReached, reportReleased;
+ const gate = new Promise((resolve) => {
+ release = resolve;
+ });
+ const reached = new Promise((resolve) => {
+ reportReached = resolve;
+ });
+ const released = new Promise((resolve) => {
+ reportReleased = resolve;
+ });
+ await page.route("**/commands", async (route) => {
+ if (route.request().postDataJSON()?.type !== type) return route.continue();
+ reportReached();
+ await gate;
+ await route.continue();
+ reportReleased();
+ });
+ return { reached, release, released };
+};
+
+try {
+ await page.goto(`${base}/ai-tool/ai-canvas/${projectId}?creation=unified`);
+ await page.getByText(L.saved, { exact: true }).waitFor();
+
+ const addStage = page.getByRole("button", { name: L.addStage, exact: true });
+ await addStage.waitFor();
+ await addStage.click();
+ const apply = page.getByRole("button", { name: L.apply, exact: true });
+ await apply.waitFor();
+ const created = director(
+ await until(
+ (snapshot) => director(snapshot).document?.kind === "director",
+ "created Director Stage",
+ ),
+ );
+ const itemId = created.item.id;
+ const documentId = created.document.id;
+ assert.deepEqual(
+ created.document.data.shots ?? [],
+ [],
+ "a new stage has an empty Storyboard",
+ );
+ const [firstCamera, ...rest] = created.document.data.cameras;
+ assert.equal(rest.length, 0, "a new stage holds exactly the default camera");
+ assert.equal(firstCamera.name, L.defaultCamera);
+
+ // A second camera comes from a preset, the only way the interface adds one. A new
+ // stage has no subject to place it on, so a character is placed first; the first
+ // placement opens the console's help once. Applying the placed camera makes the
+ // persisted active camera the second one, so a later block click on the first
+ // camera can be told apart from a write of the active camera.
+ const sceneViewport = page.locator(".cw-stage-scene");
+ await page
+ .locator('.cw-stage-object-grid button[data-stage-placement-kind="person"]')
+ .first()
+ .click();
+ const stageBox = await sceneViewport.boundingBox();
+ assert.ok(stageBox, "the stage viewport is visible to place a character");
+ await page.mouse.click(
+ stageBox.x + stageBox.width * 0.4,
+ stageBox.y + stageBox.height * 0.6,
+ );
+ const firstHelp = page.getByRole("dialog", { name: L.helpTitle, exact: true });
+ if (await firstHelp.count())
+ await firstHelp
+ .getByRole("button", { name: L.closeHelp, exact: true })
+ .click();
+ const subjectAxis = (axis) =>
+ page
+ .getByLabel(`${L.position} ${axis}`, { exact: true })
+ .inputValue()
+ .then(Number);
+ await page.getByLabel(`${L.position} X`, { exact: true }).waitFor();
+ const subject = {
+ x: await subjectAxis("X"),
+ y: await subjectAxis("Y"),
+ z: await subjectAxis("Z"),
+ };
+ await page.getByRole("tab", { name: L.camerasTab, exact: true }).click();
+ const preset = page.getByRole("button", {
+ name: L.presetFrontMedium,
+ exact: true,
+ });
+ await preset.click();
+ assert.equal(
+ await preset.getAttribute("aria-pressed"),
+ "true",
+ "the preset is armed until a subject is clicked",
+ );
+ // The character's body, a little above where it stands.
+ const subjectPoint = directorViewPoint(
+ { x: subject.x, y: subject.y + 0.9, z: subject.z },
+ stageBox,
+ );
+ await page.mouse.click(subjectPoint.x, subjectPoint.y);
+ assert.equal(
+ await preset.getAttribute("aria-pressed"),
+ "false",
+ "the click on the character placed the camera",
+ );
+ await apply.click();
+ await apply.waitFor({ state: "detached" });
+ const withCameras = director(
+ await until(
+ (snapshot) => director(snapshot, itemId).document?.data.cameras.length === 2,
+ "second camera persisted",
+ ),
+ itemId,
+ );
+ const secondCamera = withCameras.document.data.cameras[1];
+ assert.equal(secondCamera.name, L.secondCamera);
+ const activeCameraId = withCameras.document.data.activeCameraId;
+ const cameraSource = withCameras.document.data.cameraSource;
+ assert.equal(activeCameraId, secondCamera.id);
+ assert.equal(cameraSource, "camera");
+
+ await page.locator(`.react-flow__node[data-id="${itemId}"]`).click();
+ await page.getByRole("button", { name: L.openStage, exact: true }).click();
+ await apply.waitFor();
+ const previewMode = page.getByRole("group", {
+ name: L.previewMode,
+ exact: true,
+ });
+ const dynamicPreview = previewMode.getByRole("button", {
+ name: L.dynamicPreview,
+ exact: true,
+ });
+ await dynamicPreview.click();
+ const timeline = page.getByTestId("director-stage-timeline");
+ /** With DIRECTOR_STAGE_STORYBOARD_SCREENSHOT_DIR set, writes the timeline at twice
+ * its size, so a block can be looked at, as `-