agentreel 0.3.1 → 0.3.2
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/bin/agentreel.mjs +7 -3
- package/package.json +1 -1
- package/public/browser-demo.mp4 +0 -0
- package/scripts/browser_demo.py +18 -4
- package/scripts/cli_demo.py +8 -3
- package/src/CastVideo.tsx +1 -11
- package/src/types.ts +25 -29
package/bin/agentreel.mjs
CHANGED
|
@@ -29,6 +29,7 @@ function parseArgs() {
|
|
|
29
29
|
else if (arg === "--title" || arg === "-t") flags.title = args[++i];
|
|
30
30
|
else if (arg === "--output" || arg === "-o") flags.output = args[++i];
|
|
31
31
|
else if (arg === "--music") flags.music = args[++i];
|
|
32
|
+
else if (arg === "--auth" || arg === "-a") flags.auth = args[++i];
|
|
32
33
|
else if (arg === "--no-share") flags.noShare = true;
|
|
33
34
|
}
|
|
34
35
|
return flags;
|
|
@@ -47,6 +48,7 @@ Flags:
|
|
|
47
48
|
-p, --prompt <text> description of what the tool does
|
|
48
49
|
-t, --title <text> video title
|
|
49
50
|
-o, --output <file> output file (default: agentreel.mp4)
|
|
51
|
+
-a, --auth <file> Playwright storage state (cookies/auth) for browser demos
|
|
50
52
|
--music <file> path to background music mp3
|
|
51
53
|
--no-share skip the share prompt
|
|
52
54
|
-h, --help show help
|
|
@@ -128,13 +130,15 @@ function browserEnv() {
|
|
|
128
130
|
return { ...process.env, PLAYWRIGHT_BROWSERS_PATH: browsersDir };
|
|
129
131
|
}
|
|
130
132
|
|
|
131
|
-
function recordBrowser(url, task) {
|
|
133
|
+
function recordBrowser(url, task, authState) {
|
|
132
134
|
const python = findPython();
|
|
133
135
|
const script = join(ROOT, "scripts", "browser_demo.py");
|
|
134
136
|
const outFile = join(tmpdir(), "agentreel-browser-demo.mp4");
|
|
135
137
|
|
|
136
138
|
console.error(`Agent demoing browser app: ${url}`);
|
|
137
|
-
|
|
139
|
+
const args = [script, url, outFile, task];
|
|
140
|
+
if (authState) args.push("--auth", authState);
|
|
141
|
+
execFileSync(python, args, {
|
|
138
142
|
stdio: ["ignore", "inherit", "inherit"],
|
|
139
143
|
env: browserEnv(),
|
|
140
144
|
timeout: 300000,
|
|
@@ -428,7 +432,7 @@ async function main() {
|
|
|
428
432
|
|
|
429
433
|
ensureBrowserDeps();
|
|
430
434
|
console.error("Step 1/3: Recording browser demo...");
|
|
431
|
-
const videoPath = recordBrowser(demoURL, task);
|
|
435
|
+
const videoPath = recordBrowser(demoURL, task, flags.auth);
|
|
432
436
|
|
|
433
437
|
// Copy video to Remotion public dir so it can be served
|
|
434
438
|
const publicDir = join(ROOT, "public");
|
package/package.json
CHANGED
package/public/browser-demo.mp4
CHANGED
|
Binary file
|
package/scripts/browser_demo.py
CHANGED
|
@@ -124,7 +124,7 @@ def extract_highlights(video_path, task):
|
|
|
124
124
|
return highlights
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
async def record_browser_demo(url, task, output_path):
|
|
127
|
+
async def record_browser_demo(url, task, output_path, auth_state=None):
|
|
128
128
|
"""Generate and run a Playwright demo with video recording."""
|
|
129
129
|
from playwright.async_api import async_playwright
|
|
130
130
|
|
|
@@ -137,11 +137,15 @@ async def record_browser_demo(url, task, output_path):
|
|
|
137
137
|
|
|
138
138
|
async with async_playwright() as p:
|
|
139
139
|
browser = await p.chromium.launch(headless=True)
|
|
140
|
-
|
|
140
|
+
ctx_opts = dict(
|
|
141
141
|
viewport={"width": 1280, "height": 800},
|
|
142
142
|
record_video_dir=video_dir,
|
|
143
143
|
record_video_size={"width": 1280, "height": 800},
|
|
144
144
|
)
|
|
145
|
+
if auth_state and os.path.isfile(auth_state):
|
|
146
|
+
ctx_opts["storage_state"] = auth_state
|
|
147
|
+
print(f"Using auth state: {auth_state}", file=sys.stderr)
|
|
148
|
+
context = await browser.new_context(**ctx_opts)
|
|
145
149
|
|
|
146
150
|
# Inject click tracker — persists across navigations
|
|
147
151
|
click_tracker_js = (
|
|
@@ -262,5 +266,15 @@ if __name__ == "__main__":
|
|
|
262
266
|
else:
|
|
263
267
|
url = sys.argv[1]
|
|
264
268
|
output = sys.argv[2]
|
|
265
|
-
|
|
266
|
-
|
|
269
|
+
# Parse remaining args: [task] [--auth <state_file>]
|
|
270
|
+
task = "Explore the main features"
|
|
271
|
+
auth_state = None
|
|
272
|
+
i = 3
|
|
273
|
+
while i < len(sys.argv):
|
|
274
|
+
if sys.argv[i] == "--auth" and i + 1 < len(sys.argv):
|
|
275
|
+
auth_state = sys.argv[i + 1]
|
|
276
|
+
i += 2
|
|
277
|
+
else:
|
|
278
|
+
task = sys.argv[i]
|
|
279
|
+
i += 1
|
|
280
|
+
asyncio.run(record_browser_demo(url, task, output, auth_state=auth_state))
|
package/scripts/cli_demo.py
CHANGED
|
@@ -114,18 +114,23 @@ def record_demo(steps: list[dict], workdir: str, output_path: str):
|
|
|
114
114
|
write_event("o", f"\x1b[38;5;245m# {desc}\x1b[0m\r\n")
|
|
115
115
|
time.sleep(0.3)
|
|
116
116
|
|
|
117
|
-
# Type the command character by character
|
|
118
|
-
write_event("o", "
|
|
117
|
+
# Type the command character by character (no $ prompt — the renderer adds one)
|
|
118
|
+
write_event("o", "")
|
|
119
119
|
for char in cmd:
|
|
120
120
|
write_event("o", char)
|
|
121
121
|
time.sleep(0.04)
|
|
122
122
|
write_event("o", "\r\n")
|
|
123
123
|
time.sleep(0.2)
|
|
124
124
|
|
|
125
|
-
# Execute in PTY
|
|
125
|
+
# Execute in PTY with sanitized env (hide username/hostname)
|
|
126
126
|
pid, fd = pty.fork()
|
|
127
127
|
if pid == 0:
|
|
128
128
|
os.chdir(workdir)
|
|
129
|
+
os.environ["PS1"] = "$ "
|
|
130
|
+
os.environ["PROMPT_COMMAND"] = ""
|
|
131
|
+
os.environ.pop("BASH_COMMAND", None)
|
|
132
|
+
# Suppress terminal title sequences (user@host)
|
|
133
|
+
os.environ["TERM"] = "dumb"
|
|
129
134
|
os.execvp("/bin/sh", ["/bin/sh", "-c", cmd])
|
|
130
135
|
else:
|
|
131
136
|
deadline = time.time() + 15
|
package/src/CastVideo.tsx
CHANGED
|
@@ -673,17 +673,7 @@ const HighlightClip: React.FC<{
|
|
|
673
673
|
backgroundColor: "#50fa7b",
|
|
674
674
|
}}
|
|
675
675
|
/>
|
|
676
|
-
<div
|
|
677
|
-
style={{
|
|
678
|
-
flex: 1,
|
|
679
|
-
textAlign: "center",
|
|
680
|
-
fontFamily: MONO,
|
|
681
|
-
fontSize: 12,
|
|
682
|
-
color: "rgba(255,255,255,0.25)",
|
|
683
|
-
}}
|
|
684
|
-
>
|
|
685
|
-
Terminal
|
|
686
|
-
</div>
|
|
676
|
+
<div style={{ flex: 1 }} />
|
|
687
677
|
</div>
|
|
688
678
|
|
|
689
679
|
{/* Terminal body */}
|
package/src/types.ts
CHANGED
|
@@ -35,57 +35,53 @@ export interface CastProps {
|
|
|
35
35
|
title: string; // big opening title
|
|
36
36
|
subtitle?: string; // smaller text under title
|
|
37
37
|
highlights: Highlight[];
|
|
38
|
-
endText?: string; // closing CTA command, e.g. "
|
|
39
|
-
endUrl?: string; // URL shown under CTA, e.g. "github.com/islo-labs/
|
|
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
40
|
gradient?: [string, string]; // background gradient colors
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export const defaultProps: CastProps = {
|
|
44
|
-
title: "
|
|
45
|
-
subtitle: "
|
|
44
|
+
title: "agentreel",
|
|
45
|
+
subtitle: "Turn your apps into viral clips",
|
|
46
46
|
highlights: [
|
|
47
47
|
{
|
|
48
|
-
label: "
|
|
48
|
+
label: "Record",
|
|
49
49
|
overlay: "One command.",
|
|
50
50
|
lines: [
|
|
51
|
-
{ text: "npx
|
|
51
|
+
{ text: "npx agentreel --cmd 'my-cli-tool'", isPrompt: true },
|
|
52
52
|
{ text: "" },
|
|
53
|
-
{ text: "
|
|
53
|
+
{ text: " agentreel Turn your apps into viral clips", bold: true, color: "#bd93f9" },
|
|
54
54
|
{ text: "" },
|
|
55
|
-
{ text: " ✓
|
|
55
|
+
{ text: " ✓ Recording CLI demo...", color: "#50fa7b" },
|
|
56
56
|
],
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
|
-
label: "
|
|
60
|
-
overlay: "
|
|
59
|
+
label: "Highlight",
|
|
60
|
+
overlay: "AI picks the best moments.",
|
|
61
61
|
lines: [
|
|
62
|
-
{ text: "
|
|
63
|
-
{ text: "
|
|
64
|
-
{ text: "
|
|
65
|
-
{ text: '
|
|
66
|
-
{ text: '
|
|
67
|
-
{ text: "
|
|
62
|
+
{ text: "Extracting highlights...", dim: true },
|
|
63
|
+
{ text: "" },
|
|
64
|
+
{ text: " ✓ 4 highlights extracted", color: "#50fa7b" },
|
|
65
|
+
{ text: ' "Initialize" — first run', color: "#f8f8f2" },
|
|
66
|
+
{ text: ' "Configure" — setup step', color: "#f8f8f2" },
|
|
67
|
+
{ text: ' "Run" — the wow moment', color: "#f1fa8c" },
|
|
68
68
|
],
|
|
69
|
-
zoomLine:
|
|
69
|
+
zoomLine: 2,
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
|
-
label: "
|
|
73
|
-
overlay: "
|
|
72
|
+
label: "Share",
|
|
73
|
+
overlay: "Ready to post.",
|
|
74
74
|
lines: [
|
|
75
|
-
{ text: "
|
|
75
|
+
{ text: "Rendering video...", dim: true },
|
|
76
76
|
{ text: "" },
|
|
77
|
-
{ text: "
|
|
78
|
-
{ text: "│ pr-review every hour ⟳ running │", color: "#f1fa8c" },
|
|
79
|
-
{ text: "│ dep-updates Mon at 2am idle │", dim: true },
|
|
80
|
-
{ text: "└──────────────────────────────────────────┘", color: "#bd93f9" },
|
|
77
|
+
{ text: " Done: agentreel.mp4 (2.4 MB)", color: "#50fa7b" },
|
|
81
78
|
{ text: "" },
|
|
82
|
-
{ text: "
|
|
83
|
-
{ text: " ✓ PR #43 reviewed — changes requested", color: "#f1fa8c" },
|
|
79
|
+
{ text: " Share to Twitter? [Y/n]", color: "#f8f8f2" },
|
|
84
80
|
],
|
|
85
|
-
zoomLine:
|
|
81
|
+
zoomLine: 2,
|
|
86
82
|
},
|
|
87
83
|
],
|
|
88
|
-
endText: "npx
|
|
89
|
-
endUrl: "github.com/islo-labs/
|
|
84
|
+
endText: "npx agentreel",
|
|
85
|
+
endUrl: "github.com/islo-labs/agentreel",
|
|
90
86
|
gradient: ["#0f0f1a", "#1a0f2e"],
|
|
91
87
|
};
|