@clipwright/core 0.61.0 → 0.63.0
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/dist/ad-guide.d.ts +27 -0
- package/dist/ad-guide.js +7 -0
- package/dist/ad-ids.d.ts +3 -0
- package/dist/ad-ids.js +4 -0
- package/dist/ads.d.ts +222 -0
- package/dist/ads.js +57 -0
- package/dist/api-failure.d.ts +6 -0
- package/dist/api-failure.js +16 -5
- package/dist/cut-ids.d.ts +3 -0
- package/dist/cut-ids.js +4 -0
- package/dist/cuts.d.ts +221 -0
- package/dist/cuts.js +51 -0
- package/dist/diy-next.d.ts +18 -0
- package/dist/diy-next.js +13 -0
- package/dist/edit-music.d.ts +397 -0
- package/dist/edit-music.js +77 -0
- package/dist/endpoints.js +14 -0
- package/dist/errors.d.ts +29 -1
- package/dist/errors.js +23 -0
- package/dist/faceless-direction-summary.d.ts +3 -0
- package/dist/faceless-direction-summary.js +3 -0
- package/dist/faceless-public-plan.js +4 -4
- package/dist/faceless-storyboard.js +8 -9
- package/dist/film-cut.d.ts +851 -0
- package/dist/film-cut.js +168 -0
- package/dist/film-guide.d.ts +27 -0
- package/dist/film-guide.js +10 -0
- package/dist/generations.d.ts +2 -1
- package/dist/generations.js +9 -1
- package/dist/idempotency.js +2 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/openapi.js +11 -0
- package/dist/own-agent-price.d.ts +41 -5
- package/dist/own-agent-price.js +53 -14
- package/dist/own-agent-runs.d.ts +320 -2
- package/dist/own-agent-runs.js +119 -14
- package/dist/prices.d.ts +1 -0
- package/dist/prices.js +22 -2
- package/dist/runs.d.ts +1 -0
- package/dist/runs.js +3 -0
- package/dist/speech-words.d.ts +4 -0
- package/dist/speech-words.js +30 -0
- package/dist/templates/sounds.d.ts +24 -0
- package/dist/templates/sounds.js +2 -0
- package/dist/trend-niches.d.ts +57 -0
- package/dist/trend-niches.js +59 -4
- package/dist/trend-search.d.ts +1 -0
- package/dist/trend-search.js +3 -1
- package/package.json +1 -1
package/dist/film-cut.js
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { assetId } from "./asset-identity.js";
|
|
3
|
+
import { cutId } from "./cut-ids.js";
|
|
4
|
+
import { diyBlocked, diyNext } from "./diy-next.js";
|
|
5
|
+
import { FACELESS_BEAT_KINDS, FACELESS_CAMERA_MOVES, FACELESS_CUT_LOOKS, FACELESS_SHOT_SIZES, FACELESS_SPEEDS } from "./faceless-direction-summary.js";
|
|
6
|
+
import { maxCreditsField } from "./max-credits.js";
|
|
7
|
+
import { runId } from "./runs.js";
|
|
8
|
+
import { uploadId } from "./uploads.js";
|
|
9
|
+
export const FILM_CUT_CHECK_PATH = "/v1/film-cuts/check";
|
|
10
|
+
export const FILM_CUTS_QUOTE_PATH = "/v1/film-cuts/quote";
|
|
11
|
+
export const FILM_CUTS_PATH = "/v1/film-cuts";
|
|
12
|
+
export const CUT_PREVIEWS_QUOTE_PATH = "/v1/cut-previews/quote";
|
|
13
|
+
export const CUT_PREVIEWS_PATH = "/v1/cut-previews";
|
|
14
|
+
export const FILM_CUT_FORMATS = ["story", "list", "own_pictures", "cartoon"];
|
|
15
|
+
export const FILM_CUT_METHODS = ["story", "horror", "list", "how_to", "history", "cartoon"];
|
|
16
|
+
export const FILM_CUT_SYNTH_SOUNDS = ["sub_boom", "heartbeat", "pop", "slap", "whoosh", "tick", "ding", "boing", "thud"];
|
|
17
|
+
export const FILM_CUT_BED_RECIPES = ["drone_low", "wind_dark", "room_tone", "tick_pulse"];
|
|
18
|
+
export const FILM_CUT_HOLDS = ["ending", "read_text", "reveal"];
|
|
19
|
+
export const CUT_MAX_QUIET_SEC = 3;
|
|
20
|
+
export const CUT_PREVIEW_MAX_STILLS = 24;
|
|
21
|
+
const id = z.string().regex(/^[a-z0-9][a-z0-9_-]{0,31}$/u, "lowercase letters, digits, - and _, at most 32, starting with a letter or digit");
|
|
22
|
+
const word = z.number().int().nonnegative().max(5000);
|
|
23
|
+
const words = z.tuple([word, word]).refine(([first, last]) => last >= first, "the last word comes at or after the first")
|
|
24
|
+
.describe("Words of the voice as [first, last], both included: indexes into make_voice's words, 0 for the first");
|
|
25
|
+
const line = (most) => z.string().trim().min(1).max(most);
|
|
26
|
+
const why = line(300).describe("Why: what this choice does for the viewer");
|
|
27
|
+
const clipSecond = z.number().min(0).max(60);
|
|
28
|
+
const share = z.number().min(0).max(1);
|
|
29
|
+
const oneOf = (ref, keys) => keys.filter(key => ref[key] !== undefined).length === 1;
|
|
30
|
+
export const filmCutPicture = z.strictObject({
|
|
31
|
+
run_id: runId.optional().describe("A delivered generate_image run of this account"),
|
|
32
|
+
upload_id: uploadId.optional().describe("Instead of run_id: your upload; send rights_confirmed true with it"),
|
|
33
|
+
rights_confirmed: z.boolean().optional().describe("With upload_id: true confirms you may use the picture"),
|
|
34
|
+
asset_id: assetId.optional().describe("Instead of run_id: an image asset of this account"),
|
|
35
|
+
}).refine(ref => oneOf(ref, ["run_id", "upload_id", "asset_id"]), "name the picture by run_id, upload_id or asset_id, one of them");
|
|
36
|
+
const clipRef = {
|
|
37
|
+
run_id: runId.optional().describe("A delivered generate_video run of this account"),
|
|
38
|
+
asset_id: assetId.optional().describe("Instead of run_id: a video asset of this account"),
|
|
39
|
+
};
|
|
40
|
+
const ONE_CLIP = "name the clip by run_id or by asset_id, one of them";
|
|
41
|
+
export const filmCutSound = z.union([
|
|
42
|
+
z.strictObject({ synth: z.enum(FILM_CUT_SYNTH_SOUNDS).describe("A drawn sound") }),
|
|
43
|
+
z.strictObject({ kept: line(80).describe("One of your kept sounds, by its exact name (get_film_guide kept_sounds)") }),
|
|
44
|
+
z.strictObject({ file: z.string().regex(/^[a-z]+__[a-z0-9_]+$/u).describe("A catalogue sound as beat__name (list_template_sounds)") }),
|
|
45
|
+
z.strictObject({ describe: line(200).describe("What it should sound like, one event: \"a wooden shutter creaks open\"") }),
|
|
46
|
+
]);
|
|
47
|
+
export const FILM_CUT_BED_RULE = "a bed is a recipe or a description; kept sounds are short effects";
|
|
48
|
+
export const filmCutBed = z.union([
|
|
49
|
+
z.strictObject({ recipe: z.enum(FILM_CUT_BED_RECIPES).describe("A drawn ambience") }),
|
|
50
|
+
z.strictObject({ describe: line(200).describe("What the ambience sounds like: \"a looping night wind through dry grass\"; never music") }),
|
|
51
|
+
], { error: `${FILM_CUT_BED_RULE}: send { recipe } or { describe }` });
|
|
52
|
+
const beat = z.strictObject({
|
|
53
|
+
id: id.describe("The beat's name, unique in the cut"),
|
|
54
|
+
words: words.nullable().describe("The words it plays on; null only on the cold open, which plays before the voice"),
|
|
55
|
+
kind: z.enum(FACELESS_BEAT_KINDS).describe("live: a take; still_move, static_insert or customer_image: a picture or a held frame with a " +
|
|
56
|
+
"camera move; card: a text card"),
|
|
57
|
+
shot_size: z.enum(FACELESS_SHOT_SIZES).describe("How close the shot is, from ecu (extreme close-up) to ews (extreme wide)"),
|
|
58
|
+
camera: z.strictObject({
|
|
59
|
+
move: z.enum(FACELESS_CAMERA_MOVES), speed: z.enum(FACELESS_SPEEDS),
|
|
60
|
+
from: z.number().min(1).max(2).describe("Scale at the start, 1 the whole frame"), to: z.number().min(1).max(2).describe("Scale at the end"),
|
|
61
|
+
ease: z.enum(["linear", "ease_out", "ease_in_out"]),
|
|
62
|
+
}).optional().describe("The move over a picture; every beat but a live one has one"),
|
|
63
|
+
focus: z.strictObject({ x: share, y: share }).optional()
|
|
64
|
+
.describe("Where a push, pull or punch-in closes, as shares of the picture's width and height from its top-left; the centre when omitted"),
|
|
65
|
+
punch_ins: z.array(z.strictObject({ word, scale: z.number().min(1.1).max(2), hold_s: z.number().min(0.2).max(2) })).max(3).default([])
|
|
66
|
+
.describe("Quick zooms on words of this beat"),
|
|
67
|
+
priority: z.number().int().min(1).max(40).default(20).describe("1 is the beat that matters most"),
|
|
68
|
+
why,
|
|
69
|
+
technique_ids: z.array(line(64)).min(1).max(6).describe("Short names of the techniques this beat uses"),
|
|
70
|
+
text_visible: z.boolean().optional().describe("On a live beat: its frame shows readable text, a logo or a sign"),
|
|
71
|
+
picture: filmCutPicture.optional().describe("The beat shows this picture with its camera move"),
|
|
72
|
+
take: z.strictObject({ ...clipRef,
|
|
73
|
+
action_s: clipSecond.describe("The second of the clip where its action lands"),
|
|
74
|
+
action_word: word.describe("The word the action lands on; on the cold open, a word of the payoff"),
|
|
75
|
+
}).refine(take => oneOf(take, ["run_id", "asset_id"]), ONE_CLIP).optional()
|
|
76
|
+
.describe("The beat plays this clip; the window is placed so its action lands on action_word"),
|
|
77
|
+
held_frame: z.strictObject({ ...clipRef, at_s: clipSecond.describe("The second of the clip whose frame is shown") })
|
|
78
|
+
.refine(held => oneOf(held, ["run_id", "asset_id"]), ONE_CLIP).optional()
|
|
79
|
+
.describe("The beat shows one frame of a clip as a still picture, with its camera move"),
|
|
80
|
+
card: line(80).optional().describe("The beat is a text card with these words"),
|
|
81
|
+
hold: z.enum(FILM_CUT_HOLDS).optional().describe(`Only on a beat that holds over ${CUT_MAX_QUIET_SEC} s with nothing landing: ending (it ` +
|
|
82
|
+
"covers a word of the ending), read_text (a card, or a beat whose words carry an event with text) or reveal (a reveal left to sink in)"),
|
|
83
|
+
}).refine(one => oneOf(one, ["picture", "take", "held_frame", "card"]), "a beat shows exactly one of picture, take, held_frame or card");
|
|
84
|
+
export const filmCutInput = z.strictObject({
|
|
85
|
+
format: z.enum(FILM_CUT_FORMATS).describe("The video: story, list (facts, tips or steps), own_pictures or cartoon"),
|
|
86
|
+
look: z.string().regex(/^[a-z][a-z0-9_]{1,31}$/u, "a short snake_case tag, such as flat_2d")
|
|
87
|
+
.describe("The look you picked, by its tag from the guide's menu, or your own"),
|
|
88
|
+
voice_run_id: runId.describe("A delivered make_voice run of this account: its words place every beat"),
|
|
89
|
+
method: z.strictObject({
|
|
90
|
+
kind: z.enum(FILM_CUT_METHODS),
|
|
91
|
+
techniques: z.array(z.strictObject({ id: line(64), why })).min(3).max(24).describe("The techniques that shaped the video, each with why"),
|
|
92
|
+
}),
|
|
93
|
+
structure: z.strictObject({
|
|
94
|
+
arc: line(240).describe("The story in one line"),
|
|
95
|
+
hook: z.strictObject({
|
|
96
|
+
kind: z.enum(["payoff_cold_open", "payoff_line"]).describe("payoff_cold_open shows the payoff before the voice; payoff_line says it first"),
|
|
97
|
+
payoff_words: words.describe("The words of the payoff"),
|
|
98
|
+
cold_open: z.strictObject({ beat: id.describe("The first beat"), seconds: z.number().min(0.3).max(1) }).nullable()
|
|
99
|
+
.describe("With payoff_cold_open: the first beat, words null, shown this long before the voice"),
|
|
100
|
+
}),
|
|
101
|
+
loops: z.array(z.strictObject({ plant: word, pay: word })).max(3).default([])
|
|
102
|
+
.describe("Open questions: the word that plants each and the later word that pays it off"),
|
|
103
|
+
ending: z.strictObject({ kind: z.enum(["callback", "reveal", "call", "cut_to_black"]), words }),
|
|
104
|
+
}),
|
|
105
|
+
style: z.strictObject({
|
|
106
|
+
look: line(300), light: line(300),
|
|
107
|
+
palette: z.array(z.string().regex(/^#[0-9a-f]{6}$/iu)).min(3).max(5).describe("3 to 5 colours as #rrggbb: cards and outlines take theirs from it"),
|
|
108
|
+
effect_colours: line(240).describe("The colours of sparkles, glows and outlines, named"),
|
|
109
|
+
}),
|
|
110
|
+
beats: z.array(beat).min(2).max(40).describe("The beats in order, covering every word of the voice once"),
|
|
111
|
+
events: z.array(z.strictObject({ word, device: line(64).describe("The text's style: headline, badge, stamp or label; any other device draws a headline"),
|
|
112
|
+
text: z.string().trim().max(40).optional().describe("Drawn as big text on its word, such as a number; without text the event is a timing note for sound"),
|
|
113
|
+
why: line(160) })).max(160).default([])
|
|
114
|
+
.describe("Drawn as big text on its word when it has text (device: headline, badge, stamp or label); without text it is a timing note for sound"),
|
|
115
|
+
captions: z.strictObject({ on: z.boolean().default(true).describe("Burn the captions in; false for none"),
|
|
116
|
+
accents: z.array(word).max(80).default([]).describe("The word of each caption phrase that carries its point") })
|
|
117
|
+
.default({ on: true, accents: [] }),
|
|
118
|
+
transitions: z.array(z.strictObject({ after_word: word.describe("A beat's last word"), look: z.enum(FACELESS_CUT_LOOKS) })).max(40).default([])
|
|
119
|
+
.describe("Cuts other than hard, after a beat's last word"),
|
|
120
|
+
sound: z.strictObject({
|
|
121
|
+
bed: filmCutBed.nullable().describe(`One ambience under the whole voice, or null; ${FILM_CUT_BED_RULE}`),
|
|
122
|
+
hits: z.array(z.strictObject({ word: word.nullable().describe("null: the cold open"), sound: filmCutSound, why: line(160) })).max(12).default([])
|
|
123
|
+
.describe("Hits on the key words"),
|
|
124
|
+
sfx: z.array(z.strictObject({ word, sound: filmCutSound })).max(160).default([]).describe("One sound on an event's word"),
|
|
125
|
+
take_sound: z.array(runId).max(16).optional().describe("Takes (generate_video run ids of this cut) whose own sound plays under them"),
|
|
126
|
+
music: z.boolean().optional().describe("Music under the voice; the bed is then null"),
|
|
127
|
+
}),
|
|
128
|
+
breath: z.strictObject({ after_word: word, seconds: z.number().min(0.2).max(1) }).nullable().default(null)
|
|
129
|
+
.describe("One pause in the voice after the main reveal's word, with motion through it"),
|
|
130
|
+
pairing: z.array(z.strictObject({
|
|
131
|
+
picture: filmCutPicture,
|
|
132
|
+
anchored: words.optional().describe("The words the user tied the picture to, when they did"),
|
|
133
|
+
shown: words.describe("The words it is shown on"),
|
|
134
|
+
why,
|
|
135
|
+
})).max(60).default([]).describe("Your own pictures moved off the words the user tied them to, each with why"),
|
|
136
|
+
callouts: z.array(z.strictObject({
|
|
137
|
+
beat: id.describe("A picture or held_frame beat"), word: word.describe("The word it appears on, inside the beat's words"),
|
|
138
|
+
shape: z.enum(["oval", "rounded"]),
|
|
139
|
+
box: z.strictObject({ x: share, y: share, w: share, h: share }).refine(box => box.x + box.w <= 1 + 1e-9 && box.y + box.h <= 1 + 1e-9, "the box stays inside the picture").describe("The object's box as shares of the picture: x, y from the top-left, w, h"),
|
|
140
|
+
})).max(24).optional().describe("Outlines round a whole object on a picture"),
|
|
141
|
+
overrides: z.array(z.strictObject({ check: line(64), why })).max(12).default([])
|
|
142
|
+
.describe("Advice you keep your choice against, each by its check name with why"),
|
|
143
|
+
cut_id: cutId.optional().describe("The cut record this sheet belongs to (create_cut)"),
|
|
144
|
+
});
|
|
145
|
+
export const filmCutRunInput = filmCutInput.extend({ cut_id: cutId.describe("The cut record this video belongs to (create_cut)"),
|
|
146
|
+
max_credits: maxCreditsField });
|
|
147
|
+
export const filmCutPreviewInput = filmCutInput.extend({
|
|
148
|
+
cut_id: cutId.describe("The cut record this sheet belongs to (create_cut)"),
|
|
149
|
+
at: z.array(word).min(1).max(CUT_PREVIEW_MAX_STILLS).refine(list => new Set(list).size === list.length, "each word is asked once")
|
|
150
|
+
.describe(`Up to ${CUT_PREVIEW_MAX_STILLS} words of the voice, by index: each still shows the composed frame just after its word starts, ` +
|
|
151
|
+
"with the captions, text, outlines and camera as the video draws them"),
|
|
152
|
+
max_credits: maxCreditsField,
|
|
153
|
+
});
|
|
154
|
+
export const FILM_CUT_SOURCES = ["picture", "take", "held_frame", "card"];
|
|
155
|
+
export const filmCutCheck = z.strictObject({
|
|
156
|
+
ok: z.boolean(),
|
|
157
|
+
refusals: z.array(z.strictObject({ path: z.string(), message: z.string() })),
|
|
158
|
+
advice: z.array(z.strictObject({ check: z.string(), message: z.string() })),
|
|
159
|
+
plan: z.strictObject({
|
|
160
|
+
output_sec: z.number().nonnegative(),
|
|
161
|
+
shots: z.array(z.strictObject({ beat: z.string(), source: z.enum(FILM_CUT_SOURCES), from_sec: z.number().nonnegative(), to_sec: z.number().nonnegative(),
|
|
162
|
+
clip: z.strictObject({ from_sec: z.number().nonnegative(), to_sec: z.number().nonnegative(), rate: z.number().positive() }).optional() })),
|
|
163
|
+
live_sec: z.number().nonnegative(),
|
|
164
|
+
}).nullable(),
|
|
165
|
+
warnings: z.array(z.string()),
|
|
166
|
+
next: diyNext.optional().describe("A passed sheet: its quote_cut; a take not yet cleared to play: its check_take quote"),
|
|
167
|
+
blocked: diyBlocked.optional().describe("Why a take of the cut cannot play yet, and what unblocks it"),
|
|
168
|
+
});
|
package/dist/film-guide.d.ts
CHANGED
|
@@ -3,6 +3,32 @@ export declare const FILM_GUIDE_PATH = "/v1/film-guide";
|
|
|
3
3
|
export declare const FILM_KIT_PATH = "/v1/film-kit";
|
|
4
4
|
export declare const FILM_KIT_FILES: readonly ["index.ts", "src/lib/motion.ts", "src/lib/frame.tsx", "src/lib/marks.tsx", "src/lib/ui.tsx", "src/lib/objects.tsx", "src/lib/product.tsx", "src/lib/depth.tsx", "src/Film.tsx", "src/types.ts", "src/theme.ts", "src/hero/HeroSticker.tsx", "films/espresso-hit/Movie.tsx", "films/espresso-hit/scenes.tsx"];
|
|
5
5
|
export type FilmKitFile = (typeof FILM_KIT_FILES)[number];
|
|
6
|
+
export declare const FILM_GUIDE_FORMATS: readonly ["explainer", "story", "list", "own_pictures", "cartoon"];
|
|
7
|
+
export type FilmGuideFormat = (typeof FILM_GUIDE_FORMATS)[number];
|
|
8
|
+
export declare const FILM_GUIDE_SECTIONS: readonly ["steps", "story", "words", "captions", "voice", "consistency", "pictures", "motion", "density", "repair"];
|
|
9
|
+
export type FilmGuideSection = (typeof FILM_GUIDE_SECTIONS)[number];
|
|
10
|
+
export declare const filmGuideQuery: z.ZodObject<{
|
|
11
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
cartoon: "cartoon";
|
|
13
|
+
explainer: "explainer";
|
|
14
|
+
list: "list";
|
|
15
|
+
own_pictures: "own_pictures";
|
|
16
|
+
story: "story";
|
|
17
|
+
}>>;
|
|
18
|
+
section: z.ZodOptional<z.ZodEnum<{
|
|
19
|
+
captions: "captions";
|
|
20
|
+
consistency: "consistency";
|
|
21
|
+
density: "density";
|
|
22
|
+
motion: "motion";
|
|
23
|
+
pictures: "pictures";
|
|
24
|
+
repair: "repair";
|
|
25
|
+
steps: "steps";
|
|
26
|
+
story: "story";
|
|
27
|
+
voice: "voice";
|
|
28
|
+
words: "words";
|
|
29
|
+
}>>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
export type FilmGuideQuery = z.infer<typeof filmGuideQuery>;
|
|
6
32
|
export declare const FILM_KEPT_SOUNDS_MAX = 60;
|
|
7
33
|
export declare const filmGuide: z.ZodObject<{
|
|
8
34
|
guide: z.ZodString;
|
|
@@ -28,6 +54,7 @@ export declare const filmGuide: z.ZodObject<{
|
|
|
28
54
|
bytes: z.ZodNumber;
|
|
29
55
|
}, z.core.$strict>>;
|
|
30
56
|
kept_sounds: z.ZodArray<z.ZodString>;
|
|
57
|
+
version: z.ZodOptional<z.ZodString>;
|
|
31
58
|
}, z.core.$strict>;
|
|
32
59
|
export type FilmGuide = z.infer<typeof filmGuide>;
|
|
33
60
|
export declare const filmKitQuery: z.ZodObject<{
|
package/dist/film-guide.js
CHANGED
|
@@ -17,6 +17,14 @@ export const FILM_KIT_FILES = [
|
|
|
17
17
|
"films/espresso-hit/Movie.tsx",
|
|
18
18
|
"films/espresso-hit/scenes.tsx",
|
|
19
19
|
];
|
|
20
|
+
export const FILM_GUIDE_FORMATS = ["explainer", "story", "list", "own_pictures", "cartoon"];
|
|
21
|
+
export const FILM_GUIDE_SECTIONS = ["steps", "story", "words", "captions", "voice", "consistency", "pictures", "motion", "density", "repair"];
|
|
22
|
+
export const filmGuideQuery = z.strictObject({
|
|
23
|
+
format: z.enum(FILM_GUIDE_FORMATS).optional().describe("The video to make: explainer (the default, a coded film), story, list (facts or " +
|
|
24
|
+
"tips), own_pictures (the user's own pictures) or cartoon (a drawn hero in generated pictures)"),
|
|
25
|
+
section: z.enum(FILM_GUIDE_SECTIONS).optional()
|
|
26
|
+
.describe("One part of a story, list, own_pictures or cartoon guide instead of all of it: steps, or one theme of the craft"),
|
|
27
|
+
}).refine(query => query.section === undefined || (query.format !== undefined && query.format !== "explainer"), { message: "section reads one part of a story, list, own_pictures or cartoon guide: name that format too", path: ["section"] });
|
|
20
28
|
export const FILM_KEPT_SOUNDS_MAX = 60;
|
|
21
29
|
const kitVersion = z.string().regex(/^[a-f0-9]{12}$/).describe("The kit's version: a digest of its files, which changes when any of them does");
|
|
22
30
|
export const filmGuide = z.strictObject({
|
|
@@ -27,6 +35,8 @@ export const filmGuide = z.strictObject({
|
|
|
27
35
|
.describe("The scene kit's files get_film_kit serves, in reading order"),
|
|
28
36
|
kept_sounds: z.array(z.string()).max(FILM_KEPT_SOUNDS_MAX)
|
|
29
37
|
.describe("Sounds your account's films made and kept, newest first: name one exactly in sfx and it plays again, made nothing new"),
|
|
38
|
+
version: z.string().regex(/^[a-f0-9]{12}$/).optional()
|
|
39
|
+
.describe("The guide's version: a digest of the whole guide of this format, the same whichever section is read"),
|
|
30
40
|
});
|
|
31
41
|
export const filmKitQuery = z.strictObject({
|
|
32
42
|
path: z.enum(FILM_KIT_FILES).optional().describe("One kit file; every file when omitted"),
|
package/dist/generations.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const GENERATE_IMAGE_RUN_PATH = "/v1/skills/generate_image/run";
|
|
|
5
5
|
export declare const GENERATE_VIDEO_QUOTE_PATH = "/v1/skills/generate_video/quote";
|
|
6
6
|
export declare const GENERATE_VIDEO_RUN_PATH = "/v1/skills/generate_video/run";
|
|
7
7
|
export declare const GENERATION_IMAGE_MODELS: readonly ["seedream-5.0-flash", "flare", "gemini-3-pro-image", "gemini-nano-banana-2.1"];
|
|
8
|
-
export declare const GENERATION_VIDEO_MODELS: readonly ["seedance-2.0", "seedance-2.0-mini", "seedance-2.0-fast", "seedance-2.5", "kling-3.0", "kling-4.0", "kling-4.0-flash", "gemini-omni-flash-1.1", "gemini-omni-flash-1.2"];
|
|
8
|
+
export declare const GENERATION_VIDEO_MODELS: readonly ["seedance-2.0", "seedance-2.0-mini", "seedance-2.0-fast", "seedance-2.5", "seedance-2.5-flash", "kling-3.0", "kling-4.0", "kling-4.0-flash", "gemini-omni-flash-1.1", "gemini-omni-flash-1.2"];
|
|
9
9
|
export type GenerationImageModel = (typeof GENERATION_IMAGE_MODELS)[number];
|
|
10
10
|
export type GenerationVideoModel = (typeof GENERATION_VIDEO_MODELS)[number];
|
|
11
11
|
export type GenerationModel = GenerationImageModel | GenerationVideoModel;
|
|
@@ -179,6 +179,7 @@ export declare const generateVideoRequest: z.ZodObject<{
|
|
|
179
179
|
"seedance-2.0-fast": "seedance-2.0-fast";
|
|
180
180
|
"seedance-2.0-mini": "seedance-2.0-mini";
|
|
181
181
|
"seedance-2.5": "seedance-2.5";
|
|
182
|
+
"seedance-2.5-flash": "seedance-2.5-flash";
|
|
182
183
|
}>;
|
|
183
184
|
mode: z.ZodEnum<{
|
|
184
185
|
first_frame: "first_frame";
|
package/dist/generations.js
CHANGED
|
@@ -12,7 +12,7 @@ export const GENERATE_VIDEO_QUOTE_PATH = "/v1/skills/generate_video/quote";
|
|
|
12
12
|
export const GENERATE_VIDEO_RUN_PATH = "/v1/skills/generate_video/run";
|
|
13
13
|
export const GENERATION_IMAGE_MODELS = ["seedream-5.0-flash", "flare", "gemini-3-pro-image", "gemini-nano-banana-2.1"];
|
|
14
14
|
export const GENERATION_VIDEO_MODELS = [
|
|
15
|
-
"seedance-2.0", "seedance-2.0-mini", "seedance-2.0-fast", "seedance-2.5", "kling-3.0", "kling-4.0", "kling-4.0-flash",
|
|
15
|
+
"seedance-2.0", "seedance-2.0-mini", "seedance-2.0-fast", "seedance-2.5", "seedance-2.5-flash", "kling-3.0", "kling-4.0", "kling-4.0-flash",
|
|
16
16
|
"gemini-omni-flash-1.1", "gemini-omni-flash-1.2",
|
|
17
17
|
];
|
|
18
18
|
export const GENERATION_IMAGE_ASPECTS = ["9:16", "16:9", "1:1"];
|
|
@@ -103,6 +103,14 @@ export const GENERATION_CAPABILITIES = deepFreeze({
|
|
|
103
103
|
...referenceVertical(video("720p", 720, 1280, 59, H264, { vertical: true, horizontal: true })),
|
|
104
104
|
...video("1080p", 1080, 1920, 143, HEVC10, { vertical: true }, "seedance-2.5 at 1080p is HEVC 10-bit (yuv420p10le); some browsers and editors do not play it")],
|
|
105
105
|
},
|
|
106
|
+
"seedance-2.5-flash": {
|
|
107
|
+
kind: "video",
|
|
108
|
+
fps: GENERATION_VIDEO_FPS,
|
|
109
|
+
modes: { text: false, first_frame: true, reference: true },
|
|
110
|
+
duration_s: { min: 4, max: 30 },
|
|
111
|
+
rows: [...referenceVertical(video("480p", 480, 854, 17, H264, { vertical: true, horizontal: true })),
|
|
112
|
+
...referenceVertical(video("720p", 720, 1280, 38, H264, { vertical: true, horizontal: true }))],
|
|
113
|
+
},
|
|
106
114
|
"kling-3.0": {
|
|
107
115
|
kind: "video",
|
|
108
116
|
fps: GENERATION_VIDEO_FPS,
|
package/dist/idempotency.js
CHANGED
|
@@ -4,6 +4,7 @@ import { createAssetRequest } from "./assets.js";
|
|
|
4
4
|
import { candidateRequest } from "./edit-candidate.js";
|
|
5
5
|
import { revisionRequest } from "./edit-revision.js";
|
|
6
6
|
import { makeFacelessInput } from "./faceless-public.js";
|
|
7
|
+
import { filmCutPreviewInput, filmCutRunInput } from "./film-cut.js";
|
|
7
8
|
import { generateImageRequest, generateVideoRequest } from "./generations.js";
|
|
8
9
|
import { filmEditInput, filmHeroInput, filmRenderInput, filmStillsInput, filmVoiceInput, takeCheckInput, takeFramesInput } from "./own-agent-runs.js";
|
|
9
10
|
import { runId } from "./runs.js";
|
|
@@ -67,7 +68,7 @@ export function generationIdempotencyKeyFor(skill, request, clientId) {
|
|
|
67
68
|
export function ownAgentIdempotencyKeyFor(skill, request, clientId) {
|
|
68
69
|
const schema = skill === "film_stills" ? filmStillsInput : skill === "film_voice" ? filmVoiceInput : skill === "film_hero" ? filmHeroInput
|
|
69
70
|
: skill === "film_edit" ? filmEditInput : skill === "film_take_frames" ? takeFramesInput : skill === "film_take_check" ? takeCheckInput
|
|
70
|
-
: filmRenderInput;
|
|
71
|
+
: skill === "film_cut" ? filmCutRunInput : skill === "film_cut_preview" ? filmCutPreviewInput : filmRenderInput;
|
|
71
72
|
return createHash("sha256").update(clientId + JSON.stringify(canonicalize({ skill, request: schema.parse(request) }))).digest("hex");
|
|
72
73
|
}
|
|
73
74
|
export function uploadRequestIdentity(kind, input) {
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ export * from "./film-drafts.js";
|
|
|
9
9
|
export * from "./film-guide.js";
|
|
10
10
|
export * from "./ad-guide.js";
|
|
11
11
|
export * from "./own-agent-runs.js";
|
|
12
|
+
export * from "./film-cut.js";
|
|
13
|
+
export * from "./ads.js";
|
|
14
|
+
export * from "./cuts.js";
|
|
15
|
+
export * from "./diy-next.js";
|
|
12
16
|
export * from "./script-voice.js";
|
|
13
17
|
export * from "./ugc-layers.js";
|
|
14
18
|
export * from "./ugc-scenes.js";
|
|
@@ -54,6 +58,7 @@ export * from "./run-media.js";
|
|
|
54
58
|
export * from "./pacing.js";
|
|
55
59
|
export * from "./render-backend.js";
|
|
56
60
|
export * from "./tts-backend.js";
|
|
61
|
+
export * from "./speech-words.js";
|
|
57
62
|
export * from "./vendor-response.js";
|
|
58
63
|
export * from "./public-endpoints.js";
|
|
59
64
|
export * from "./endpoints.js";
|
|
@@ -70,6 +75,7 @@ export * from "./face-billing.js";
|
|
|
70
75
|
export * from "./long-form-pricing.js";
|
|
71
76
|
export * from "./parts-pricing.js";
|
|
72
77
|
export * from "./music.js";
|
|
78
|
+
export * from "./edit-music.js";
|
|
73
79
|
export * from "./presenter-matte.js";
|
|
74
80
|
export * from "./media-timebase.js";
|
|
75
81
|
export * from "./billing-terms.js";
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,10 @@ export * from "./film-drafts.js";
|
|
|
9
9
|
export * from "./film-guide.js";
|
|
10
10
|
export * from "./ad-guide.js";
|
|
11
11
|
export * from "./own-agent-runs.js";
|
|
12
|
+
export * from "./film-cut.js";
|
|
13
|
+
export * from "./ads.js";
|
|
14
|
+
export * from "./cuts.js";
|
|
15
|
+
export * from "./diy-next.js";
|
|
12
16
|
export * from "./script-voice.js";
|
|
13
17
|
export * from "./ugc-layers.js";
|
|
14
18
|
export * from "./ugc-scenes.js";
|
|
@@ -54,6 +58,7 @@ export * from "./run-media.js";
|
|
|
54
58
|
export * from "./pacing.js";
|
|
55
59
|
export * from "./render-backend.js";
|
|
56
60
|
export * from "./tts-backend.js";
|
|
61
|
+
export * from "./speech-words.js";
|
|
57
62
|
export * from "./vendor-response.js";
|
|
58
63
|
export * from "./public-endpoints.js";
|
|
59
64
|
export * from "./endpoints.js";
|
|
@@ -70,6 +75,7 @@ export * from "./face-billing.js";
|
|
|
70
75
|
export * from "./long-form-pricing.js";
|
|
71
76
|
export * from "./parts-pricing.js";
|
|
72
77
|
export * from "./music.js";
|
|
78
|
+
export * from "./edit-music.js";
|
|
73
79
|
export * from "./presenter-matte.js";
|
|
74
80
|
export * from "./media-timebase.js";
|
|
75
81
|
export * from "./billing-terms.js";
|
package/dist/openapi.js
CHANGED
|
@@ -173,9 +173,20 @@ export const OPENAPI_ROUTES = {
|
|
|
173
173
|
"POST /v1/take-checks/quote": { exposure: "excluded", reason: "Not offered yet: film runs join the contract when their mode launches (#1337)." },
|
|
174
174
|
"POST /v1/take-checks": { exposure: "excluded", reason: "Not offered yet: film runs join the contract when their mode launches (#1337)." },
|
|
175
175
|
"GET /v1/film-runs/{id}": { exposure: "excluded", reason: "Not offered yet: film runs join the contract when their mode launches (#1337)." },
|
|
176
|
+
"POST /v1/film-cuts/check": { exposure: "excluded", reason: "Not offered yet: the cut check joins the contract when faceless cuts open to every account." },
|
|
177
|
+
"POST /v1/film-cuts/quote": { exposure: "excluded", reason: "Not offered yet: the cut joins the contract when faceless cuts open to every account." },
|
|
178
|
+
"POST /v1/film-cuts": { exposure: "excluded", reason: "Not offered yet: the cut joins the contract when faceless cuts open to every account." },
|
|
179
|
+
"POST /v1/cut-previews/quote": { exposure: "excluded", reason: "Not offered yet: the preview joins the contract when faceless cuts open to every account." },
|
|
180
|
+
"POST /v1/cut-previews": { exposure: "excluded", reason: "Not offered yet: the preview joins the contract when faceless cuts open to every account." },
|
|
181
|
+
"POST /v1/cuts": { exposure: "excluded", reason: "Not offered yet: cut records join the contract when faceless cuts open to every account." },
|
|
182
|
+
"POST /v1/cuts/{id}": { exposure: "excluded", reason: "Not offered yet: cut records join the contract when faceless cuts open to every account." },
|
|
183
|
+
"GET /v1/cuts/{id}": { exposure: "excluded", reason: "Not offered yet: cut records join the contract when faceless cuts open to every account." },
|
|
176
184
|
"GET /v1/film-guide": { exposure: "excluded", reason: "Not offered yet: the film guide joins the contract when its mode launches (#1356)." },
|
|
177
185
|
"GET /v1/film-kit": { exposure: "excluded", reason: "Not offered yet: the film kit joins the contract when its mode launches (#1356)." },
|
|
178
186
|
"GET /v1/ad-guide": { exposure: "excluded", reason: "Not offered yet: the ad guide joins the contract when it opens to every account (#1539)." },
|
|
187
|
+
"POST /v1/ads": { exposure: "excluded", reason: "Not offered yet: ad records join the contract with the ad guide, when it opens to every account (#1539)." },
|
|
188
|
+
"POST /v1/ads/{id}": { exposure: "excluded", reason: "Not offered yet: ad records join the contract with the ad guide, when it opens to every account (#1539)." },
|
|
189
|
+
"GET /v1/ads/{id}": { exposure: "excluded", reason: "Not offered yet: ad records join the contract with the ad guide, when it opens to every account (#1539)." },
|
|
179
190
|
"GET /internal/portfolio-metrics": { exposure: "excluded",
|
|
180
191
|
reason: "Internal funnel aggregates behind their own secret, outside the client contract (docs/03-api.md section 12)." },
|
|
181
192
|
"GET /v1/public/workflows": { exposure: "public", operationId: "listWorkflows", tag: "Workflows", anonymous: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const OWN_AGENT_TARIFF = "own-agent-v2";
|
|
3
3
|
export declare const OWN_AGENT_TARIFF_V1 = "own-agent-v1";
|
|
4
|
-
export declare const OWN_AGENT_SKILLS: readonly ["film_stills", "film_voice", "film_render", "film_hero", "film_edit", "film_take_frames", "film_take_check"];
|
|
4
|
+
export declare const OWN_AGENT_SKILLS: readonly ["film_stills", "film_voice", "film_render", "film_hero", "film_edit", "film_take_frames", "film_take_check", "film_cut", "film_cut_preview"];
|
|
5
5
|
export type OwnAgentSkill = (typeof OWN_AGENT_SKILLS)[number];
|
|
6
6
|
export declare const OWN_STILL_CREDITS = 1;
|
|
7
7
|
export declare const OWN_FREE_STILLS = 120, OWN_FREE_STILLS_WINDOW_HOURS = 24;
|
|
@@ -11,8 +11,24 @@ export declare const OWN_STILLS_MAX_PER_CALL = 24, OWN_FILM_MAX_SECONDS = 120, O
|
|
|
11
11
|
export declare const OWN_STILLS_SINGLE_MAX = 8;
|
|
12
12
|
export declare const OWN_HERO_POSE_CREDITS = 7, OWN_HERO_POSES = 9;
|
|
13
13
|
export declare const OWN_EDIT_CREDITS = 10, OWN_EDIT_MAX_SECONDS = 60;
|
|
14
|
-
export declare const OWN_TAKE_FRAMES_MAX = 96;
|
|
14
|
+
export declare const OWN_TAKE_FRAMES_MAX = 96, TAKE_FRAMES_PER_HOUR = 60, TAKE_FRAMES_WINDOW_SECONDS = 3600;
|
|
15
|
+
export declare const TAKE_PICTURE_CHECKS_PER_HOUR = 30;
|
|
16
|
+
export declare const TAKE_MOTION_CHECKS_PER_HOUR = 30;
|
|
17
|
+
export declare const CUT_PREVIEWS_PER_HOUR = 20;
|
|
15
18
|
export declare const OWN_TAKE_CHECK_CREDITS = 10;
|
|
19
|
+
export declare const OWN_TAKE_CHECK_PICTURE_CREDITS = 20;
|
|
20
|
+
export declare const OWN_CUT_CREDITS = 45, OWN_CUT_INCLUDED_SECONDS = 60, OWN_CUT_EXTRA_SECOND_CREDITS = 1, OWN_CUT_MAX_SECONDS = 90;
|
|
21
|
+
export declare const OWN_CUT_MIN_SECONDS = 10;
|
|
22
|
+
export declare const OWN_CUT_BED_CREDITS = 35;
|
|
23
|
+
export declare const OWN_CUT_TAKE_SOUND_CREDITS_PER_SECOND = 4;
|
|
24
|
+
export declare const OWN_CUT_MAX_NEW_SOUNDS = 8;
|
|
25
|
+
export declare const OWN_CUT_MAX_SOURCES = 40, OWN_CUT_MAX_SOURCE_BYTES = 1000000000;
|
|
26
|
+
export declare const ownCutParts: z.ZodObject<{
|
|
27
|
+
bed: z.ZodBoolean;
|
|
28
|
+
take_sound_seconds: z.ZodNumber;
|
|
29
|
+
music: z.ZodBoolean;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
export type OwnCutParts = z.infer<typeof ownCutParts>;
|
|
16
32
|
export declare const ownAgentTerms: z.ZodObject<{
|
|
17
33
|
tariff: z.ZodEnum<{
|
|
18
34
|
"own-agent-v1": "own-agent-v1";
|
|
@@ -25,7 +41,15 @@ export declare const ownAgentTerms: z.ZodObject<{
|
|
|
25
41
|
voice_credits_per_second: z.ZodNumber;
|
|
26
42
|
pose_credits: z.ZodOptional<z.ZodNumber>;
|
|
27
43
|
edit_credits: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
music_credits: z.ZodOptional<z.ZodNumber>;
|
|
28
45
|
take_check_credits: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
picture_check_credits: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
cut_credits: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
cut_included_seconds: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
cut_extra_second_credits: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
cut_bed_credits: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
cut_take_sound_credits_per_second: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
cut_music_credits: z.ZodOptional<z.ZodNumber>;
|
|
29
53
|
free_stills: z.ZodOptional<z.ZodNumber>;
|
|
30
54
|
free_stills_window_hours: z.ZodOptional<z.ZodNumber>;
|
|
31
55
|
}, z.core.$strict>;
|
|
@@ -36,11 +60,15 @@ export declare const ownFilmRenderCredits: (s: number, terms?: OwnAgentTerms) =>
|
|
|
36
60
|
export declare const ownVoiceCredits: (s: number, terms?: OwnAgentTerms) => number;
|
|
37
61
|
export declare function ownStillsCredits(n: number, terms?: OwnAgentTerms, free?: number): number;
|
|
38
62
|
export declare function ownHeroCredits(n: number, terms?: OwnAgentTerms): number;
|
|
39
|
-
export declare function ownEditCredits(s: number, terms?: OwnAgentTerms): number;
|
|
63
|
+
export declare function ownEditCredits(s: number, terms?: OwnAgentTerms, music?: boolean): number;
|
|
40
64
|
export type OwnAgentDelivery = {
|
|
41
65
|
skill: "film_stills";
|
|
42
66
|
frames: number;
|
|
43
67
|
free?: number;
|
|
68
|
+
} | {
|
|
69
|
+
skill: "film_cut_preview";
|
|
70
|
+
frames: number;
|
|
71
|
+
free?: number;
|
|
44
72
|
} | {
|
|
45
73
|
skill: "film_voice";
|
|
46
74
|
seconds: number;
|
|
@@ -53,13 +81,21 @@ export type OwnAgentDelivery = {
|
|
|
53
81
|
} | {
|
|
54
82
|
skill: "film_edit";
|
|
55
83
|
seconds: number;
|
|
84
|
+
music?: boolean;
|
|
56
85
|
} | {
|
|
57
86
|
skill: "film_take_frames";
|
|
58
87
|
sheets: number;
|
|
59
88
|
} | {
|
|
60
89
|
skill: "film_take_check";
|
|
61
90
|
checks: number;
|
|
62
|
-
|
|
63
|
-
|
|
91
|
+
against?: "motion" | "picture";
|
|
92
|
+
} | ({
|
|
93
|
+
skill: "film_cut";
|
|
94
|
+
seconds: number;
|
|
95
|
+
} & OwnCutParts);
|
|
96
|
+
export declare function ownCutCredits(cut: {
|
|
97
|
+
seconds: number;
|
|
98
|
+
} & OwnCutParts, terms?: OwnAgentTerms): number;
|
|
99
|
+
export declare function ownTakeCheckCredits(n: number, terms?: OwnAgentTerms, against?: "motion" | "picture"): number;
|
|
64
100
|
export declare function ownTakeFramesCredits(sheets: number): number;
|
|
65
101
|
export declare function ownAgentCharge(delivery: OwnAgentDelivery, terms: OwnAgentTerms, heldCredits: number): number;
|
package/dist/own-agent-price.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { FACELESS_EXPLAINER_POSE_PICTURES, FACELESS_IMAGE_CREDITS } from "./faceless-price.js";
|
|
3
|
+
import { MUSIC_BED_CREDITS } from "./music.js";
|
|
3
4
|
export const OWN_AGENT_TARIFF = "own-agent-v2";
|
|
4
5
|
export const OWN_AGENT_TARIFF_V1 = "own-agent-v1";
|
|
5
|
-
export const OWN_AGENT_SKILLS = ["film_stills", "film_voice", "film_render", "film_hero", "film_edit", "film_take_frames", "film_take_check"
|
|
6
|
+
export const OWN_AGENT_SKILLS = ["film_stills", "film_voice", "film_render", "film_hero", "film_edit", "film_take_frames", "film_take_check",
|
|
7
|
+
"film_cut", "film_cut_preview"];
|
|
6
8
|
export const OWN_STILL_CREDITS = 1;
|
|
7
9
|
export const OWN_FREE_STILLS = 120, OWN_FREE_STILLS_WINDOW_HOURS = 24;
|
|
8
10
|
export const OWN_FILM_RENDER_CREDITS = 100, OWN_FILM_INCLUDED_SECONDS = 60, OWN_FILM_EXTRA_SECOND_CREDITS = 2;
|
|
@@ -11,8 +13,19 @@ export const OWN_STILLS_MAX_PER_CALL = 24, OWN_FILM_MAX_SECONDS = 120, OWN_VOICE
|
|
|
11
13
|
export const OWN_STILLS_SINGLE_MAX = 8;
|
|
12
14
|
export const OWN_HERO_POSE_CREDITS = FACELESS_IMAGE_CREDITS, OWN_HERO_POSES = FACELESS_EXPLAINER_POSE_PICTURES;
|
|
13
15
|
export const OWN_EDIT_CREDITS = 10, OWN_EDIT_MAX_SECONDS = 60;
|
|
14
|
-
export const OWN_TAKE_FRAMES_MAX = 96;
|
|
16
|
+
export const OWN_TAKE_FRAMES_MAX = 96, TAKE_FRAMES_PER_HOUR = 60, TAKE_FRAMES_WINDOW_SECONDS = 3600;
|
|
17
|
+
export const TAKE_PICTURE_CHECKS_PER_HOUR = 30;
|
|
18
|
+
export const TAKE_MOTION_CHECKS_PER_HOUR = 30;
|
|
19
|
+
export const CUT_PREVIEWS_PER_HOUR = 20;
|
|
15
20
|
export const OWN_TAKE_CHECK_CREDITS = 10;
|
|
21
|
+
export const OWN_TAKE_CHECK_PICTURE_CREDITS = 20;
|
|
22
|
+
export const OWN_CUT_CREDITS = 45, OWN_CUT_INCLUDED_SECONDS = 60, OWN_CUT_EXTRA_SECOND_CREDITS = 1, OWN_CUT_MAX_SECONDS = 90;
|
|
23
|
+
export const OWN_CUT_MIN_SECONDS = 10;
|
|
24
|
+
export const OWN_CUT_BED_CREDITS = 35;
|
|
25
|
+
export const OWN_CUT_TAKE_SOUND_CREDITS_PER_SECOND = 4;
|
|
26
|
+
export const OWN_CUT_MAX_NEW_SOUNDS = 8;
|
|
27
|
+
export const OWN_CUT_MAX_SOURCES = 40, OWN_CUT_MAX_SOURCE_BYTES = 1_000_000_000;
|
|
28
|
+
export const ownCutParts = z.strictObject({ bed: z.boolean(), take_sound_seconds: z.number().nonnegative(), music: z.boolean() });
|
|
16
29
|
export const ownAgentTerms = z.strictObject({
|
|
17
30
|
tariff: z.enum([OWN_AGENT_TARIFF_V1, OWN_AGENT_TARIFF]),
|
|
18
31
|
still_credits: z.number().int().nonnegative(),
|
|
@@ -22,14 +35,27 @@ export const ownAgentTerms = z.strictObject({
|
|
|
22
35
|
voice_credits_per_second: z.number().int().nonnegative(),
|
|
23
36
|
pose_credits: z.number().int().nonnegative().optional(),
|
|
24
37
|
edit_credits: z.number().int().nonnegative().optional(),
|
|
38
|
+
music_credits: z.number().int().nonnegative().optional(),
|
|
25
39
|
take_check_credits: z.number().int().nonnegative().optional(),
|
|
40
|
+
picture_check_credits: z.number().int().nonnegative().optional(),
|
|
41
|
+
cut_credits: z.number().int().nonnegative().optional(),
|
|
42
|
+
cut_included_seconds: z.number().int().positive().optional(),
|
|
43
|
+
cut_extra_second_credits: z.number().int().nonnegative().optional(),
|
|
44
|
+
cut_bed_credits: z.number().int().nonnegative().optional(),
|
|
45
|
+
cut_take_sound_credits_per_second: z.number().int().nonnegative().optional(),
|
|
46
|
+
cut_music_credits: z.number().int().nonnegative().optional(),
|
|
26
47
|
free_stills: z.number().int().nonnegative().optional(),
|
|
27
48
|
free_stills_window_hours: z.number().int().positive().optional(),
|
|
28
|
-
}).refine(t => (t.tariff === OWN_AGENT_TARIFF) === (t.free_stills !== undefined) && (t.free_stills === undefined) === (t.free_stills_window_hours === undefined), `free stills come with their window, and only on ${OWN_AGENT_TARIFF}`)
|
|
49
|
+
}).refine(t => (t.tariff === OWN_AGENT_TARIFF) === (t.free_stills !== undefined) && (t.free_stills === undefined) === (t.free_stills_window_hours === undefined), `free stills come with their window, and only on ${OWN_AGENT_TARIFF}`)
|
|
50
|
+
.refine(t => new Set(CUT_TERMS.map(key => t[key] === undefined)).size === 1, "a cut's prices come all together or not at all");
|
|
51
|
+
const CUT_TERMS = ["cut_credits", "cut_included_seconds", "cut_extra_second_credits", "cut_bed_credits", "cut_take_sound_credits_per_second",
|
|
52
|
+
"cut_music_credits"];
|
|
29
53
|
export const ownAgentTermsNow = () => ({ tariff: OWN_AGENT_TARIFF, still_credits: OWN_STILL_CREDITS, render_credits: OWN_FILM_RENDER_CREDITS,
|
|
30
54
|
included_seconds: OWN_FILM_INCLUDED_SECONDS, extra_second_credits: OWN_FILM_EXTRA_SECOND_CREDITS, voice_credits_per_second: OWN_VOICE_CREDITS_PER_SECOND,
|
|
31
|
-
pose_credits: OWN_HERO_POSE_CREDITS, edit_credits: OWN_EDIT_CREDITS,
|
|
32
|
-
free_stills_window_hours: OWN_FREE_STILLS_WINDOW_HOURS
|
|
55
|
+
pose_credits: OWN_HERO_POSE_CREDITS, edit_credits: OWN_EDIT_CREDITS, music_credits: MUSIC_BED_CREDITS, take_check_credits: OWN_TAKE_CHECK_CREDITS,
|
|
56
|
+
picture_check_credits: OWN_TAKE_CHECK_PICTURE_CREDITS, free_stills: OWN_FREE_STILLS, free_stills_window_hours: OWN_FREE_STILLS_WINDOW_HOURS, cut_credits: OWN_CUT_CREDITS, cut_included_seconds: OWN_CUT_INCLUDED_SECONDS,
|
|
57
|
+
cut_extra_second_credits: OWN_CUT_EXTRA_SECOND_CREDITS, cut_bed_credits: OWN_CUT_BED_CREDITS,
|
|
58
|
+
cut_take_sound_credits_per_second: OWN_CUT_TAKE_SOUND_CREDITS_PER_SECOND, cut_music_credits: MUSIC_BED_CREDITS });
|
|
33
59
|
export const isOwnAgentEnabled = (env) => env.CLIPWRIGHT_OWN_AGENT === "1";
|
|
34
60
|
const seconds = (s, max, what) => {
|
|
35
61
|
if (!Number.isFinite(s) || s <= 0 || s > max)
|
|
@@ -55,18 +81,30 @@ export function ownHeroCredits(n, terms = ownAgentTermsNow()) {
|
|
|
55
81
|
throw new Error("these terms price no hero pose");
|
|
56
82
|
return terms.pose_credits * n;
|
|
57
83
|
}
|
|
58
|
-
export function ownEditCredits(s, terms = ownAgentTermsNow()) {
|
|
84
|
+
export function ownEditCredits(s, terms = ownAgentTermsNow(), music = false) {
|
|
59
85
|
seconds(s, OWN_EDIT_MAX_SECONDS, "an edit");
|
|
60
86
|
if (terms.edit_credits === undefined)
|
|
61
87
|
throw new Error("these terms price no edit");
|
|
62
|
-
|
|
88
|
+
if (music && terms.music_credits === undefined)
|
|
89
|
+
throw new Error("these terms price no music");
|
|
90
|
+
return terms.edit_credits + (music ? terms.music_credits : 0);
|
|
63
91
|
}
|
|
64
|
-
export function
|
|
92
|
+
export function ownCutCredits(cut, terms = ownAgentTermsNow()) {
|
|
93
|
+
const s = seconds(cut.seconds, OWN_CUT_MAX_SECONDS, "a cut");
|
|
94
|
+
if (terms.cut_credits === undefined)
|
|
95
|
+
throw new Error("these terms price no cut");
|
|
96
|
+
if (!Number.isFinite(cut.take_sound_seconds) || cut.take_sound_seconds < 0)
|
|
97
|
+
throw new Error(`${cut.take_sound_seconds} s of take sound is not a length`);
|
|
98
|
+
return terms.cut_credits + terms.cut_extra_second_credits * Math.max(0, s - terms.cut_included_seconds) + (cut.bed ? terms.cut_bed_credits : 0)
|
|
99
|
+
+ terms.cut_take_sound_credits_per_second * Math.ceil(cut.take_sound_seconds - 1e-9) + (cut.music ? terms.cut_music_credits : 0);
|
|
100
|
+
}
|
|
101
|
+
export function ownTakeCheckCredits(n, terms = ownAgentTermsNow(), against = "motion") {
|
|
65
102
|
if (n !== 0 && n !== 1)
|
|
66
103
|
throw new Error(`${n} take verdicts is outside 0–1`);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
104
|
+
const unit = against === "picture" ? terms.picture_check_credits : terms.take_check_credits;
|
|
105
|
+
if (unit === undefined)
|
|
106
|
+
throw new Error(against === "picture" ? "these terms price no picture check" : "these terms price no take check");
|
|
107
|
+
return unit * n;
|
|
70
108
|
}
|
|
71
109
|
export function ownTakeFramesCredits(sheets) {
|
|
72
110
|
if (!Number.isSafeInteger(sheets) || sheets < 0 || sheets > OWN_TAKE_FRAMES_MAX)
|
|
@@ -74,12 +112,13 @@ export function ownTakeFramesCredits(sheets) {
|
|
|
74
112
|
return 0;
|
|
75
113
|
}
|
|
76
114
|
export function ownAgentCharge(delivery, terms, heldCredits) {
|
|
77
|
-
const charge = delivery.skill === "film_stills" ? ownStillsCredits(delivery.frames, terms, delivery.free)
|
|
115
|
+
const charge = delivery.skill === "film_stills" || delivery.skill === "film_cut_preview" ? ownStillsCredits(delivery.frames, terms, delivery.free)
|
|
78
116
|
: delivery.skill === "film_voice" ? ownVoiceCredits(delivery.seconds, terms)
|
|
79
117
|
: delivery.skill === "film_hero" ? ownHeroCredits(delivery.poses, terms)
|
|
80
|
-
: delivery.skill === "film_edit" ? ownEditCredits(delivery.seconds, terms)
|
|
118
|
+
: delivery.skill === "film_edit" ? ownEditCredits(delivery.seconds, terms, delivery.music === true)
|
|
81
119
|
: delivery.skill === "film_take_frames" ? ownTakeFramesCredits(delivery.sheets)
|
|
82
|
-
: delivery.skill === "film_take_check" ? ownTakeCheckCredits(delivery.checks, terms
|
|
120
|
+
: delivery.skill === "film_take_check" ? ownTakeCheckCredits(delivery.checks, terms, delivery.against)
|
|
121
|
+
: delivery.skill === "film_cut" ? ownCutCredits(delivery, terms) : ownFilmRenderCredits(delivery.seconds, terms);
|
|
83
122
|
if (!Number.isSafeInteger(heldCredits) || charge > heldCredits)
|
|
84
123
|
throw new Error(`${delivery.skill} charge ${charge} is over its hold ${heldCredits}`);
|
|
85
124
|
return charge;
|