@aicopycoders/exodus 2026.11.1100-beta.6 → 2026.11.1100-beta.7
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: exodus-video
|
|
3
|
-
description: Make a video ad with Exodus from the terminal. One sentence ("swipe this ad as a microdrama for my brand", "make this a UGC video") is walked through the template door stop by stop, with a yes asked before each paid step. A competitor's video ad (a file, a link, or an ad in Exodus) is swiped with `exodus video swipe`, as Swipe a video does on the dashboard: broken down, matched to a kind of ad, read first, then one sheet of choices and one yes for the write and the whole video (or, when the member asks, step by step with a yes before each paid step). The main path is script-first: run a saved video workflow with `npx @aicopycoders/exodus workflow run`. You read and approve the storyboard, pull every finished piece (per-scene clips, the narration track and per-scene voice, keyframes, cast identity stills, word timings, the music bed) into a folder with `exodus video pull`, and upload a finished cut for approval. Exodus makes the pieces; the cut is made outside it, in whatever editor the user wants — this skill hands over the pieces and the facts about them, it does not prescribe an editor. Use it whenever the user has invoked Exodus and wants anything to do with a video ad, an ad run's clips or storyboard, "pull the pieces", "stitch it together", "make the cut", "upload my cut", or checking on a video run ("exodus, make a video ad from this script", "exodus, is my video run done", "exodus, pull the clips for run X and cut them", "exodus, what's wrong with scene 3", "exodus video status"). Also use it when the user ran an `npx @aicopycoders/exodus video` command or the `exodus` hub skill routed here. Admins get every video command; beta testers with video switched on get start, swipe, status, storyboard, approve, voices, retry-frame, pull and upload on their own brands (see "Beta testers"). "video isn't enabled for this key" means the run id is wrong, the command is admin-only, or video isn't switched on for that dashboard user, so check the id and then say so; do not retry. Never claim generic video-editing asks ("edit this mp4", "add captions to my reel") without Exodus context; in shared folders those belong to the user's other tools. Running or authoring workflows generally is `exodus-workflow`; static image ads are `exodus-image`; copy is `exodus-write`.
|
|
3
|
+
description: Make a video ad with Exodus from the terminal. One sentence ("swipe this ad as a microdrama for my brand", "make this a UGC video") is walked through the template door stop by stop, with a yes asked before each paid step. A competitor's video ad (a file, a link, or an ad in Exodus) is swiped with `exodus video swipe`, as Swipe a video does on the dashboard: broken down, matched to a kind of ad, read first, then one sheet of choices and one yes for the write and the whole video (or, when the member asks, step by step with a yes before each paid step). With no ad named ("find some ads to swipe for this product, give me options"), it first lists the video ads in the brand's swipe library with `exodus video swipe find` and offers at most six. The main path is script-first: run a saved video workflow with `npx @aicopycoders/exodus workflow run`. You read and approve the storyboard, pull every finished piece (per-scene clips, the narration track and per-scene voice, keyframes, cast identity stills, word timings, the music bed) into a folder with `exodus video pull`, and upload a finished cut for approval. Exodus makes the pieces; the cut is made outside it, in whatever editor the user wants — this skill hands over the pieces and the facts about them, it does not prescribe an editor. Use it whenever the user has invoked Exodus and wants anything to do with a video ad, an ad run's clips or storyboard, "pull the pieces", "stitch it together", "make the cut", "upload my cut", or checking on a video run ("exodus, make a video ad from this script", "exodus, is my video run done", "exodus, pull the clips for run X and cut them", "exodus, what's wrong with scene 3", "exodus video status"). Also use it when the user ran an `npx @aicopycoders/exodus video` command or the `exodus` hub skill routed here. Admins get every video command; beta testers with video switched on get start, swipe, status, storyboard, approve, voices, retry-frame, pull and upload on their own brands (see "Beta testers"). "video isn't enabled for this key" means the run id is wrong, the command is admin-only, or video isn't switched on for that dashboard user, so check the id and then say so; do not retry. Never claim generic video-editing asks ("edit this mp4", "add captions to my reel") without Exodus context; in shared folders those belong to the user's other tools. Running or authoring workflows generally is `exodus-workflow`; static image ads are `exodus-image`; copy is `exodus-write`.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Video: make the pieces, cut the ad, hand it back
|
|
@@ -369,8 +369,9 @@ sentence to a film") keeps the picks stop and the pilot clip.
|
|
|
369
369
|
|
|
370
370
|
By default a swipe is one round: you read the ad, send the member one sheet,
|
|
371
371
|
and on their one yes write the brand's version and make each video they
|
|
372
|
-
picked.
|
|
373
|
-
|
|
372
|
+
picked. When the member names no ad, the options come first (step 0): video
|
|
373
|
+
ads from the brand's swipe library to pick from. A member who asks to say yes
|
|
374
|
+
before each paid step gets "Step by step" below.
|
|
374
375
|
|
|
375
376
|
**Long waits.** The CLI waits up to 25 minutes for a breakdown, 10 for a
|
|
376
377
|
template, 15 for a write (the write always waits; it has no `--wait`), and 60
|
|
@@ -380,6 +381,122 @@ was cut off or timed out is not a failure: the work goes on. Follow it by the
|
|
|
380
381
|
id it printed, with the command the CLI names, and never by running the paid
|
|
381
382
|
line again: a second run buys it a second time.
|
|
382
383
|
|
|
384
|
+
### 0. No ad named: find some
|
|
385
|
+
|
|
386
|
+
When the member asks for ads to swipe without naming one ("find some ads to
|
|
387
|
+
swipe for this product, give me options"), offer options first. Skip this
|
|
388
|
+
step when the member named a file, a link or an id.
|
|
389
|
+
|
|
390
|
+
1. The free product check comes first, as in step 1: `exodus video swipe
|
|
391
|
+
products`, and with no products, tell the member and stop. Then, free:
|
|
392
|
+
`exodus video swipe find --json`. It looks through up to 200 ads of the
|
|
393
|
+
brand's swipe library, shared fairly across the competitors (the whole
|
|
394
|
+
library when it holds fewer, and then `"wholeLibrary"` is true), and keeps
|
|
395
|
+
the video ads with a file, newest collected first, each with its id,
|
|
396
|
+
advertiser, first line, word count and the start of its transcript. Its
|
|
397
|
+
counts are of the ads it looked through, not of the whole library.
|
|
398
|
+
2. Send the options in one message, then stop and wait:
|
|
399
|
+
|
|
400
|
+
> I found <V> video ads from <C> competitors in <your swipe library, or, when "wholeLibrary" is false: the 200 ads I looked through in your swipe library>. The <k> that fit <product> best:
|
|
401
|
+
> 1. **<Advertiser>**: "<first line>" (<w> words). Fits: <one reason, from the ad's words and the product>.
|
|
402
|
+
> 2. **<Advertiser>**: post text "<first line>" (no transcript yet).
|
|
403
|
+
> <V − k> more found. Say "more" for the next six, or name a competitor.
|
|
404
|
+
> Pick by number, or say "all" for these <k>. Your pick is your yes to read
|
|
405
|
+
> every ad you pick, one after another: each read costs a little, on the
|
|
406
|
+
> team's keys and on your model key. Nothing is written or started before
|
|
407
|
+
> your yes to the sheet.
|
|
408
|
+
|
|
409
|
+
The rules of the options:
|
|
410
|
+
|
|
411
|
+
- **At most six options in one message.** "More" sends the next six in the
|
|
412
|
+
same order you chose them by, leaving out every ad already shown; past
|
|
413
|
+
the rows the CLI showed, run `exodus video swipe find --limit 200
|
|
414
|
+
--json`. When the member names a competitor, run `exodus video
|
|
415
|
+
swipe find --brand "<name>" --json`. Leave out the "more found" line when
|
|
416
|
+
there are no more. When that find says none of the video ads is from that
|
|
417
|
+
name, say the CLI's line and offer the advertisers it lists.
|
|
418
|
+
- **"All" means the options the member last saw**, never every ad found.
|
|
419
|
+
- **The reason comes from the ad's words and the product.** A product fact
|
|
420
|
+
in it comes only from `exodus video swipe products` (the product's name
|
|
421
|
+
and description) or the primer. Say nothing about the competitor beyond
|
|
422
|
+
the ad's own words. Never call an ad a winner, a top ad or a proven ad:
|
|
423
|
+
the list holds no results (no spend, no views, no days running) and does
|
|
424
|
+
not rank by them. Its order is newest collected first, nothing more.
|
|
425
|
+
- **Post text is not spoken.** A first line with `"firstLineFrom": "post
|
|
426
|
+
text"` is the post's headline or text, not words said in the video: show
|
|
427
|
+
it as post text, never as something someone says.
|
|
428
|
+
- **An ad with no transcript goes last**, with no reason: its words are not
|
|
429
|
+
known before the read.
|
|
430
|
+
- **The kind of an ad is known only after it is read.** Never state a kind
|
|
431
|
+
as fact before a read.
|
|
432
|
+
|
|
433
|
+
**A find by kind.** When the member asks for a kind of ad ("find me some
|
|
434
|
+
authority yappers"), offer at most six whose words sound like that kind, and
|
|
435
|
+
say so in the message's first line, as "<kind>: sounds like, from the words;
|
|
436
|
+
the read confirms it." After the reads, the sheet's first
|
|
437
|
+
line names any ad the template read as another kind, so the member can drop
|
|
438
|
+
it ("drop video 3, go" is already a yes).
|
|
439
|
+
|
|
440
|
+
**What a pick is.** Only numbers given after an options message ("1, 3 and
|
|
441
|
+
5"), or "all" (the options the member last saw), are picks. The numbering
|
|
442
|
+
goes on across "more" and across a new find (for a named competitor): the
|
|
443
|
+
next six are 7 to 12, and so on, never 1 again. Keep the id of every
|
|
444
|
+
number you showed, and read a pick by that id. "You pick" is not a
|
|
445
|
+
pick: name your own picks by number, each with its reason, and wait; read
|
|
446
|
+
nothing yet. A reply that takes them ("yes, those") is the pick. "Swipe all
|
|
447
|
+
of them" in the first message, before any options were shown, gets the
|
|
448
|
+
options first. A reply that picks nothing (a question, "tell me more about
|
|
449
|
+
2", "maybe") is not a pick: answer it and wait.
|
|
450
|
+
|
|
451
|
+
**A pick is the yes to read every ad picked.** Say in one line what you are
|
|
452
|
+
about to read and who pays, in words like: "I'll read these 2 ads now, one
|
|
453
|
+
after another: each breakdown on the team's keys, each template on your own
|
|
454
|
+
model key." Then step 1 reads them in number order, by the ids the find
|
|
455
|
+
printed (`--ad <id>`), each breakdown then its template, without asking
|
|
456
|
+
again between them. Only what the member did not pick still gets the one
|
|
457
|
+
ask of "The limit: $0.50 for the read." in step 1: an ad found or named
|
|
458
|
+
after the pick, or a second pass over the same list. A pick whose read is
|
|
459
|
+
refused (its video expired or was removed; the read says so in one sentence
|
|
460
|
+
and buys nothing) or fails is left out, as step 1 says. Reading a failed ad
|
|
461
|
+
again is paid and needs its own yes.
|
|
462
|
+
|
|
463
|
+
**Into the sheet.** Every pick is on the sheet, in number order. The count is
|
|
464
|
+
ads × personas, and every rule of step 3 holds, above 6 videos too. In a
|
|
465
|
+
sheet file, each pick is `{"ad": "<id>"}` in `"sources"`, in the same order.
|
|
466
|
+
|
|
467
|
+
**Only part of the library was looked through.** When `"wholeLibrary"` is false
|
|
468
|
+
and none of those ads is a video with a file, the library is not empty:
|
|
469
|
+
the find looked through only part of it. Say the CLI's line, say that, and
|
|
470
|
+
offer a link or a file of an ad. Do not offer mining.
|
|
471
|
+
|
|
472
|
+
**An empty library.** When the find answers "The swipe library has no ads yet
|
|
473
|
+
for this brand.", or, with `"wholeLibrary"` true, that none of its ads is a
|
|
474
|
+
video with a file, tell the member in the CLI's own words, then offer
|
|
475
|
+
three ways and run none of them:
|
|
476
|
+
|
|
477
|
+
- a link or a file of an ad (step 1 reads it);
|
|
478
|
+
- `exodus swipe brands list` (free): the competitors this brand tracks, each
|
|
479
|
+
with the date it was last mined;
|
|
480
|
+
- `exodus swipe mine`: collects the tracked competitors' ads into the
|
|
481
|
+
library.
|
|
482
|
+
|
|
483
|
+
**Before any yes to mining**, tell the member in one message: it runs on
|
|
484
|
+
their own Scrape Creators key; the CLI prints no price for it; it mines every
|
|
485
|
+
active competitor on the watchlist, up to 50 in one run, the least recently
|
|
486
|
+
mined first; and it starts the moment it runs, in the background. Only a
|
|
487
|
+
reply that names mining after that message is the yes ("yes, mine them"), and
|
|
488
|
+
it buys the mining only, no read. After the mine, do not find again at
|
|
489
|
+
once: `exodus swipe latest` and `exodus swipe status <runId>` follow the
|
|
490
|
+
weekly swipe run, not mining, so they cannot show it is done. The mine
|
|
491
|
+
itself prints "Check progress: exodus swipe brands list". Tell the member
|
|
492
|
+
the mine has started and that you can look again in a few minutes. When
|
|
493
|
+
they ask, run `exodus swipe brands list` (a competitor that showed
|
|
494
|
+
`never-scraped` and now shows a `last=` date has been mined; the date has
|
|
495
|
+
no time, so one mined earlier the same day shows no change), then `exodus
|
|
496
|
+
video swipe find --json`. If it is still empty, say what the list shows and
|
|
497
|
+
stop; do not keep checking. Transcripts are made after the mine finishes, so
|
|
498
|
+
a newly mined ad can show "no transcript yet" for a while.
|
|
499
|
+
|
|
383
500
|
### 1. Read the ad
|
|
384
501
|
|
|
385
502
|
First, free: `exodus video swipe products`. When it answers "This brand has
|
|
@@ -424,7 +541,10 @@ member once when the costs counted have reached $0.50, or when any read so
|
|
|
424
541
|
far is unknown: an unknown cost counts as reaching the limit. Say what is
|
|
425
542
|
left to read. A new template is always
|
|
426
543
|
unknown, so with several ads you read the first and ask before the rest. The
|
|
427
|
-
check comes before each read, so the total can pass $0.50 by one read.
|
|
544
|
+
check comes before each read, so the total can pass $0.50 by one read. Ads
|
|
545
|
+
the member picked by number from the options (step 0), or with "all", are
|
|
546
|
+
already a yes to read: read every picked ad without this ask. The ask still
|
|
547
|
+
comes before any ad they did not pick.
|
|
428
548
|
|
|
429
549
|
A breakdown or a template that fails prints why. With one ad, tell the
|
|
430
550
|
member and stop. With several, leave that ad out, say so in the sheet's first
|
|
@@ -768,8 +888,8 @@ prints no price, never guess one, and run the same line with `--yes` only
|
|
|
768
888
|
after their yes.
|
|
769
889
|
|
|
770
890
|
1. **Get the ad.** One of a video file, a link (Meta Ad Library, TikTok,
|
|
771
|
-
Instagram or YouTube), or
|
|
772
|
-
that `exodus
|
|
891
|
+
Instagram or YouTube), or a video ad in the brand's swipe library by the
|
|
892
|
+
id that `exodus video swipe find` prints (free):
|
|
773
893
|
`exodus video swipe --file <ad.mp4> | --url <link> | --ad <swipeAdId>`.
|
|
774
894
|
The breakdown is paid on the team's keys, not the member's. A link or an
|
|
775
895
|
ad this brand broke down before comes back at once and costs nothing.
|
|
@@ -823,6 +943,7 @@ exodus video swipe write <breakdownId> --product <id> [--mode <mode>] [--closene
|
|
|
823
943
|
the brand's version (member's key); waits for it
|
|
824
944
|
exodus video swipe show <swipeId> one swipe again
|
|
825
945
|
exodus video swipe list the brand's newest swipes; a refused one shows what it cost
|
|
946
|
+
exodus video swipe find [--brand "<name>"] [--limit <n>] video ads in the swipe library to offer as options (free); no kind, no results
|
|
826
947
|
exodus video swipe start <swipeId> [--style <look>] [--title "<name>"] [--music] [--one-shot] [--yes] [--wait]
|
|
827
948
|
start the run on the kind the swipe wrote
|
|
828
949
|
exodus video swipe run --sheet <file> [--status] [--persona <name>] [--yes] [--retry-refused] [--wait] every video of a sheet saved as a JSON file
|
|
@@ -6,6 +6,7 @@ export declare const SWIPE_TEMPLATE_PATH = "/api/v2/video/swipe-template";
|
|
|
6
6
|
export declare const SWIPE_PRODUCTS_PATH = "/api/v2/video/swipe-products";
|
|
7
7
|
export declare const SWIPES_PATH = "/api/v2/video/swipes";
|
|
8
8
|
export declare const SWIPE_RUNS_PATH = "/api/v2/video/swipe-runs";
|
|
9
|
+
export declare const SWIPE_LIBRARY_PATH = "/api/v2/swipe-library";
|
|
9
10
|
export interface SwipeBreakdown {
|
|
10
11
|
_id: string;
|
|
11
12
|
sourceKind: "url" | "file" | "ad";
|
|
@@ -206,6 +207,10 @@ export type SwipePlan = {
|
|
|
206
207
|
} | {
|
|
207
208
|
kind: "list";
|
|
208
209
|
opts: SwipeOpts;
|
|
210
|
+
} | {
|
|
211
|
+
kind: "find";
|
|
212
|
+
ask: FindAsk;
|
|
213
|
+
opts: SwipeOpts;
|
|
209
214
|
} | {
|
|
210
215
|
kind: "start";
|
|
211
216
|
swipeId: string;
|
|
@@ -258,6 +263,46 @@ export declare function swipeStatusFlow(breakdownId: string, opts: SwipeRunOptio
|
|
|
258
263
|
export declare function fullLines(data: Record<string, unknown>): string[];
|
|
259
264
|
export declare function swipeTemplateFlow(breakdownId: string, opts: SwipeRunOptions, deps: VideoDeps): Promise<FlowResult>;
|
|
260
265
|
export declare function swipeProductsFlow(opts: SwipeOpts, deps: VideoDeps): Promise<FlowResult>;
|
|
266
|
+
export declare const FIND_READ = 200;
|
|
267
|
+
export declare const FIND_PAID_FLAGS: readonly ["yes", "wait", "file", "url", "ad"];
|
|
268
|
+
export declare const FIND_OTHER_FLAGS: readonly ["one-shot", "music", "mode", "closeness", "product", "look", "script", "style", "title", "sheet", "full", "status", "persona", "retry-refused"];
|
|
269
|
+
export declare const FIND_KIND_LINE = "The kind of an ad is known only after it is read.";
|
|
270
|
+
export declare const FIND_EMPTY_LIBRARY = "The swipe library has no ads yet for this brand.";
|
|
271
|
+
export interface FindAsk {
|
|
272
|
+
brand: string | null;
|
|
273
|
+
limit: number;
|
|
274
|
+
}
|
|
275
|
+
export interface SwipeLibraryRow {
|
|
276
|
+
_id: string;
|
|
277
|
+
brandName?: string;
|
|
278
|
+
format?: string;
|
|
279
|
+
transcript?: string;
|
|
280
|
+
bodyText?: string;
|
|
281
|
+
headline?: string;
|
|
282
|
+
ctaText?: string;
|
|
283
|
+
imageUrl?: string;
|
|
284
|
+
videoUrl?: string;
|
|
285
|
+
}
|
|
286
|
+
export interface SwipeCandidate {
|
|
287
|
+
n: number;
|
|
288
|
+
id: string;
|
|
289
|
+
advertiser: string | null;
|
|
290
|
+
firstLine: string | null;
|
|
291
|
+
firstLineFrom: "transcript" | "post text" | null;
|
|
292
|
+
words: number | null;
|
|
293
|
+
text: string | null;
|
|
294
|
+
}
|
|
295
|
+
export interface SwipeCandidates {
|
|
296
|
+
read: number;
|
|
297
|
+
wholeLibrary: boolean;
|
|
298
|
+
videos: number;
|
|
299
|
+
competitors: number;
|
|
300
|
+
candidates: SwipeCandidate[];
|
|
301
|
+
allVideos: number;
|
|
302
|
+
advertisers: string[];
|
|
303
|
+
}
|
|
304
|
+
export declare function swipeCandidatesOf(rows: unknown[], ask: FindAsk): SwipeCandidates;
|
|
305
|
+
export declare function swipeFindFlow(ask: FindAsk, opts: SwipeOpts, deps: VideoDeps): Promise<FlowResult>;
|
|
261
306
|
export declare function swipeWriteFlow(breakdownId: string, ask: WriteAsk, opts: SwipeRunOptions, deps: VideoDeps): Promise<FlowResult>;
|
|
262
307
|
export declare function swipeShowFlow(swipeId: string, opts: SwipeOpts, deps: VideoDeps): Promise<FlowResult>;
|
|
263
308
|
export declare function swipeListFlow(opts: SwipeOpts, deps: VideoDeps): Promise<FlowResult>;
|
|
@@ -12,6 +12,7 @@ export const SWIPE_TEMPLATE_PATH = "/api/v2/video/swipe-template";
|
|
|
12
12
|
export const SWIPE_PRODUCTS_PATH = "/api/v2/video/swipe-products";
|
|
13
13
|
export const SWIPES_PATH = "/api/v2/video/swipes";
|
|
14
14
|
export const SWIPE_RUNS_PATH = "/api/v2/video/swipe-runs";
|
|
15
|
+
export const SWIPE_LIBRARY_PATH = "/api/v2/swipe-library";
|
|
15
16
|
export const SWIPE_MODES = [
|
|
16
17
|
{ flag: "whole-ad", mode: "whole", label: "Whole ad", helper: "Every part of their ad, rewritten for your brand." },
|
|
17
18
|
{ flag: "hook-only", mode: "hook", label: "Hook only", helper: "Their opening hook. The rest is new, written for your product." },
|
|
@@ -73,7 +74,7 @@ export function needsYesResult(step, json, choice = []) {
|
|
|
73
74
|
],
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
|
-
const VERBS = ["status", "template", "products", "write", "show", "list", "start", "run"];
|
|
77
|
+
const VERBS = ["status", "template", "products", "write", "show", "list", "start", "run", "find"];
|
|
77
78
|
export function parseSwipeMode(value) {
|
|
78
79
|
return SWIPE_MODES.find((m) => m.flag === value.trim().toLowerCase())?.mode ?? null;
|
|
79
80
|
}
|
|
@@ -148,6 +149,33 @@ export function planSwipeCommand(rest, occurrences) {
|
|
|
148
149
|
return { kind: "products", opts };
|
|
149
150
|
if (verb === "list")
|
|
150
151
|
return { kind: "list", opts };
|
|
152
|
+
if (verb === "find") {
|
|
153
|
+
const typedFlag = (names) => occurrences.find((o) => names.some((name) => o.flag === name || o.flag === `no-${name}`))?.flag;
|
|
154
|
+
const paid = typedFlag(FIND_PAID_FLAGS);
|
|
155
|
+
if (paid) {
|
|
156
|
+
return usage(`video swipe find only lists the swipe library and buys nothing, so it takes no --${paid}. Read a picked ad with exodus video swipe --ad <id>.`);
|
|
157
|
+
}
|
|
158
|
+
const other = typedFlag(FIND_OTHER_FLAGS);
|
|
159
|
+
if (other)
|
|
160
|
+
return usage(`video swipe find takes no --${other}: it only lists the swipe library. Its flags are --brand, --limit and --json.`);
|
|
161
|
+
const switchWord = (word) => ON_WORDS.has(word.toLowerCase()) || OFF_WORDS.has(word.toLowerCase());
|
|
162
|
+
const extra = rest
|
|
163
|
+
.slice(1)
|
|
164
|
+
.find((word) => !(switchWord(word) && occurrences.some((o) => SWITCHES.includes(o.flag) && o.value === word)));
|
|
165
|
+
if (extra !== undefined)
|
|
166
|
+
return usage(`video swipe find takes no id (got "${extra}"). Name a competitor with --brand "<name>".`);
|
|
167
|
+
const brand = value("brand");
|
|
168
|
+
if (brand === null)
|
|
169
|
+
return usage("video swipe find --brand needs a competitor's name.");
|
|
170
|
+
const limitWord = value("limit");
|
|
171
|
+
if (limitWord === null)
|
|
172
|
+
return usage(`video swipe find --limit needs a number from 1 to ${FIND_MAX}.`);
|
|
173
|
+
const limit = limitWord === undefined ? FIND_DEFAULT_LIMIT : /^\d+$/.test(limitWord.trim()) ? Number(limitWord.trim()) : NaN;
|
|
174
|
+
if (!(limit >= 1 && limit <= FIND_MAX)) {
|
|
175
|
+
return usage(`video swipe find --limit must be a whole number from 1 to ${FIND_MAX}, not "${limitWord}".`);
|
|
176
|
+
}
|
|
177
|
+
return { kind: "find", ask: { brand: brand?.trim() ?? null, limit }, opts };
|
|
178
|
+
}
|
|
151
179
|
if (verb === "run") {
|
|
152
180
|
const typed = SHEET_FLAGS.find(([flag]) => last(flag) !== undefined);
|
|
153
181
|
if (typed) {
|
|
@@ -648,6 +676,123 @@ export async function swipeProductsFlow(opts, deps) {
|
|
|
648
676
|
],
|
|
649
677
|
};
|
|
650
678
|
}
|
|
679
|
+
export const FIND_READ = 200;
|
|
680
|
+
const FIND_MAX = FIND_READ;
|
|
681
|
+
const FIND_DEFAULT_LIMIT = 30;
|
|
682
|
+
const FIRST_LINE_MAX = 60;
|
|
683
|
+
export const FIND_PAID_FLAGS = ["yes", "wait", "file", "url", "ad"];
|
|
684
|
+
export const FIND_OTHER_FLAGS = [
|
|
685
|
+
"one-shot",
|
|
686
|
+
"music",
|
|
687
|
+
"mode",
|
|
688
|
+
"closeness",
|
|
689
|
+
"product",
|
|
690
|
+
"look",
|
|
691
|
+
"script",
|
|
692
|
+
"style",
|
|
693
|
+
"title",
|
|
694
|
+
"sheet",
|
|
695
|
+
"full",
|
|
696
|
+
"status",
|
|
697
|
+
"persona",
|
|
698
|
+
"retry-refused",
|
|
699
|
+
];
|
|
700
|
+
const TEXT_MAX = 400;
|
|
701
|
+
export const FIND_KIND_LINE = "The kind of an ad is known only after it is read.";
|
|
702
|
+
export const FIND_EMPTY_LIBRARY = "The swipe library has no ads yet for this brand.";
|
|
703
|
+
function textOf(value) {
|
|
704
|
+
return typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "";
|
|
705
|
+
}
|
|
706
|
+
function cut(text, max) {
|
|
707
|
+
return text.length > max ? `${text.slice(0, max - 1)}…` : text;
|
|
708
|
+
}
|
|
709
|
+
export function swipeCandidatesOf(rows, ask) {
|
|
710
|
+
const videos = rows.filter((row) => isRecord(row) && typeof row._id === "string" && row.format === "video" && textOf(row.videoUrl) !== "");
|
|
711
|
+
const advertisers = [];
|
|
712
|
+
for (const row of videos) {
|
|
713
|
+
const name = textOf(row.brandName);
|
|
714
|
+
if (name && !advertisers.some((seen) => seen.toLowerCase() === name.toLowerCase()))
|
|
715
|
+
advertisers.push(name);
|
|
716
|
+
}
|
|
717
|
+
const wanted = ask.brand?.toLowerCase() ?? null;
|
|
718
|
+
const matched = wanted === null ? videos : videos.filter((row) => textOf(row.brandName).toLowerCase().includes(wanted));
|
|
719
|
+
const competitors = new Set(matched.map((row) => textOf(row.brandName).toLowerCase()).filter(Boolean)).size;
|
|
720
|
+
const candidates = matched.slice(0, ask.limit).map((row, i) => {
|
|
721
|
+
const transcript = textOf(row.transcript);
|
|
722
|
+
const first = transcript || textOf(row.headline) || textOf(row.bodyText);
|
|
723
|
+
return {
|
|
724
|
+
n: i + 1,
|
|
725
|
+
id: row._id,
|
|
726
|
+
advertiser: textOf(row.brandName) || null,
|
|
727
|
+
firstLine: first ? cut(first, FIRST_LINE_MAX) : null,
|
|
728
|
+
firstLineFrom: transcript ? "transcript" : first ? "post text" : null,
|
|
729
|
+
words: transcript ? transcript.split(" ").length : null,
|
|
730
|
+
text: transcript ? transcript.slice(0, TEXT_MAX) : null,
|
|
731
|
+
};
|
|
732
|
+
});
|
|
733
|
+
return { read: rows.length, wholeLibrary: rows.length < FIND_READ, videos: matched.length, competitors, candidates, allVideos: videos.length, advertisers };
|
|
734
|
+
}
|
|
735
|
+
function windowWords(found) {
|
|
736
|
+
if (!found.wholeLibrary) {
|
|
737
|
+
return `the ${found.read} ads looked through in the swipe library (shared across competitors; the library may hold more)`;
|
|
738
|
+
}
|
|
739
|
+
return found.read === 1 ? "the only ad in the swipe library" : `all ${found.read} ads in the swipe library`;
|
|
740
|
+
}
|
|
741
|
+
function findEmptyLine(found, ask) {
|
|
742
|
+
if (found.read === 0)
|
|
743
|
+
return FIND_EMPTY_LIBRARY;
|
|
744
|
+
if (found.allVideos === 0) {
|
|
745
|
+
return found.read === 1
|
|
746
|
+
? "The only ad in the swipe library is not a video with a file."
|
|
747
|
+
: `None of ${windowWords(found)} is a video with a file.`;
|
|
748
|
+
}
|
|
749
|
+
if (found.videos === 0) {
|
|
750
|
+
const where = found.wholeLibrary ? "in the swipe library" : "looked through in the swipe library";
|
|
751
|
+
return `None of the ${plural(found.allVideos, "video ad", "video ads")} ${where} is from "${ask.brand}". They are from: ${found.advertisers.join(", ")}.`;
|
|
752
|
+
}
|
|
753
|
+
return null;
|
|
754
|
+
}
|
|
755
|
+
export async function swipeFindFlow(ask, opts, deps) {
|
|
756
|
+
const { json } = opts;
|
|
757
|
+
const res = await deps.get(`${SWIPE_LIBRARY_PATH}?limit=${FIND_READ}`);
|
|
758
|
+
if (!res.ok) {
|
|
759
|
+
const error = formatApiError(res);
|
|
760
|
+
return { code: 1, lines: json ? [JSON.stringify({ ok: false, status: res.status, error })] : [error] };
|
|
761
|
+
}
|
|
762
|
+
const rows = isRecord(res.data) && Array.isArray(res.data.swipes) ? res.data.swipes : null;
|
|
763
|
+
if (!rows)
|
|
764
|
+
return failed("The server's answer about the swipe library could not be read.", json);
|
|
765
|
+
const found = swipeCandidatesOf(rows, ask);
|
|
766
|
+
const empty = findEmptyLine(found, ask);
|
|
767
|
+
const { read, wholeLibrary, videos, competitors, candidates } = found;
|
|
768
|
+
if (json) {
|
|
769
|
+
return {
|
|
770
|
+
code: 0,
|
|
771
|
+
lines: [
|
|
772
|
+
JSON.stringify({ ok: true, read, wholeLibrary, videos, competitors, shown: candidates.length, candidates, ...(empty ? { empty } : {}) }),
|
|
773
|
+
],
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
if (empty)
|
|
777
|
+
return { code: 0, lines: [empty] };
|
|
778
|
+
const width = Math.max(...candidates.map((c) => c.id.length));
|
|
779
|
+
return {
|
|
780
|
+
code: 0,
|
|
781
|
+
lines: [
|
|
782
|
+
`${plural(videos, "video ad", "video ads")}${ask.brand ? ` matching "${ask.brand}"` : ""}, from ${plural(competitors, "competitor", "competitors")}, newest collected first.`,
|
|
783
|
+
`The counts are of ${windowWords(found)}.`,
|
|
784
|
+
...candidates.map((c) => {
|
|
785
|
+
const said = c.firstLine ? `${c.firstLineFrom === "post text" ? "post text " : ""}"${c.firstLine}"` : "";
|
|
786
|
+
const tail = c.words === null ? "no transcript yet" : plural(c.words, "word", "words");
|
|
787
|
+
return `${String(c.n).padStart(4)} ${c.id.padEnd(width)} ${c.advertiser ?? "(advertiser unknown)"}: ${said ? `${said} ${tail}` : tail}`;
|
|
788
|
+
}),
|
|
789
|
+
...(candidates.length < videos ? [`Showing the first ${candidates.length}; --limit <n> shows up to ${FIND_MAX}.`] : []),
|
|
790
|
+
"Read one (paid, on the team's keys; ask first): exodus video swipe --ad <id> --yes --wait",
|
|
791
|
+
"An ad read before costs nothing to read again, unless that read failed: then reading it again is paid.",
|
|
792
|
+
`${FIND_KIND_LINE} This list holds no results, so it does not rank by them.`,
|
|
793
|
+
],
|
|
794
|
+
};
|
|
795
|
+
}
|
|
651
796
|
const WRITE_MAX_POLLS = 180;
|
|
652
797
|
function choiceLines(ask) {
|
|
653
798
|
const mode = modeOf(ask.mode);
|
|
@@ -2408,6 +2553,8 @@ export async function runSwipePlan(plan, deps, onProgressLine) {
|
|
|
2408
2553
|
return swipeShowFlow(plan.swipeId, opts, deps);
|
|
2409
2554
|
case "list":
|
|
2410
2555
|
return swipeListFlow(opts, deps);
|
|
2556
|
+
case "find":
|
|
2557
|
+
return swipeFindFlow(plan.ask, opts, deps);
|
|
2411
2558
|
case "start":
|
|
2412
2559
|
return swipeStartFlow(plan.swipeId, plan.ask, opts, deps);
|
|
2413
2560
|
case "run":
|
package/dist/commands/video.js
CHANGED
|
@@ -204,6 +204,7 @@ Usage:
|
|
|
204
204
|
exodus video swipe write <breakdownId> --product <id> [--mode whole-ad|hook-only|their-format|new-look] [--closeness <1-5|mirror|close|same-beats|same-arc|pattern-only>] [--look <slug>] [--script <file>] [--yes] [--json]
|
|
205
205
|
exodus video swipe show <swipeId> [--json]
|
|
206
206
|
exodus video swipe list [--json]
|
|
207
|
+
exodus video swipe find [--brand "<name>"] [--limit <n>] [--json]
|
|
207
208
|
exodus video swipe start <swipeId> [--style <look>] [--title "<name>"] [--music] [--one-shot] [--yes] [--wait] [--json]
|
|
208
209
|
exodus video swipe run --sheet <file> [--status] [--persona <name>] [--yes] [--retry-refused] [--wait] [--json]
|
|
209
210
|
|
|
@@ -449,7 +450,8 @@ what it buys and who pays. The CLI prints no price for any of them.
|
|
|
449
450
|
YouTube (swipe). A link this brand broke down before is
|
|
450
451
|
used again, and costs nothing
|
|
451
452
|
--ad <swipeAdId> An ad in the brand's swipe library (swipe). An ad
|
|
452
|
-
broken down before costs nothing
|
|
453
|
+
broken down before costs nothing. swipe find lists
|
|
454
|
+
the library's video ads and their ids
|
|
453
455
|
--yes The member said yes to this paid step (swipe, swipe
|
|
454
456
|
template, swipe write, swipe start), or to every paid
|
|
455
457
|
step of the sheet (swipe run)
|
|
@@ -502,6 +504,16 @@ what it buys and who pays. The CLI prints no price for any of them.
|
|
|
502
504
|
--persona <name> Only that persona's videos (swipe run)
|
|
503
505
|
--retry-refused Write again an ad the writer refused (swipe run). Paid,
|
|
504
506
|
so it needs --yes too
|
|
507
|
+
--brand "<name>" Only that competitor's ads, by a case-blind piece of
|
|
508
|
+
its name (swipe find)
|
|
509
|
+
--limit <n> How many ads swipe find shows, 1 to 200. 30 if left off.
|
|
510
|
+
The counts are of every match
|
|
511
|
+
swipe find is free and buys nothing: it looks through up to 200 ads of the
|
|
512
|
+
brand's swipe library, shared fairly across its competitors (the whole
|
|
513
|
+
library when it holds fewer), keeping the video ads with a file, newest
|
|
514
|
+
collected first. Its counts are of the ads it looked through. It holds no
|
|
515
|
+
results and no kind, so it ranks by neither; the kind of an ad is known only
|
|
516
|
+
after it is read. It takes no other verb's flags.
|
|
505
517
|
The template picks the kind of ad: swipe template prints it and its look, so
|
|
506
518
|
ask the member before the write. A swipe run has no picks stop and no pilot
|
|
507
519
|
clip; it stops at the storyboard unless --one-shot. --wait on swipe and swipe
|
|
@@ -549,6 +561,7 @@ Examples:
|
|
|
549
561
|
exodus video swipe template bd_123 --yes
|
|
550
562
|
exodus video swipe write bd_123 --product prod_1 --mode hook-only --closeness close --yes
|
|
551
563
|
exodus video swipe start sw_123 --yes --wait
|
|
564
|
+
exodus video swipe find --brand "AG1" --json
|
|
552
565
|
`.trim();
|
|
553
566
|
const SHOWS_PATH = "/api/v2/shows";
|
|
554
567
|
const RUNS_PATH = "/api/v2/video/runs";
|
|
@@ -6071,23 +6084,30 @@ const VALUE_FLAGS = new Set([
|
|
|
6071
6084
|
"sheet",
|
|
6072
6085
|
"persona",
|
|
6073
6086
|
]);
|
|
6087
|
+
const FIND_VALUE_FLAGS = new Set(["brand", "limit"]);
|
|
6074
6088
|
export function parsePositional(args = process.argv.slice(3)) {
|
|
6075
|
-
const
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6089
|
+
const read = (valueFlags) => {
|
|
6090
|
+
const out = [];
|
|
6091
|
+
let i = 0;
|
|
6092
|
+
while (i < args.length) {
|
|
6093
|
+
const arg = args[i];
|
|
6094
|
+
if (arg.startsWith("--")) {
|
|
6095
|
+
const key = arg.slice(2).split("=", 1)[0] ?? "";
|
|
6096
|
+
if (!arg.includes("=") && (VALUE_FLAGS.has(key) || valueFlags.has(key)))
|
|
6097
|
+
i += 2;
|
|
6098
|
+
else
|
|
6099
|
+
i++;
|
|
6100
|
+
continue;
|
|
6101
|
+
}
|
|
6102
|
+
out.push(arg);
|
|
6103
|
+
i++;
|
|
6086
6104
|
}
|
|
6087
|
-
out
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6105
|
+
return out;
|
|
6106
|
+
};
|
|
6107
|
+
const asFind = read(FIND_VALUE_FLAGS);
|
|
6108
|
+
if (asFind[0] === "swipe" && asFind[1] === "find")
|
|
6109
|
+
return asFind;
|
|
6110
|
+
return read(new Set());
|
|
6091
6111
|
}
|
|
6092
6112
|
function flagString(flags, name) {
|
|
6093
6113
|
const value = flags[name];
|