agentreel 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -45
- package/bin/agentreel.mjs +175 -185
- package/package.json +1 -1
- package/public/browser-demo.mp4 +0 -0
- package/public/music.mp3 +0 -0
- package/src/CastVideo.tsx +981 -638
- package/src/Root.tsx +16 -12
- package/src/types.ts +100 -48
package/src/Root.tsx
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { Composition } from "remotion";
|
|
2
2
|
import { CastVideo } from "./CastVideo";
|
|
3
|
-
import { defaultProps, CastProps } from "./types";
|
|
3
|
+
import { defaultProps, CastProps, Highlight } from "./types";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const TIMING = { title: 2.5, termHighlight: 4.5, browserHighlight: 7.0, textSlide: 3.5, diagram: 5.0, tree: 6.0, end: 3.5 };
|
|
6
|
+
|
|
7
|
+
function highlightDuration(h: Highlight): number {
|
|
8
|
+
if (h.statement) return TIMING.textSlide;
|
|
9
|
+
if (h.diagram) return TIMING.diagram;
|
|
10
|
+
if (h.panels) return TIMING.diagram;
|
|
11
|
+
if (h.tree) return TIMING.tree;
|
|
12
|
+
if (h.videoSrc) return TIMING.browserHighlight;
|
|
13
|
+
return TIMING.termHighlight;
|
|
14
|
+
}
|
|
8
15
|
|
|
9
16
|
export const RemotionRoot: React.FC = () => {
|
|
10
17
|
return (
|
|
@@ -19,20 +26,17 @@ export const RemotionRoot: React.FC = () => {
|
|
|
19
26
|
calculateMetadata={({ props }) => {
|
|
20
27
|
const p = props as unknown as CastProps;
|
|
21
28
|
const fps = 30;
|
|
22
|
-
const isDemo = p.mode === "demo";
|
|
23
|
-
const timing = isDemo ? DEMO : REEL;
|
|
24
29
|
|
|
25
|
-
const titleFrames = Math.round(
|
|
30
|
+
const titleFrames = Math.round(TIMING.title * fps);
|
|
26
31
|
const highlightFrames = p.highlights.reduce((sum, h) => {
|
|
27
|
-
|
|
28
|
-
return sum + Math.round(dur * fps);
|
|
32
|
+
return sum + Math.round(highlightDuration(h) * fps);
|
|
29
33
|
}, 0);
|
|
30
|
-
const endFrames = Math.round(
|
|
34
|
+
const endFrames = Math.round(TIMING.end * fps);
|
|
31
35
|
|
|
32
36
|
return {
|
|
33
37
|
durationInFrames: titleFrames + highlightFrames + endFrames,
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
38
|
+
width: 1080,
|
|
39
|
+
height: 1080,
|
|
36
40
|
};
|
|
37
41
|
}}
|
|
38
42
|
/>
|
package/src/types.ts
CHANGED
|
@@ -4,84 +4,136 @@ export interface ClickEvent {
|
|
|
4
4
|
timeSec: number; // seconds relative to highlight start
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export interface DiagramNode {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
x: number; // 0-1 normalized position
|
|
11
|
+
y: number; // 0-1 normalized position
|
|
12
|
+
color?: string; // hex color override
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface DiagramEdge {
|
|
16
|
+
from: string; // node id
|
|
17
|
+
to: string; // node id
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface DiagramData {
|
|
21
|
+
nodes: DiagramNode[];
|
|
22
|
+
edges: DiagramEdge[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface PanelData {
|
|
26
|
+
title: string;
|
|
27
|
+
stat?: string; // big number/word at top (e.g. "1", "3x", "AI")
|
|
28
|
+
statLabel?: string; // label under the stat (e.g. "command", "faster")
|
|
29
|
+
content: string; // multi-line via \n — each line gets an animated checkmark
|
|
30
|
+
color?: string; // accent color
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface TreeData {
|
|
34
|
+
root: string; // root node label
|
|
35
|
+
depth: number; // levels deep (3-5)
|
|
36
|
+
branching: number | number[]; // uniform (3) or per-level ([4, 2, 3])
|
|
37
|
+
nodeLabels?: string[][]; // labels by level
|
|
38
|
+
outro?: string; // text that scrolls in at the bottom (multi-line via \n)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// A highlight is one "moment" in the video.
|
|
42
|
+
// Exactly one of: lines, videoSrc, statement, diagram, panels.
|
|
9
43
|
export interface Highlight {
|
|
10
|
-
label: string;
|
|
11
|
-
overlay?: string; //
|
|
44
|
+
label: string;
|
|
45
|
+
overlay?: string; // text overlay (browser clips only)
|
|
12
46
|
|
|
13
|
-
//
|
|
47
|
+
// Terminal lines
|
|
14
48
|
lines?: TermLine[];
|
|
15
49
|
zoomLine?: number;
|
|
16
50
|
|
|
17
|
-
// Browser
|
|
18
|
-
videoSrc?: string;
|
|
19
|
-
videoStartSec?: number;
|
|
20
|
-
videoEndSec?: number;
|
|
21
|
-
focusX?: number;
|
|
22
|
-
focusY?: number;
|
|
23
|
-
clicks?: ClickEvent[];
|
|
51
|
+
// Browser video clip
|
|
52
|
+
videoSrc?: string;
|
|
53
|
+
videoStartSec?: number;
|
|
54
|
+
videoEndSec?: number;
|
|
55
|
+
focusX?: number;
|
|
56
|
+
focusY?: number;
|
|
57
|
+
clicks?: ClickEvent[];
|
|
58
|
+
|
|
59
|
+
// Text slide — bold narrative statement
|
|
60
|
+
statement?: string;
|
|
61
|
+
|
|
62
|
+
// Diagram — animated node/edge visualization
|
|
63
|
+
diagram?: DiagramData;
|
|
64
|
+
|
|
65
|
+
// Side-by-side panels
|
|
66
|
+
panels?: { left: PanelData; right: PanelData };
|
|
67
|
+
|
|
68
|
+
// Auto-generated fractal tree
|
|
69
|
+
tree?: TreeData;
|
|
24
70
|
}
|
|
25
71
|
|
|
26
72
|
export interface TermLine {
|
|
27
73
|
text: string;
|
|
28
|
-
color?: string;
|
|
74
|
+
color?: string;
|
|
29
75
|
bold?: boolean;
|
|
30
76
|
dim?: boolean;
|
|
31
|
-
isPrompt?: boolean;
|
|
77
|
+
isPrompt?: boolean;
|
|
32
78
|
}
|
|
33
79
|
|
|
34
80
|
export interface CastProps {
|
|
35
|
-
title: string;
|
|
36
|
-
subtitle?: string;
|
|
81
|
+
title: string;
|
|
82
|
+
subtitle?: string;
|
|
37
83
|
highlights: Highlight[];
|
|
38
|
-
endText?: string;
|
|
39
|
-
endUrl?: string;
|
|
40
|
-
gradient?: [string, string]; // background gradient colors
|
|
41
|
-
mode?: "reel" | "demo"; // "reel" = 1080x1080 marketing clip, "demo" = 1920x1080 chapter walkthrough
|
|
84
|
+
endText?: string;
|
|
85
|
+
endUrl?: string;
|
|
42
86
|
}
|
|
43
87
|
|
|
44
88
|
export const defaultProps: CastProps = {
|
|
45
89
|
title: "agentreel",
|
|
46
|
-
subtitle: "Turn your apps into
|
|
90
|
+
subtitle: "Turn your apps into demo videos",
|
|
47
91
|
highlights: [
|
|
48
92
|
{
|
|
49
|
-
label: "
|
|
50
|
-
|
|
51
|
-
lines: [
|
|
52
|
-
{ text: "npx agentreel --cmd 'my-cli-tool'", isPrompt: true },
|
|
53
|
-
{ text: "" },
|
|
54
|
-
{ text: " agentreel Turn your apps into viral clips", bold: true, color: "#bd93f9" },
|
|
55
|
-
{ text: "" },
|
|
56
|
-
{ text: " ✓ Recording CLI demo...", color: "#50fa7b" },
|
|
57
|
-
],
|
|
93
|
+
label: "The Problem",
|
|
94
|
+
statement: "Your app is amazing.\nBut nobody knows it yet.",
|
|
58
95
|
},
|
|
59
96
|
{
|
|
60
|
-
label: "
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
97
|
+
label: "How It Works",
|
|
98
|
+
panels: {
|
|
99
|
+
left: {
|
|
100
|
+
title: "You",
|
|
101
|
+
stat: "1",
|
|
102
|
+
statLabel: "command",
|
|
103
|
+
content: "Point it at your app\nHit enter",
|
|
104
|
+
color: "#111111",
|
|
105
|
+
},
|
|
106
|
+
right: {
|
|
107
|
+
title: "AI",
|
|
108
|
+
stat: "5",
|
|
109
|
+
statLabel: "steps automated",
|
|
110
|
+
content: "Records the demo\nExtracts highlights\nBuilds the narrative\nAnimates the tree\nRenders the video",
|
|
111
|
+
color: "#22c55e",
|
|
112
|
+
},
|
|
113
|
+
},
|
|
71
114
|
},
|
|
72
115
|
{
|
|
73
|
-
label: "
|
|
74
|
-
overlay: "Ready to post.",
|
|
116
|
+
label: "Record",
|
|
75
117
|
lines: [
|
|
76
|
-
{ text: "
|
|
118
|
+
{ text: "npx agentreel --cmd 'my-cli-tool'", isPrompt: true },
|
|
77
119
|
{ text: "" },
|
|
78
|
-
{ text: "
|
|
120
|
+
{ text: " agentreel Turn your apps into viral clips", bold: true, color: "#6d28d9" },
|
|
79
121
|
{ text: "" },
|
|
80
|
-
{ text: "
|
|
122
|
+
{ text: " ✓ Recording CLI demo...", color: "#16a34a" },
|
|
81
123
|
],
|
|
82
|
-
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
label: "Pipeline",
|
|
127
|
+
tree: {
|
|
128
|
+
root: "agentreel",
|
|
129
|
+
depth: 4,
|
|
130
|
+
branching: [5, 3, 2],
|
|
131
|
+
nodeLabels: [
|
|
132
|
+
["Record", "Plan", "Extract", "Render", "Share"],
|
|
133
|
+
],
|
|
134
|
+
outro: "Ready to share.\nIn seconds.",
|
|
135
|
+
},
|
|
83
136
|
},
|
|
84
137
|
],
|
|
85
138
|
endText: "npx agentreel",
|
|
86
|
-
gradient: ["#0f0f1a", "#1a0f2e"],
|
|
87
139
|
};
|