@clipwright/core 0.46.0 → 0.48.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-pause-trim.d.ts +1 -0
- package/dist/ad-pause-trim.js +4 -2
- package/dist/ad-pause-trim.js.map +1 -1
- package/dist/api-failure.d.ts +2 -0
- package/dist/api-failure.js +10 -2
- package/dist/api-failure.js.map +1 -1
- package/dist/assets.d.ts +85 -0
- package/dist/assets.js +5 -0
- package/dist/assets.js.map +1 -1
- package/dist/caption-language.d.ts +3 -0
- package/dist/caption-language.js +13 -0
- package/dist/caption-language.js.map +1 -1
- package/dist/contract-dispositions.d.ts +163 -42
- package/dist/contract-dispositions.js +3 -2
- package/dist/contract-dispositions.js.map +1 -1
- package/dist/contracts/v1/workflow-brief.d.ts +472 -94
- package/dist/contracts/v1/workflow-brief.js +2 -0
- package/dist/contracts/v1/workflow-brief.js.map +1 -1
- package/dist/contracts/v1/workflow-catalog.d.ts +474 -94
- package/dist/contracts/v1/workflow-client.d.ts +253 -47
- package/dist/contracts/v1/workflow-client.js +2 -1
- package/dist/contracts/v1/workflow-client.js.map +1 -1
- package/dist/contracts/v1/workflow-execution.d.ts +41 -0
- package/dist/contracts/v1/workflow-next.d.ts +13 -0
- package/dist/contracts/v1/workflow-plan.d.ts +710 -141
- package/dist/contracts/v1/workflow-run-read.d.ts +14 -0
- package/dist/design.d.ts +2 -0
- package/dist/design.js +4 -2
- package/dist/design.js.map +1 -1
- package/dist/endpoints.js +21 -0
- package/dist/endpoints.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +8 -0
- package/dist/errors.js.map +1 -1
- package/dist/explainer-fit.d.ts +8 -2
- package/dist/explainer-fit.js +28 -5
- package/dist/explainer-fit.js.map +1 -1
- package/dist/faceless-price.d.ts +66 -2
- package/dist/faceless-price.js +66 -7
- package/dist/faceless-price.js.map +1 -1
- package/dist/faceless-public.d.ts +272 -50
- package/dist/faceless-public.js +84 -15
- package/dist/faceless-public.js.map +1 -1
- package/dist/faceless-voices.d.ts +37 -1
- package/dist/faceless-voices.js +41 -1
- package/dist/faceless-voices.js.map +1 -1
- package/dist/film-drafts.d.ts +251 -0
- package/dist/film-drafts.js +92 -0
- package/dist/film-drafts.js.map +1 -0
- package/dist/film-guide.d.ts +74 -0
- package/dist/film-guide.js +42 -0
- package/dist/film-guide.js.map +1 -0
- package/dist/film-styles.d.ts +109 -0
- package/dist/film-styles.js +29 -0
- package/dist/film-styles.js.map +1 -0
- package/dist/generation-shot.d.ts +100 -0
- package/dist/generation-shot.js +129 -0
- package/dist/generation-shot.js.map +1 -0
- package/dist/generations.d.ts +69 -3
- package/dist/generations.js +37 -3
- package/dist/generations.js.map +1 -1
- package/dist/idempotency.d.ts +3 -0
- package/dist/idempotency.js +6 -0
- package/dist/idempotency.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/mascots.d.ts +118 -0
- package/dist/mascots.js +30 -0
- package/dist/mascots.js.map +1 -0
- package/dist/music.d.ts +2 -0
- package/dist/music.js +4 -1
- package/dist/music.js.map +1 -1
- package/dist/naming.d.ts +6 -0
- package/dist/naming.js +137 -0
- package/dist/naming.js.map +1 -0
- package/dist/openapi.js +14 -0
- package/dist/openapi.js.map +1 -1
- package/dist/own-agent-price.d.ts +53 -0
- package/dist/own-agent-price.js +67 -0
- package/dist/own-agent-price.js.map +1 -0
- package/dist/own-agent-runs.d.ts +186 -0
- package/dist/own-agent-runs.js +110 -0
- package/dist/own-agent-runs.js.map +1 -0
- package/dist/prices.js +27 -10
- package/dist/prices.js.map +1 -1
- package/dist/reference-lyrics.d.ts +47 -0
- package/dist/reference-lyrics.js +39 -0
- package/dist/reference-lyrics.js.map +1 -0
- package/dist/resolved-timeline.d.ts +3 -3
- package/dist/run-static-warnings.js +4 -1
- package/dist/run-static-warnings.js.map +1 -1
- package/dist/runs.d.ts +12 -0
- package/dist/runs.js +4 -0
- package/dist/runs.js.map +1 -1
- package/dist/scene-place.d.ts +5 -2
- package/dist/scene-place.js +8 -2
- package/dist/scene-place.js.map +1 -1
- package/dist/skill-theme-explainer.d.ts +2 -0
- package/dist/skill-theme-explainer.js +64 -0
- package/dist/skill-theme-explainer.js.map +1 -0
- package/dist/skill-theme.d.ts +161 -0
- package/dist/skill-theme.js +274 -0
- package/dist/skill-theme.js.map +1 -0
- package/dist/skills.d.ts +740 -120
- package/dist/skills.js +39 -11
- package/dist/skills.js.map +1 -1
- package/dist/tts-model-languages.generated.json +10 -1
- package/dist/ugc-scenes.d.ts +9 -4
- package/dist/ugc-scenes.js +27 -3
- package/dist/ugc-scenes.js.map +1 -1
- package/dist/voice-admission.d.ts +235 -47
- package/dist/voice-catalog.generated.json +1129 -691
- package/dist/workflows/methods/faceless-explainer.d.ts +109 -0
- package/dist/workflows/methods/faceless-explainer.js +2 -2
- package/dist/workflows/methods/faceless-explainer.js.map +1 -1
- package/dist/workflows/methods/kinetic-launch.d.ts +109 -0
- package/dist/workflows/methods/product-image-story.d.ts +109 -0
- package/dist/workflows/methods/reference-remake.d.ts +109 -0
- package/dist/workflows/methods/shared.d.ts +109 -0
- package/dist/workflows/methods/ugc-faq-answer.d.ts +109 -0
- package/dist/workflows/methods/ugc-product-intro.d.ts +109 -0
- package/dist/workflows/methods/website-proof-demo.d.ts +109 -0
- package/dist/workflows/reference-remake.d.ts +57 -0
- package/dist/workflows/reference-remake.js +139 -11
- package/dist/workflows/reference-remake.js.map +1 -1
- package/dist/workflows/validate.js +1 -1
- package/dist/workflows/validate.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const FILM_DRAFTS_PATH = "/v1/film-drafts";
|
|
3
|
+
export declare const FILM_DRAFT_PATH = "/v1/film-drafts/:id";
|
|
4
|
+
export declare const FILM_DRAFT_FILES_PATH = "/v1/film-drafts/:id/files";
|
|
5
|
+
export declare const filmDraftId: z.ZodString;
|
|
6
|
+
export declare const FILM_SKILLS: readonly ["explainer"];
|
|
7
|
+
/** The scene gate's bounds, checked again where the code runs. */
|
|
8
|
+
export declare const FILM_MAX_FILES = 12, FILM_FILE_MAX_BYTES = 40000;
|
|
9
|
+
export declare const FILM_FILE_NAME: RegExp;
|
|
10
|
+
/** A draft lives this long after its last change, and an account keeps at most this many. */
|
|
11
|
+
export declare const FILM_DRAFT_TTL_DAYS = 7, FILM_DRAFTS_PER_ACCOUNT = 20;
|
|
12
|
+
export declare const FILM_MAX_CUES = 200, FILM_MAX_SFX = 400, FILM_SFX_MAX_REPEATS = 40, FILM_CAPTIONS_MAX_CHARS = 4000;
|
|
13
|
+
/** One sound event: one sound, a series (`n` × `step`), or key strokes on every word between `from` and `to`. */
|
|
14
|
+
export declare const filmSfxEvent: z.ZodObject<{
|
|
15
|
+
s: z.ZodString;
|
|
16
|
+
at: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
17
|
+
dt: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
n: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
g: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
from: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
22
|
+
to: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export type FilmSfxEvent = z.infer<typeof filmSfxEvent>;
|
|
25
|
+
export declare const createFilmDraftInput: z.ZodObject<{
|
|
26
|
+
skill: z.ZodDefault<z.ZodEnum<{
|
|
27
|
+
explainer: "explainer";
|
|
28
|
+
}>>;
|
|
29
|
+
mascot_id: z.ZodOptional<z.ZodString>;
|
|
30
|
+
language: z.ZodOptional<z.ZodString>;
|
|
31
|
+
theme_overrides: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
palette: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
34
|
+
accent_ink: z.ZodOptional<z.ZodString>;
|
|
35
|
+
background: z.ZodOptional<z.ZodString>;
|
|
36
|
+
ink: z.ZodOptional<z.ZodString>;
|
|
37
|
+
surface: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strict>>;
|
|
39
|
+
fonts: z.ZodOptional<z.ZodObject<{
|
|
40
|
+
display: z.ZodOptional<z.ZodEnum<{
|
|
41
|
+
Bangers: "Bangers";
|
|
42
|
+
"Bebas Neue": "Bebas Neue";
|
|
43
|
+
Bungee: "Bungee";
|
|
44
|
+
Caveat: "Caveat";
|
|
45
|
+
Inter: "Inter";
|
|
46
|
+
Montserrat: "Montserrat";
|
|
47
|
+
Oswald: "Oswald";
|
|
48
|
+
"PT Sans": "PT Sans";
|
|
49
|
+
"Permanent Marker": "Permanent Marker";
|
|
50
|
+
"Plus Jakarta Sans": "Plus Jakarta Sans";
|
|
51
|
+
Roboto: "Roboto";
|
|
52
|
+
"Titan One": "Titan One";
|
|
53
|
+
}>>;
|
|
54
|
+
body: z.ZodOptional<z.ZodEnum<{
|
|
55
|
+
Bangers: "Bangers";
|
|
56
|
+
"Bebas Neue": "Bebas Neue";
|
|
57
|
+
Bungee: "Bungee";
|
|
58
|
+
Caveat: "Caveat";
|
|
59
|
+
Inter: "Inter";
|
|
60
|
+
Montserrat: "Montserrat";
|
|
61
|
+
Oswald: "Oswald";
|
|
62
|
+
"PT Sans": "PT Sans";
|
|
63
|
+
"Permanent Marker": "Permanent Marker";
|
|
64
|
+
"Plus Jakarta Sans": "Plus Jakarta Sans";
|
|
65
|
+
Roboto: "Roboto";
|
|
66
|
+
"Titan One": "Titan One";
|
|
67
|
+
}>>;
|
|
68
|
+
}, z.core.$strict>>;
|
|
69
|
+
variation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
70
|
+
}, z.core.$strict>>;
|
|
71
|
+
style: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
anime: "anime";
|
|
73
|
+
bricks: "bricks";
|
|
74
|
+
cel80s: "cel80s";
|
|
75
|
+
clay: "clay";
|
|
76
|
+
claymation: "claymation";
|
|
77
|
+
comic: "comic";
|
|
78
|
+
diorama: "diorama";
|
|
79
|
+
isle: "isle";
|
|
80
|
+
lowpoly: "lowpoly";
|
|
81
|
+
paper: "paper";
|
|
82
|
+
pixel: "pixel";
|
|
83
|
+
popup: "popup";
|
|
84
|
+
ps2: "ps2";
|
|
85
|
+
riso: "riso";
|
|
86
|
+
watercolor: "watercolor";
|
|
87
|
+
}>>;
|
|
88
|
+
}, z.core.$strict>;
|
|
89
|
+
export type CreateFilmDraftInput = z.infer<typeof createFilmDraftInput>;
|
|
90
|
+
export declare const putFilmFilesInput: z.ZodObject<{
|
|
91
|
+
base_revision: z.ZodNumber;
|
|
92
|
+
files: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
|
|
93
|
+
cues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
94
|
+
sfx: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
95
|
+
s: z.ZodString;
|
|
96
|
+
at: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
97
|
+
dt: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
n: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
g: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
from: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
102
|
+
to: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
103
|
+
}, z.core.$strict>>>;
|
|
104
|
+
captions: z.ZodOptional<z.ZodString>;
|
|
105
|
+
beats: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
106
|
+
subject: z.ZodEnum<{
|
|
107
|
+
coil_in: "coil_in";
|
|
108
|
+
coil_soak: "coil_soak";
|
|
109
|
+
comp_squeeze: "comp_squeeze";
|
|
110
|
+
comp_travel: "comp_travel";
|
|
111
|
+
fan_blow: "fan_blow";
|
|
112
|
+
fan_cool: "fan_cool";
|
|
113
|
+
finale: "finale";
|
|
114
|
+
"green-fruit": "green-fruit";
|
|
115
|
+
heat_away: "heat_away";
|
|
116
|
+
hook_cold: "hook_cold";
|
|
117
|
+
hook_heat: "hook_heat";
|
|
118
|
+
hook_how: "hook_how";
|
|
119
|
+
ice: "ice";
|
|
120
|
+
loop: "loop";
|
|
121
|
+
low: "low";
|
|
122
|
+
out_coil: "out_coil";
|
|
123
|
+
"plant-seed": "plant-seed";
|
|
124
|
+
pressure: "pressure";
|
|
125
|
+
salad: "salad";
|
|
126
|
+
same_loop: "same_loop";
|
|
127
|
+
seed: "seed";
|
|
128
|
+
sprout: "sprout";
|
|
129
|
+
stake: "stake";
|
|
130
|
+
sun: "sun";
|
|
131
|
+
to_liquid: "to_liquid";
|
|
132
|
+
tomato: "tomato";
|
|
133
|
+
transplant: "transplant";
|
|
134
|
+
valve: "valve";
|
|
135
|
+
water: "water";
|
|
136
|
+
}>;
|
|
137
|
+
line: z.ZodString;
|
|
138
|
+
at: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
139
|
+
}, z.core.$strict>>>;
|
|
140
|
+
}, z.core.$strict>;
|
|
141
|
+
export type PutFilmFilesInput = z.infer<typeof putFilmFilesInput>;
|
|
142
|
+
export declare const filmDraft: z.ZodObject<{
|
|
143
|
+
draft_id: z.ZodString;
|
|
144
|
+
skill: z.ZodEnum<{
|
|
145
|
+
explainer: "explainer";
|
|
146
|
+
}>;
|
|
147
|
+
revision: z.ZodNumber;
|
|
148
|
+
theme: z.ZodObject<{
|
|
149
|
+
version: z.ZodLiteral<1>;
|
|
150
|
+
tokens: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
151
|
+
fonts: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
152
|
+
variation: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
153
|
+
hero: z.ZodEnum<{
|
|
154
|
+
atlas_9: "atlas_9";
|
|
155
|
+
none: "none";
|
|
156
|
+
vector: "vector";
|
|
157
|
+
}>;
|
|
158
|
+
logo: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodArray<z.ZodEnum<{
|
|
159
|
+
corner: "corner";
|
|
160
|
+
end_card: "end_card";
|
|
161
|
+
in_scene: "in_scene";
|
|
162
|
+
}>>]>;
|
|
163
|
+
source: z.ZodEnum<{
|
|
164
|
+
brand_kit: "brand_kit";
|
|
165
|
+
kit: "kit";
|
|
166
|
+
overrides: "overrides";
|
|
167
|
+
}>;
|
|
168
|
+
warnings: z.ZodArray<z.ZodString>;
|
|
169
|
+
}, z.core.$strict>;
|
|
170
|
+
theme_sha256: z.ZodString;
|
|
171
|
+
mascot_id: z.ZodNullable<z.ZodString>;
|
|
172
|
+
language: z.ZodNullable<z.ZodString>;
|
|
173
|
+
files: z.ZodArray<z.ZodObject<{
|
|
174
|
+
name: z.ZodString;
|
|
175
|
+
bytes: z.ZodNumber;
|
|
176
|
+
}, z.core.$strict>>;
|
|
177
|
+
cues: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
178
|
+
sfx: z.ZodArray<z.ZodObject<{
|
|
179
|
+
s: z.ZodString;
|
|
180
|
+
at: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
181
|
+
dt: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
n: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
g: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
from: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
186
|
+
to: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
187
|
+
}, z.core.$strict>>;
|
|
188
|
+
captions: z.ZodNullable<z.ZodString>;
|
|
189
|
+
style: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
190
|
+
anime: "anime";
|
|
191
|
+
bricks: "bricks";
|
|
192
|
+
cel80s: "cel80s";
|
|
193
|
+
clay: "clay";
|
|
194
|
+
claymation: "claymation";
|
|
195
|
+
comic: "comic";
|
|
196
|
+
diorama: "diorama";
|
|
197
|
+
isle: "isle";
|
|
198
|
+
lowpoly: "lowpoly";
|
|
199
|
+
paper: "paper";
|
|
200
|
+
pixel: "pixel";
|
|
201
|
+
popup: "popup";
|
|
202
|
+
ps2: "ps2";
|
|
203
|
+
riso: "riso";
|
|
204
|
+
watercolor: "watercolor";
|
|
205
|
+
}>>>;
|
|
206
|
+
beats: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
207
|
+
subject: z.ZodEnum<{
|
|
208
|
+
coil_in: "coil_in";
|
|
209
|
+
coil_soak: "coil_soak";
|
|
210
|
+
comp_squeeze: "comp_squeeze";
|
|
211
|
+
comp_travel: "comp_travel";
|
|
212
|
+
fan_blow: "fan_blow";
|
|
213
|
+
fan_cool: "fan_cool";
|
|
214
|
+
finale: "finale";
|
|
215
|
+
"green-fruit": "green-fruit";
|
|
216
|
+
heat_away: "heat_away";
|
|
217
|
+
hook_cold: "hook_cold";
|
|
218
|
+
hook_heat: "hook_heat";
|
|
219
|
+
hook_how: "hook_how";
|
|
220
|
+
ice: "ice";
|
|
221
|
+
loop: "loop";
|
|
222
|
+
low: "low";
|
|
223
|
+
out_coil: "out_coil";
|
|
224
|
+
"plant-seed": "plant-seed";
|
|
225
|
+
pressure: "pressure";
|
|
226
|
+
salad: "salad";
|
|
227
|
+
same_loop: "same_loop";
|
|
228
|
+
seed: "seed";
|
|
229
|
+
sprout: "sprout";
|
|
230
|
+
stake: "stake";
|
|
231
|
+
sun: "sun";
|
|
232
|
+
to_liquid: "to_liquid";
|
|
233
|
+
tomato: "tomato";
|
|
234
|
+
transplant: "transplant";
|
|
235
|
+
valve: "valve";
|
|
236
|
+
water: "water";
|
|
237
|
+
}>;
|
|
238
|
+
line: z.ZodString;
|
|
239
|
+
at: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
240
|
+
}, z.core.$strict>>>;
|
|
241
|
+
warnings: z.ZodArray<z.ZodString>;
|
|
242
|
+
created_at: z.ZodString;
|
|
243
|
+
expires_at: z.ZodString;
|
|
244
|
+
}, z.core.$strict>;
|
|
245
|
+
export type FilmDraft = z.infer<typeof filmDraft>;
|
|
246
|
+
/** The draft's files after a patch, or the sentences saying why the patch is refused. Bytes are UTF-8, as the gate counts them. */
|
|
247
|
+
export declare function patchFilmFiles(current: Readonly<Record<string, string>>, patch: Readonly<Record<string, string | null>>): {
|
|
248
|
+
files: Record<string, string>;
|
|
249
|
+
} | {
|
|
250
|
+
refusals: string[];
|
|
251
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { assetId } from "./asset-identity.js";
|
|
3
|
+
import { FILM_MAX_BEATS, FILM_STYLES, filmBeat } from "./film-styles.js";
|
|
4
|
+
import { resolvedSkillTheme, skillThemeOverrides } from "./skill-theme.js";
|
|
5
|
+
// A film draft of the «own agent» mode (#1291 F2): your agent keeps its scene files, anchors and sound events here between calls, under the
|
|
6
|
+
// brand theme frozen when the draft was made. Stills and the render read a revision of it; the draft itself is free.
|
|
7
|
+
export const FILM_DRAFTS_PATH = "/v1/film-drafts";
|
|
8
|
+
export const FILM_DRAFT_PATH = "/v1/film-drafts/:id";
|
|
9
|
+
export const FILM_DRAFT_FILES_PATH = "/v1/film-drafts/:id/files";
|
|
10
|
+
export const filmDraftId = z.string().regex(/^fdr_[a-f0-9]{32}$/);
|
|
11
|
+
export const FILM_SKILLS = ["explainer"];
|
|
12
|
+
/** The scene gate's bounds, checked again where the code runs. */
|
|
13
|
+
export const FILM_MAX_FILES = 12, FILM_FILE_MAX_BYTES = 40_000;
|
|
14
|
+
export const FILM_FILE_NAME = /^[A-Za-z][\w-]{0,40}\.tsx?$/;
|
|
15
|
+
/** A draft lives this long after its last change, and an account keeps at most this many. */
|
|
16
|
+
export const FILM_DRAFT_TTL_DAYS = 7, FILM_DRAFTS_PER_ACCOUNT = 20;
|
|
17
|
+
export const FILM_MAX_CUES = 200, FILM_MAX_SFX = 400, FILM_SFX_MAX_REPEATS = 40, FILM_CAPTIONS_MAX_CHARS = 4000;
|
|
18
|
+
const ANCHOR = z.string().regex(/^[A-Za-z_]\w{0,40}$/, "an anchor is an identifier");
|
|
19
|
+
const moment = z.union([ANCHOR, z.number().min(0).max(600)]);
|
|
20
|
+
/** One sound event: one sound, a series (`n` × `step`), or key strokes on every word between `from` and `to`. */
|
|
21
|
+
export const filmSfxEvent = z.strictObject({
|
|
22
|
+
s: z.string().min(1).max(80).describe("A built-in sound (thud pop tick click key swish whoosh marker stamp ding confetti popper rise) or one named in words"),
|
|
23
|
+
at: moment.optional(), dt: z.number().min(-5).max(5).optional(),
|
|
24
|
+
n: z.number().int().min(1).max(FILM_SFX_MAX_REPEATS).optional(), step: z.number().min(0).max(2).optional(),
|
|
25
|
+
g: z.number().min(0).max(3).optional(),
|
|
26
|
+
from: moment.optional(), to: moment.optional(),
|
|
27
|
+
}).refine(e => e.at !== undefined || e.from !== undefined || e.to !== undefined, "an event has `at`, or both `from` and `to`")
|
|
28
|
+
.refine(e => (e.from === undefined) === (e.to === undefined), "`from` and `to` come together")
|
|
29
|
+
.refine(e => !(e.at !== undefined && e.from !== undefined), "an event has `at` or `from`/`to`, not both");
|
|
30
|
+
export const createFilmDraftInput = z.strictObject({
|
|
31
|
+
skill: z.enum(FILM_SKILLS).default("explainer"),
|
|
32
|
+
mascot_id: assetId.optional().describe("A saved mascot (list_assets with mascot true) as the film's hero; the brand kit's when omitted"),
|
|
33
|
+
language: z.string().regex(/^[a-z]{2}$/).optional().describe("The script's language (ISO 639-1); a brand face without its letters keeps the kit's"),
|
|
34
|
+
theme_overrides: skillThemeOverrides.optional().describe("Palette roles, faces or variation over the brand kit, for this film only"),
|
|
35
|
+
style: z.enum(FILM_STYLES).optional()
|
|
36
|
+
.describe("A drawn style: the film is drawn from the draft's beats in this style and the brand's colours, not from scene files"),
|
|
37
|
+
});
|
|
38
|
+
export const putFilmFilesInput = z.strictObject({
|
|
39
|
+
base_revision: z.number().int().min(0).describe("The revision these changes apply to; a stale one is refused with 409"),
|
|
40
|
+
files: z.record(z.string(), z.string().max(FILM_FILE_MAX_BYTES).nullable()).default({})
|
|
41
|
+
.describe("Scene files by name (Movie.tsx, ch1.tsx…): text replaces the file, null deletes it, an omitted file stays"),
|
|
42
|
+
cues: z.record(ANCHOR, z.number().min(0).max(600)).optional()
|
|
43
|
+
.describe("Every anchor the scenes read, in seconds; when sent, replaces the draft's anchors; omitted, the draft's stay"),
|
|
44
|
+
sfx: z.array(filmSfxEvent).max(FILM_MAX_SFX).optional().describe("The sound events; when sent, replaces the draft's; omitted, the draft's stay"),
|
|
45
|
+
captions: z.string().max(FILM_CAPTIONS_MAX_CHARS).optional()
|
|
46
|
+
.describe("One caption phrase per line, *word* the phrase's accent; when sent, replaces the draft's; omitted, the draft's stay"),
|
|
47
|
+
beats: z.array(filmBeat).min(1).max(FILM_MAX_BEATS).optional()
|
|
48
|
+
.describe("A styled draft's beats in order, each drawn until the next starts; replaces the draft's"),
|
|
49
|
+
});
|
|
50
|
+
export const filmDraft = z.strictObject({
|
|
51
|
+
draft_id: filmDraftId,
|
|
52
|
+
skill: z.enum(FILM_SKILLS),
|
|
53
|
+
revision: z.number().int().min(0),
|
|
54
|
+
theme: resolvedSkillTheme,
|
|
55
|
+
theme_sha256: z.string().regex(/^[a-f0-9]{64}$/),
|
|
56
|
+
mascot_id: assetId.nullable(),
|
|
57
|
+
language: z.string().nullable(),
|
|
58
|
+
files: z.array(z.strictObject({ name: z.string(), bytes: z.number().int().min(0) })),
|
|
59
|
+
cues: z.record(z.string(), z.number()),
|
|
60
|
+
sfx: z.array(filmSfxEvent),
|
|
61
|
+
captions: z.string().nullable(),
|
|
62
|
+
// An answer from before styled drafts (#1338) carries neither: a draft of scene files.
|
|
63
|
+
style: z.enum(FILM_STYLES).nullable().default(null),
|
|
64
|
+
beats: z.array(filmBeat).default([]),
|
|
65
|
+
warnings: z.array(z.string()),
|
|
66
|
+
created_at: z.string(),
|
|
67
|
+
expires_at: z.string(),
|
|
68
|
+
});
|
|
69
|
+
/** The draft's files after a patch, or the sentences saying why the patch is refused. Bytes are UTF-8, as the gate counts them. */
|
|
70
|
+
export function patchFilmFiles(current, patch) {
|
|
71
|
+
const refusals = [], files = { ...current };
|
|
72
|
+
for (const [name, text] of Object.entries(patch)) {
|
|
73
|
+
if (!FILM_FILE_NAME.test(name)) {
|
|
74
|
+
refusals.push(`${name}: a file name is a letter, then letters, digits, - or _, ending .ts or .tsx`);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if (text === null) {
|
|
78
|
+
delete files[name];
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const bytes = new TextEncoder().encode(text).length;
|
|
82
|
+
if (bytes > FILM_FILE_MAX_BYTES) {
|
|
83
|
+
refusals.push(`${name}: ${bytes} bytes is over ${FILM_FILE_MAX_BYTES}`);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
files[name] = text;
|
|
87
|
+
}
|
|
88
|
+
if (Object.keys(files).length > FILM_MAX_FILES)
|
|
89
|
+
refusals.push(`the film would hold ${Object.keys(files).length} files, over ${FILM_MAX_FILES}`);
|
|
90
|
+
return refusals.length ? { refusals } : { files };
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=film-drafts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"film-drafts.js","sourceRoot":"","sources":["../src/film-drafts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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C;YAAC,SAAS;QAAC,CAAC;QACvH,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACrB,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,cAAc;QAAE,QAAQ,CAAC,IAAI,CAAC,uBAAuB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,gBAAgB,cAAc,EAAE,CAAC,CAAC;IAChJ,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const FILM_GUIDE_PATH = "/v1/film-guide";
|
|
3
|
+
export declare const FILM_KIT_PATH = "/v1/film-kit";
|
|
4
|
+
/** The kit files an agent reads, relative to the kit's root, in reading order: the module a film imports, the drawers behind it, the film
|
|
5
|
+
* frame, then the reference film. */
|
|
6
|
+
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/Film.tsx", "src/types.ts", "src/theme.ts", "src/hero/HeroSticker.tsx", "films/espresso-hit/Movie.tsx", "films/espresso-hit/scenes.tsx"];
|
|
7
|
+
export type FilmKitFile = (typeof FILM_KIT_FILES)[number];
|
|
8
|
+
/** The most kept sounds the guide names, as many as the hosted writer is shown. */
|
|
9
|
+
export declare const FILM_KEPT_SOUNDS_MAX = 60;
|
|
10
|
+
export declare const filmGuide: z.ZodObject<{
|
|
11
|
+
guide: z.ZodString;
|
|
12
|
+
method: z.ZodString;
|
|
13
|
+
kit_version: z.ZodString;
|
|
14
|
+
kit_files: z.ZodArray<z.ZodObject<{
|
|
15
|
+
path: z.ZodEnum<{
|
|
16
|
+
"films/espresso-hit/Movie.tsx": "films/espresso-hit/Movie.tsx";
|
|
17
|
+
"films/espresso-hit/scenes.tsx": "films/espresso-hit/scenes.tsx";
|
|
18
|
+
"index.ts": "index.ts";
|
|
19
|
+
"src/Film.tsx": "src/Film.tsx";
|
|
20
|
+
"src/hero/HeroSticker.tsx": "src/hero/HeroSticker.tsx";
|
|
21
|
+
"src/lib/frame.tsx": "src/lib/frame.tsx";
|
|
22
|
+
"src/lib/marks.tsx": "src/lib/marks.tsx";
|
|
23
|
+
"src/lib/motion.ts": "src/lib/motion.ts";
|
|
24
|
+
"src/lib/objects.tsx": "src/lib/objects.tsx";
|
|
25
|
+
"src/lib/product.tsx": "src/lib/product.tsx";
|
|
26
|
+
"src/lib/ui.tsx": "src/lib/ui.tsx";
|
|
27
|
+
"src/theme.ts": "src/theme.ts";
|
|
28
|
+
"src/types.ts": "src/types.ts";
|
|
29
|
+
}>;
|
|
30
|
+
bytes: z.ZodNumber;
|
|
31
|
+
}, z.core.$strict>>;
|
|
32
|
+
kept_sounds: z.ZodArray<z.ZodString>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
export type FilmGuide = z.infer<typeof filmGuide>;
|
|
35
|
+
export declare const filmKitQuery: z.ZodObject<{
|
|
36
|
+
path: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
"films/espresso-hit/Movie.tsx": "films/espresso-hit/Movie.tsx";
|
|
38
|
+
"films/espresso-hit/scenes.tsx": "films/espresso-hit/scenes.tsx";
|
|
39
|
+
"index.ts": "index.ts";
|
|
40
|
+
"src/Film.tsx": "src/Film.tsx";
|
|
41
|
+
"src/hero/HeroSticker.tsx": "src/hero/HeroSticker.tsx";
|
|
42
|
+
"src/lib/frame.tsx": "src/lib/frame.tsx";
|
|
43
|
+
"src/lib/marks.tsx": "src/lib/marks.tsx";
|
|
44
|
+
"src/lib/motion.ts": "src/lib/motion.ts";
|
|
45
|
+
"src/lib/objects.tsx": "src/lib/objects.tsx";
|
|
46
|
+
"src/lib/product.tsx": "src/lib/product.tsx";
|
|
47
|
+
"src/lib/ui.tsx": "src/lib/ui.tsx";
|
|
48
|
+
"src/theme.ts": "src/theme.ts";
|
|
49
|
+
"src/types.ts": "src/types.ts";
|
|
50
|
+
}>>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
export type FilmKitQuery = z.infer<typeof filmKitQuery>;
|
|
53
|
+
export declare const filmKit: z.ZodObject<{
|
|
54
|
+
kit_version: z.ZodString;
|
|
55
|
+
files: z.ZodArray<z.ZodObject<{
|
|
56
|
+
path: z.ZodEnum<{
|
|
57
|
+
"films/espresso-hit/Movie.tsx": "films/espresso-hit/Movie.tsx";
|
|
58
|
+
"films/espresso-hit/scenes.tsx": "films/espresso-hit/scenes.tsx";
|
|
59
|
+
"index.ts": "index.ts";
|
|
60
|
+
"src/Film.tsx": "src/Film.tsx";
|
|
61
|
+
"src/hero/HeroSticker.tsx": "src/hero/HeroSticker.tsx";
|
|
62
|
+
"src/lib/frame.tsx": "src/lib/frame.tsx";
|
|
63
|
+
"src/lib/marks.tsx": "src/lib/marks.tsx";
|
|
64
|
+
"src/lib/motion.ts": "src/lib/motion.ts";
|
|
65
|
+
"src/lib/objects.tsx": "src/lib/objects.tsx";
|
|
66
|
+
"src/lib/product.tsx": "src/lib/product.tsx";
|
|
67
|
+
"src/lib/ui.tsx": "src/lib/ui.tsx";
|
|
68
|
+
"src/theme.ts": "src/theme.ts";
|
|
69
|
+
"src/types.ts": "src/types.ts";
|
|
70
|
+
}>;
|
|
71
|
+
text: z.ZodString;
|
|
72
|
+
}, z.core.$strict>>;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
export type FilmKit = z.infer<typeof filmKit>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// The «own agent» explainer's guide and scene kit, served read-only (#1356): the guide a customer's agent writes its film from, its method
|
|
3
|
+
// appendix, and the kit's sources with a reference film, so the agent reads the props it draws with instead of guessing them.
|
|
4
|
+
export const FILM_GUIDE_PATH = "/v1/film-guide";
|
|
5
|
+
export const FILM_KIT_PATH = "/v1/film-kit";
|
|
6
|
+
/** The kit files an agent reads, relative to the kit's root, in reading order: the module a film imports, the drawers behind it, the film
|
|
7
|
+
* frame, then the reference film. */
|
|
8
|
+
export const FILM_KIT_FILES = [
|
|
9
|
+
"index.ts",
|
|
10
|
+
"src/lib/motion.ts",
|
|
11
|
+
"src/lib/frame.tsx",
|
|
12
|
+
"src/lib/marks.tsx",
|
|
13
|
+
"src/lib/ui.tsx",
|
|
14
|
+
"src/lib/objects.tsx",
|
|
15
|
+
"src/lib/product.tsx",
|
|
16
|
+
"src/Film.tsx",
|
|
17
|
+
"src/types.ts",
|
|
18
|
+
"src/theme.ts",
|
|
19
|
+
"src/hero/HeroSticker.tsx",
|
|
20
|
+
"films/espresso-hit/Movie.tsx",
|
|
21
|
+
"films/espresso-hit/scenes.tsx",
|
|
22
|
+
];
|
|
23
|
+
/** The most kept sounds the guide names, as many as the hosted writer is shown. */
|
|
24
|
+
export const FILM_KEPT_SOUNDS_MAX = 60;
|
|
25
|
+
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");
|
|
26
|
+
export const filmGuide = z.strictObject({
|
|
27
|
+
guide: z.string().min(1).describe("The explainer guide, Markdown: the steps, the tools and routes, the rules the checks refuse"),
|
|
28
|
+
method: z.string().min(1).describe("Its appendix, Markdown: the craft behind every step"),
|
|
29
|
+
kit_version: kitVersion,
|
|
30
|
+
kit_files: z.array(z.strictObject({ path: z.enum(FILM_KIT_FILES), bytes: z.number().int().positive() }))
|
|
31
|
+
.describe("The scene kit's files get_film_kit serves, in reading order"),
|
|
32
|
+
kept_sounds: z.array(z.string()).max(FILM_KEPT_SOUNDS_MAX)
|
|
33
|
+
.describe("Sounds your account's films made and kept, newest first: name one exactly in sfx and it plays again, made nothing new"),
|
|
34
|
+
});
|
|
35
|
+
export const filmKitQuery = z.strictObject({
|
|
36
|
+
path: z.enum(FILM_KIT_FILES).optional().describe("One kit file; every file when omitted"),
|
|
37
|
+
});
|
|
38
|
+
export const filmKit = z.strictObject({
|
|
39
|
+
kit_version: kitVersion,
|
|
40
|
+
files: z.array(z.strictObject({ path: z.enum(FILM_KIT_FILES), text: z.string() })),
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=film-guide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"film-guide.js","sourceRoot":"","sources":["../src/film-guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,2IAA2I;AAC3I,8HAA8H;AAE9H,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAChD,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAC;AAE5C;sCACsC;AACtC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU;IACV,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,gBAAgB;IAChB,qBAAqB;IACrB,qBAAqB;IACrB,cAAc;IACd,cAAc;IACd,cAAc;IACd,0BAA0B;IAC1B,8BAA8B;IAC9B,+BAA+B;CACvB,CAAC;AAGX,mFAAmF;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,MAAM,UAAU,GAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,+EAA+E,CAAC,CAAC;AAE/I,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,CAAC;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6FAA6F,CAAC;IAChI,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qDAAqD,CAAC;IACzF,WAAW,EAAE,UAAU;IACvB,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;SACrG,QAAQ,CAAC,6DAA6D,CAAC;IAC1E,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC;SACvD,QAAQ,CAAC,uHAAuH,CAAC;CACrI,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;CAC1F,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,YAAY,CAAC;IACpC,WAAW,EAAE,UAAU;IACvB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;CACnF,CAAC,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const FILM_STYLES: readonly ["pixel", "ps2", "comic", "bricks", "clay", "paper", "anime", "lowpoly", "riso", "diorama", "popup", "claymation", "watercolor", "isle", "cel80s"];
|
|
3
|
+
export type FilmStyle = (typeof FILM_STYLES)[number];
|
|
4
|
+
/** What a style can draw: one subject a beat. */
|
|
5
|
+
export declare const FILM_STYLE_SUBJECTS: readonly ["seed", "plant-seed", "water", "sun", "sprout", "transplant", "stake", "green-fruit", "tomato", "salad", "hook_cold", "hook_heat", "hook_how", "loop", "low", "coil_in", "coil_soak", "fan_blow", "fan_cool", "comp_travel", "comp_squeeze", "out_coil", "heat_away", "to_liquid", "valve", "pressure", "ice", "same_loop", "finale"];
|
|
6
|
+
/** A styled film's bounds: beats, a beat's length and the film's, as the style runtime takes them. */
|
|
7
|
+
export declare const FILM_MAX_BEATS = 40, FILM_BEAT_MIN_SEC = 0.5, FILM_BEAT_MAX_SEC = 20, FILM_STYLED_MAX_SEC = 90, FILM_BEAT_LINE_MAX_CHARS = 160;
|
|
8
|
+
/** One beat: the subject drawn, the line shown, and when it starts (an anchor of the draft's cues, or seconds); it lasts until the next. */
|
|
9
|
+
export declare const filmBeat: z.ZodObject<{
|
|
10
|
+
subject: z.ZodEnum<{
|
|
11
|
+
coil_in: "coil_in";
|
|
12
|
+
coil_soak: "coil_soak";
|
|
13
|
+
comp_squeeze: "comp_squeeze";
|
|
14
|
+
comp_travel: "comp_travel";
|
|
15
|
+
fan_blow: "fan_blow";
|
|
16
|
+
fan_cool: "fan_cool";
|
|
17
|
+
finale: "finale";
|
|
18
|
+
"green-fruit": "green-fruit";
|
|
19
|
+
heat_away: "heat_away";
|
|
20
|
+
hook_cold: "hook_cold";
|
|
21
|
+
hook_heat: "hook_heat";
|
|
22
|
+
hook_how: "hook_how";
|
|
23
|
+
ice: "ice";
|
|
24
|
+
loop: "loop";
|
|
25
|
+
low: "low";
|
|
26
|
+
out_coil: "out_coil";
|
|
27
|
+
"plant-seed": "plant-seed";
|
|
28
|
+
pressure: "pressure";
|
|
29
|
+
salad: "salad";
|
|
30
|
+
same_loop: "same_loop";
|
|
31
|
+
seed: "seed";
|
|
32
|
+
sprout: "sprout";
|
|
33
|
+
stake: "stake";
|
|
34
|
+
sun: "sun";
|
|
35
|
+
to_liquid: "to_liquid";
|
|
36
|
+
tomato: "tomato";
|
|
37
|
+
transplant: "transplant";
|
|
38
|
+
valve: "valve";
|
|
39
|
+
water: "water";
|
|
40
|
+
}>;
|
|
41
|
+
line: z.ZodString;
|
|
42
|
+
at: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
export type FilmBeat = z.infer<typeof filmBeat>;
|
|
45
|
+
/** What a styled draft keeps beside its theme: the style, the brand roles the brand or the call chose (none: the style's own colours), the
|
|
46
|
+
* account's seed for the style's variation, and the beats. */
|
|
47
|
+
export declare const filmDraftCanvas: z.ZodObject<{
|
|
48
|
+
style: z.ZodEnum<{
|
|
49
|
+
anime: "anime";
|
|
50
|
+
bricks: "bricks";
|
|
51
|
+
cel80s: "cel80s";
|
|
52
|
+
clay: "clay";
|
|
53
|
+
claymation: "claymation";
|
|
54
|
+
comic: "comic";
|
|
55
|
+
diorama: "diorama";
|
|
56
|
+
isle: "isle";
|
|
57
|
+
lowpoly: "lowpoly";
|
|
58
|
+
paper: "paper";
|
|
59
|
+
pixel: "pixel";
|
|
60
|
+
popup: "popup";
|
|
61
|
+
ps2: "ps2";
|
|
62
|
+
riso: "riso";
|
|
63
|
+
watercolor: "watercolor";
|
|
64
|
+
}>;
|
|
65
|
+
roles: z.ZodObject<{
|
|
66
|
+
background: z.ZodOptional<z.ZodString>;
|
|
67
|
+
surface: z.ZodOptional<z.ZodString>;
|
|
68
|
+
ink: z.ZodOptional<z.ZodString>;
|
|
69
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
70
|
+
accent_ink: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
seed: z.ZodNumber;
|
|
73
|
+
beats: z.ZodArray<z.ZodObject<{
|
|
74
|
+
subject: z.ZodEnum<{
|
|
75
|
+
coil_in: "coil_in";
|
|
76
|
+
coil_soak: "coil_soak";
|
|
77
|
+
comp_squeeze: "comp_squeeze";
|
|
78
|
+
comp_travel: "comp_travel";
|
|
79
|
+
fan_blow: "fan_blow";
|
|
80
|
+
fan_cool: "fan_cool";
|
|
81
|
+
finale: "finale";
|
|
82
|
+
"green-fruit": "green-fruit";
|
|
83
|
+
heat_away: "heat_away";
|
|
84
|
+
hook_cold: "hook_cold";
|
|
85
|
+
hook_heat: "hook_heat";
|
|
86
|
+
hook_how: "hook_how";
|
|
87
|
+
ice: "ice";
|
|
88
|
+
loop: "loop";
|
|
89
|
+
low: "low";
|
|
90
|
+
out_coil: "out_coil";
|
|
91
|
+
"plant-seed": "plant-seed";
|
|
92
|
+
pressure: "pressure";
|
|
93
|
+
salad: "salad";
|
|
94
|
+
same_loop: "same_loop";
|
|
95
|
+
seed: "seed";
|
|
96
|
+
sprout: "sprout";
|
|
97
|
+
stake: "stake";
|
|
98
|
+
sun: "sun";
|
|
99
|
+
to_liquid: "to_liquid";
|
|
100
|
+
tomato: "tomato";
|
|
101
|
+
transplant: "transplant";
|
|
102
|
+
valve: "valve";
|
|
103
|
+
water: "water";
|
|
104
|
+
}>;
|
|
105
|
+
line: z.ZodString;
|
|
106
|
+
at: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
107
|
+
}, z.core.$strict>>;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
export type FilmDraftCanvas = z.infer<typeof filmDraftCanvas>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// The drawn styles a film draft may name (#1338): each draws the whole film from the draft's beats, in the draft's brand colours, instead of
|
|
3
|
+
// the draft's scene code. A test holds these names equal to the styles and subjects the render site carries.
|
|
4
|
+
export const FILM_STYLES = ["pixel", "ps2", "comic", "bricks", "clay", "paper", "anime", "lowpoly", "riso", "diorama",
|
|
5
|
+
"popup", "claymation", "watercolor", "isle", "cel80s"];
|
|
6
|
+
/** What a style can draw: one subject a beat. */
|
|
7
|
+
export const FILM_STYLE_SUBJECTS = ["seed", "plant-seed", "water", "sun", "sprout", "transplant", "stake", "green-fruit", "tomato", "salad",
|
|
8
|
+
"hook_cold", "hook_heat", "hook_how", "loop", "low", "coil_in", "coil_soak", "fan_blow", "fan_cool", "comp_travel", "comp_squeeze", "out_coil",
|
|
9
|
+
"heat_away", "to_liquid", "valve", "pressure", "ice", "same_loop", "finale"];
|
|
10
|
+
/** A styled film's bounds: beats, a beat's length and the film's, as the style runtime takes them. */
|
|
11
|
+
export const FILM_MAX_BEATS = 40, FILM_BEAT_MIN_SEC = 0.5, FILM_BEAT_MAX_SEC = 20, FILM_STYLED_MAX_SEC = 90, FILM_BEAT_LINE_MAX_CHARS = 160;
|
|
12
|
+
const ANCHOR = z.string().regex(/^[A-Za-z_]\w{0,40}$/, "an anchor is an identifier");
|
|
13
|
+
/** One beat: the subject drawn, the line shown, and when it starts (an anchor of the draft's cues, or seconds); it lasts until the next. */
|
|
14
|
+
export const filmBeat = z.strictObject({
|
|
15
|
+
subject: z.enum(FILM_STYLE_SUBJECTS).describe("What the style draws on this beat"),
|
|
16
|
+
line: z.string().trim().min(1).max(FILM_BEAT_LINE_MAX_CHARS).describe("The words shown on this beat"),
|
|
17
|
+
at: z.union([ANCHOR, z.number().min(0).max(600)]).describe("When the beat starts: an anchor of the draft's cues or seconds; the first starts the film"),
|
|
18
|
+
});
|
|
19
|
+
const ROLE = z.string().regex(/^#[0-9a-fA-F]{6}$/);
|
|
20
|
+
/** What a styled draft keeps beside its theme: the style, the brand roles the brand or the call chose (none: the style's own colours), the
|
|
21
|
+
* account's seed for the style's variation, and the beats. */
|
|
22
|
+
export const filmDraftCanvas = z.strictObject({
|
|
23
|
+
style: z.enum(FILM_STYLES),
|
|
24
|
+
roles: z.strictObject({ background: ROLE.optional(), surface: ROLE.optional(), ink: ROLE.optional(), accent: ROLE.optional(),
|
|
25
|
+
accent_ink: ROLE.optional() }),
|
|
26
|
+
seed: z.number().int().min(0).max(2 ** 31 - 1),
|
|
27
|
+
beats: z.array(filmBeat).max(FILM_MAX_BEATS),
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=film-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"film-styles.js","sourceRoot":"","sources":["../src/film-styles.ts"],"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