agentreel 0.4.0 → 0.4.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 +6 -50
- package/package.json +1 -1
- package/scripts/cli_demo.py +10 -0
- package/public/browser-demo.mp4 +0 -0
- package/public/screenshot.png +0 -0
package/bin/agentreel.mjs
CHANGED
|
@@ -330,29 +330,7 @@ async function renderVideo(props, output, musicPath) {
|
|
|
330
330
|
console.error(`\nDone: ${output} (${Math.round(size / 1024)} KB)`);
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
// ──
|
|
334
|
-
|
|
335
|
-
// Video upload placeholder — will add agentreel.dev hosting later
|
|
336
|
-
async function uploadVideo(_filePath) {
|
|
337
|
-
return null;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function openShareURL(videoURL, text) {
|
|
341
|
-
const tweetText = encodeURIComponent(text);
|
|
342
|
-
const encodedURL = encodeURIComponent(videoURL);
|
|
343
|
-
const intentURL = `https://twitter.com/intent/tweet?text=${tweetText}&url=${encodedURL}`;
|
|
344
|
-
|
|
345
|
-
console.error(`\n Share: ${videoURL}`);
|
|
346
|
-
console.error(` Tweet: ${intentURL}\n`);
|
|
347
|
-
|
|
348
|
-
// Open in browser
|
|
349
|
-
const cmd = process.platform === "darwin" ? "open" : "xdg-open";
|
|
350
|
-
try {
|
|
351
|
-
execFileSync(cmd, [intentURL], { stdio: "ignore" });
|
|
352
|
-
} catch {
|
|
353
|
-
console.error(" (Could not open browser — copy the link above)");
|
|
354
|
-
}
|
|
355
|
-
}
|
|
333
|
+
// ── Share ───────────────────────────────────────────────────
|
|
356
334
|
|
|
357
335
|
function askYesNo(question) {
|
|
358
336
|
return new Promise((resolve) => {
|
|
@@ -387,22 +365,6 @@ async function shareFlow(outputPath, title, prompt) {
|
|
|
387
365
|
}
|
|
388
366
|
}
|
|
389
367
|
|
|
390
|
-
// ── Auto-describe ──────────────────────────────────────────
|
|
391
|
-
|
|
392
|
-
function autoDescribe(cmd, url) {
|
|
393
|
-
const target = cmd || url;
|
|
394
|
-
try {
|
|
395
|
-
const result = execFileSync("claude", [
|
|
396
|
-
"-p",
|
|
397
|
-
`Describe what this tool/app does in one short sentence (under 10 words). No quotes, no period. Just the description.\n\n${target}`,
|
|
398
|
-
"--output-format", "text",
|
|
399
|
-
], { encoding: "utf-8", timeout: 30000, stdio: ["ignore", "pipe", "ignore"] });
|
|
400
|
-
const desc = result.trim();
|
|
401
|
-
if (desc && desc.length < 100) return desc;
|
|
402
|
-
} catch { /* fall through */ }
|
|
403
|
-
return cmd ? cmd.split(/\s+/).pop() : "Web app demo";
|
|
404
|
-
}
|
|
405
|
-
|
|
406
368
|
// ── PR Context ─────────────────────────────────────────────
|
|
407
369
|
|
|
408
370
|
function fetchPRContext(prRef) {
|
|
@@ -648,37 +610,32 @@ async function main() {
|
|
|
648
610
|
}
|
|
649
611
|
|
|
650
612
|
// ── Manual modes (--cmd / --url) ─────────────────────────
|
|
651
|
-
console.error("Generating description...");
|
|
652
|
-
const description = autoDescribe(flags.cmd, flags.url);
|
|
653
|
-
console.error(` "${description}"`);
|
|
654
|
-
|
|
655
613
|
let videoTitle = flags.title || flags.cmd || flags.url;
|
|
656
614
|
|
|
657
615
|
if (flags.cmd) {
|
|
658
616
|
console.error("Step 1/3: Recording CLI demo...");
|
|
659
|
-
const castPath = recordCLI(flags.cmd, process.cwd(),
|
|
617
|
+
const castPath = recordCLI(flags.cmd, process.cwd(), flags.cmd, flags.guidelines);
|
|
660
618
|
|
|
661
619
|
console.error("Step 2/3: Extracting highlights...");
|
|
662
|
-
const highlightsPath = extractHighlightsFromCast(castPath,
|
|
620
|
+
const highlightsPath = extractHighlightsFromCast(castPath, flags.cmd, flags.guidelines);
|
|
663
621
|
const highlights = JSON.parse(readFileSync(highlightsPath, "utf-8"));
|
|
664
622
|
console.error(` ${highlights.length} highlights extracted`);
|
|
665
623
|
|
|
666
624
|
console.error("Step 3/3: Rendering video...");
|
|
667
625
|
await renderVideo({
|
|
668
626
|
title: videoTitle,
|
|
669
|
-
subtitle: description,
|
|
670
627
|
highlights,
|
|
671
628
|
endText: flags.cmd,
|
|
672
629
|
}, output, flags.music);
|
|
673
630
|
|
|
674
631
|
if (!noShare) {
|
|
675
|
-
await shareFlow(resolve(output), videoTitle,
|
|
632
|
+
await shareFlow(resolve(output), videoTitle, flags.cmd);
|
|
676
633
|
}
|
|
677
634
|
return;
|
|
678
635
|
}
|
|
679
636
|
|
|
680
637
|
if (flags.url) {
|
|
681
|
-
const task =
|
|
638
|
+
const task = "Explore the main features of this app";
|
|
682
639
|
|
|
683
640
|
ensureBrowserDeps();
|
|
684
641
|
console.error("Step 1/3: Recording browser demo...");
|
|
@@ -700,14 +657,13 @@ async function main() {
|
|
|
700
657
|
console.error("Step 3/3: Rendering video...");
|
|
701
658
|
await renderVideo({
|
|
702
659
|
title: videoTitle,
|
|
703
|
-
subtitle: description,
|
|
704
660
|
highlights,
|
|
705
661
|
endText: flags.url,
|
|
706
662
|
endUrl: flags.url,
|
|
707
663
|
}, output, flags.music);
|
|
708
664
|
|
|
709
665
|
if (!noShare) {
|
|
710
|
-
await shareFlow(resolve(output), videoTitle,
|
|
666
|
+
await shareFlow(resolve(output), videoTitle, flags.url);
|
|
711
667
|
}
|
|
712
668
|
return;
|
|
713
669
|
}
|
package/package.json
CHANGED
package/scripts/cli_demo.py
CHANGED
|
@@ -215,6 +215,16 @@ def extract_highlights(cast_path: str, context: str, guidelines: str = "") -> li
|
|
|
215
215
|
raw_output = "".join(lines_output)
|
|
216
216
|
# Clean ANSI for Claude to read, but keep the raw for display
|
|
217
217
|
clean = re.sub(r'\x1b\[[0-9;]*[a-zA-Z]', '', raw_output)
|
|
218
|
+
# Collapse carriage-return overwrites (spinners, progress bars).
|
|
219
|
+
# \r means "go back to line start" — keep only the final version of each line.
|
|
220
|
+
collapsed_lines = []
|
|
221
|
+
for line in clean.split('\n'):
|
|
222
|
+
parts = line.split('\r')
|
|
223
|
+
# Keep only the last non-empty segment (what's actually visible)
|
|
224
|
+
final = parts[-1].strip() if parts else ""
|
|
225
|
+
if final and (not collapsed_lines or final != collapsed_lines[-1]):
|
|
226
|
+
collapsed_lines.append(final)
|
|
227
|
+
clean = '\n'.join(collapsed_lines)
|
|
218
228
|
|
|
219
229
|
guidelines_block = f"\n\nAdditional guidelines: {guidelines}" if guidelines else ""
|
|
220
230
|
|
package/public/browser-demo.mp4
DELETED
|
Binary file
|
package/public/screenshot.png
DELETED
|
Binary file
|