agentreel 0.6.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/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
- // Duration constants per mode
6
- const REEL = { title: 2.5, termHighlight: 4.5, browserHighlight: 7.0, end: 3.5 };
7
- const DEMO = { title: 2.0, termHighlight: 12.0, browserHighlight: 10.0, end: 3.0 };
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(timing.title * fps);
30
+ const titleFrames = Math.round(TIMING.title * fps);
26
31
  const highlightFrames = p.highlights.reduce((sum, h) => {
27
- const dur = h.videoSrc ? timing.browserHighlight : timing.termHighlight;
28
- return sum + Math.round(dur * fps);
32
+ return sum + Math.round(highlightDuration(h) * fps);
29
33
  }, 0);
30
- const endFrames = Math.round(timing.end * fps);
34
+ const endFrames = Math.round(TIMING.end * fps);
31
35
 
32
36
  return {
33
37
  durationInFrames: titleFrames + highlightFrames + endFrames,
34
- width: isDemo ? 1920 : 1080,
35
- height: isDemo ? 1080 : 1080,
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
- // A highlight is one "moment" in the demo.
8
- // Either terminal lines (CLI demo) or a video clip (browser demo).
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; // e.g. "Initialize", "Configure", "Run"
11
- overlay?: string; // big text overlay shown on top (e.g. "One command.")
44
+ label: string;
45
+ overlay?: string; // text overlay (browser clips only)
12
46
 
13
- // CLI mode — terminal lines
47
+ // Terminal lines
14
48
  lines?: TermLine[];
15
49
  zoomLine?: number;
16
50
 
17
- // Browser mode — video clip from recorded session
18
- videoSrc?: string; // path to video file (served via staticFile)
19
- videoStartSec?: number; // trim: start time in seconds
20
- videoEndSec?: number; // trim: end time in seconds
21
- focusX?: number; // 0-1, focal point X for zoom (default 0.5)
22
- focusY?: number; // 0-1, focal point Y for zoom (default 0.5)
23
- clicks?: ClickEvent[]; // click positions for cursor animation
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; // hex color for the line
74
+ color?: string;
29
75
  bold?: boolean;
30
76
  dim?: boolean;
31
- isPrompt?: boolean; // prefix with $
77
+ isPrompt?: boolean;
32
78
  }
33
79
 
34
80
  export interface CastProps {
35
- title: string; // big opening title
36
- subtitle?: string; // smaller text under title
81
+ title: string;
82
+ subtitle?: string;
37
83
  highlights: Highlight[];
38
- endText?: string; // closing CTA command, e.g. "npx agentreel"
39
- endUrl?: string; // URL shown under CTA, e.g. "github.com/islo-labs/agentreel"
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: undefined,
90
+ subtitle: "Turn your apps into demo videos",
47
91
  highlights: [
48
92
  {
49
- label: "Record",
50
- overlay: "One command.",
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: "Highlight",
61
- overlay: "AI picks the best moments.",
62
- lines: [
63
- { text: "Extracting highlights...", dim: true },
64
- { text: "" },
65
- { text: " ✓ 4 highlights extracted", color: "#50fa7b" },
66
- { text: ' "Initialize" first run', color: "#f8f8f2" },
67
- { text: ' "Configure" — setup step', color: "#f8f8f2" },
68
- { text: ' "Run" — the wow moment', color: "#f1fa8c" },
69
- ],
70
- zoomLine: 2,
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: "Share",
74
- overlay: "Ready to post.",
116
+ label: "Record",
75
117
  lines: [
76
- { text: "Rendering video...", dim: true },
118
+ { text: "npx agentreel --cmd 'my-cli-tool'", isPrompt: true },
77
119
  { text: "" },
78
- { text: " Done: agentreel.mp4 (2.4 MB)", color: "#50fa7b" },
120
+ { text: " agentreel Turn your apps into viral clips", bold: true, color: "#6d28d9" },
79
121
  { text: "" },
80
- { text: " Share to Twitter? [Y/n]", color: "#f8f8f2" },
122
+ { text: " Recording CLI demo...", color: "#16a34a" },
81
123
  ],
82
- zoomLine: 2,
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
  };