agentreel 0.1.3 → 0.1.5
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 +12 -41
- package/package.json +1 -1
package/bin/agentreel.mjs
CHANGED
|
@@ -306,39 +306,8 @@ async function renderVideo(props, output, musicPath) {
|
|
|
306
306
|
|
|
307
307
|
// ── Upload + Share ──────────────────────────────────────────
|
|
308
308
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
const email = process.env.STREAMABLE_EMAIL;
|
|
312
|
-
const password = process.env.STREAMABLE_PASSWORD;
|
|
313
|
-
|
|
314
|
-
if (email && password) {
|
|
315
|
-
try {
|
|
316
|
-
const result = execFileSync("curl", [
|
|
317
|
-
"-s", "-u", `${email}:${password}`,
|
|
318
|
-
"-F", `file=@${filePath}`,
|
|
319
|
-
"https://api.streamable.com/upload",
|
|
320
|
-
], { timeout: 60000 });
|
|
321
|
-
const data = JSON.parse(result.toString());
|
|
322
|
-
if (data.shortcode) {
|
|
323
|
-
return `https://streamable.com/${data.shortcode}`;
|
|
324
|
-
}
|
|
325
|
-
} catch { /* fall through */ }
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
// Try Imgur as fallback (supports anonymous video upload)
|
|
329
|
-
try {
|
|
330
|
-
const result = execFileSync("curl", [
|
|
331
|
-
"-s",
|
|
332
|
-
"-H", "Authorization: Client-ID 546c25a59c58ad7",
|
|
333
|
-
"-F", `video=@${filePath}`,
|
|
334
|
-
"https://api.imgur.com/3/upload",
|
|
335
|
-
], { timeout: 120000 });
|
|
336
|
-
const data = JSON.parse(result.toString());
|
|
337
|
-
if (data.data?.link) {
|
|
338
|
-
return data.data.link;
|
|
339
|
-
}
|
|
340
|
-
} catch { /* fall through */ }
|
|
341
|
-
|
|
309
|
+
// Video upload placeholder — will add agentreel.dev hosting later
|
|
310
|
+
async function uploadVideo(_filePath) {
|
|
342
311
|
return null;
|
|
343
312
|
}
|
|
344
313
|
|
|
@@ -369,25 +338,27 @@ function askYesNo(question) {
|
|
|
369
338
|
});
|
|
370
339
|
}
|
|
371
340
|
|
|
372
|
-
async function shareFlow(outputPath, title) {
|
|
341
|
+
async function shareFlow(outputPath, title, prompt) {
|
|
373
342
|
const shouldShare = await askYesNo("Share to Twitter? [Y/n] ");
|
|
374
343
|
if (!shouldShare) return;
|
|
375
344
|
|
|
345
|
+
// Use prompt for tweet text if available, otherwise title
|
|
346
|
+
const tweetBody = prompt || title;
|
|
347
|
+
|
|
376
348
|
console.error("Uploading video...");
|
|
377
349
|
const url = await uploadVideo(outputPath);
|
|
378
350
|
|
|
351
|
+
const text = `${tweetBody}\n\nMade with agentreel`;
|
|
352
|
+
|
|
379
353
|
if (url) {
|
|
380
|
-
const text = `${title}\n\nMade with agentreel`;
|
|
381
354
|
openShareURL(url, text);
|
|
382
355
|
} else {
|
|
383
|
-
// No upload worked — open Twitter with just the text, user attaches video manually
|
|
384
356
|
console.error("Could not auto-upload. Opening Twitter — drag your video into the tweet.");
|
|
385
|
-
const text = `${title}\n\nMade with agentreel`;
|
|
386
357
|
const tweetText = encodeURIComponent(text);
|
|
387
358
|
const intentURL = `https://twitter.com/intent/tweet?text=${tweetText}`;
|
|
388
|
-
const
|
|
359
|
+
const openCmd = process.platform === "darwin" ? "open" : "xdg-open";
|
|
389
360
|
try {
|
|
390
|
-
execFileSync(
|
|
361
|
+
execFileSync(openCmd, [intentURL], { stdio: "ignore" });
|
|
391
362
|
} catch {
|
|
392
363
|
console.error(` Tweet link: ${intentURL}`);
|
|
393
364
|
}
|
|
@@ -452,7 +423,7 @@ async function main() {
|
|
|
452
423
|
}, output, flags.music);
|
|
453
424
|
|
|
454
425
|
if (!noShare) {
|
|
455
|
-
await shareFlow(resolve(output), videoTitle);
|
|
426
|
+
await shareFlow(resolve(output), videoTitle, prompt);
|
|
456
427
|
}
|
|
457
428
|
return;
|
|
458
429
|
}
|
|
@@ -483,7 +454,7 @@ async function main() {
|
|
|
483
454
|
}, output, flags.music);
|
|
484
455
|
|
|
485
456
|
if (!noShare) {
|
|
486
|
-
await shareFlow(resolve(output), videoTitle);
|
|
457
|
+
await shareFlow(resolve(output), videoTitle, prompt);
|
|
487
458
|
}
|
|
488
459
|
return;
|
|
489
460
|
}
|