@aicopycoders/exodus 2026.11.1200-beta.1 → 2026.11.1200-beta.3
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.
|
@@ -575,7 +575,7 @@ Send this in one message, in this order, then stop and wait:
|
|
|
575
575
|
> **How many:** <n> videos = <a> ads × <p> personas:
|
|
576
576
|
> - Video 1: <ad> × <persona>
|
|
577
577
|
> - Video 2: <ad> × <persona>
|
|
578
|
-
> **Cost:** the
|
|
578
|
+
> **Cost:** no price before the write; a kind with a saved sheet gets its price after it.
|
|
579
579
|
> **My picks:** <one line, with the reason>. **It buys:** <n> scripts and <n>
|
|
580
580
|
> whole videos, on your keys. Say go, or change a row. (Above 6 videos, end
|
|
581
581
|
> with "Say yes to <n> videos, or change a row." instead.)
|
|
@@ -621,8 +621,14 @@ The rows:
|
|
|
621
621
|
picture of the room, a cut-out of the product and one take for each 15 or
|
|
622
622
|
25 seconds of script, on the member's Kie key, and text calls on their
|
|
623
623
|
model key; it needs their ElevenLabs key and their Kie key. Its price is
|
|
624
|
-
the server's estimate,
|
|
625
|
-
prints
|
|
624
|
+
the server's estimate, known once the swipe is written: `exodus video swipe
|
|
625
|
+
sheet price <swipeId>` (free) prints it at 720p or a 480p draft, the whole
|
|
626
|
+
video or the first take only, each with the most it can cost.
|
|
627
|
+
- **The saved sheet** (a kind that has one; One-take UGC today). The server
|
|
628
|
+
keeps one for each swipe of such a kind, made after its write. For such a
|
|
629
|
+
video this sheet's yes covers the write only, and **It buys:** says so:
|
|
630
|
+
"<n> scripts now; each video after your yes on its saved sheet". The
|
|
631
|
+
saved sheet and its yes come in step 4.
|
|
626
632
|
- **Persona.** Offer the three saved personas that fit the ad best, each with
|
|
627
633
|
a short reason, then "show all <N>" (every persona not marked
|
|
628
634
|
`[archived]`). Several may be picked: one video for each.
|
|
@@ -654,8 +660,10 @@ The rows:
|
|
|
654
660
|
characters counting as one today. Show the multiplication, as in "4 videos
|
|
655
661
|
= 2 ads × 2 personas". Above 6 videos, say the count and ask for the yes on
|
|
656
662
|
that count in so many words: "That is 8 videos. Say yes to 8 videos."
|
|
657
|
-
- **Cost.**
|
|
658
|
-
that: no number, no range, no guess.
|
|
663
|
+
- **Cost.** Before the write the CLI prints no price for a swipe, so the
|
|
664
|
+
sheet says exactly that: no number, no range, no guess. A kind with a saved
|
|
665
|
+
sheet (One-take UGC today) gets its price after the write, with its saved
|
|
666
|
+
sheet (step 4). The Director block of `exodus video
|
|
659
667
|
status` prints "Spent: $… of $12.00": the $12.00 is the Director's limit
|
|
660
668
|
for its redos on that video, not a price and not a ceiling for the first
|
|
661
669
|
pass. Never quote it as the cost.
|
|
@@ -687,8 +695,31 @@ no music. With more than one product and none named, ask that one row first.
|
|
|
687
695
|
|
|
688
696
|
The yes covers the writes and the starts, and the bot calls when step 5
|
|
689
697
|
applies; nothing else. The breakdown and the template are once per ad, and
|
|
690
|
-
are done already.
|
|
691
|
-
|
|
698
|
+
are done already.
|
|
699
|
+
|
|
700
|
+
**The saved sheet** changes this for a kind that has one (One-take UGC
|
|
701
|
+
today): the yes of step 3 covers its writes, and its starts wait for one more
|
|
702
|
+
yes. Run step 1 for every such video first. Then read each one's saved sheet
|
|
703
|
+
with `exodus video swipe sheet <swipeId>` (free) and show them one time,
|
|
704
|
+
together in one message: their rows, and the swipe's dashboard page each
|
|
705
|
+
prints (that page does not show the saved sheet yet). Ask one yes for all
|
|
706
|
+
their starts, then run step 2 for each. A reply that only changes a row is
|
|
707
|
+
not that yes: set it with `exodus video swipe sheet set <swipeId>
|
|
708
|
+
notes="<words>"` (free; `<row>=` clears a row), say the change in one line,
|
|
709
|
+
and ask the yes again. Say a row marked "no step reads it yet" as saved, not
|
|
710
|
+
used. The start copies the saved sheet into the video; a change after it is
|
|
711
|
+
for the next video.
|
|
712
|
+
With each sheet, show its price: `exodus video swipe sheet price <swipeId>`
|
|
713
|
+
(free) prints it at the sheet's rows, with the most it can cost and one line
|
|
714
|
+
of what it leaves out. A 480p draft or the first take only is a row the
|
|
715
|
+
member sets (`size=480p`, `takes=first`) when the price lists them; read the
|
|
716
|
+
price again after a set. The first take only is a cheap check of the method
|
|
717
|
+
and the size, not of the final person: the whole video after it is a second
|
|
718
|
+
start, paid on its own (`takes=all`, then `swipe start <swipeId> --again`),
|
|
719
|
+
and it casts the person and draws the pictures again. Say so before that yes.
|
|
720
|
+
|
|
721
|
+
For each video, in the listed order, run steps 1 and 2; step 3 comes once
|
|
722
|
+
every video has started:
|
|
692
723
|
|
|
693
724
|
1. `exodus video swipe write <breakdownId> --product <id> --mode whole-ad
|
|
694
725
|
--closeness <n> --yes`. A mode set from a note changes the line:
|
|
@@ -705,12 +736,16 @@ step 3 comes once every video has started:
|
|
|
705
736
|
read them yet."
|
|
706
737
|
The write's last line says "Start the video (paid; ask first)": the
|
|
707
738
|
sheet's yes was that ask, so start now, with the line below, not the
|
|
708
|
-
write's own, which leaves out `--one-shot`.
|
|
709
|
-
|
|
739
|
+
write's own, which leaves out `--one-shot`. For a kind with a saved
|
|
740
|
+
sheet, that ask is the saved sheet's yes instead: start after it. Note the
|
|
741
|
+
swipe id it printed for that video.
|
|
710
742
|
2. `exodus video swipe start <swipeId> --one-shot --yes`, without
|
|
711
743
|
`--one-shot` when the member chose to stop at the storyboard, and with
|
|
712
|
-
`--music` when they chose music.
|
|
713
|
-
|
|
744
|
+
`--music` when they chose music. For a kind with a saved sheet whose price
|
|
745
|
+
printed a number, add `--max-usd <n>` with the "at most" it showed: a
|
|
746
|
+
start that can now cost more is refused, and nothing is started. No
|
|
747
|
+
number printed: no `--max-usd`, and never a guessed one. Give the member the
|
|
748
|
+
`Watch it:` link at once. Then go on to the next video.
|
|
714
749
|
3. When every video has started, follow each run with `exodus video status
|
|
715
750
|
<runId>` and do what it prints. A one-shot run that waits for a cut goes
|
|
716
751
|
to "End: watch and approve" (pull, cut, upload, the run page). A run that
|
|
@@ -899,10 +934,11 @@ noted only.
|
|
|
899
934
|
### Step by step: a yes before each paid step
|
|
900
935
|
|
|
901
936
|
For a member who asks for stops. Four steps cost money, and the CLI prints no
|
|
902
|
-
price for any of them
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
937
|
+
price for any of them but the start of a kind with a saved sheet. Run each
|
|
938
|
+
one first without `--yes`: it sends nothing and prints what the step buys and
|
|
939
|
+
who pays. Tell the member both, and the price when it prints one, else say
|
|
940
|
+
the CLI prints no price; never guess one, and run the same line with `--yes`
|
|
941
|
+
only after their yes.
|
|
906
942
|
|
|
907
943
|
1. **Get the ad.** One of a video file, a link (Meta Ad Library, TikTok,
|
|
908
944
|
Instagram or YouTube), or a video ad in the brand's swipe library by the
|
|
@@ -914,9 +950,16 @@ after their yes.
|
|
|
914
950
|
Once it is done, `exodus video swipe status <breakdownId> --full` prints
|
|
915
951
|
what Exodus read from the ad: each shot with its cut times, a-roll or
|
|
916
952
|
cutaway, framing, camera and description, then the script with who says
|
|
917
|
-
each line, then the cast. It is free. Show the
|
|
918
|
-
the script before the template, so they can say
|
|
919
|
-
ad right.
|
|
953
|
+
each line, then the cast, then how it is filmed. It is free. Show the
|
|
954
|
+
member the shot list and the script before the template, so they can say
|
|
955
|
+
whether Exodus read their ad right. In "How it is filmed", every line but
|
|
956
|
+
Measured, Cuts and Words is the video model's reading by eye, and it is
|
|
957
|
+
often wrong: in Exodus's own checks the camera height was right 2 times
|
|
958
|
+
in 9. Cuts is counted, but it includes jump cuts the video model saw.
|
|
959
|
+
Give the by-eye lines as what Exodus thinks it saw, never as fact, and
|
|
960
|
+
ask the member to check any that matters against the ad. Measured says
|
|
961
|
+
only that most of the part of the frame it could read stood still; it
|
|
962
|
+
does not prove the phone was put down.
|
|
920
963
|
2. **The template.** `exodus video swipe template <breakdownId>`, paid on the
|
|
921
964
|
member's own Anthropic or OpenRouter key. It prints the kind of ad and the
|
|
922
965
|
look the ad matched, and why. A template made before costs nothing. Show
|
|
@@ -946,6 +989,14 @@ after their yes.
|
|
|
946
989
|
it buys the whole video with no stop: ask before passing it. `--wait` waits until the run needs the
|
|
947
990
|
member. A swipe that already has a video is refused, with its run; a
|
|
948
991
|
second video from it needs `--again` and the member's yes to a second video.
|
|
992
|
+
For a kind with a saved sheet (One-take UGC today), show the saved sheet
|
|
993
|
+
one time before this start, as in step 4 (`exodus video swipe sheet
|
|
994
|
+
<swipeId>`, free), in the same message as what the start buys and who
|
|
995
|
+
pays (the line without `--yes`). On this path the saved sheet's yes is
|
|
996
|
+
the start's yes: ask once, then run the line with `--yes` and the
|
|
997
|
+
`--max-usd <n>` that line printed (its price's "at most"): a start that
|
|
998
|
+
can now cost more is refused, and nothing is started. A reply that
|
|
999
|
+
only changes a row is not that yes.
|
|
949
1000
|
6. **Then** stop 3 (the storyboard) and the end, as above.
|
|
950
1001
|
|
|
951
1002
|
### Every swipe command
|
|
@@ -954,7 +1005,7 @@ after their yes.
|
|
|
954
1005
|
exodus video swipe --file <ad.mp4> | --url <link> | --ad <swipeAdId> [--yes] [--wait]
|
|
955
1006
|
break the ad down (team's keys); one read before costs nothing
|
|
956
1007
|
exodus video swipe status <breakdownId> [--wait] [--full] where the breakdown stands, step by step;
|
|
957
|
-
--full adds what it read: shots, script, cast
|
|
1008
|
+
--full adds what it read: shots, script, cast, filming
|
|
958
1009
|
exodus video swipe template <breakdownId> [--yes] the kind of ad and look it matched (member's key)
|
|
959
1010
|
exodus video swipe products the brand's products and their ids
|
|
960
1011
|
exodus video swipe write <breakdownId> --product <id> [--mode <mode>] [--closeness <step>] [--look <slug>] [--script <file>] [--kind <kind>] [--yes]
|
|
@@ -963,9 +1014,13 @@ exodus video swipe show <swipeId> one swipe again
|
|
|
963
1014
|
exodus video swipe list the brand's newest swipes, each with when it was written and its product;
|
|
964
1015
|
a refused one shows what it cost
|
|
965
1016
|
exodus video swipe find [--brand "<name>"] [--limit <n>] video ads in the swipe library to offer as options (free); no kind, no results
|
|
966
|
-
exodus video swipe start <swipeId> [--style <look>] [--title "<name>"] [--music] [--one-shot] [--again] [--yes] [--wait]
|
|
1017
|
+
exodus video swipe start <swipeId> [--style <look>] [--title "<name>"] [--music] [--one-shot] [--again] [--max-usd <n>] [--yes] [--wait]
|
|
967
1018
|
start the run on the kind the swipe wrote; --again for a
|
|
968
1019
|
second, paid video of a swipe that already has one
|
|
1020
|
+
exodus video swipe sheet <swipeId> the saved sheet the server keeps for a swipe (free);
|
|
1021
|
+
no dashboard page shows it yet
|
|
1022
|
+
exodus video swipe sheet set <swipeId> <row>=<value> ... change rows of the saved sheet, all or none; <row>= clears one (free)
|
|
1023
|
+
exodus video swipe sheet price <swipeId> the video's price at the saved sheet's rows and at each size and takes (free)
|
|
969
1024
|
exodus video swipe run --sheet <file> [--status] [--persona <name>] [--yes] [--retry-refused] [--wait] every video of a sheet saved as a JSON file
|
|
970
1025
|
```
|
|
971
1026
|
|
|
@@ -7,6 +7,8 @@ export declare const SWIPE_TEMPLATE_PATH = "/api/v2/video/swipe-template";
|
|
|
7
7
|
export declare const SWIPE_PRODUCTS_PATH = "/api/v2/video/swipe-products";
|
|
8
8
|
export declare const SWIPES_PATH = "/api/v2/video/swipes";
|
|
9
9
|
export declare const SWIPE_RUNS_PATH = "/api/v2/video/swipe-runs";
|
|
10
|
+
export declare const SWIPE_SHEET_PATH = "/api/v2/video/swipe-sheet";
|
|
11
|
+
export declare const SWIPE_SHEET_PRICE_PATH = "/api/v2/video/swipe-sheet-price";
|
|
10
12
|
export declare const SWIPE_LIBRARY_PATH = "/api/v2/swipe-library";
|
|
11
13
|
export interface SwipeBreakdown {
|
|
12
14
|
_id: string;
|
|
@@ -57,8 +59,78 @@ export interface SwipeFull {
|
|
|
57
59
|
text: string;
|
|
58
60
|
}>;
|
|
59
61
|
};
|
|
62
|
+
version?: string;
|
|
63
|
+
filming?: SwipeFilming;
|
|
60
64
|
warnings: string[];
|
|
61
65
|
}
|
|
66
|
+
export interface SwipeFilming {
|
|
67
|
+
filmedBy?: string;
|
|
68
|
+
movement?: string;
|
|
69
|
+
cuts?: string;
|
|
70
|
+
cutsPerMinute?: number;
|
|
71
|
+
framing?: string;
|
|
72
|
+
places?: string;
|
|
73
|
+
placeList?: Array<{
|
|
74
|
+
setting?: string;
|
|
75
|
+
line: string;
|
|
76
|
+
}>;
|
|
77
|
+
placeLine?: string;
|
|
78
|
+
props?: string[];
|
|
79
|
+
light?: string;
|
|
80
|
+
lightSource?: string;
|
|
81
|
+
body?: string;
|
|
82
|
+
captions?: {
|
|
83
|
+
amount?: string;
|
|
84
|
+
style?: string;
|
|
85
|
+
position?: string;
|
|
86
|
+
caps?: boolean;
|
|
87
|
+
};
|
|
88
|
+
inserts?: Array<{
|
|
89
|
+
part: string;
|
|
90
|
+
at: number;
|
|
91
|
+
secondsOn?: number;
|
|
92
|
+
where?: string;
|
|
93
|
+
widthPct?: number;
|
|
94
|
+
words?: string;
|
|
95
|
+
}>;
|
|
96
|
+
brollShare?: string;
|
|
97
|
+
wordsPerSecond?: number;
|
|
98
|
+
firstSeconds?: string;
|
|
99
|
+
hookBuilt?: string;
|
|
100
|
+
endCard?: string;
|
|
101
|
+
measuredStillPct?: number;
|
|
102
|
+
cameraHeight?: string;
|
|
103
|
+
cameraTilt?: string;
|
|
104
|
+
pose?: string;
|
|
105
|
+
moves?: Array<{
|
|
106
|
+
move: string;
|
|
107
|
+
at: number;
|
|
108
|
+
to?: number;
|
|
109
|
+
}>;
|
|
110
|
+
held?: Array<{
|
|
111
|
+
thing: string;
|
|
112
|
+
hands?: string;
|
|
113
|
+
product?: boolean;
|
|
114
|
+
wholeAd: boolean;
|
|
115
|
+
from?: number;
|
|
116
|
+
to?: number;
|
|
117
|
+
}>;
|
|
118
|
+
handActions?: Array<{
|
|
119
|
+
does: string;
|
|
120
|
+
things?: string;
|
|
121
|
+
product?: boolean;
|
|
122
|
+
from: number;
|
|
123
|
+
to: number;
|
|
124
|
+
}>;
|
|
125
|
+
personLook?: {
|
|
126
|
+
hair?: string;
|
|
127
|
+
hairColour?: string;
|
|
128
|
+
skinTone?: string;
|
|
129
|
+
build?: string;
|
|
130
|
+
glasses?: string;
|
|
131
|
+
facialHair?: string;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
62
134
|
export interface SwipeTemplateView {
|
|
63
135
|
kind: {
|
|
64
136
|
key: string;
|
|
@@ -134,6 +206,80 @@ export interface SwipeListRow {
|
|
|
134
206
|
name: string;
|
|
135
207
|
} | null;
|
|
136
208
|
}
|
|
209
|
+
export type SheetFrom = "you" | "their-ad" | "kind";
|
|
210
|
+
export interface SavedSheetRow {
|
|
211
|
+
id: string;
|
|
212
|
+
label: string;
|
|
213
|
+
value: string | number | boolean | null;
|
|
214
|
+
from: SheetFrom | null;
|
|
215
|
+
why: string | null;
|
|
216
|
+
options: Array<{
|
|
217
|
+
id: string;
|
|
218
|
+
label: string;
|
|
219
|
+
}> | null;
|
|
220
|
+
optionsCostUsd: number | null;
|
|
221
|
+
usedBy: string | null;
|
|
222
|
+
readOnly: boolean;
|
|
223
|
+
}
|
|
224
|
+
export interface SavedSheet {
|
|
225
|
+
swipeId: string;
|
|
226
|
+
kind: {
|
|
227
|
+
key: string;
|
|
228
|
+
label: string;
|
|
229
|
+
} | null;
|
|
230
|
+
run: {
|
|
231
|
+
id: string;
|
|
232
|
+
} | null;
|
|
233
|
+
sections: Array<{
|
|
234
|
+
id: string;
|
|
235
|
+
label: string;
|
|
236
|
+
rows: SavedSheetRow[];
|
|
237
|
+
}>;
|
|
238
|
+
startRefusal?: string;
|
|
239
|
+
}
|
|
240
|
+
export type SwipePriceRow = {
|
|
241
|
+
size: string;
|
|
242
|
+
takes: "all" | "first";
|
|
243
|
+
filmedTakes: number;
|
|
244
|
+
costUsd: number;
|
|
245
|
+
maxUsd: number;
|
|
246
|
+
lines: Array<{
|
|
247
|
+
what: string;
|
|
248
|
+
usd: number;
|
|
249
|
+
}>;
|
|
250
|
+
startRefusal?: string;
|
|
251
|
+
} | {
|
|
252
|
+
size: string;
|
|
253
|
+
takes: "all" | "first";
|
|
254
|
+
why: string;
|
|
255
|
+
};
|
|
256
|
+
export type SwipePrice = {
|
|
257
|
+
swipeId: string;
|
|
258
|
+
kind: {
|
|
259
|
+
key: string;
|
|
260
|
+
label: string;
|
|
261
|
+
} | null;
|
|
262
|
+
priced: true;
|
|
263
|
+
sizeChoices: boolean;
|
|
264
|
+
scriptTakes: number;
|
|
265
|
+
picked: Extract<SwipePriceRow, {
|
|
266
|
+
costUsd: number;
|
|
267
|
+
}>;
|
|
268
|
+
options: SwipePriceRow[];
|
|
269
|
+
notes: string[];
|
|
270
|
+
leavesOut: string;
|
|
271
|
+
startRefusals: string[];
|
|
272
|
+
heldBy: string | null;
|
|
273
|
+
approximate: true;
|
|
274
|
+
} | {
|
|
275
|
+
swipeId: string;
|
|
276
|
+
kind: {
|
|
277
|
+
key: string;
|
|
278
|
+
label: string;
|
|
279
|
+
} | null;
|
|
280
|
+
priced: false;
|
|
281
|
+
why: string;
|
|
282
|
+
};
|
|
137
283
|
type ServerMode = "whole" | "hook" | "their-format" | "new-look";
|
|
138
284
|
export declare const SWIPE_MODES: ReadonlyArray<{
|
|
139
285
|
flag: string;
|
|
@@ -179,6 +325,7 @@ export interface StartAsk {
|
|
|
179
325
|
title?: string;
|
|
180
326
|
music: boolean;
|
|
181
327
|
oneShot: boolean;
|
|
328
|
+
maxUsd?: number;
|
|
182
329
|
}
|
|
183
330
|
export interface SwipeOpts {
|
|
184
331
|
json: boolean;
|
|
@@ -226,6 +373,19 @@ export type SwipePlan = {
|
|
|
226
373
|
ask: StartAsk;
|
|
227
374
|
again: boolean;
|
|
228
375
|
opts: SwipeOpts;
|
|
376
|
+
} | {
|
|
377
|
+
kind: "sheet";
|
|
378
|
+
swipeId: string;
|
|
379
|
+
opts: SwipeOpts;
|
|
380
|
+
} | {
|
|
381
|
+
kind: "sheet-set";
|
|
382
|
+
swipeId: string;
|
|
383
|
+
picks: Record<string, string | null>;
|
|
384
|
+
opts: SwipeOpts;
|
|
385
|
+
} | {
|
|
386
|
+
kind: "sheet-price";
|
|
387
|
+
swipeId: string;
|
|
388
|
+
opts: SwipeOpts;
|
|
229
389
|
} | {
|
|
230
390
|
kind: "run";
|
|
231
391
|
sheetFile: string;
|
|
@@ -237,6 +397,7 @@ export type SwipePlan = {
|
|
|
237
397
|
export declare function parseSwipeMode(value: string): ServerMode | null;
|
|
238
398
|
export declare function parseCloseness(value: string): number | null;
|
|
239
399
|
export declare function planSwipeCommand(rest: string[], occurrences: FlagOccurrence[]): SwipePlan;
|
|
400
|
+
export declare const SHEET_ROW_ID: RegExp;
|
|
240
401
|
export interface ChoiceWords {
|
|
241
402
|
who: string;
|
|
242
403
|
flag: (name: string) => string;
|
|
@@ -271,11 +432,12 @@ export interface SwipeRunOptions extends SwipeOpts {
|
|
|
271
432
|
export declare function swipeBreakdownFlow(source: SwipeSource, opts: SwipeRunOptions, deps: VideoDeps): Promise<FlowResult>;
|
|
272
433
|
export declare function swipeStatusFlow(breakdownId: string, opts: SwipeRunOptions, deps: VideoDeps, full?: boolean): Promise<FlowResult>;
|
|
273
434
|
export declare function fullLines(data: Record<string, unknown>): string[];
|
|
435
|
+
export declare function filmingLines(filming: SwipeFilming | undefined, version?: string): string[];
|
|
274
436
|
export declare function swipeTemplateFlow(breakdownId: string, opts: SwipeRunOptions, deps: VideoDeps): Promise<FlowResult>;
|
|
275
437
|
export declare function swipeProductsFlow(opts: SwipeOpts, deps: VideoDeps): Promise<FlowResult>;
|
|
276
438
|
export declare const FIND_READ = 200;
|
|
277
439
|
export declare const FIND_PAID_FLAGS: readonly ["yes", "wait", "file", "url", "ad", "again"];
|
|
278
|
-
export declare const FIND_OTHER_FLAGS: readonly ["one-shot", "music", "mode", "closeness", "product", "look", "script", "style", "title", "sheet", "full", "status", "persona", "retry-refused", "kind"];
|
|
440
|
+
export declare const FIND_OTHER_FLAGS: readonly ["one-shot", "music", "mode", "closeness", "product", "look", "script", "style", "title", "sheet", "full", "status", "persona", "retry-refused", "kind", "max-usd"];
|
|
279
441
|
export declare const FIND_KIND_LINE = "The kind of an ad is known only after it is read.";
|
|
280
442
|
export declare const FIND_EMPTY_LIBRARY = "The swipe library has no ads yet for this brand.";
|
|
281
443
|
export interface FindAsk {
|
|
@@ -316,6 +478,11 @@ export declare function swipeFindFlow(ask: FindAsk, opts: SwipeOpts, deps: Video
|
|
|
316
478
|
export declare function swipeWriteFlow(breakdownId: string, ask: WriteAsk, opts: SwipeRunOptions, deps: VideoDeps): Promise<FlowResult>;
|
|
317
479
|
export declare function swipeShowFlow(swipeId: string, opts: SwipeOpts, deps: VideoDeps): Promise<FlowResult>;
|
|
318
480
|
export declare function swipeListFlow(opts: SwipeOpts, deps: VideoDeps): Promise<FlowResult>;
|
|
481
|
+
export declare function sheetLines(sheet: SavedSheet, dashboardUrl: string): string[];
|
|
482
|
+
export declare function swipeSheetReadFlow(swipeId: string, opts: SwipeOpts, deps: VideoDeps): Promise<FlowResult>;
|
|
483
|
+
export declare function swipeSheetSetFlow(swipeId: string, picks: Record<string, string | null>, opts: SwipeOpts, deps: VideoDeps): Promise<FlowResult>;
|
|
484
|
+
export declare function priceLines(price: SwipePrice, dashboardUrl: string): string[];
|
|
485
|
+
export declare function swipeSheetPriceFlow(swipeId: string, opts: SwipeOpts, deps: VideoDeps): Promise<FlowResult>;
|
|
319
486
|
export declare const SWIPE_ALREADY_STARTED_CODE = "SWIPE_ALREADY_STARTED";
|
|
320
487
|
export declare function alreadyStartedOf(res: ApiResponse<unknown>): {
|
|
321
488
|
runId: string;
|
|
@@ -12,6 +12,8 @@ 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_SHEET_PATH = "/api/v2/video/swipe-sheet";
|
|
16
|
+
export const SWIPE_SHEET_PRICE_PATH = "/api/v2/video/swipe-sheet-price";
|
|
15
17
|
export const SWIPE_LIBRARY_PATH = "/api/v2/swipe-library";
|
|
16
18
|
export const SWIPE_MODES = [
|
|
17
19
|
{ flag: "whole-ad", mode: "whole", label: "Whole ad", helper: "Every part of their ad, rewritten for your brand." },
|
|
@@ -74,7 +76,7 @@ export function needsYesResult(step, json, choice = []) {
|
|
|
74
76
|
],
|
|
75
77
|
};
|
|
76
78
|
}
|
|
77
|
-
const VERBS = ["status", "template", "products", "write", "show", "list", "start", "run", "find"];
|
|
79
|
+
const VERBS = ["status", "template", "products", "write", "show", "list", "start", "run", "find", "sheet"];
|
|
78
80
|
export function parseSwipeMode(value) {
|
|
79
81
|
return SWIPE_MODES.find((m) => m.flag === value.trim().toLowerCase())?.mode ?? null;
|
|
80
82
|
}
|
|
@@ -200,6 +202,8 @@ export function planSwipeCommand(rest, occurrences) {
|
|
|
200
202
|
}
|
|
201
203
|
return { kind: "run", sheetFile: sheet.trim(), retryRefused: on("retry-refused"), status: on("status"), persona: persona?.trim() ?? null, opts };
|
|
202
204
|
}
|
|
205
|
+
if (verb === "sheet")
|
|
206
|
+
return planSheet(rest.slice(1), occurrences, opts);
|
|
203
207
|
if (!id) {
|
|
204
208
|
const named = verb === "show" || verb === "start" ? "swipeId" : "breakdownId";
|
|
205
209
|
return usage(`video swipe ${verb} needs a ${named === "swipeId" ? "swipe" : "breakdown"} id: exodus video swipe ${verb} <${named}>`);
|
|
@@ -214,7 +218,14 @@ export function planSwipeCommand(rest, occurrences) {
|
|
|
214
218
|
const start = startChoicesOf({ style: value("style"), title: value("title"), music: on("music"), oneShot: on("one-shot") }, CLI_WORDS.start);
|
|
215
219
|
if ("problem" in start)
|
|
216
220
|
return usage(start.problem);
|
|
217
|
-
|
|
221
|
+
const most = value("max-usd");
|
|
222
|
+
if (most === null)
|
|
223
|
+
return usage("video swipe start --max-usd needs the most the price showed, such as 4.89.");
|
|
224
|
+
if (most !== undefined && !/^\d+(\.\d{1,2})?$/.test(most.trim())) {
|
|
225
|
+
return usage(`video swipe start --max-usd takes a dollar amount, such as 4.89 (got "${most}").`);
|
|
226
|
+
}
|
|
227
|
+
const ask = most === undefined ? start.ask : { ...start.ask, maxUsd: Number(most.trim()) };
|
|
228
|
+
return { kind: "start", swipeId: id, ask, again: on("again"), opts };
|
|
218
229
|
}
|
|
219
230
|
const product = value("product");
|
|
220
231
|
if (!product)
|
|
@@ -227,6 +238,55 @@ export function planSwipeCommand(rest, occurrences) {
|
|
|
227
238
|
return usage(`video swipe write --kind needs the key of a kind of ad. ${KIND_CHECKED}`);
|
|
228
239
|
return { kind: "write", breakdownId: id, ask: { productId: product.trim(), ...write.ask, ...(kind !== undefined ? { kind: kind.trim() } : {}) }, opts };
|
|
229
240
|
}
|
|
241
|
+
export const SHEET_ROW_ID = /^[A-Za-z][A-Za-z0-9-]{0,63}$/;
|
|
242
|
+
const SHEET_SET_LINE = 'exodus video swipe sheet set <swipeId> <row>=<value> [<row>=<value> ...]';
|
|
243
|
+
const SHEET_PRICE_LINE = "exodus video swipe sheet price <swipeId>";
|
|
244
|
+
function planSheet(words, occurrences, opts) {
|
|
245
|
+
const usage = (line) => ({ kind: "usage", line });
|
|
246
|
+
const typedFlag = (names) => occurrences.find((o) => names.some((name) => o.flag === name || o.flag === `no-${name}`))?.flag;
|
|
247
|
+
const paid = typedFlag(FIND_PAID_FLAGS);
|
|
248
|
+
if (paid)
|
|
249
|
+
return usage(`video swipe sheet is free and buys nothing, so it takes no --${paid}. Its only flag is --json.`);
|
|
250
|
+
const other = typedFlag([...FIND_OTHER_FLAGS, "brand", "limit"]);
|
|
251
|
+
if (other)
|
|
252
|
+
return usage(`video swipe sheet takes no --${other}. Its only flag is --json.`);
|
|
253
|
+
const switchWords = new Set(occurrences.filter((o) => o.flag === "json" && o.value !== undefined).map((o) => o.value));
|
|
254
|
+
const given = words.filter((word) => !(switchWords.has(word) && (ON_WORDS.has(word.toLowerCase()) || OFF_WORDS.has(word.toLowerCase()))));
|
|
255
|
+
if (given[0] === "price") {
|
|
256
|
+
const [, swipeId, ...extra] = given;
|
|
257
|
+
if (!swipeId)
|
|
258
|
+
return usage(`video swipe sheet price needs a swipe id: ${SHEET_PRICE_LINE}`);
|
|
259
|
+
if (extra.length > 0)
|
|
260
|
+
return usage(`video swipe sheet price takes one swipe id (got "${extra[0]}"): ${SHEET_PRICE_LINE}`);
|
|
261
|
+
return { kind: "sheet-price", swipeId, opts };
|
|
262
|
+
}
|
|
263
|
+
if (given[0] !== "set") {
|
|
264
|
+
const [swipeId, ...extra] = given;
|
|
265
|
+
if (!swipeId)
|
|
266
|
+
return usage("video swipe sheet needs a swipe id: exodus video swipe sheet <swipeId>");
|
|
267
|
+
if (extra.length > 0)
|
|
268
|
+
return usage(`video swipe sheet takes one swipe id (got "${extra[0]}"). To change a row: ${SHEET_SET_LINE}`);
|
|
269
|
+
return { kind: "sheet", swipeId, opts };
|
|
270
|
+
}
|
|
271
|
+
const [, swipeId, ...pairs] = given;
|
|
272
|
+
if (!swipeId || swipeId.includes("="))
|
|
273
|
+
return usage(`video swipe sheet set needs a swipe id first: ${SHEET_SET_LINE}`);
|
|
274
|
+
if (pairs.length === 0)
|
|
275
|
+
return usage(`video swipe sheet set needs a row and its value, such as notes="<your words>": ${SHEET_SET_LINE}`);
|
|
276
|
+
const picks = {};
|
|
277
|
+
for (const pair of pairs) {
|
|
278
|
+
const at = pair.indexOf("=");
|
|
279
|
+
const row = at === -1 ? pair : pair.slice(0, at);
|
|
280
|
+
if (at === -1 || !SHEET_ROW_ID.test(row)) {
|
|
281
|
+
return usage(`video swipe sheet set takes <row>=<value>, not "${pair}". A row given as <row>= is cleared.`);
|
|
282
|
+
}
|
|
283
|
+
if (Object.prototype.hasOwnProperty.call(picks, row))
|
|
284
|
+
return usage(`video swipe sheet set names "${row}" twice. Give each row once.`);
|
|
285
|
+
const value = pair.slice(at + 1);
|
|
286
|
+
picks[row] = value === "" ? null : value;
|
|
287
|
+
}
|
|
288
|
+
return { kind: "sheet-set", swipeId, picks, opts };
|
|
289
|
+
}
|
|
230
290
|
const KIND_CHECKED = "A kind this ad can't be made as is refused, with the kinds it can be made as, before the write is paid.";
|
|
231
291
|
const templateKindLine = (template, kind) => kind ? `Kind of ad: ${template.kind.label}, the template's pick; the write uses ${kind}, the sheet's kind.` : `Kind of ad: ${template.kind.label}.`;
|
|
232
292
|
function kindElsewhere(verb) {
|
|
@@ -610,10 +670,85 @@ export function fullLines(data) {
|
|
|
610
670
|
lines.push(` ${member.name || member.characterId} (${member.characterId}), ${EMBODIMENT[member.embodiment] ?? member.embodiment}`);
|
|
611
671
|
lines.push(` Look: ${member.look}`, ` Voice: ${member.voice}`);
|
|
612
672
|
}
|
|
673
|
+
lines.push("", ...filmingLines(full.filming, full.version));
|
|
613
674
|
if (full.warnings.length > 0)
|
|
614
675
|
lines.push("", "What it was not sure about:", ...full.warnings.map((warning) => ` - ${warning}`));
|
|
615
676
|
return lines;
|
|
616
677
|
}
|
|
678
|
+
const atSec = (sec) => `${sec.toFixed(1)} s`;
|
|
679
|
+
const fromTo = (from, to) => from !== undefined && to !== undefined ? seconds(from, to) : from !== undefined ? `from ${atSec(from)}` : to !== undefined ? `to ${atSec(to)}` : "";
|
|
680
|
+
const joinParts = (parts, by = ", ") => parts.filter((p) => typeof p === "string" && p !== "").join(by);
|
|
681
|
+
const oneLine = (text) => text.trim().replace(/\s*\n\s*/g, " / ");
|
|
682
|
+
const productWord = (product) => (product === true ? "the product" : product === false ? "not the product" : "");
|
|
683
|
+
export function filmingLines(filming, version) {
|
|
684
|
+
if (!filming || Object.keys(filming).length === 0) {
|
|
685
|
+
return [
|
|
686
|
+
version === "1.0"
|
|
687
|
+
? "How it is filmed: this breakdown does not say (it is of version 1.0, made before Exodus read how an ad is filmed)."
|
|
688
|
+
: "How it is filmed: nothing was read.",
|
|
689
|
+
];
|
|
690
|
+
}
|
|
691
|
+
const f = filming;
|
|
692
|
+
const out = [];
|
|
693
|
+
const line = (label, text) => {
|
|
694
|
+
if (text !== "")
|
|
695
|
+
out.push(` ${label}: ${oneLine(text)}`);
|
|
696
|
+
};
|
|
697
|
+
line("Camera", f.filmedBy ?? "");
|
|
698
|
+
line("Measured", f.measuredStillPct !== undefined
|
|
699
|
+
? `in ${f.measuredStillPct}% of the moments the measure settled in the talking shots, most of the part of the frame it could read stood still and no larger part slid together (this does not prove the phone was put down: a still layer over most of the frame reads the same)`
|
|
700
|
+
: "");
|
|
701
|
+
line("Camera height", f.cameraHeight ?? "");
|
|
702
|
+
line("Camera tilt", f.cameraTilt ?? "");
|
|
703
|
+
line("Camera movement", f.movement ?? "");
|
|
704
|
+
line("Framing", f.framing ?? "");
|
|
705
|
+
line("Pose", joinParts([f.pose, f.body && `body: ${f.body}`], "; "));
|
|
706
|
+
line("Moves", (f.moves ?? []).map((m) => `${m.move} ${m.to !== undefined ? seconds(m.at, m.to) : `at ${atSec(m.at)}`}`).join("; "));
|
|
707
|
+
line("Holds", (f.held ?? [])
|
|
708
|
+
.map((h) => `${h.thing} (${joinParts([h.hands && `${h.hands} ${h.hands === "one" ? "hand" : "hands"}`, productWord(h.product), h.wholeAd ? "the whole ad" : fromTo(h.from, h.to)])})`)
|
|
709
|
+
.join("; "));
|
|
710
|
+
line("Hands", (f.handActions ?? []).map((a) => `${seconds(a.from, a.to)} ${a.does}${a.things ? `, with ${a.things}` : ""}${a.product === undefined ? "" : ` (${productWord(a.product)})`}`).join("; "));
|
|
711
|
+
const p = f.personLook ?? {};
|
|
712
|
+
line("The person", joinParts([
|
|
713
|
+
p.hair &&
|
|
714
|
+
(p.hair === "bald" || p.hair === "shaved"
|
|
715
|
+
? `${p.hair} head`
|
|
716
|
+
: p.hair === "covered"
|
|
717
|
+
? (p.hairColour ? `${p.hairColour} hair, covered` : "hair covered")
|
|
718
|
+
: `${joinParts([p.hair, p.hairColour], " ")} hair`),
|
|
719
|
+
p.hair === undefined && p.hairColour && `${p.hairColour} hair`,
|
|
720
|
+
p.skinTone && `${p.skinTone} skin`,
|
|
721
|
+
p.build && `${p.build} build`,
|
|
722
|
+
p.glasses && (p.glasses === "none" ? "no glasses" : p.glasses),
|
|
723
|
+
p.facialHair && (p.facialHair === "none" ? "no facial hair" : p.facialHair),
|
|
724
|
+
]));
|
|
725
|
+
const placeList = (f.placeList ?? []).map((place) => joinParts([place.setting, place.line], ": ")).join("; ");
|
|
726
|
+
if (placeList)
|
|
727
|
+
line(`Places${f.places ? ` (${f.places})` : ""}`, placeList);
|
|
728
|
+
else
|
|
729
|
+
line("Places", f.places ?? "");
|
|
730
|
+
line("Main place", f.placeLine ?? "");
|
|
731
|
+
line("In view", (f.props ?? []).join(", "));
|
|
732
|
+
line("Light", joinParts([f.light, f.lightSource && `from ${f.lightSource}`]));
|
|
733
|
+
const c = f.captions;
|
|
734
|
+
line("Captions", c ? joinParts([c.amount, c.style, c.position, c.caps === undefined ? "" : c.caps ? "in capitals" : "not in capitals"], "; ") : "");
|
|
735
|
+
if ((f.inserts ?? []).length > 0) {
|
|
736
|
+
out.push(" Laid over the picture:");
|
|
737
|
+
for (const i of f.inserts ?? []) {
|
|
738
|
+
const when = i.secondsOn !== undefined ? `${atSec(i.at)} for ${atSec(i.secondsOn)}` : atSec(i.at);
|
|
739
|
+
out.push(` ${when} ${joinParts([i.part, i.where, i.widthPct !== undefined && `${i.widthPct}% wide`])}${i.words ? `: ${oneLine(i.words)}` : ""}`);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
const perMinute = f.cutsPerMinute !== undefined ? `${f.cutsPerMinute} a minute` : "";
|
|
743
|
+
line("Cuts", f.cuts ? `${f.cuts}${perMinute ? ` (${perMinute})` : ""}` : perMinute);
|
|
744
|
+
line("B-roll", f.brollShare ?? "");
|
|
745
|
+
line("Words", f.wordsPerSecond !== undefined ? `${f.wordsPerSecond} a second` : "");
|
|
746
|
+
line("First seconds", f.firstSeconds ?? "");
|
|
747
|
+
line("How the hook is built", f.hookBuilt ?? "");
|
|
748
|
+
line("How it ends", f.endCard ?? "");
|
|
749
|
+
return ["How it is filmed:", ...(out.length > 0 ? [BY_EYE, ...out] : [" Nothing was read."])];
|
|
750
|
+
}
|
|
751
|
+
const BY_EYE = " (The video model's reading by eye, not proven: every line but Measured, taken from the frames; Words, counted by code; and Cuts, counted by code with the jump cuts the video model saw.)";
|
|
617
752
|
const TEMPLATE_MAX_POLLS = 120;
|
|
618
753
|
function templateLines(template) {
|
|
619
754
|
return [
|
|
@@ -721,6 +856,7 @@ export const FIND_OTHER_FLAGS = [
|
|
|
721
856
|
"persona",
|
|
722
857
|
"retry-refused",
|
|
723
858
|
"kind",
|
|
859
|
+
"max-usd",
|
|
724
860
|
];
|
|
725
861
|
const TEXT_MAX = 400;
|
|
726
862
|
export const FIND_KIND_LINE = "The kind of an ad is known only after it is read.";
|
|
@@ -990,6 +1126,210 @@ export async function swipeListFlow(opts, deps) {
|
|
|
990
1126
|
}),
|
|
991
1127
|
};
|
|
992
1128
|
}
|
|
1129
|
+
const FROM_WORDS = { you: "from you", "their-ad": "from their ad", kind: "from the kind of ad" };
|
|
1130
|
+
function sheetOf(data) {
|
|
1131
|
+
if (!isRecord(data) || !isRecord(data.sheet) || !Array.isArray(data.sheet.sections))
|
|
1132
|
+
return null;
|
|
1133
|
+
return { sheet: data.sheet, dashboardUrl: typeof data.dashboardUrl === "string" ? data.dashboardUrl : "" };
|
|
1134
|
+
}
|
|
1135
|
+
export function sheetLines(sheet, dashboardUrl) {
|
|
1136
|
+
const { swipeId } = sheet;
|
|
1137
|
+
const page = dashboardUrl ? [`The swipe on the dashboard: ${dashboardUrl}`] : [];
|
|
1138
|
+
if (sheet.sections.length === 0) {
|
|
1139
|
+
const none = sheet.startRefusal ??
|
|
1140
|
+
(sheet.kind
|
|
1141
|
+
? `${sheet.kind.label} (${sheet.kind.key}) has no sheet: swipe ${swipeId} has nothing to set.`
|
|
1142
|
+
: `Swipe ${swipeId} has no sheet: nothing to set.`);
|
|
1143
|
+
return [none, ...(sheet.run ? [`Its video: run ${sheet.run.id}.`] : []), ...page];
|
|
1144
|
+
}
|
|
1145
|
+
const rows = sheet.sections.flatMap((section) => section.rows);
|
|
1146
|
+
const lines = [`The sheet of swipe ${swipeId}${sheet.kind ? `, ${sheet.kind.label} (${sheet.kind.key})` : ""}:`];
|
|
1147
|
+
for (const section of sheet.sections) {
|
|
1148
|
+
lines.push("", section.label);
|
|
1149
|
+
for (const row of section.rows) {
|
|
1150
|
+
const value = row.value === null ? "not set" : String(row.value);
|
|
1151
|
+
lines.push(` ${row.id}${row.readOnly ? ", read only" : ""}: ${value}`);
|
|
1152
|
+
if (row.from)
|
|
1153
|
+
lines.push(` ${FROM_WORDS[row.from]}${row.why ? `: ${row.why}` : ""}`);
|
|
1154
|
+
if (row.options) {
|
|
1155
|
+
const cost = row.optionsCostUsd ? ` (showing them costs ${usd(row.optionsCostUsd)})` : "";
|
|
1156
|
+
lines.push(` options${cost}: ${row.options.map((option) => `${option.id} (${option.label})`).join(", ")}`);
|
|
1157
|
+
}
|
|
1158
|
+
lines.push(` ${row.usedBy ? `read by: ${row.usedBy}` : "no step reads it yet"}`);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
const settable = rows.filter((row) => !row.readOnly).map((row) => row.id);
|
|
1162
|
+
lines.push("");
|
|
1163
|
+
if (settable.length > 0) {
|
|
1164
|
+
lines.push(`Change a row (free): exodus video swipe sheet set ${swipeId} <row>=<value>, or <row>= to clear it. Rows you can set: ${settable.join(", ")}.`);
|
|
1165
|
+
}
|
|
1166
|
+
lines.push(...page, sheet.run
|
|
1167
|
+
? `Its video, run ${sheet.run.id}, keeps the sheet as it was at its start. A change now is for the next video.`
|
|
1168
|
+
: "Starting the video copies this sheet into it; a change after the start is for the next video.");
|
|
1169
|
+
return lines;
|
|
1170
|
+
}
|
|
1171
|
+
export async function swipeSheetReadFlow(swipeId, opts, deps) {
|
|
1172
|
+
const res = await deps.get(`${SWIPE_SHEET_PATH}?id=${encodeURIComponent(swipeId)}`);
|
|
1173
|
+
if (!res.ok)
|
|
1174
|
+
return swipeError(res, opts.json);
|
|
1175
|
+
const read = sheetOf(res.data);
|
|
1176
|
+
if (!read)
|
|
1177
|
+
return failed("The server's answer about this sheet could not be read.", opts.json);
|
|
1178
|
+
if (opts.json)
|
|
1179
|
+
return { code: 0, lines: [JSON.stringify({ ok: true, ...read })] };
|
|
1180
|
+
return { code: 0, lines: sheetLines(read.sheet, read.dashboardUrl) };
|
|
1181
|
+
}
|
|
1182
|
+
export async function swipeSheetSetFlow(swipeId, picks, opts, deps) {
|
|
1183
|
+
const readAgain = `Whether it was saved is not known. Read the sheet again: exodus video swipe sheet ${swipeId}`;
|
|
1184
|
+
let res;
|
|
1185
|
+
try {
|
|
1186
|
+
res = await deps.post(SWIPE_SHEET_PATH, { swipeId, picks });
|
|
1187
|
+
}
|
|
1188
|
+
catch (err) {
|
|
1189
|
+
const error = `The server could not be reached: ${describeFetchFailure(err)}.`;
|
|
1190
|
+
return { code: 1, lines: opts.json ? [JSON.stringify({ ok: false, error, saved: "unknown" })] : [error, readAgain] };
|
|
1191
|
+
}
|
|
1192
|
+
if (!res.ok) {
|
|
1193
|
+
if (res.status === 404)
|
|
1194
|
+
return swipeError(res, opts.json);
|
|
1195
|
+
const error = swipeErrorLine(res);
|
|
1196
|
+
const refused = res.status >= 400 && res.status < 500;
|
|
1197
|
+
if (opts.json)
|
|
1198
|
+
return { code: 1, lines: [JSON.stringify({ ok: false, status: res.status, error, saved: refused ? false : "unknown" })] };
|
|
1199
|
+
if (refused && /Nothing was (set|saved)\.$/.test(error))
|
|
1200
|
+
return { code: 1, lines: [error] };
|
|
1201
|
+
return { code: 1, lines: [error, refused ? "Nothing was saved." : readAgain] };
|
|
1202
|
+
}
|
|
1203
|
+
const read = sheetOf(res.data);
|
|
1204
|
+
if (!read)
|
|
1205
|
+
return failed("The sheet was saved, but the server's answer could not be read: exodus video swipe sheet " + swipeId, opts.json);
|
|
1206
|
+
if (opts.json)
|
|
1207
|
+
return { code: 0, lines: [JSON.stringify({ ok: true, saved: true, ...read })] };
|
|
1208
|
+
const set = Object.keys(picks).filter((row) => picks[row] !== null);
|
|
1209
|
+
const cleared = Object.keys(picks).filter((row) => picks[row] === null);
|
|
1210
|
+
const said = [...(set.length > 0 ? [`Saved ${set.join(", ")}.`] : []), ...(cleared.length > 0 ? [`Cleared ${cleared.join(", ")}.`] : [])];
|
|
1211
|
+
return { code: 0, lines: [said.join(" "), "", ...sheetLines(read.sheet, read.dashboardUrl)] };
|
|
1212
|
+
}
|
|
1213
|
+
function priceOf(data) {
|
|
1214
|
+
if (!isRecord(data) || !isRecord(data.price) || typeof data.price.priced !== "boolean")
|
|
1215
|
+
return null;
|
|
1216
|
+
const price = data.price;
|
|
1217
|
+
if (price.priced && (!isRecord(price.picked) || !Array.isArray(price.options)))
|
|
1218
|
+
return null;
|
|
1219
|
+
return { price, dashboardUrl: typeof data.dashboardUrl === "string" ? data.dashboardUrl : "" };
|
|
1220
|
+
}
|
|
1221
|
+
const lineUsd = (value) => (Math.abs(value * 100 - Math.round(value * 100)) < 1e-6 ? usd(value) : `$${value.toFixed(3)}`);
|
|
1222
|
+
function filmWords(row, scriptTakes) {
|
|
1223
|
+
if (row.takes === "first" && scriptTakes > 1)
|
|
1224
|
+
return `${row.size}, the first take only`;
|
|
1225
|
+
return `${row.size}, ${scriptTakes === 1 ? "its one take" : `all ${scriptTakes} takes`}`;
|
|
1226
|
+
}
|
|
1227
|
+
function priceWords(row) {
|
|
1228
|
+
if ("why" in row)
|
|
1229
|
+
return `no price: ${row.why}`;
|
|
1230
|
+
return `about ${usd(row.costUsd)}, at most ${usd(row.maxUsd)}${row.startRefusal ? `. The start refuses it: ${row.startRefusal}` : ""}`;
|
|
1231
|
+
}
|
|
1232
|
+
function distinctOptions(price) {
|
|
1233
|
+
return price.scriptTakes > 1 ? price.options : price.options.filter((row) => row.takes === "all");
|
|
1234
|
+
}
|
|
1235
|
+
function cheaperOption(price) {
|
|
1236
|
+
return price.options.some((row) => !("why" in row) && !row.startRefusal && row.costUsd < price.picked.costUsd);
|
|
1237
|
+
}
|
|
1238
|
+
function pickedPriceLine(price) {
|
|
1239
|
+
return `about ${usd(price.picked.costUsd)}, at most ${usd(price.picked.maxUsd)} (${filmWords(price.picked, price.scriptTakes)}, as the swipe's sheet stands)`;
|
|
1240
|
+
}
|
|
1241
|
+
function changeLine(price) {
|
|
1242
|
+
if (!price.sizeChoices)
|
|
1243
|
+
return "This server offers the kind's own size and every take for now: 480p and the first take only are not switched on.";
|
|
1244
|
+
const rows = distinctOptions(price);
|
|
1245
|
+
const sizes = [...new Set(rows.map((row) => row.size))];
|
|
1246
|
+
const takes = [...new Set(rows.map((row) => row.takes))];
|
|
1247
|
+
const parts = [`size=<${sizes.join(" or ")}>`, ...(takes.length > 1 ? [`takes=<${takes.join(" or ")}>`] : [])];
|
|
1248
|
+
return `Change it (free): exodus video swipe sheet set ${price.swipeId} ${parts.join(" ")}. The start films what the sheet says then.`;
|
|
1249
|
+
}
|
|
1250
|
+
const AT_MOST = "At most: every take and every picture ordered twice, the most the run orders for one storyboard. A change asked for after the takes are filmed, such as a new voice or the storyboard made again, films them again and is paid on top.";
|
|
1251
|
+
function refusalLines(price) {
|
|
1252
|
+
return [
|
|
1253
|
+
...price.startRefusals.map((why) => `The start would be refused now: ${why}`),
|
|
1254
|
+
...(price.heldBy ? [`This swipe already has a video, run ${price.heldBy}: a start makes a second, paid video only with --again.`] : []),
|
|
1255
|
+
];
|
|
1256
|
+
}
|
|
1257
|
+
export function priceLines(price, dashboardUrl) {
|
|
1258
|
+
const page = dashboardUrl ? [`The swipe on the dashboard: ${dashboardUrl}`] : [];
|
|
1259
|
+
if (!price.priced)
|
|
1260
|
+
return [`No price for the video of swipe ${price.swipeId}: ${price.why}`, ...page];
|
|
1261
|
+
const lines = [
|
|
1262
|
+
`The video of swipe ${price.swipeId}${price.kind ? `, ${price.kind.label} (${price.kind.key})` : ""}, before the yes:`,
|
|
1263
|
+
`Price: ${pickedPriceLine(price)}.`,
|
|
1264
|
+
...(price.picked.startRefusal ? [`The start refuses it: ${price.picked.startRefusal}`] : []),
|
|
1265
|
+
...price.picked.lines.map((line) => ` ${line.what}: ${lineUsd(line.usd)}`),
|
|
1266
|
+
"",
|
|
1267
|
+
...(price.sizeChoices ? ["Each size:", ...distinctOptions(price).map((row) => ` ${filmWords(row, price.scriptTakes)}: ${priceWords(row)}`), ""] : []),
|
|
1268
|
+
...price.notes,
|
|
1269
|
+
price.leavesOut,
|
|
1270
|
+
AT_MOST,
|
|
1271
|
+
...refusalLines(price),
|
|
1272
|
+
changeLine(price),
|
|
1273
|
+
...page,
|
|
1274
|
+
];
|
|
1275
|
+
return lines.filter((line, i) => !(line === "" && lines[i - 1] === ""));
|
|
1276
|
+
}
|
|
1277
|
+
export async function swipeSheetPriceFlow(swipeId, opts, deps) {
|
|
1278
|
+
const res = await deps.get(`${SWIPE_SHEET_PRICE_PATH}?id=${encodeURIComponent(swipeId)}`);
|
|
1279
|
+
if (!res.ok)
|
|
1280
|
+
return swipeError(res, opts.json);
|
|
1281
|
+
const read = priceOf(res.data);
|
|
1282
|
+
if (!read)
|
|
1283
|
+
return failed("The server's answer about this price could not be read.", opts.json);
|
|
1284
|
+
if (opts.json)
|
|
1285
|
+
return { code: 0, lines: [JSON.stringify({ ok: true, ...read })] };
|
|
1286
|
+
return { code: 0, lines: priceLines(read.price, read.dashboardUrl) };
|
|
1287
|
+
}
|
|
1288
|
+
async function startNeedsYes(swipeId, step, json, again, choice, deps) {
|
|
1289
|
+
let price = null;
|
|
1290
|
+
try {
|
|
1291
|
+
const res = await deps.get(`${SWIPE_SHEET_PRICE_PATH}?id=${encodeURIComponent(swipeId)}`);
|
|
1292
|
+
price = res.ok ? (priceOf(res.data)?.price ?? null) : null;
|
|
1293
|
+
}
|
|
1294
|
+
catch {
|
|
1295
|
+
price = null;
|
|
1296
|
+
}
|
|
1297
|
+
if (!price?.priced)
|
|
1298
|
+
return needsYesResult(step, json, choice);
|
|
1299
|
+
const { buys, paidBy } = PAID[step];
|
|
1300
|
+
if (json)
|
|
1301
|
+
return { code: 0, lines: [JSON.stringify({ ok: false, needsYes: true, buys, paidBy, price })] };
|
|
1302
|
+
const when = step === "start-one-shot"
|
|
1303
|
+
? "paid from the start: the whole video is made with no stop"
|
|
1304
|
+
: "paid once the storyboard is approved: the run stops there first";
|
|
1305
|
+
return {
|
|
1306
|
+
code: 0,
|
|
1307
|
+
lines: [
|
|
1308
|
+
"This step costs money, so nothing was sent.",
|
|
1309
|
+
...choice,
|
|
1310
|
+
`It buys: ${buys}`,
|
|
1311
|
+
`Who pays: ${paidBy}`,
|
|
1312
|
+
`The whole video's price: ${pickedPriceLine(price)}, ${when}.`,
|
|
1313
|
+
...(price.picked.startRefusal ? [`The start refuses it: ${price.picked.startRefusal}`] : []),
|
|
1314
|
+
price.leavesOut,
|
|
1315
|
+
AT_MOST,
|
|
1316
|
+
...price.startRefusals.map((why) => `The start would be refused now: ${why}`),
|
|
1317
|
+
...(price.heldBy && !again ? [`This swipe already has a video, run ${price.heldBy}: this start is refused, and a second, paid video needs --again.`] : []),
|
|
1318
|
+
...(cheaperOption(price) ? [`For less, set the sheet first (free): exodus video swipe sheet price ${swipeId} lists each size.`] : []),
|
|
1319
|
+
`Ask the member. On their yes, run the same command with --yes --max-usd ${price.picked.maxUsd.toFixed(2)}: the start is refused if it can now cost more.`,
|
|
1320
|
+
],
|
|
1321
|
+
};
|
|
1322
|
+
}
|
|
1323
|
+
async function maxUsdUnsupported(swipeId, maxUsd, deps) {
|
|
1324
|
+
const cannot = `so it can't hold this start to ${usd(maxUsd)}, and nothing was started.`;
|
|
1325
|
+
try {
|
|
1326
|
+
const res = await deps.get(`${SWIPE_SHEET_PRICE_PATH}?id=${encodeURIComponent(swipeId)}`);
|
|
1327
|
+
return missingRouteLine(res, "exodus video swipe start --max-usd") ? `This server has no price before the yes, ${cannot}` : null;
|
|
1328
|
+
}
|
|
1329
|
+
catch {
|
|
1330
|
+
return `The server could not be asked whether it holds a start to a price, ${cannot}`;
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
993
1333
|
export const SWIPE_ALREADY_STARTED_CODE = "SWIPE_ALREADY_STARTED";
|
|
994
1334
|
export function alreadyStartedOf(res) {
|
|
995
1335
|
if (res.ok || res.status !== 409 || !isRecord(res.data) || !isRecord(res.data.error))
|
|
@@ -1002,7 +1342,12 @@ export function alreadyStartedOf(res) {
|
|
|
1002
1342
|
export async function swipeStartFlow(swipeId, ask, opts, deps, again = false) {
|
|
1003
1343
|
const { json } = opts;
|
|
1004
1344
|
if (!opts.yes) {
|
|
1005
|
-
return
|
|
1345
|
+
return startNeedsYes(swipeId, ask.oneShot ? "start-one-shot" : "start", json, again, again ? ["With --again: a second video from this swipe, even if it already has one. It is paid on its own."] : [], deps);
|
|
1346
|
+
}
|
|
1347
|
+
if (ask.maxUsd !== undefined) {
|
|
1348
|
+
const unheld = await maxUsdUnsupported(swipeId, ask.maxUsd, deps);
|
|
1349
|
+
if (unheld)
|
|
1350
|
+
return failed(unheld, json);
|
|
1006
1351
|
}
|
|
1007
1352
|
const res = await deps.post(SWIPE_RUNS_PATH, {
|
|
1008
1353
|
swipeId,
|
|
@@ -1011,6 +1356,7 @@ export async function swipeStartFlow(swipeId, ask, opts, deps, again = false) {
|
|
|
1011
1356
|
...(ask.music ? { music: true } : {}),
|
|
1012
1357
|
...(ask.oneShot ? {} : { reviewStoryboard: true }),
|
|
1013
1358
|
...(again ? { again: true } : {}),
|
|
1359
|
+
...(ask.maxUsd !== undefined ? { maxUsd: ask.maxUsd } : {}),
|
|
1014
1360
|
});
|
|
1015
1361
|
const held = alreadyStartedOf(res);
|
|
1016
1362
|
if (held) {
|
|
@@ -2774,6 +3120,12 @@ export async function runSwipePlan(plan, deps, onProgressLine) {
|
|
|
2774
3120
|
return swipeFindFlow(plan.ask, opts, deps);
|
|
2775
3121
|
case "start":
|
|
2776
3122
|
return swipeStartFlow(plan.swipeId, plan.ask, opts, deps, plan.again);
|
|
3123
|
+
case "sheet":
|
|
3124
|
+
return swipeSheetReadFlow(plan.swipeId, opts, deps);
|
|
3125
|
+
case "sheet-set":
|
|
3126
|
+
return swipeSheetSetFlow(plan.swipeId, plan.picks, opts, deps);
|
|
3127
|
+
case "sheet-price":
|
|
3128
|
+
return swipeSheetPriceFlow(plan.swipeId, opts, deps);
|
|
2777
3129
|
case "run":
|
|
2778
3130
|
return swipeSheetFlow(plan.sheetFile, { ...opts, retryRefused: plan.retryRefused, status: plan.status, persona: plan.persona }, deps);
|
|
2779
3131
|
}
|
package/dist/commands/video.js
CHANGED
|
@@ -205,8 +205,11 @@ Usage:
|
|
|
205
205
|
exodus video swipe show <swipeId> [--json]
|
|
206
206
|
exodus video swipe list [--json]
|
|
207
207
|
exodus video swipe find [--brand "<name>"] [--limit <n>] [--json]
|
|
208
|
-
exodus video swipe start <swipeId> [--style <look>] [--title "<name>"] [--music] [--one-shot] [--again] [--yes] [--wait] [--json]
|
|
208
|
+
exodus video swipe start <swipeId> [--style <look>] [--title "<name>"] [--music] [--one-shot] [--again] [--max-usd <n>] [--yes] [--wait] [--json]
|
|
209
209
|
exodus video swipe run --sheet <file> [--status] [--persona <name>] [--yes] [--retry-refused] [--wait] [--json]
|
|
210
|
+
exodus video swipe sheet <swipeId> [--json]
|
|
211
|
+
exodus video swipe sheet set <swipeId> <row>=<value> [<row>=<value> ...] [--json]
|
|
212
|
+
exodus video swipe sheet price <swipeId> [--json]
|
|
210
213
|
|
|
211
214
|
Options:
|
|
212
215
|
--out <dir> Folder to write the pulled pieces into (pull)
|
|
@@ -443,7 +446,8 @@ the brand's version, then start the video on the kind the swipe wrote. Four
|
|
|
443
446
|
steps cost money: swipe (the breakdown, on the team's keys), swipe template
|
|
444
447
|
and swipe write (on your own Anthropic or OpenRouter key) and swipe start (the
|
|
445
448
|
run's storyboard and pictures). Without --yes each one sends nothing and says
|
|
446
|
-
what it buys and who pays. The CLI prints no price for any of them
|
|
449
|
+
what it buys and who pays. The CLI prints no price for any of them, but for
|
|
450
|
+
swipe start of a kind whose saved sheet has one.
|
|
447
451
|
--file <ad.mp4> The ad as a video file: MP4, MOV, M4V or WebM, up to
|
|
448
452
|
300 MB (swipe)
|
|
449
453
|
--url <link> A link to the ad: Meta Ad Library, TikTok, Instagram or
|
|
@@ -482,7 +486,7 @@ what it buys and who pays. The CLI prints no price for any of them.
|
|
|
482
486
|
--full What the breakdown read from the ad (swipe status): each
|
|
483
487
|
shot with its cut times, a-roll or cutaway, framing,
|
|
484
488
|
camera and description; the script with who says each
|
|
485
|
-
line; and
|
|
489
|
+
line; the cast; and how it is filmed. No pictures
|
|
486
490
|
--look <slug> The new look (swipe write --mode new-look)
|
|
487
491
|
--script <file> Your own script (swipe write --mode their-format)
|
|
488
492
|
--kind <kind> A kind of ad in place of the one the template picked
|
|
@@ -521,6 +525,16 @@ library when it holds fewer), keeping the video ads with a file, newest
|
|
|
521
525
|
collected first. Its counts are of the ads it looked through. It holds no
|
|
522
526
|
results and no kind, so it ranks by neither; the kind of an ad is known only
|
|
523
527
|
after it is read. It takes no other verb's flags.
|
|
528
|
+
swipe sheet is free too: the saved sheet, the choices the server keeps for a
|
|
529
|
+
written swipe, and the swipe's page on the dashboard, which does not show the
|
|
530
|
+
saved sheet yet. Each row says its value, where it comes from and why, and
|
|
531
|
+
which step reads it. swipe sheet set <swipeId> <row>=<value> changes rows, all
|
|
532
|
+
or none; <row>= clears one. The start copies the saved sheet into the video; a
|
|
533
|
+
change after it is for the next video. A kind of ad with no sheet has nothing
|
|
534
|
+
to set. swipe sheet price <swipeId> is free: the price of the video at the
|
|
535
|
+
sheet's rows and at each size and takes, with the most it can cost. swipe
|
|
536
|
+
start --max-usd <n> holds the start to the most a price showed: a start that
|
|
537
|
+
can now cost more is refused, and nothing is started.
|
|
524
538
|
The template picks the kind of ad: swipe template prints it and its look, so
|
|
525
539
|
ask the member before the write. A swipe run has no picks stop and no pilot
|
|
526
540
|
clip; it stops at the storyboard unless --one-shot. --wait on swipe and swipe
|
|
@@ -6093,6 +6107,7 @@ const VALUE_FLAGS = new Set([
|
|
|
6093
6107
|
]);
|
|
6094
6108
|
const FIND_VALUE_FLAGS = new Set(["brand", "limit"]);
|
|
6095
6109
|
const WRITE_VALUE_FLAGS = new Set(["kind"]);
|
|
6110
|
+
const START_VALUE_FLAGS = new Set(["max-usd"]);
|
|
6096
6111
|
export function parsePositional(args = process.argv.slice(3)) {
|
|
6097
6112
|
const read = (valueFlags) => {
|
|
6098
6113
|
const out = [];
|
|
@@ -6118,6 +6133,9 @@ export function parsePositional(args = process.argv.slice(3)) {
|
|
|
6118
6133
|
const asWrite = read(WRITE_VALUE_FLAGS);
|
|
6119
6134
|
if (asWrite[0] === "swipe" && asWrite[1] === "write")
|
|
6120
6135
|
return asWrite;
|
|
6136
|
+
const asStart = read(START_VALUE_FLAGS);
|
|
6137
|
+
if (asStart[0] === "swipe" && asStart[1] === "start")
|
|
6138
|
+
return asStart;
|
|
6121
6139
|
return read(new Set());
|
|
6122
6140
|
}
|
|
6123
6141
|
function flagString(flags, name) {
|