agentreel 0.1.4 → 0.1.6
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 +20 -33
- package/package.json +1 -1
package/bin/agentreel.mjs
CHANGED
|
@@ -306,17 +306,8 @@ async function renderVideo(props, output, musicPath) {
|
|
|
306
306
|
|
|
307
307
|
// ── Upload + Share ──────────────────────────────────────────
|
|
308
308
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
const result = execFileSync("curl", [
|
|
312
|
-
"-s",
|
|
313
|
-
"-H", "Authorization: Client-ID 546c25a59c58ad7",
|
|
314
|
-
"-F", `video=@${filePath}`,
|
|
315
|
-
"https://api.imgur.com/3/upload",
|
|
316
|
-
], { timeout: 120000 });
|
|
317
|
-
const data = JSON.parse(result.toString());
|
|
318
|
-
if (data.data?.link) return data.data.link;
|
|
319
|
-
} catch { /* fall through */ }
|
|
309
|
+
// Video upload placeholder — will add agentreel.dev hosting later
|
|
310
|
+
async function uploadVideo(_filePath) {
|
|
320
311
|
return null;
|
|
321
312
|
}
|
|
322
313
|
|
|
@@ -347,29 +338,25 @@ function askYesNo(question) {
|
|
|
347
338
|
});
|
|
348
339
|
}
|
|
349
340
|
|
|
350
|
-
async function shareFlow(outputPath, title) {
|
|
341
|
+
async function shareFlow(outputPath, title, prompt) {
|
|
351
342
|
const shouldShare = await askYesNo("Share to Twitter? [Y/n] ");
|
|
352
343
|
if (!shouldShare) return;
|
|
353
344
|
|
|
354
|
-
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
} catch {
|
|
370
|
-
console.error(` Tweet link: ${intentURL}`);
|
|
371
|
-
}
|
|
372
|
-
console.error(` Video: ${resolve(outputPath)}`);
|
|
345
|
+
// Use prompt for tweet text if available, otherwise title
|
|
346
|
+
const tweetBody = prompt || title;
|
|
347
|
+
|
|
348
|
+
const text = `${tweetBody}\n\nMade with agentreel`;
|
|
349
|
+
const tweetText = encodeURIComponent(text);
|
|
350
|
+
const intentURL = `https://twitter.com/intent/tweet?text=${tweetText}`;
|
|
351
|
+
|
|
352
|
+
console.error(`\n Opening Twitter — attach your video to the tweet.`);
|
|
353
|
+
console.error(` Video: ${resolve(outputPath)}\n`);
|
|
354
|
+
|
|
355
|
+
const openCmd = process.platform === "darwin" ? "open" : "xdg-open";
|
|
356
|
+
try {
|
|
357
|
+
execFileSync(openCmd, [intentURL], { stdio: "ignore" });
|
|
358
|
+
} catch {
|
|
359
|
+
console.error(` Link: ${intentURL}`);
|
|
373
360
|
}
|
|
374
361
|
}
|
|
375
362
|
|
|
@@ -430,7 +417,7 @@ async function main() {
|
|
|
430
417
|
}, output, flags.music);
|
|
431
418
|
|
|
432
419
|
if (!noShare) {
|
|
433
|
-
await shareFlow(resolve(output), videoTitle);
|
|
420
|
+
await shareFlow(resolve(output), videoTitle, prompt);
|
|
434
421
|
}
|
|
435
422
|
return;
|
|
436
423
|
}
|
|
@@ -461,7 +448,7 @@ async function main() {
|
|
|
461
448
|
}, output, flags.music);
|
|
462
449
|
|
|
463
450
|
if (!noShare) {
|
|
464
|
-
await shareFlow(resolve(output), videoTitle);
|
|
451
|
+
await shareFlow(resolve(output), videoTitle, prompt);
|
|
465
452
|
}
|
|
466
453
|
return;
|
|
467
454
|
}
|