The VS Code of video editing, built for agents.
TypeScript
Remove example files and README for cleanup
konstantin-paulus45d1ca0bc5e2
diff --git a/knowledge/INSTRUCTIONS.md b/knowledge/INSTRUCTIONS.mdnew file mode 100644index 00000000..84c192e0--- /dev/null+++ b/knowledge/INSTRUCTIONS.md@@ -0,0 +1,23 @@+Diffusion Studio, a video editor, is running on this machine and you are connected to it.++Projects are folders of JSX; \`open\` a folder once, then write its files and save — the app recompiles and re-renders.++---+name: editor+description: >-+ Understand, generate, and edit footage with Diffusion Studio via the `dapi`+ CLI: analyze video/audio/images, generate them with AI, and compose video+ compositions. Use for any media analysis, media generation, or video editing+ task.+path: /skills/editor.md+---+name: watch+description: >-+ Watch and understand footage with Diffusion Studio via the `dapi` CLI: answer+ questions about a video or audio file, summarize it, find+ scenes and moments, pull quotes, and describe what happens and when. Use+ whenever the user asks what's in a piece of footage, wants a summary or+ recap, wants to locate a moment ("where does X happen", "find the scene+ where..."), or needs a claim about a video or audio file checked.+path: /skills/watch.md+---diff --git a/knowledge/brand/README.md b/knowledge/brand/README.mdnew file mode 100644index 00000000..fb49048d--- /dev/null+++ b/knowledge/brand/README.md@@ -0,0 +1,26 @@+# Diffusion Studio brand++The fallback brand system: use it only when the brief, the project, or the user+supplies no branding of their own. Any branding they do specify wins.++When it applies, these references are the source of truth, and the bundled+library comes before anything newly made.++## Read the relevant references++| Task | Read |+| --- | --- |+| Visual design or graphics | `design.md` |+| Copy or writing | `voice.md` |+| Video | `design.md`, `video.md`, `library.md` |+| Assets, components, or compositions | `library.md` and the reference for its medium |++When work spans multiple rows, use each relevant reference.++## Apply the system++1. Check `library.md` before creating a brand asset, component, or composition.+2. Reuse the closest existing item and change its content or inputs.+3. Use relative paths to bundled assets instead of external file-share links.+4. Do not invent product facts, claims, assets, or brand rules.+5. Report missing inputs, deliberate exceptions, and reusable work that should join the library.diff --git a/knowledge/brand/assets/audio/music/.gitkeep b/knowledge/brand/assets/audio/music/.gitkeepnew file mode 100644index 00000000..8b137891--- /dev/null+++ b/knowledge/brand/assets/audio/music/.gitkeep@@ -0,0 +1 @@+diff --git a/knowledge/brand/assets/audio/sfx/.gitkeep b/knowledge/brand/assets/audio/sfx/.gitkeepnew file mode 100644index 00000000..8b137891--- /dev/null+++ b/knowledge/brand/assets/audio/sfx/.gitkeep@@ -0,0 +1 @@+diff --git a/knowledge/brand/assets/audio/voiceovers/.gitkeep b/knowledge/brand/assets/audio/voiceovers/.gitkeepnew file mode 100644index 00000000..8b137891--- /dev/null+++ b/knowledge/brand/assets/audio/voiceovers/.gitkeep@@ -0,0 +1 @@+diff --git a/knowledge/brand/assets/components/callout.tsx b/knowledge/brand/assets/components/callout.tsxnew file mode 100644index 00000000..93da2806--- /dev/null+++ b/knowledge/brand/assets/components/callout.tsx@@ -0,0 +1,67 @@+import type { Time } from "@diffusionstudio/jsx";+import { colors, fonts, frameMetrics, typography } from "./tokens";++export type CalloutProps = {+ width: number;+ height: number;+ start: Time;+ end: Time;+ label: string;+ value: string;+};++export function Callout(props: CalloutProps) {+ const frame = frameMetrics(props.width, props.height);+ const panelWidth = Math.min(560 * frame.scale, frame.right - frame.left);+ const panelHeight = 152 * frame.scale;+ const panelTop = frame.bottom - panelHeight;++ return (+ <>+ <rect+ name="Callout panel"+ start={props.start}+ end={props.end}+ x={frame.left}+ y={panelTop}+ width={panelWidth}+ height={panelHeight}+ fill={colors.surface}+ />+ <text+ name="Callout label"+ start={props.start}+ end={props.end}+ x={frame.left + 24 * frame.scale}+ y={panelTop + 24 * frame.scale}+ width={panelWidth - 48 * frame.scale}+ height={32 * frame.scale}+ textAlign="left"+ textBaseline="top"+ fontFamily={fonts.sans}+ fontSize={typography.label.size * frame.scale}+ fontWeight={typography.label.weight}+ color={colors.textSecondary}+ >+ {props.label}+ </text>+ <text+ name="Callout value"+ start={props.start}+ end={props.end}+ x={frame.left + 24 * frame.scale}+ y={panelTop + 72 * frame.scale}+ width={panelWidth - 48 * frame.scale}+ height={56 * frame.scale}+ textAlign="left"+ textBaseline="top"+ fontFamily={fonts.sans}+ fontSize={typography.lowerThirdName.size * frame.scale}+ fontWeight={typography.lowerThirdName.weight}+ color={colors.text}+ >+ {props.value}+ </text>+ </>+ );+}diff --git a/knowledge/brand/assets/components/lower-third.tsx b/knowledge/brand/assets/components/lower-third.tsxnew file mode 100644index 00000000..667db4fc--- /dev/null+++ b/knowledge/brand/assets/components/lower-third.tsx@@ -0,0 +1,69 @@+import type { Time } from "@diffusionstudio/jsx";+import { colors, fonts, frameMetrics, typography } from "./tokens";++export type LowerThirdProps = {+ width: number;+ height: number;+ start: Time;+ end: Time;+ name: string;+ detail: string;+};++export function LowerThird(props: LowerThirdProps) {+ const frame = frameMetrics(props.width, props.height);+ const panelHeight = 172 * frame.scale;+ const nameHeight = 60 * frame.scale;+ const detailHeight = 40 * frame.scale;+ const panelTop = frame.bottom - panelHeight;+ const contentWidth = frame.right - frame.left;++ return (+ <>+ <rect+ name="Lower third panel"+ start={props.start}+ end={props.end}+ x={0}+ y={panelTop}+ width={props.width}+ height={panelHeight}+ fill={colors.surface}+ />+ <text+ name="Lower third name"+ start={props.start}+ end={props.end}+ x={frame.left}+ y={panelTop + 32 * frame.scale}+ width={contentWidth}+ height={nameHeight}+ textAlign="left"+ textBaseline="bottom"+ fontFamily={fonts.sans}+ fontSize={typography.lowerThirdName.size * frame.scale}+ fontWeight={typography.lowerThirdName.weight}+ color={colors.text}+ >+ {props.name}+ </text>+ <text+ name="Lower third detail"+ start={props.start}+ end={props.end}+ x={frame.left}+ y={panelTop + 108 * frame.scale}+ width={contentWidth}+ height={detailHeight}+ textAlign="left"+ textBaseline="top"+ fontFamily={fonts.sans}+ fontSize={typography.lowerThirdDetail.size * frame.scale}+ fontWeight={typography.lowerThirdDetail.weight}+ color={colors.textSecondary}+ >+ {props.detail}+ </text>+ </>+ );+}diff --git a/knowledge/brand/assets/components/media-grid.tsx b/knowledge/brand/assets/components/media-grid.tsxnew file mode 100644index 00000000..ff98c914--- /dev/null+++ b/knowledge/brand/assets/components/media-grid.tsx@@ -0,0 +1,113 @@+import type { Fit, Time } from "@diffusionstudio/jsx";+import { layoutMetrics } from "./tokens";++export type MediaGridItem = {+ name: string;+ src: string;+ sourceIn?: Time;+ objectFit?: Fit;+ muted: boolean;+};++export type MediaGridProps = {+ width: number;+ height: number;+ start: Time;+ end: Time;+ items: readonly MediaGridItem[];+ name?: string;+};++type Slot = {+ x: number;+ y: number;+ width: number;+ height: number;+ cornerRadius: number;+};++export function mediaGridSlots(width: number, height: number, count: number): Slot[] {+ if (count !== 1 && count !== 2 && count !== 4) {+ throw new Error(`MediaGrid needs 1, 2, or 4 items; received ${count}.`);+ }++ if (count === 1) {+ return [{ x: 0, y: 0, width, height, cornerRadius: 0 }];+ }++ const { margin, gap, cornerRadius } = layoutMetrics(width, height);+ const availableWidth = width - margin * 2;+ const availableHeight = height - margin * 2;++ if (count === 2) {+ const isPortrait = height > width;+ const size = isPortrait+ ? Math.min(availableWidth, (availableHeight - gap) / 2)+ : Math.min((availableWidth - gap) / 2, availableHeight);+ const gridWidth = isPortrait ? size : size * 2 + gap;+ const gridHeight = isPortrait ? size * 2 + gap : size;+ const left = (width - gridWidth) / 2;+ const top = (height - gridHeight) / 2;++ return [+ { x: left, y: top, width: size, height: size, cornerRadius },+ {+ x: isPortrait ? left : left + size + gap,+ y: isPortrait ? top + size + gap : top,+ width: size,+ height: size,+ cornerRadius,+ },+ ];+ }++ const size = Math.min((availableWidth - gap) / 2, (availableHeight - gap) / 2);+ const gridSize = size * 2 + gap;+ const left = (width - gridSize) / 2;+ const top = (height - gridSize) / 2;++ return [+ { x: left, y: top, width: size, height: size, cornerRadius },+ { x: left + size + gap, y: top, width: size, height: size, cornerRadius },+ { x: left, y: top + size + gap, width: size, height: size, cornerRadius },+ {+ x: left + size + gap,+ y: top + size + gap,+ width: size,+ height: size,+ cornerRadius,+ },+ ];+}++export function MediaGrid(props: MediaGridProps) {+ const slots = mediaGridSlots(props.width, props.height, props.items.length);+ const gridName = props.name ?? "Media grid";++ return (+ <>+ {props.items.map((item, index) => {+ const slot = slots[index];++ return (+ <sequence name={`${gridName} — ${item.name}`}>+ <video+ name={item.name}+ src={item.src}+ start={props.start}+ end={props.end}+ sourceIn={item.sourceIn}+ x={slot.x}+ y={slot.y}+ width={slot.width}+ height={slot.height}+ cornerRadius={slot.cornerRadius}+ objectFit={item.objectFit ?? "contain"}+ muted={item.muted}+ />+ </sequence>+ );+ })}+ </>+ );+}diff --git a/knowledge/brand/assets/components/title-card.tsx b/knowledge/brand/assets/components/title-card.tsxnew file mode 100644index 00000000..5b2c9bbc--- /dev/null+++ b/knowledge/brand/assets/components/title-card.tsx@@ -0,0 +1,63 @@+import type { Time } from "@diffusionstudio/jsx";+import { colors, fonts, frameMetrics, typography } from "./tokens";++export type TitleCardProps = {+ width: number;+ height: number;+ start: Time;+ end: Time;+ title: string;+ subtitle?: string;+};++export function TitleCard(props: TitleCardProps) {+ const frame = frameMetrics(props.width, props.height);+ const titleHeight = 240 * frame.scale;+ const subtitleHeight = 80 * frame.scale;+ const gap = 24 * frame.scale;+ const blockBottom = frame.bottom - 36 * frame.scale;+ const subtitleTop = blockBottom - subtitleHeight;+ const titleBottom = props.subtitle ? subtitleTop - gap : blockBottom;+ const contentWidth = frame.right - frame.left;++ return (+ <>+ <text+ name="Title"+ start={props.start}+ end={props.end}+ x={frame.left}+ y={titleBottom - titleHeight}+ width={contentWidth}+ height={titleHeight}+ textAlign="left"+ textBaseline="bottom"+ fontFamily={fonts.sans}+ fontSize={typography.title.size * frame.scale}+ fontWeight={typography.title.weight}+ color={colors.text}+ >+ {props.title}+ </text>+ {props.subtitle ? (+ <text+ name="Subtitle"+ start={props.start}+ end={props.end}+ x={frame.left}+ y={subtitleTop}+ width={contentWidth}+ height={subtitleHeight}+ textAlign="left"+ textBaseline="top"+ fontFamily={fonts.sans}+ fontSize={typography.subtitle.size * frame.scale}+ fontWeight={typography.subtitle.weight}+ color={colors.textSecondary}+ >+ {props.subtitle}+ </text>+ ) : null}+ </>+ );+}diff --git a/knowledge/brand/assets/components/tokens.ts b/knowledge/brand/assets/components/tokens.tsnew file mode 100644index 00000000..7a84e2f6--- /dev/null+++ b/knowledge/brand/assets/components/tokens.ts@@ -0,0 +1,54 @@+export const colors = {+ background: "#000000",+ surface: "#161616",+ text: "#F8F8F8",+ textSecondary: "#A4A4A4",+ brandRed: "#F43535",+} as const;++export const fonts = {+ sans: "Geist",+ mono: "Geist Mono",+} as const;++export const typography = {+ title: { size: 96, weight: 600 },+ subtitle: { size: 60, weight: 400 },+ lowerThirdName: { size: 48, weight: 500 },+ lowerThirdDetail: { size: 30, weight: 400 },+ label: { size: 24, weight: 500 },+} as const;++export const spacing = {+ labelToValue: 16,+ stackedLines: 24,+ separateBlocks: 40,+ margin: 64,+ mediaGap: 40,+ mediaCornerRadius: 24,+} as const;++export function layoutMetrics(width: number, height: number) {+ const scale = Math.min(width, height) / 1080;++ return {+ scale,+ margin: spacing.margin * scale,+ gap: spacing.mediaGap * scale,+ cornerRadius: spacing.mediaCornerRadius * scale,+ };+}++export function frameMetrics(width: number, height: number) {+ const { scale, margin } = layoutMetrics(width, height);+ const isNineBySixteen = Math.abs(width / height - 9 / 16) < 0.02;++ return {+ scale,+ margin,+ left: margin,+ right: isNineBySixteen ? width - 180 * scale : width - margin,+ top: isNineBySixteen ? 200 * scale : margin,+ bottom: isNineBySixteen ? height - 400 * scale : height - margin,+ };+}diff --git a/knowledge/brand/assets/compositions/end-card.tsx b/knowledge/brand/assets/compositions/end-card.tsxnew file mode 100644index 00000000..42b218c6--- /dev/null+++ b/knowledge/brand/assets/compositions/end-card.tsx@@ -0,0 +1,37 @@+import { TitleCard } from "../components/title-card";+import { colors } from "../components/tokens";++const WIDTH = 1080;+const HEIGHT = 1920;+const DURATION = 4;++const inputs = {+ title: "",+ cta: "",+};++function requireInput(value: string, name: string) {+ if (!value.trim()) {+ throw new Error(`Set inputs.${name} before mounting end-card.tsx.`);+ }++ return value;+}++export default function EndCard() {+ const title = requireInput(inputs.title, "title");+ const cta = requireInput(inputs.cta, "cta");++ return (+ <scene id="end-card" name="End card" width={WIDTH} height={HEIGHT} fill={colors.background}>+ <TitleCard+ width={WIDTH}+ height={HEIGHT}+ start={0}+ end={DURATION}+ title={title}+ subtitle={cta}+ />+ </scene>+ );+}diff --git a/knowledge/brand/assets/compositions/product-demo.tsx b/knowledge/brand/assets/compositions/product-demo.tsxnew file mode 100644index 00000000..fff1be84--- /dev/null+++ b/knowledge/brand/assets/compositions/product-demo.tsx@@ -0,0 +1,56 @@+import { LowerThird } from "../components/lower-third";+import { colors } from "../components/tokens";++const WIDTH = 1080;+const HEIGHT = 1920;+const DURATION = 6;++const inputs = {+ videoSrc: "",+ name: "",+ detail: "",+};++function requireInput(value: string, name: string) {+ if (!value.trim()) {+ throw new Error(`Set inputs.${name} before mounting product-demo.tsx.`);+ }++ return value;+}++export default function ProductDemo() {+ const videoSrc = requireInput(inputs.videoSrc, "videoSrc");+ const name = requireInput(inputs.name, "name");+ const detail = requireInput(inputs.detail, "detail");++ return (+ <scene+ id="product-demo"+ name="Product demo"+ width={WIDTH}+ height={HEIGHT}+ fill={colors.background}+ >+ <sequence name="Product footage">+ <video+ name="Product footage"+ src={videoSrc}+ width={WIDTH}+ height={HEIGHT}+ start={0}+ end={DURATION}+ objectFit="contain"+ />+ </sequence>+ <LowerThird+ width={WIDTH}+ height={HEIGHT}+ start={3}+ end={DURATION}+ name={name}+ detail={detail}+ />+ </scene>+ );+}diff --git a/knowledge/brand/assets/compositions/product-tour.tsx b/knowledge/brand/assets/compositions/product-tour.tsxnew file mode 100644index 00000000..dd7fade3--- /dev/null+++ b/knowledge/brand/assets/compositions/product-tour.tsx@@ -0,0 +1,98 @@+import { LowerThird } from "../components/lower-third";+import { MediaGrid } from "../components/media-grid";+import { colors } from "../components/tokens";++// Use 1920×1080, 1080×1920, or 1080×1080.+const WIDTH = 1920;+const HEIGHT = 1080;+const PHASE = 3;+const DURATION = PHASE * 4;++const inputs = {+ primaryVideoSrc: "",+ secondaryVideoSrc: "",+ detailVideoSrc: "",+ fourthVideoSrc: "",+ name: "",+ detail: "",+};++function requireInput(value: string, name: string) {+ if (!value.trim()) {+ throw new Error(`Set inputs.${name} before mounting product-tour.tsx.`);+ }++ return value;+}++export default function ProductTour() {+ const primary = requireInput(inputs.primaryVideoSrc, "primaryVideoSrc");+ const secondary = requireInput(inputs.secondaryVideoSrc, "secondaryVideoSrc");+ const detailVideo = requireInput(inputs.detailVideoSrc, "detailVideoSrc");+ const fourth = requireInput(inputs.fourthVideoSrc, "fourthVideoSrc");+ const name = requireInput(inputs.name, "name");+ const detail = requireInput(inputs.detail, "detail");++ return (+ <scene+ id="product-tour"+ name="Product tour"+ width={WIDTH}+ height={HEIGHT}+ fill={colors.background}+ >+ <MediaGrid+ name="Full product view"+ width={WIDTH}+ height={HEIGHT}+ start={0}+ end={PHASE}+ items={[{ name: "Primary product view", src: primary, sourceIn: 0, muted: false }]}+ />++ <MediaGrid+ name="Two product views"+ width={WIDTH}+ height={HEIGHT}+ start={PHASE}+ end={PHASE * 2}+ items={[+ { name: "Primary product view", src: primary, sourceIn: PHASE, muted: false },+ { name: "Secondary product view", src: secondary, sourceIn: 0, muted: true },+ ]}+ />++ <MediaGrid+ name="Four product details"+ width={WIDTH}+ height={HEIGHT}+ start={PHASE * 2}+ end={PHASE * 3}+ items={[+ { name: "Primary product detail", src: primary, sourceIn: PHASE * 2, muted: false },+ { name: "Secondary product detail", src: secondary, sourceIn: 0, muted: true },+ { name: "Third product detail", src: detailVideo, sourceIn: 0, muted: true },+ { name: "Fourth product detail", src: fourth, sourceIn: 0, muted: true },+ ]}+ />++ <MediaGrid+ name="Final product view"+ width={WIDTH}+ height={HEIGHT}+ start={PHASE * 3}+ end={DURATION}+ items={[{ name: "Primary product view", src: primary, sourceIn: PHASE * 3, muted: false }]}+ />++ <LowerThird+ width={WIDTH}+ height={HEIGHT}+ start={PHASE * 3}+ end={DURATION}+ name={name}+ detail={detail}+ />+ </scene>+ );+}diff --git a/knowledge/brand/assets/fonts/.gitkeep b/knowledge/brand/assets/fonts/.gitkeepnew file mode 100644index 00000000..8b137891--- /dev/null+++ b/knowledge/brand/assets/fonts/.gitkeep@@ -0,0 +1 @@+diff --git a/knowledge/brand/assets/imagery/.gitkeep b/knowledge/brand/assets/imagery/.gitkeepnew file mode 100644index 00000000..8b137891--- /dev/null+++ b/knowledge/brand/assets/imagery/.gitkeep@@ -0,0 +1 @@+diff --git a/knowledge/brand/assets/logos/icon-white.svg b/knowledge/brand/assets/logos/icon-white.svgnew file mode 100644index 00000000..6772da3f--- /dev/null+++ b/knowledge/brand/assets/logos/icon-white.svg@@ -0,0 +1,3 @@+<svg width="150" height="150" viewBox="0 0 150 150" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M63.0888 31.3278C70.7687 26.8907 80.2313 26.8907 87.9111 31.3278L107.089 42.4086C114.769 46.8457 119.5 55.0458 119.5 63.9196V86.0804C119.5 94.9539 114.769 103.154 107.089 107.591L87.9111 118.672C80.2313 123.109 70.7687 123.109 63.0888 118.672L43.9105 107.591C36.2309 103.154 31.5 94.9539 31.5 86.0804V63.9196C31.5 55.0458 36.2308 46.8457 43.9105 42.4086L63.0888 31.3278ZM81.8278 42.2313C77.9879 40.0131 73.2566 40.0131 69.4173 42.2313L50.2553 53.3032C46.4155 55.5218 44.0494 59.6218 44.0494 64.0586V86.1999C44.0494 90.637 46.4154 94.7369 50.2553 96.9554L69.4173 108.026C73.2566 110.245 77.9879 110.245 81.8278 108.026L100.989 96.9554C104.829 94.7369 107.195 90.637 107.195 86.1999V64.0586C107.195 59.6218 104.829 55.5217 100.989 53.3032L81.8278 42.2313Z" fill="white"/>+</svg>diff --git a/knowledge/brand/assets/logos/logo-white.svg b/knowledge/brand/assets/logos/logo-white.svgnew file mode 100644index 00000000..0a88cd37--- /dev/null+++ b/knowledge/brand/assets/logos/logo-white.svg@@ -0,0 +1,20 @@+<svg width="786" height="156" viewBox="0 0 786 156" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M63.9286 33.1456C71.8245 28.5869 81.5532 28.5869 89.4492 33.1456L109.167 44.53C117.063 49.0887 121.927 57.5135 121.927 66.6305V89.3987C121.927 98.5154 117.063 106.941 109.167 111.499L89.4492 122.884C81.5532 127.442 71.8245 127.442 63.9286 122.884L44.2108 111.499C36.3152 106.941 31.4512 98.5154 31.4512 89.3987V66.6305C31.4512 57.5136 36.3151 49.0888 44.2108 44.53L63.9286 33.1456ZM83.1947 44.3479C79.2468 42.0689 74.3824 42.0688 70.4351 44.3479L50.7341 55.7232C46.7862 58.0026 44.3536 62.215 44.3536 66.7733V89.5215C44.3536 94.0801 46.7861 98.2924 50.7341 100.572L70.4351 111.946C74.3824 114.225 79.2468 114.225 83.1947 111.946L102.895 100.572C106.843 98.2924 109.276 94.0801 109.276 89.5215V66.7733C109.276 62.2149 106.843 58.0025 102.895 55.7232L83.1947 44.3479Z" fill="white"/>+<path d="M560.702 45.6675C565.496 45.6675 569.584 46.5463 572.967 48.3042C576.349 50.062 579.021 52.4657 580.983 55.5142C582.946 58.5626 584.153 62.0481 584.606 65.9702L574.558 66.5376C574.263 64.1665 573.54 62.0764 572.39 60.2671C571.239 58.4579 569.679 57.0434 567.707 56.0249C565.735 55.0065 563.342 54.4976 560.527 54.4976C557.009 54.4976 554.223 55.3162 552.17 56.9526C550.117 58.589 549.09 60.7351 549.09 63.3911C549.09 65.164 549.514 66.6329 550.363 67.7974C551.212 68.9619 552.711 69.9805 554.857 70.853C557.004 71.7255 560.064 72.6398 564.038 73.5952C569.46 74.824 573.764 76.3324 576.949 78.1206C580.134 79.9088 582.405 81.9917 583.761 84.3696C585.117 86.7476 585.795 89.4609 585.795 92.5093C585.795 96.2282 584.842 99.4519 582.938 102.179C581.035 104.906 578.381 107.002 574.978 108.468C571.574 109.934 567.608 110.667 563.078 110.667C558.065 110.667 553.721 109.762 550.047 107.952C546.372 106.141 543.48 103.628 541.372 100.41C539.264 97.1918 538.041 93.4379 537.705 89.1489L547.797 88.5601C548.178 91.403 549.006 93.8176 550.281 95.8032C551.557 97.7889 553.272 99.2915 555.427 100.31C557.582 101.329 560.191 101.837 563.253 101.837C565.893 101.837 568.137 101.503 569.984 100.835C571.832 100.167 573.243 99.1802 574.219 97.8745C575.194 96.5688 575.683 94.9696 575.683 93.0776C575.683 91.3466 575.271 89.8131 574.45 88.478C573.629 87.1431 572.06 85.9176 569.744 84.8022C567.428 83.6868 564.005 82.5857 559.476 81.4995C554.477 80.2872 550.481 78.9404 547.487 77.4595C544.494 75.9785 542.327 74.1449 540.987 71.9585C539.648 69.772 538.978 67.047 538.978 63.7837C538.978 60.1956 539.848 57.0411 541.59 54.3208C543.331 51.6005 545.827 49.4779 549.076 47.9536C552.325 46.4295 556.201 45.6675 560.702 45.6675Z" fill="white"/>+<path d="M375.09 61.5796C379.138 61.5796 382.542 62.2687 385.302 63.6479C388.062 65.0274 390.222 66.8764 391.781 69.1948C393.341 71.5133 394.339 74.1074 394.778 76.9761L384.884 77.5015C384.589 75.9083 384.02 74.5153 383.177 73.3228C382.333 72.1303 381.229 71.1969 379.865 70.5229C378.501 69.8491 376.873 69.5122 374.98 69.5122C372.058 69.5123 369.875 70.0881 368.432 71.2397C366.988 72.3914 366.267 73.883 366.267 75.7144C366.267 77.0786 366.596 78.1973 367.256 79.0698C367.916 79.9423 368.993 80.6535 370.488 81.2036C371.983 81.7538 373.985 82.2339 376.491 82.645C381.334 83.4205 385.132 84.4071 387.886 85.603C390.64 86.7991 392.589 88.2825 393.731 90.0532C394.874 91.8239 395.444 93.9849 395.444 96.5356C395.444 99.4672 394.617 101.961 392.962 104.018C391.307 106.075 389.037 107.64 386.153 108.712C383.27 109.785 379.936 110.321 376.154 110.321C371.728 110.321 367.996 109.645 364.958 108.295C361.92 106.945 359.573 105.084 357.918 102.711C356.263 100.339 355.319 97.6275 355.085 94.5767L365.043 94.0718C365.482 96.6506 366.575 98.6814 368.319 100.164C370.064 101.646 372.683 102.387 376.176 102.387C379.007 102.387 381.252 101.929 382.912 101.012C384.572 100.095 385.402 98.6375 385.402 96.6401C385.402 95.512 385.131 94.5704 384.589 93.8159C384.047 93.0615 382.996 92.4024 381.436 91.8384C379.875 91.2742 377.563 90.7276 374.501 90.1997C369.852 89.3681 366.201 88.3577 363.549 87.1675C360.896 85.9773 359.012 84.4777 357.896 82.6685C356.781 80.8592 356.224 78.6719 356.224 76.1069C356.224 71.8203 357.834 68.3277 361.053 65.6284C364.272 62.9292 368.951 61.5796 375.09 61.5796Z" fill="white"/>+<path fill-rule="evenodd" clip-rule="evenodd" d="M441.527 61.5796C446.001 61.5797 449.906 62.5828 453.243 64.5894C456.58 66.596 459.17 69.4166 461.013 73.0513C462.856 76.6861 463.777 80.9857 463.777 85.9497C463.777 90.8694 462.856 95.1616 461.013 98.8257C459.17 102.489 456.58 105.321 453.243 107.321C449.906 109.32 446.001 110.321 441.527 110.321C437.054 110.321 433.137 109.32 429.778 107.321C426.419 105.321 423.818 102.49 421.975 98.8257C420.131 95.1616 419.21 90.8694 419.21 85.9497C419.21 80.9857 420.131 76.6861 421.975 73.0513C423.818 69.4165 426.419 66.596 429.778 64.5894C433.137 62.5828 437.054 61.5796 441.527 61.5796ZM441.527 69.8276C437.657 69.8276 434.642 71.2552 432.486 74.1108C430.33 76.9666 429.252 80.9132 429.252 85.9497C429.252 91 430.33 94.9496 432.486 97.7983C434.642 100.647 437.657 102.072 441.527 102.072C445.398 102.072 448.4 100.647 450.534 97.7983C452.668 94.9496 453.735 91.0001 453.735 85.9497C453.735 80.9132 452.668 76.9666 450.534 74.1108C448.4 71.2553 445.398 69.8277 441.527 69.8276Z" fill="white"/>+<path fill-rule="evenodd" clip-rule="evenodd" d="M763.724 61.5796C768.197 61.5796 772.102 62.5827 775.439 64.5894C778.776 66.596 781.367 69.4165 783.21 73.0513C785.053 76.6861 785.975 80.9857 785.975 85.9497C785.975 90.8694 785.053 95.1616 783.21 98.8257C781.367 102.49 778.776 105.321 775.439 107.321C772.102 109.32 768.197 110.321 763.724 110.321C759.25 110.321 755.334 109.32 751.975 107.321C748.616 105.321 746.014 102.49 744.171 98.8257C742.328 95.1616 741.406 90.8694 741.406 85.9497C741.406 80.9857 742.328 76.6861 744.171 73.0513C746.014 69.4165 748.615 66.596 751.975 64.5894C755.334 62.5827 759.25 61.5796 763.724 61.5796ZM763.724 69.8276C759.853 69.8276 756.84 71.2553 754.684 74.1108C752.527 76.9666 751.449 80.9132 751.449 85.9497C751.449 91.0002 752.527 94.9495 754.684 97.7983C756.84 100.647 759.853 102.072 763.724 102.072C767.594 102.072 770.596 100.647 772.73 97.7983C774.864 94.9495 775.932 91.0002 775.932 85.9497C775.932 80.9132 774.864 76.9666 772.73 74.1108C770.597 71.2554 767.594 69.8276 763.724 69.8276Z" fill="white"/>+<path d="M319.208 90.1919C319.208 94.3383 319.916 97.3861 321.333 99.3354C322.75 101.285 324.933 102.259 327.884 102.259C331.171 102.259 333.739 101.182 335.589 99.0269C337.439 96.8719 338.364 93.8124 338.364 89.8481V62.6294H348.035V109.268H339.051L338.96 101.663C338.02 103.841 336.72 105.628 335.057 107.02C332.429 109.219 329.031 110.319 324.863 110.319C320.166 110.319 316.437 108.757 313.677 105.632C310.917 102.508 309.537 98.1797 309.537 92.6479V62.6294H319.208V90.1919Z" fill="white"/>+<path d="M636.149 90.1919C636.149 94.3382 636.858 97.386 638.274 99.3354C639.691 101.285 641.875 102.259 644.825 102.259C648.112 102.259 650.681 101.182 652.531 99.0269C654.381 96.8719 655.306 93.8122 655.306 89.8481V62.6294H664.978V109.268H655.993L655.901 101.665C654.961 103.842 653.661 105.628 651.998 107.02C649.37 109.219 645.972 110.319 641.805 110.319C637.107 110.319 633.378 108.757 630.618 105.632C627.858 102.508 626.479 98.1796 626.479 92.6479V62.6294H636.149V90.1919Z" fill="white"/>+<path fill-rule="evenodd" clip-rule="evenodd" d="M715.41 109.258H706.377L706.113 102.292C704.828 104.804 702.89 106.768 700.297 108.185C697.704 109.602 694.772 110.31 691.502 110.31C687.5 110.31 684.038 109.313 681.117 107.321C678.196 105.328 675.951 102.511 674.381 98.8696C672.811 95.2278 672.026 90.917 672.026 85.939C672.026 80.9611 672.815 76.651 674.392 73.0093C675.968 69.3675 678.221 66.5507 681.149 64.5581C684.078 62.5655 687.528 61.5688 691.502 61.5688C694.695 61.5689 697.549 62.2368 700.062 63.5718C702.576 64.9068 704.468 66.7787 705.738 69.187V47.062H715.41V109.258ZM694.126 69.8169C690.445 69.817 687.514 71.2519 685.336 74.1216C683.158 76.9913 682.068 80.9307 682.068 85.939C682.068 90.875 683.161 94.7966 685.347 97.7026C687.532 100.609 690.459 102.061 694.126 102.061C696.619 102.061 698.726 101.423 700.449 100.148C702.172 98.8725 703.484 97.0265 704.386 94.6099C705.287 92.1933 705.738 89.3028 705.738 85.939C705.738 82.4865 705.287 79.5628 704.386 77.1685C703.484 74.7742 702.172 72.95 700.449 71.6968C698.726 70.4436 696.618 69.8169 694.126 69.8169Z" fill="white"/>+<path d="M493.952 61.5796C497.444 61.5796 500.358 62.3467 502.692 63.8813C505.027 65.4161 506.789 67.5122 507.977 70.1694C509.164 72.8267 509.759 75.8604 509.759 79.271V109.269H500.088V82.2778C500.088 79.5566 499.801 77.2594 499.228 75.3872C498.654 73.5149 497.718 72.0879 496.419 71.1079C495.12 70.128 493.4 69.6382 491.261 69.6382C488.035 69.6382 485.433 70.7173 483.456 72.8745C481.479 75.0318 480.489 78.1664 480.489 82.2778V109.269H470.818V62.6304H479.603L479.839 70.7056C480.351 69.3574 480.994 68.1721 481.771 67.1519C483.224 65.2445 485.002 63.8391 487.104 62.9351C489.205 62.0311 491.488 61.5796 493.952 61.5796Z" fill="white"/>+<path d="M607.444 62.6294H619.797V70.436H607.444V95.7495C607.444 97.9078 607.915 99.3995 608.856 100.224C609.798 101.049 611.24 101.461 613.181 101.461H619.797V109.268H610.84C606.369 109.268 603.074 108.237 600.954 106.177C598.834 104.117 597.773 100.882 597.773 96.4712V70.436H590.646V62.6294H597.773V51.7036H607.444V62.6294Z" fill="white"/>+<path fill-rule="evenodd" clip-rule="evenodd" d="M192.892 47.062C202.68 47.062 210.211 49.7635 215.484 55.1655C220.758 60.5675 223.394 68.2614 223.395 78.2476C223.395 88.1757 220.801 95.8268 215.615 101.2C210.429 106.572 203.03 109.258 193.418 109.258H172.758V47.062H192.892ZM182.604 100.366H192.892C199.687 100.366 204.767 98.5313 208.131 94.8628C211.495 91.1941 213.177 85.6486 213.177 78.2271C213.177 70.7167 211.495 65.1272 208.131 61.4585C204.767 57.7898 199.687 55.9556 192.892 55.9556H182.604V100.366Z" fill="white"/>+<path d="M274.701 54.8687H267.742C265.932 54.8687 264.591 55.3474 263.721 56.3052C262.851 57.2629 262.416 58.6325 262.416 60.4126V63.3345H280.056V59.8442C280.056 55.9225 281.157 52.8119 283.359 50.5122C285.562 48.2124 288.984 47.062 293.623 47.062H302.032V54.8687H295.073C293.263 54.8687 291.923 55.3477 291.053 56.3052C290.183 57.2629 289.747 58.6325 289.747 60.4126V63.3345H301.398V71.1421H289.747V109.258H280.056V71.1421H262.416V109.258H252.724V71.1421H246.206V63.3345H252.724V59.8442C252.724 55.9224 253.826 52.8119 256.028 50.5122C258.231 48.2125 261.652 47.0621 266.291 47.062H274.701V54.8687Z" fill="white"/>+<path d="M239.931 109.255H230.259V62.6167H239.931V109.255Z" fill="white"/>+<path d="M412.15 109.255H402.479V62.6167H412.15V109.255Z" fill="white"/>+<path d="M734.348 109.255H724.677V62.6167H734.348V109.255Z" fill="white"/>+<path d="M240.127 55.9556H230.063V46.5718H240.127V55.9556Z" fill="white"/>+<path d="M412.347 55.9556H402.283V46.5718H412.347V55.9556Z" fill="white"/>+<path d="M734.544 55.9556H724.48V46.5718H734.544V55.9556Z" fill="white"/>+</svg>diff --git a/knowledge/brand/design.md b/knowledge/brand/design.mdnew file mode 100644index 00000000..6fcb6a76--- /dev/null+++ b/knowledge/brand/design.md@@ -0,0 +1,103 @@+# Diffusion Studio visual guide++Define color, type, identity, imagery, layout, safe areas, and captions. Use `video.md` for motion and sound, `voice.md` for words, and `library.md` for reusable files.++Scale every pixel value below from a short edge of 1080.++## Visual principles++- Build structure with scale, weight, spacing, and luminance.+- Keep the frame near-achromatic. Use color only when it carries meaning.+- Show the product clearly. Do not decorate over controls or content the viewer must read.+- Prefer one clear focal point to several equal points.++## Color++Use these hex values in Diffusion Studio source.++| Role | Value |+| --- | --- |+| Background | `#000000` |+| Surface | `#161616` |+| Text | `#F8F8F8` |+| Text, secondary | `#A4A4A4` |+| Brand red | `#F43535` |++Default to leaving red out. It lives on the app icon. At most one element may carry it. Never+use it for a title or a large fill. The app's destructive state is `#E62D2D`, so red beside+product UI may read as an error.++`#008CFF` is the product blue. Use it only when it already appears in real product UI. Never+use it as a brand accent.++Place text on `#000000` or `#161616`. Do not rely on a shadow or stroke for contrast.++## Typography++Use `Geist`. Use `Geist Mono` for code and figures. Do not use italic.++| Role | Size | Weight | Copy limit |+| --- | ---: | ---: | ---: |+| Title | 96 | 600 | 32 characters |+| Subtitle | 60 | 400 | 64 characters |+| Lower-third name | 48 | 500 | 28 characters |+| Lower-third detail | 30 | 400 | 40 characters |+| Label | 24 | 500 | 16 characters |++Rewrite copy that exceeds a limit. Do not shrink the type. Confirm that Geist and Geist Mono+are available before final output; no font files are bundled yet.++## Logo and icon++Use `assets/logos/logo-white.svg` or `assets/logos/icon-white.svg` on a dark, quiet background. Use the wordmark when the name must be clear. Use the icon only when the product is already named or the small space cannot hold the wordmark.++Do not tint, outline, stretch, crop, rotate, rebuild, or place either mark over busy footage.+No dark mark, minimum size, clear-space rule, or video-scale logo bug has been supplied. Do not+invent one.++## Product imagery++- Show real product UI. Do not reconstruct or recolor it.+- Use `contain` when viewers must read the whole interface.+- Use `cover` only when the crop cannot hide a control, label, or result needed for the point.+- Keep product captures sharp and at their native aspect ratio.+- Use a plain surface around captures instead of stretching them to fill a frame.+- Add photography or illustration only when the request or library supplies a suitable asset.++## Layout and aspect ratios++Use a margin of 64 and a gap of 40. Use other spacing in multiples of 8: 16 between a label and+value, 24 between lines in one block, and 40 between separate blocks.++Use a corner radius of 24 on framed media panels. Do not round full-frame media.++Left-align copy and anchor it low. Center copy only when it stands alone on a plain background.+Use at most two text elements in one shot: a primary line and its qualifier.++Use these media forms:++- **Full frame:** one product view or one dominant subject.+- **Two-up:** two states, inputs, speakers, or before-and-after views.+- **Four-up:** a set of equal details that remain legible at delivery size.++Keep two-up panels square when the source allows it. Place them side by side in 16:9 and 1:1,+and stack them in 9:16. Use a centered 2×2 grid for four-up. Use+`assets/components/media-grid.tsx` for the tested geometry.++### 9:16 text safe area++At 1080×1920, keep readable content inside `x 64–900`, `y 200–1520`. The right 180 is the platform action rail and the bottom 400 is the caption reserve. Graphics may cross these bounds; text may not.++## Captions++Use `stark` for 9:16 output and `cascade` for other ratios. Pass no `colors`; neither preset+exposes color slots. On 9:16, do not add another bottom offset to the preset.++A preset carries its own legibility. Never put a band, plate, or gradient behind captions. When one+does not read over the footage, change the preset or its `verticalAlign` or `offsetY`; if it still does not read,+that is the answer for that stretch, not a reason to dim the picture.++## Known gaps++The brand has no bundled fonts, dark logo, approved video logo bug, image library, shared code+text size, or measured minimum logo size. Name the gap when a task depends on one.diff --git a/knowledge/brand/library.md b/knowledge/brand/library.mdnew file mode 100644index 00000000..f113d2df--- /dev/null+++ b/knowledge/brand/library.md@@ -0,0 +1,57 @@+# Diffusion Studio brand library++Use this catalog before selecting or making a brand file. References define the brand; bundled+files apply it. Keep one-off project media with its project.++## Components and shared values++| File | Use | Notes |+| --- | --- | --- |+| `assets/components/tokens.ts` | Share brand color, type, spacing, and safe-area values | Keep it in sync with `design.md` |+| `assets/components/title-card.tsx` | Add a title and optional qualifier | Follow title and subtitle limits in `design.md` |+| `assets/components/lower-third.tsx` | Add a name and detail over footage | Keep both lines inside the text safe area |+| `assets/components/callout.tsx` | Add a short label and value | Use it for one fact, not a paragraph |+| `assets/components/media-grid.tsx` | Place one, two, or four media sources | A two-up layout stacks in portrait and sits side by side otherwise |++Components do not own a `<scene>`. Read the matching source for its inputs and copy only the+files the project needs.++## Compositions++| File | Use | Format | Required inputs |+| --- | --- | --- | --- |+| `assets/compositions/product-demo.tsx` | A single product capture with a lower third | 9:16 | `videoSrc`, `name`, `detail` |+| `assets/compositions/product-tour.tsx` | Full frame to two-up to four-up and back | 16:9 by default; may use 9:16 or 1:1 | Four media sources, `name`, `detail` |+| `assets/compositions/end-card.tsx` | A plain branded end card | 9:16 | `title`, `cta` |++Compositions own `<scene>`, timing, and editable inputs. They are starting points, not a second+component system in the Diffusion Studio app.++## Logos++| File | Use |+| --- | --- |+| `assets/logos/logo-white.svg` | Wordmark on a dark, quiet background |+| `assets/logos/icon-white.svg` | Product icon when the name is already clear |++No dark mark is bundled.++## Fonts, imagery, and audio++No font, reusable image, music, sound-effect, or voiceover file is bundled yet. Do not replace a+missing asset with an unlicensed or unrelated file.++Keep reusable fonts in `assets/fonts/`, imagery in `assets/imagery/`, music in+`assets/audio/music/`, sound effects in `assets/audio/sfx/`, and voiceovers in+`assets/audio/voiceovers/`. Reuse a recording only when its words, delivery, and usage rights fit.++## Select media++Use catalog entries and filenames to shortlist likely matches. Inspect those candidates first,+and widen the search only when needed.++## Add to the library++When adding media, record its source and usage rights in this catalog. Add a reusable item only+after it has a clear repeated use. Give a component one job and a small input set. Add a+composition when the scene flow repeats. Do not add a one-off choice as a brand rule.diff --git a/knowledge/brand/video.md b/knowledge/brand/video.mdnew file mode 100644index 00000000..733fce9c--- /dev/null+++ b/knowledge/brand/video.md@@ -0,0 +1,74 @@+# Diffusion Studio video guide++Define how the brand behaves over time. Use `design.md` for visual rules, `voice.md` for words,+and `library.md` for reusable source.++Work at 30 fps.++## Scene and media structure++Use full frame while one product state carries the point. Move to two-up to compare or connect+two views. Move to four-up only when all four details remain readable. Return to full frame+when one view becomes primary again.++Change the layout because the idea changes, not to add motion. Prefer a hard cut between layout+forms. Carry one element across the cut only when it represents the same object or state.++In 9:16, hold split layouts longer because each panel is smaller. In 1:1, check that both copy+and product UI still have one clear focal point.++## Timing++Enter over 400 ms (`"12f"`). Exit over 200 ms (`"6f"`). Stagger support by 100 ms (`"3f"`).+Keep a single entrance or exit under 600 ms (`"18f"`).++## Easing++Use the nearest anchor and change it only when the motion needs a different quality. Do not use+`linear` unless the movement is mechanical.++| Anchor | Use | Easing |+| --- | --- | --- |+| Entrance | arriving | `cubicBezier(0.2,0.75,0.34,0.94)` |+| Settle | landing or resolving | `cubicBezier(0,0.65,0.51,0.99)` |+| Travel | moving between states | `cubicBezier(1,0.49,0,0.55)` |+| Exit | leaving | `cubicBezier(1,0.02,0.54,0.42)` |++Do not use the `bouncy` or `strong` spring presets.++## Movement++Lead with one element and delay its support by `"3f"`. Stagger repeated items from a meaningful+origin: first, center, or focal point. Let opacity finish before movement so text becomes+readable before it settles.++Use one flourish per beat. Treat a busy scene as a layout problem.++## Cuts and transitions++| Method | Use |+| --- | --- |+| Hard cut on action | energy while authored motion is still moving |+| Jump cut | matched direction and speed across the seam |+| Continuous carry | the same object or state across two beats |+| Hold cut | read-critical text, product UI, and final lockups |++Use a 300 ms `dissolve` only between two shots of the same subject. Use `fadeToBlack` only to+end a video. Do not use `fadeToWhite`, `slideFromLeft`, or `slideFromRight`.++Cut product captures after the needed action or label has been visible long enough to read.+Tighten a slow cut before adding motion.++## Captions++Add captions after the edit and final audio placement. Keep each caption on screen long enough+to read without racing the voice. Use the visual treatment in `design.md`.++## Sound++Use audio supplied for the project or approved in `library.md`.++Give speech priority. Use one clear source for product audio when several copies of the same+capture appear on screen; mute the rest.++No house mix level has been supplied. Do not invent one.diff --git a/knowledge/brand/voice.md b/knowledge/brand/voice.mdnew file mode 100644index 00000000..120fe069--- /dev/null+++ b/knowledge/brand/voice.md@@ -0,0 +1,45 @@+# Diffusion Studio language and voice guide++Use this guide for what Diffusion Studio says and how it says it. Apply it to titles, labels,+scripts, captions, calls to action, and product descriptions.++## Approved product language++| Name | Copy | Use |+| --- | --- | --- |+| Product name | `Diffusion Studio` | Every product reference |+| One-line description | The video editor for teams creating with agents. | Short introductions and summaries |++Keep `video editor`, `teams`, and `agents` when adapting the one-line description. Do not broaden+a product claim beyond what the request or supplied evidence supports.++## Writing++- Lead with the result or action.+- Use short words, short sentences, and active voice.+- Cut any word that adds no meaning.+- State what the product does. Do not add hype or an unsupported claim.+- Keep code, product names, technical terms, and interface labels exact.+- Avoid familiar figures of speech and vague claims.+- Rewrite copy that breaks a length limit. Do not shrink the type.+- Break a writing rule when accuracy or clarity requires it.++Review every prose output against these rules before delivering it.++## Tone++Sound clear, calm, and sure. Let the work supply the energy. Do not sound grand, cute, vague,+or eager to impress.++Avoid claims such as `effortless`, `magical`, `revolutionary`, or `all-in-one` unless the team+has approved and proved the claim.++## Calls to action++Write a direct action that matches the destination. Name the action rather than promising an+outcome. Keep it short enough to work without punctuation.++## Spoken copy++Apply the same writing and tone rules to scripts and narration. No house delivery or+pronunciation guide has been supplied. Do not invent one.diff --git a/examples/01-basics.tsx b/knowledge/examples/01-basics.tsxsimilarity index 98%rename from examples/01-basics.tsxrename to knowledge/examples/01-basics.tsxindex b5761d27..5ad421f2 100644--- a/examples/01-basics.tsx+++ b/knowledge/examples/01-basics.tsx@@ -1,4 +1,3 @@-/* @jsxImportSource @diffusionstudio/jsx *//* The everyday composition: sequenced A-roll, an image overlay, data-driven* titles via <For>, and a music bed under everything.*diff --git a/examples/02-genai.tsx b/knowledge/examples/02-genai.tsxsimilarity index 98%rename from examples/02-genai.tsxrename to knowledge/examples/02-genai.tsxindex 1bd95863..68012163 100644--- a/examples/02-genai.tsx+++ b/knowledge/examples/02-genai.tsx@@ -1,4 +1,3 @@-/* @jsxImportSource @diffusionstudio/jsx *//* Multi-stage generation: text-to-image keyframes, image-to-video motion,* a text-to-speech voiceover, generated ambience, and captions on top.*diff --git a/examples/03-ticker.tsx b/knowledge/examples/03-ticker.tsxsimilarity index 98%rename from examples/03-ticker.tsxrename to knowledge/examples/03-ticker.tsxindex dbff834b..8cb20f41 100644--- a/examples/03-ticker.tsx+++ b/knowledge/examples/03-ticker.tsx@@ -1,4 +1,3 @@-/* @jsxImportSource @diffusionstudio/jsx *//* Declarative animation: useTicker exposes the playhead as reactive* accessors, createMemo derives values from it, and props consume the memos.*diff --git a/examples/04-html-in-canvas.tsx b/knowledge/examples/04-html-in-canvas.tsxsimilarity index 98%rename from examples/04-html-in-canvas.tsxrename to knowledge/examples/04-html-in-canvas.tsxindex 13772c1c..049ba1af 100644--- a/examples/04-html-in-canvas.tsx+++ b/knowledge/examples/04-html-in-canvas.tsx@@ -1,4 +1,3 @@-/* @jsxImportSource @diffusionstudio/jsx *//* An AI prompt box as real HTML, centered in the frame.** cp examples/04-html-in-canvas.tsx ~/Projects/html-in-canvas/index.tsxdiff --git a/examples/05-anime-timeline.tsx b/knowledge/examples/05-anime-timeline.tsxsimilarity index 98%rename from examples/05-anime-timeline.tsxrename to knowledge/examples/05-anime-timeline.tsxindex 511cca76..03b8e339 100644--- a/examples/05-anime-timeline.tsx+++ b/knowledge/examples/05-anime-timeline.tsx@@ -1,4 +1,3 @@-/* @jsxImportSource @diffusionstudio/jsx *//* Anime.js timeline scrubbed by the playhead: one clock, two render worlds.** cp examples/05-anime-timeline.tsx ~/Projects/anime-timeline/index.tsxdiff --git a/examples/06-three.tsx b/knowledge/examples/06-three.tsxsimilarity index 99%rename from examples/06-three.tsxrename to knowledge/examples/06-three.tsxindex 748febcd..3ff1bcce 100644--- a/examples/06-three.tsx+++ b/knowledge/examples/06-three.tsx@@ -1,4 +1,3 @@-/* @jsxImportSource @diffusionstudio/jsx *//* Three.js owning a <surface>: a glTF helmet spun by the playhead.** cp examples/06-three.tsx ~/Projects/three/index.tsxdiff --git a/examples/07-webgpu.tsx b/knowledge/examples/07-webgpu.tsxsimilarity index 99%rename from examples/07-webgpu.tsxrename to knowledge/examples/07-webgpu.tsxindex 0714b5bb..c955d74b 100644--- a/examples/07-webgpu.tsx+++ b/knowledge/examples/07-webgpu.tsx@@ -1,4 +1,3 @@-/* @jsxImportSource @diffusionstudio/jsx *//* WebGPU owning a <surface>: a triangle whose colors cycle with the playhead.** cp examples/07-webgpu.tsx ~/Projects/webgpu/index.tsxdiff --git a/examples/08-shader-paint.tsx b/knowledge/examples/08-shader-paint.tsxsimilarity index 97%rename from examples/08-shader-paint.tsxrename to knowledge/examples/08-shader-paint.tsxindex 534893b2..0512afce 100644--- a/examples/08-shader-paint.tsx+++ b/knowledge/examples/08-shader-paint.tsx@@ -1,4 +1,3 @@-/* @jsxImportSource @diffusionstudio/jsx *//* A shader paint post-processing a video: chromatic aberration pulsing with* the playhead plus a vignette, driven by two uniforms.*diff --git a/examples/09-inspect-variables.tsx b/knowledge/examples/09-inspect-variables.tsxsimilarity index 97%rename from examples/09-inspect-variables.tsxrename to knowledge/examples/09-inspect-variables.tsxindex f5379407..97a9f4d4 100644--- a/examples/09-inspect-variables.tsx+++ b/knowledge/examples/09-inspect-variables.tsx@@ -1,4 +1,3 @@-/* @jsxImportSource @diffusionstudio/jsx *//* `@inspect` variables: annotate a top-level const and the editor's right* sidebar grows a control for it (stage level, under the background picker).* Moving the control moves the composition live — no remount — and the valuediff --git a/examples/10-typegpu.tsx b/knowledge/examples/10-typegpu.tsxsimilarity index 99%rename from examples/10-typegpu.tsxrename to knowledge/examples/10-typegpu.tsxindex a4d9a544..53bd2903 100644--- a/examples/10-typegpu.tsx+++ b/knowledge/examples/10-typegpu.tsx@@ -1,4 +1,3 @@-/* @jsxImportSource @diffusionstudio/jsx *//* TypeGPU on a <surface>: an underwater caustics shader written in TypeScript.** The shader is TypeGPU's caustics example (docs.swmansion.com/TypeGPU,diff --git a/examples/11-redraw.tsx b/knowledge/examples/11-redraw.tsxsimilarity index 99%rename from examples/11-redraw.tsxrename to knowledge/examples/11-redraw.tsxindex 4800560c..f20ef8a8 100644--- a/examples/11-redraw.tsx+++ b/knowledge/examples/11-redraw.tsx@@ -1,4 +1,3 @@-/* @jsxImportSource @diffusionstudio/jsx *//* Redraw on a <surface>: the "hello" write-on stroke from redraw's docs.** Redraw (redraw.dev) is a 2D renderer on WebGPU: a Library declares customdiff --git a/examples/README.md b/knowledge/examples/README.mdsimilarity index 100%rename from examples/README.mdrename to knowledge/examples/README.mddiff --git a/examples/tsconfig.json b/knowledge/examples/tsconfig.jsonsimilarity index 100%rename from examples/tsconfig.jsonrename to knowledge/examples/tsconfig.jsondiff --git a/knowledge/guides/prompts/media-listen.md b/knowledge/guides/prompts/media-listen.mdnew file mode 100644index 00000000..1362652e--- /dev/null+++ b/knowledge/guides/prompts/media-listen.md@@ -0,0 +1,12 @@+# Writing prompts for `dapi media listen`++`media listen` puts a multimodal model in front of an audio track and answers a prompt about it. A good prompt is specific about what you want and asks for timestamps so the answer lines up with the timeline. With no prompt it returns a general description; the examples below shape that into something more useful.++## Examples+When you refer to a specific moment inside a prompt, use `MM:SS` (e.g. `01:15` for one minute fifteen seconds).++- Summarize the footage in 3 sentences.+- What are the examples given at 00:05 and 00:10 supposed to tell us?+- Describe the key events in this footage. Include timestamps for salient moments.+- Transcribe the speech in the audio. Include timestamps as provided.+- Tell me the name of the music track playing and include the timestamps for start and end.diff --git a/knowledge/guides/walkthroughs/podcast-clip.md b/knowledge/guides/walkthroughs/podcast-clip.mdnew file mode 100644index 00000000..b9d75c63--- /dev/null+++ b/knowledge/guides/walkthroughs/podcast-clip.md@@ -0,0 +1,114 @@+# Example: podcast clipping++A long two-or-more-speaker conversation — one to three hours — cut down to a single vertical short. The work is mostly search: the clip-worthy moment has to be found before anything is edited. Audio carries everything you need for that search, so the whole discovery pass runs on an audio-only download; video is only fetched once the moment is known.++## 1. Brief++Write the brief first: the source URL or file, how many clips are wanted, the target duration (25–35 s unless told otherwise), the delivery format (1080×1920), and any editorial steer — a topic to favour, a speaker to feature, moments to avoid. A clip has no surrounding context to lean on, so **self-containment is the hard requirement**; record it in the brief and check the result against it.++## 2. Audio-only pass++Download the audio track alone. It is a fraction of the bytes, and the best moments are found without visuals.++```bash+dapi fetch <url> -a -o podcast.m4a+```++## 3. Segment the audio++A three-hour track is too long for one analysis pass, so split it into segments and analyze each. Segments are **windows**, not files: `listen -s/-e` takes the range directly, and the timestamps it returns are relative to `-s`. Pick one of three ways to choose the boundaries:++1. **Waveform.** `dapi media waveform` renders loudness over the whole track and returns the silent spans as second ranges. Cut segments at those spans — the boundaries land between thoughts instead of inside them.+2. **Naive.** Fixed 15–30 minute segments. Nothing to parse, and good enough because the analysis reports its own timestamps; a moment straddling a boundary is the only loss.+3. **Source transcript.** Many platforms publish one (YouTube captions, show notes with chapter markers). Parse its timestamps and use chapters or topic shifts as boundaries — the cheapest option when it exists, since it needs no decoding at all.++## 4. Find the clip-worthy moments++Run `dapi media listen` on each segment with a prompt that spells out the criteria and demands timestamps.++```bash+dapi media listen podcast.m4a -s '15:00' -e '45:00' -p 'This is a podcast. Find the 3 most clip-worthy self-contained moments in this segment for a vertical social short. Criteria: a complete thought, punchline, or surprising revelation that works with NO prior context; roughly 25-35 seconds long; opens on a strong hook line and lands on a clean button. For each give: exact start and end timestamp (MM:SS, relative to this segment), who is speaking, a one-line summary of what is said, and a hook-strength rating 1-10. Be strict about self-containment.'+```++Asking for a rating and a one-line summary is what makes the candidates comparable across segments. Add the segment's `-s` offset back to each returned timestamp to get absolute positions in the source, then pick the winner on hook strength and self-containment — not on how interesting the topic is.++## 5. Lock the exact cut points++The analysis gives you seconds; a clip needs the frame. Tighten both ends against the real audio:++- `dapi media transcribe` prints word-level start/end times (use ffmpeg to shorten). Put the in-point on the first word of the hook line and the out-point after the last word of the button.+- `dapi media waveform podcast.m4a -s <in> -e <out>` shows the breaths around those words, so you can open the in-point a beat early and let the out-point land on the silence after the line instead of clipping its tail.++## 6. Download the segment and lay it out++Now fetch the video, and **download with padding** — a few seconds either side of the locked range — so the trim can still be nudged without downloading again.++`dapi media probe clip-raw.mp4` gives the source dimensions (a podcast is almost always 1920×1080) and confirms where the padded range actually starts, since a keyframe-aligned download can begin slightly early.++Give the node the **source's own aspect ratio**, scaled to the scene height, rather than the scene's box: the node is then wider than the scene, and the scene crops it. That geometry is what makes the framing in the next step possible.++```tsx+const raw = "/Downloads/clip-raw.mp4";++// Locked range, expressed in the padded download's own time.+const IN = 6.4; // first word of the hook+const OUT = 36.1; // after the button lands++const SCENE_W = 1080;+const NODE_H = 1920;+const NODE_W = NODE_H * (1920 / 1080); // source aspect, scaled to scene height ≈ 3413++export default function Project() {+ return (+ <stage camera={[0.25, 0, 0, 0.25, 235, 70]}>+ <scene name="Podcast clip" width={SCENE_W} height={1920} fill="black" active>+ <sequence name="A-roll">+ <video src={raw} width={NODE_W} height={NODE_H} x={(SCENE_W - NODE_W) / 2}+ start={0} sourceIn={IN} sourceOut={OUT} />+ </sequence>+ </scene>+ </stage>+ );+}+```++Save the file and get the trim right before framing or captions — `dapi capture <sceneId> -t 0` on the in-point and the out-point is the check.++## 7. Frame the active speaker (optional if necessary)+++```tsx+import { useTicker } from "@diffusionstudio/jsx";++const turns = [+ { at: 0, fx: 0.30 },+ { at: 8.2, fx: 0.70 },+ { at: 24.5, fx: 0.30 },+];++const { time } = useTicker();+// time() is the scene playhead; the clip starts at 0, so it is already node-local.+const speakerX = () =>+ centerOn((turns.findLast((s) => time() >= s.at) ?? turns[0]).fx);++// ...+<video src={raw} width={NODE_W} height={NODE_H}+ start={0} sourceIn={IN} sourceOut={OUT} x={speakerX()} />+```+++## 8. Captions++Add captions last, after the trim and framing are verified. Use the **`classic`** preset centred — it is the first choice for vertical content.++```tsx+<captions preset="classic" verticalAlign="center" />+```++If the caption block lands on the speakers' faces, push it off with `offsetY` rather than changing the framing you just verified:++```tsx+<captions preset="classic" verticalAlign="center" offsetY={420} />+```++Capture a frame per caption line with `dapi capture` and check readability at delivery size — a caption over a mouth is worse than no caption.diff --git a/knowledge/guides/walkthroughs/talking-head.md b/knowledge/guides/walkthroughs/talking-head.mdnew file mode 100644index 00000000..6f3e8436--- /dev/null+++ b/knowledge/guides/walkthroughs/talking-head.md@@ -0,0 +1,105 @@+# Example: long-form talking head++A single speaker to camera — an explainer, a podcast solo, a course lesson. The recording is long and raw: restarts, flubbed lines, and dead air between thoughts. The edit cuts it down to the clean story, back-to-back, never mid-word. The transcript drives the A-roll; the waveform separates silence from performance.++## 1. Brief++Write the brief first. It records the source files, the target duration (or "keep everything good"), and any editorial instruction. Absent a target length or explicit direction, **make no editorial cuts**: keep every good part, drop only silences and double takes, and keep the story chronological.++## 2. Analysis++The transcript is the spine, so transcribe everything with speech.++- **Transcribe every video and any external audio.** `dapi media transcribe <id|path>` prints word-level start/end times — the times you cut on. Run it on each camera take and on any separate recording (a lav or interface track you will sync to).+- **Render the waveform to read the gaps.** `dapi media waveform <id|path>` marks silence in red and returns it as second ranges. A transcript marks only speech, so a gap in it can be silence *or* something to keep — a laugh, a breath. The waveform tells them apart: red is dead air to cut; a gap that still shows signal is performance to keep.+- **Resolve double takes visually.** The transcript shows repeated lines; usually the **last** take is the keeper. When takes read equally well, `dapi media grab -t` the first word of each and keep the sharpest — motion blur means a bad take.++## 3. Lay out the A-roll++Drop **every** double take and silence, and put the good parts in chronological order.++```tsx+import { For } from "solid-js";++const raw = "/Recordings/take.mp4";++// Kept stretches, in order — source range only.+const takes = [+ { src: raw, sourceIn: 48.2, sourceOut: 53.9 }, // opener — third take, sourceIn on the first word+ { src: raw, sourceIn: 61.7, sourceOut: 69.4 }, // next sentence — sourceIn opens ~0.4 s early for a breath+ { src: raw, sourceIn: 74.0, sourceOut: 78.1 }, // mid-sentence pickup — flubbed clause dropped+ { src: raw, sourceIn: 95.2, sourceOut: 102.8 }, // closer — trailing air left in sourceOut+];++// Chain them back-to-back: each start is the sum of the durations before it.+let cursor = 0;+const aRoll = takes.map((t) => {+ const start = cursor;+ cursor += t.sourceOut - t.sourceIn;+ return { ...t, start };+});++export default function Project() {+ return (+ <stage camera={[0.25, 0, 0, 0.25, 235, 70]}>+ <scene name="Talking head" width={1080} height={1920} fill="black" active>+ <sequence name="A-roll">+ <For each={aRoll}>+ {(clip) => (+ <video src={clip.src} width={1080} height={1920}+ start={clip.start} sourceIn={clip.sourceIn} sourceOut={clip.sourceOut} />+ )}+ </For>+ </sequence>+ </scene>+ </stage>+ );+}+```++The silence you *keep* between sentences lives inside the clips, not in a timeline gap — a gap in a sequence freezes or blanks the frame. Carry a pause by extending a clip's `sourceOut` (or opening the next `sourceIn`) into the real silence, and keep the timeline gapless.++Save the file — the app recompiles and re-renders it — and get the spine right before layering anything on top.++## 4. Cut points++- **Open tight.** Set the first `sourceIn` on the first word — dead air at the top kills retention.+- **Between sentences, leave 0.3–0.5 s of silence.** Enough to breathe, not to drag. Tune it with each clip's `sourceOut` / next `sourceIn`.+- **Mid-sentence, butt the words together.** When you drop a clause inside a sentence, close the gap as far as it goes — never mid-word. Grab the frames around the join to confirm the word is whole.+- **End on up to 0.8 s.** Leave a little trailing air in the last `sourceOut` so the video doesn't stop abruptly.++## 5. Verification++Run `dapi check <sceneId>` first: on a long timeline of many clips, a `sourceOut`/`start` that don't meet leaves a gap no sampled frame would land on, and the check names those spans outright.++Then the cut points, which matter most. Capture the **first frame of every clip** with `dapi capture <sceneId> -t ...` at each clip's `start`, and check the cut didn't land on a bad frame — motion blur is the usual tell; nudge `sourceIn` a few frames to a settled one. Reconcile against the brief, and re-check neighbouring cuts after any structural change.++## 6. Visual hook (optional)++A hook makes the video readable at a glance. Aim for a frame you could lift out and use as a thumbnail.++- **Just a title.** One line of large Inter at medium weight, in a single colour. That is the whole hook: **no sub-header, eyebrow, or secondary line**, and **no background, box, panel, or fill** — the text sits directly on the A-roll.+- **Placement.** Beside the speaker's head or below it, **never covering the head**. A popular strategy is to place it A-roll aware.+- **Duration.** Keep it on screen as long as the viewer needs to read it.++One line of copy is a job for the native `<text>` tag:++```tsx+<text+ x={80} y={1240} width={920} height={260}+ start={0} end={3}+ fontFamily="Inter" fontSize={84} fontWeight={500} color="#fff"+ textAlign="left" textBaseline="top"+>+ The one editing trick+</text>+```++## 7. Captions (optional)++Add captions **last**, after every cut and overlay is verified, so they transcribe the final audio at its final placement. Use the **`whisper`** preset aligned to the bottom, and start it where the hook ends — set both `start` and `sourceIn` to that timestamp so the transcript stays aligned (see `reference/jsx/captions.md` in the project's docs). Keep captions off overlays and off the important part of the A-roll.++```tsx+{/* Hook holds until 00:03; captions begin there. */}+<captions preset="whisper" verticalAlign="bottom" start={3} sourceIn={3} />+```diff --git a/reference/jsx/README.md b/knowledge/reference/jsx/README.mdsimilarity index 100%rename from reference/jsx/README.mdrename to knowledge/reference/jsx/README.mddiff --git a/reference/jsx/adjustment-layer.md b/knowledge/reference/jsx/adjustment-layer.mdsimilarity index 100%rename from reference/jsx/adjustment-layer.mdrename to knowledge/reference/jsx/adjustment-layer.mddiff --git a/reference/jsx/animations.md b/knowledge/reference/jsx/animations.mdsimilarity index 100%rename from reference/jsx/animations.mdrename to knowledge/reference/jsx/animations.mddiff --git a/reference/jsx/audio-sync.md b/knowledge/reference/jsx/audio-sync.mdsimilarity index 100%rename from reference/jsx/audio-sync.mdrename to knowledge/reference/jsx/audio-sync.mddiff --git a/reference/jsx/audio.md b/knowledge/reference/jsx/audio.mdsimilarity index 100%rename from reference/jsx/audio.mdrename to knowledge/reference/jsx/audio.mddiff --git a/reference/jsx/captions.md b/knowledge/reference/jsx/captions.mdsimilarity index 100%rename from reference/jsx/captions.mdrename to knowledge/reference/jsx/captions.mddiff --git a/reference/jsx/elements.md b/knowledge/reference/jsx/elements.mdsimilarity index 100%rename from reference/jsx/elements.mdrename to knowledge/reference/jsx/elements.mddiff --git a/reference/jsx/errors.md b/knowledge/reference/jsx/errors.mdsimilarity index 100%rename from reference/jsx/errors.mdrename to knowledge/reference/jsx/errors.mddiff --git a/reference/jsx/fonts.md b/knowledge/reference/jsx/fonts.mdsimilarity index 100%rename from reference/jsx/fonts.mdrename to knowledge/reference/jsx/fonts.mddiff --git a/reference/jsx/generate.md b/knowledge/reference/jsx/generate.mdsimilarity index 100%rename from reference/jsx/generate.mdrename to knowledge/reference/jsx/generate.mddiff --git a/reference/jsx/group.md b/knowledge/reference/jsx/group.mdsimilarity index 100%rename from reference/jsx/group.mdrename to knowledge/reference/jsx/group.mddiff --git a/reference/jsx/html.md b/knowledge/reference/jsx/html.mdsimilarity index 100%rename from reference/jsx/html.mdrename to knowledge/reference/jsx/html.mddiff --git a/reference/jsx/image.md b/knowledge/reference/jsx/image.mdsimilarity index 100%rename from reference/jsx/image.mdrename to knowledge/reference/jsx/image.mddiff --git a/reference/jsx/keyframes.md b/knowledge/reference/jsx/keyframes.mdsimilarity index 100%rename from reference/jsx/keyframes.mdrename to knowledge/reference/jsx/keyframes.mddiff --git a/reference/jsx/lifecycle.md b/knowledge/reference/jsx/lifecycle.mdsimilarity index 100%rename from reference/jsx/lifecycle.mdrename to knowledge/reference/jsx/lifecycle.mddiff --git a/reference/jsx/media.md b/knowledge/reference/jsx/media.mdsimilarity index 100%rename from reference/jsx/media.mdrename to knowledge/reference/jsx/media.mddiff --git a/reference/jsx/module.md b/knowledge/reference/jsx/module.mdsimilarity index 100%rename from reference/jsx/module.mdrename to knowledge/reference/jsx/module.mddiff --git a/reference/jsx/paints.md b/knowledge/reference/jsx/paints.mdsimilarity index 100%rename from reference/jsx/paints.mdrename to knowledge/reference/jsx/paints.mddiff --git a/reference/jsx/rect.md b/knowledge/reference/jsx/rect.mdsimilarity index 100%rename from reference/jsx/rect.mdrename to knowledge/reference/jsx/rect.mddiff --git a/reference/jsx/scene.md b/knowledge/reference/jsx/scene.mdsimilarity index 100%rename from reference/jsx/scene.mdrename to knowledge/reference/jsx/scene.mddiff --git a/reference/jsx/sequences.md b/knowledge/reference/jsx/sequences.mdsimilarity index 100%rename from reference/jsx/sequences.mdrename to knowledge/reference/jsx/sequences.mddiff --git a/reference/jsx/shader-paint.md b/knowledge/reference/jsx/shader-paint.mdsimilarity index 100%rename from reference/jsx/shader-paint.mdrename to knowledge/reference/jsx/shader-paint.mddiff --git a/reference/jsx/stage.md b/knowledge/reference/jsx/stage.mdsimilarity index 100%rename from reference/jsx/stage.mdrename to knowledge/reference/jsx/stage.mddiff --git a/reference/jsx/styles.md b/knowledge/reference/jsx/styles.mdsimilarity index 100%rename from reference/jsx/styles.mdrename to knowledge/reference/jsx/styles.mddiff --git a/reference/jsx/surface-paint.md b/knowledge/reference/jsx/surface-paint.mdsimilarity index 100%rename from reference/jsx/surface-paint.mdrename to knowledge/reference/jsx/surface-paint.mddiff --git a/reference/jsx/text.md b/knowledge/reference/jsx/text.mdsimilarity index 100%rename from reference/jsx/text.mdrename to knowledge/reference/jsx/text.mddiff --git a/reference/jsx/timing.md b/knowledge/reference/jsx/timing.mdsimilarity index 100%rename from reference/jsx/timing.mdrename to knowledge/reference/jsx/timing.mddiff --git a/reference/jsx/transitions.md b/knowledge/reference/jsx/transitions.mdsimilarity index 100%rename from reference/jsx/transitions.mdrename to knowledge/reference/jsx/transitions.mddiff --git a/reference/jsx/variables.md b/knowledge/reference/jsx/variables.mdsimilarity index 100%rename from reference/jsx/variables.mdrename to knowledge/reference/jsx/variables.mddiff --git a/reference/jsx/video.md b/knowledge/reference/jsx/video.mdsimilarity index 100%rename from reference/jsx/video.mdrename to knowledge/reference/jsx/video.mddiff --git a/reference/README.md b/knowledge/reference/tools/README.mdsimilarity index 100%rename from reference/README.mdrename to knowledge/reference/tools/README.mddiff --git a/reference/capture.md b/knowledge/reference/tools/capture.mdsimilarity index 100%rename from reference/capture.mdrename to knowledge/reference/tools/capture.mddiff --git a/reference/check.md b/knowledge/reference/tools/check.mdsimilarity index 100%rename from reference/check.mdrename to knowledge/reference/tools/check.mddiff --git a/reference/context.md b/knowledge/reference/tools/context.mdsimilarity index 100%rename from reference/context.mdrename to knowledge/reference/tools/context.mddiff --git a/reference/export.md b/knowledge/reference/tools/export.mdsimilarity index 100%rename from reference/export.mdrename to knowledge/reference/tools/export.mddiff --git a/reference/fetch.md b/knowledge/reference/tools/fetch.mdsimilarity index 100%rename from reference/fetch.mdrename to knowledge/reference/tools/fetch.mddiff --git a/reference/fonts.md b/knowledge/reference/tools/fonts.mdsimilarity index 100%rename from reference/fonts.mdrename to knowledge/reference/tools/fonts.mddiff --git a/reference/logs.md b/knowledge/reference/tools/logs.mdsimilarity index 100%rename from reference/logs.mdrename to knowledge/reference/tools/logs.mddiff --git a/reference/media/filmstrip.md b/knowledge/reference/tools/media/filmstrip.mdsimilarity index 100%rename from reference/media/filmstrip.mdrename to knowledge/reference/tools/media/filmstrip.mddiff --git a/reference/media/grab.md b/knowledge/reference/tools/media/grab.mdsimilarity index 100%rename from reference/media/grab.mdrename to knowledge/reference/tools/media/grab.mddiff --git a/reference/media/listen.md b/knowledge/reference/tools/media/listen.mdsimilarity index 100%rename from reference/media/listen.mdrename to knowledge/reference/tools/media/listen.mddiff --git a/reference/media/probe.md b/knowledge/reference/tools/media/probe.mdsimilarity index 100%rename from reference/media/probe.mdrename to knowledge/reference/tools/media/probe.mddiff --git a/reference/media/transcribe.md b/knowledge/reference/tools/media/transcribe.mdsimilarity index 100%rename from reference/media/transcribe.mdrename to knowledge/reference/tools/media/transcribe.mddiff --git a/reference/media/waveform.md b/knowledge/reference/tools/media/waveform.mdsimilarity index 100%rename from reference/media/waveform.mdrename to knowledge/reference/tools/media/waveform.mddiff --git a/reference/models.md b/knowledge/reference/tools/models.mdsimilarity index 100%rename from reference/models.mdrename to knowledge/reference/tools/models.mddiff --git a/reference/open.md b/knowledge/reference/tools/open.mdsimilarity index 100%rename from reference/open.mdrename to knowledge/reference/tools/open.mddiff --git a/reference/report.md b/knowledge/reference/tools/report.mdsimilarity index 100%rename from reference/report.mdrename to knowledge/reference/tools/report.mddiff --git a/reference/screenshot.md b/knowledge/reference/tools/screenshot.mdsimilarity index 100%rename from reference/screenshot.mdrename to knowledge/reference/tools/screenshot.mddiff --git a/reference/voices.md b/knowledge/reference/tools/voices.mdsimilarity index 100%rename from reference/voices.mdrename to knowledge/reference/tools/voices.mddiff --git a/reference/whoami.md b/knowledge/reference/tools/whoami.mdsimilarity index 100%rename from reference/whoami.mdrename to knowledge/reference/tools/whoami.mddiff --git a/knowledge/skills/editor.md b/knowledge/skills/editor.mdnew file mode 100644index 00000000..a3210bc7--- /dev/null+++ b/knowledge/skills/editor.md@@ -0,0 +1,75 @@+# Footage analysis++How to understand source material before editing it. Inspect only the modalities the decision turns on — speech, action, music, graphics, or atmosphere may lead, so there is no fixed priority. Sample the picture against what the audio tells you.++- **Always probe first.** `dapi media probe <id|path>` reports the container and its tracks, telling you up front whether the file has a video track, an audio track, or both. Everything after branches on that.+- **Get the lay of the land.** Render a `dapi media waveform` (audio) and a `dapi media filmstrip` (video) for a fast, cheap overview of where the loud and quiet stretches fall, and where the visual scene changes are. A filmstrip shows coarse structure and scene state, not crop, framing, readability, or an exact cut frame.+- **Listen to the audio.** Run `dapi media listen` with a prompt tailored to the context (what you actually need to know), and explicitly ask the model to include timestamps in its answer. See [media-listen.md](references/examples/prompts/media-listen.md) for prompt patterns.+- **Transcribe speech.** For speech, `dapi media transcribe` prints the full transcript with word-level start/end times directly — read any segment straight from it.+- **Sample the video against the audio.** Use `dapi media grab` to pull frames. When the audio has already pointed you at specific moments, feed those timestamps straight in from the transcript or listen output, e.g. `-t '00:32' '00:45' ...`. When you need a visual pass without such cues, reach for `--auto`: it scans the footage and keeps only the frames where the picture settles into a new visual state, dropping near-duplicates.++# The editing loop++- Write the brief first. For anything nontrivial, capture the edit as a markdown file: it is the plan every save works toward and the thing to check the result against.+- Lay down the A-roll. Assemble the primary footage as JSX and save. Get the spine of the edit right before anything else.+- Layer the rest on top. Once the A-roll holds, add B-roll and secondary assets (sound effects, captions, overlays) in the same source.+- Symlink media the project uses into its `assets/` folder and name it by library path (`assets/b-roll/drone.mp4` is `"b-roll/drone.mp4"`); local and remote paths work too but stay outside the library.+- `dapi context` reports which folder the app actually has open, where the playhead sits, and where every `generate.*` declaration stands — poll it to wait for generations without blocking.++**The source is the document.** A project is a folder of JSX; Use `dapi open <dir>` once, then write the files and save. Saving recompiles and re-renders the canvas.++# Compositing++- Chrome, scaffolding, and ornament all draw from a visual budget whose default balance is `0`; prefer not to use them. A cut, hold, or change of size can separate two ideas as clearly as a divider without adding visual clutter. An element earns its place by deepening the story, guiding attention, or expanding imagination, never by filling space.+- Video is its own medium, with its own rules; it is not a website, poster, slide, or UI. It is watched, not read.+- Don't darken, blur, or cover the picture to make something on top of it legible+- Let visuals, sound, and voice carry context; let text punctuate rather than explain. Do not add copy, eyebrows, labels, underlines, or brand color highlights unless the brief or explicit video guidance calls for them; examples alone are not instructions.+- Choose easing from the intended weight, energy, and continuity of the action.+- When the brief, project, or user specifies branding, follow it. Only when none is specified, fall back to the [Diffusion Studio brand](references/brand/README.md) — its design, voice, video, and library references, and the components and compositions bundled with them.++# Verification++How to confirm a change actually produced what you intended. A clean save does not guarantee a correct-looking composition.++- Run `dapi check <id>` first. It catches black frames, clips that never become visible, zero-duration or fully transparent nodes, and assets that failed to load or generate.+- Use `dapi capture <id>` to see what the viewer actually gets.+- Reconcile captured frames with the brief, and the brief with these guidelines.+- Verify after every stage, not only at the end — build the composition incrementally so a problem is caught next to the change that caused it.+- Scale verification to the change. A small or incremental tweak the user asked for needs no visual confirmation so the user gets the result back fast and can keep iterating.+- Fix the largest viewer-facing problem before polishing details, and recheck related moments after structural changes, since pacing, continuity, emphasis, and meaning are relational.+- Use `screenshot` or `logs` to debug issues.+- DO NOT export/render the scene for visual confirmation — `dapi capture` is equivalent to a render but far more efficient. Rendering to a video should be a user-triggered action unless explicitly requested in the prompt.++# Best practices++- Wrap clips in `<sequence>` tags wherever the parent tag supports it — A-roll, B-roll, and other clips belong in sequences so the timeline stays structured rather than a flat, messy pile. A sequence does not place its children: give every clip an explicit `start`.+- Use the built-in tags for the media a composition is made of (audio, video, images, captions).+- Hoist the properties that define the composition's look — title copy, font family and size, accent colors, key padding — into top-level consts annotated with `@inspect`, so they become live controls in the app's inspector.+- For anything 3D, use Three.js drawn into a `<surface>` tag.+- For motion graphics, overlays and UI-heavy graphics, the `<html>` tag driven by a paused [anime.js](https://animejs.com) timeline+- Before animating anything, read the [easings reference](references/easings.md) and choose easings deliberately — default or linear easing is what makes motion read as a slideshow.+- Add auto captions last, after everything else is assembled, so they transcribe the finished audio at its final placement.+- Open the application in the background (`dapi open -b`) for tasks that don't require an editing UI.+- Only render (export) the result when prompted.+- Start with a fresh project.++# Docs++Every project carries its own authoring reference, written by the app for the installed version, and its `AGENTS.md` points at it. Read it there and trust it over memory; it is app-owned, so never edit it.++- [Installation guide, read when dapi is unavailable](references/installation.md)+- [Easings: which cubic-bezier to use and when](references/easings.md)+- [Diffusion Studio brand — the fallback when no other branding is specified](references/brand/README.md)++# Examples++Read worked example(s) that match your context.++## Video editing++- [Long-form talking head](references/examples/video-editing/talking-head.md)+- [Podcast clipping](references/examples/video-editing/podcast-clip.md)++## Prompts++- [Writing prompts for `dapi media listen`](references/examples/prompts/media-listen.md)diff --git a/knowledge/skills/watch.md b/knowledge/skills/watch.mdnew file mode 100644index 00000000..178f9a32--- /dev/null+++ b/knowledge/skills/watch.md@@ -0,0 +1,28 @@+# Watching footage++How to understand source material. Inspect only the modalities the question turns on — speech, action, music, graphics, or atmosphere may lead, so there is no fixed priority. Sample the picture against what the audio tells you.++- **Always probe first.** `dapi media probe <id|path>` reports the container and its tracks, telling you up front whether the file has a video track, an audio track, or both. Everything after branches on that.+- **Get the lay of the land.** Render a `dapi media waveform` (audio) and a `dapi media filmstrip` (video) for a fast, cheap overview of where the loud and quiet stretches fall, and where the visual scene changes are. A filmstrip shows coarse structure and scene state, not crop, framing, readability, or an exact cut frame.+- **Listen to the audio.** Run `dapi media listen` with a prompt tailored to the context (what you actually need to know), and explicitly ask the model to include timestamps in its answer. See [media-listen.md](references/media-listen.md) for prompt patterns.+- **Transcribe speech.** For speech, `dapi media transcribe` prints the full transcript with word-level start/end times directly — read any segment straight from it.+- **Sample the video against the audio.** Use `dapi media grab` to pull frames. When the audio has already pointed you at specific moments, feed those timestamps straight in from the transcript or listen output, e.g. `-t '00:32' '00:45' ...`. When you need a visual pass without such cues, reach for `--auto`: it scans the footage and keeps only the frames where the picture settles into a new visual state, dropping near-duplicates.++# Matching depth to the question++Read only as much of the footage as the answer requires — each pass costs time, and `listen` costs credits.++- A duration or format question ends at `probe`.+- "Where is the quiet part" or "how is it paced" is usually answered by the waveform and filmstrip alone.+- A question about what was said resolves fastest through `transcribe`; quote the transcript and its times directly.+- Questions about non-speech audio (music, tone, sound events, speaker identity) are what `listen` is for.+- Only questions about what is *seen* need frames — and the audio pass usually tells you which moments to grab, so grab those instead of scanning blind.+- For open-ended questions ("summarize this", "what happens here"), combine passes: structure from waveform + filmstrip, content from transcript or listen, then frames at the salient moments to confirm what the picture shows.++# Answering++- Ground every claim in something you actually saw or heard — a transcript line, a listen answer, a grabbed frame. If the evidence is ambiguous, say so rather than smoothing over it.+- Anchor answers to the timeline. Give timestamps as `MM:SS` (or `HH:MM:SS` for long footage) so the user can jump straight to the moment; for a scene or segment, give its start and end.+- When asked to find a scene or moment, return the timestamp range plus a one-line description of what identifies it, so the user can confirm it is the right one.+- Summaries follow the footage's own structure: what happens, in order, with the timestamps where each part begins. Length matches what the user asked for, not what the footage contains.+- This skill only reads footage. When the user wants the footage changed — cut, composed, captioned, exported — that is the `editor` skill's job.