@clipwright/core 0.67.0 → 0.69.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/README.md +1 -1
- package/dist/ads.d.ts +2 -0
- package/dist/ads.js +2 -1
- package/dist/assets.d.ts +25 -1
- package/dist/assets.js +19 -7
- package/dist/cuts.d.ts +1 -0
- package/dist/design.d.ts +12 -0
- package/dist/design.js +2 -0
- package/dist/edit-music.js +2 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -0
- package/dist/faceless-public.d.ts +1 -0
- package/dist/film-cut.js +4 -3
- package/dist/generations.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/mascots.d.ts +6 -0
- package/dist/mascots.js +15 -0
- package/dist/own-agent-price.d.ts +5 -1
- package/dist/own-agent-price.js +5 -1
- package/dist/own-agent-runs.d.ts +5 -0
- package/dist/own-agent-runs.js +12 -3
- package/dist/prices.js +6 -3
- package/dist/trend-keywords.d.ts +20 -0
- package/dist/trend-keywords.js +13 -0
- package/dist/trend-niches.js +3 -1
- package/dist/trend-search.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @clipwright/core
|
|
2
2
|
|
|
3
3
|
Zod schemas and the shared request/response contract of the
|
|
4
|
-
[Clipwright](https://clipwright.io/?ref=npm) UGC and faceless video API. Published because
|
|
4
|
+
[Clipwright™](https://clipwright.io/?ref=npm) UGC and faceless video API. Published because
|
|
5
5
|
the SDK and the MCP server depend on it; the API validates against these same
|
|
6
6
|
schemas, so they are the contract rather than a copy of it.
|
|
7
7
|
|
package/dist/ads.d.ts
CHANGED
|
@@ -99,6 +99,7 @@ export declare const adTake: z.ZodObject<{
|
|
|
99
99
|
finding: z.ZodNullable<z.ZodString>;
|
|
100
100
|
shake: z.ZodNullable<z.ZodString>;
|
|
101
101
|
}, z.core.$strict>>;
|
|
102
|
+
speech: z.ZodOptional<z.ZodBoolean>;
|
|
102
103
|
against: z.ZodOptional<z.ZodEnum<{
|
|
103
104
|
motion: "motion";
|
|
104
105
|
picture: "picture";
|
|
@@ -183,6 +184,7 @@ export declare const adRecord: z.ZodObject<{
|
|
|
183
184
|
finding: z.ZodNullable<z.ZodString>;
|
|
184
185
|
shake: z.ZodNullable<z.ZodString>;
|
|
185
186
|
}, z.core.$strict>>;
|
|
187
|
+
speech: z.ZodOptional<z.ZodBoolean>;
|
|
186
188
|
against: z.ZodOptional<z.ZodEnum<{
|
|
187
189
|
motion: "motion";
|
|
188
190
|
picture: "picture";
|
package/dist/ads.js
CHANGED
|
@@ -2,13 +2,14 @@ import { z } from "zod";
|
|
|
2
2
|
import { adId, adSlotId } from "./ad-ids.js";
|
|
3
3
|
import { assetId } from "./asset-identity.js";
|
|
4
4
|
import { diyBlocked, diyNext } from "./diy-next.js";
|
|
5
|
+
import { OWN_CUT_MAX_BEATS } from "./own-agent-price.js";
|
|
5
6
|
import { FILM_EDIT_MAX_CLIPS, takeCheckVerdict } from "./own-agent-runs.js";
|
|
6
7
|
import { runId } from "./runs.js";
|
|
7
8
|
export { adId, adSlotId } from "./ad-ids.js";
|
|
8
9
|
export const ADS_PATH = "/v1/ads";
|
|
9
10
|
export const AD_PATH = "/v1/ads/:id";
|
|
10
11
|
export const DIY_RECORD_KINDS = ["ad", "faceless"];
|
|
11
|
-
export const DIY_MAX_SLOTS = { ad: FILM_EDIT_MAX_CLIPS, faceless:
|
|
12
|
+
export const DIY_MAX_SLOTS = { ad: FILM_EDIT_MAX_CLIPS, faceless: OWN_CUT_MAX_BEATS };
|
|
12
13
|
export const AD_MAX_SLOTS = DIY_MAX_SLOTS.ad;
|
|
13
14
|
export const AD_RECORDS_PER_DAY = 50;
|
|
14
15
|
export const adBrief = z.strictObject({
|
package/dist/assets.d.ts
CHANGED
|
@@ -23,8 +23,11 @@ export declare const ASSET_BYTES_ROUTE_VIDEO_MAX_BYTES: number;
|
|
|
23
23
|
export declare const ASSET_PROCESSING_SECONDS = 600;
|
|
24
24
|
export declare const ASSET_VIDEO_DOWNLOAD_DEADLINE_MS = 90000;
|
|
25
25
|
export declare const ASSET_INGEST_TASK_MAX_DURATION_SECONDS = 300;
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const ASSET_PUT_VIDEO_TYPES: readonly ["video/mp4", "video/quicktime", "video/webm"];
|
|
27
|
+
export declare const ASSET_PUT_MEDIA_TYPES: readonly ["image/png", "image/jpeg", "video/mp4", "video/quicktime", "video/webm"];
|
|
27
28
|
export type AssetPutMediaType = (typeof ASSET_PUT_MEDIA_TYPES)[number];
|
|
29
|
+
export declare const isAssetPutVideoType: (mediaType: string) => boolean;
|
|
30
|
+
export declare const assetPutStoredType: (mediaType: AssetPutMediaType) => "image/png" | "image/jpeg" | "video/mp4";
|
|
28
31
|
export declare const INGEST_ASSET_MEDIA_TASK = "ingest-asset-media";
|
|
29
32
|
export declare const ASSET_PREVIEW_TASK = "make-asset-preview";
|
|
30
33
|
export declare const ASSET_PREVIEW_MAX_SIDE = 512;
|
|
@@ -47,6 +50,8 @@ export declare const assetPutSource: z.ZodObject<{
|
|
|
47
50
|
"image/jpeg": "image/jpeg";
|
|
48
51
|
"image/png": "image/png";
|
|
49
52
|
"video/mp4": "video/mp4";
|
|
53
|
+
"video/quicktime": "video/quicktime";
|
|
54
|
+
"video/webm": "video/webm";
|
|
50
55
|
}>;
|
|
51
56
|
bytes: z.ZodNumber;
|
|
52
57
|
sha256: z.ZodString;
|
|
@@ -73,6 +78,8 @@ export declare const assetSource: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
73
78
|
"image/jpeg": "image/jpeg";
|
|
74
79
|
"image/png": "image/png";
|
|
75
80
|
"video/mp4": "video/mp4";
|
|
81
|
+
"video/quicktime": "video/quicktime";
|
|
82
|
+
"video/webm": "video/webm";
|
|
76
83
|
}>;
|
|
77
84
|
bytes: z.ZodNumber;
|
|
78
85
|
sha256: z.ZodString;
|
|
@@ -103,6 +110,8 @@ export declare const createAssetRequest: z.ZodObject<{
|
|
|
103
110
|
"image/jpeg": "image/jpeg";
|
|
104
111
|
"image/png": "image/png";
|
|
105
112
|
"video/mp4": "video/mp4";
|
|
113
|
+
"video/quicktime": "video/quicktime";
|
|
114
|
+
"video/webm": "video/webm";
|
|
106
115
|
}>;
|
|
107
116
|
bytes: z.ZodNumber;
|
|
108
117
|
sha256: z.ZodString;
|
|
@@ -215,6 +224,7 @@ export declare const asset: z.ZodObject<{
|
|
|
215
224
|
}, z.core.$strict>>;
|
|
216
225
|
url: z.ZodString;
|
|
217
226
|
preview_url: z.ZodOptional<z.ZodString>;
|
|
227
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
218
228
|
expires_at: z.ZodString;
|
|
219
229
|
created_at: z.ZodString;
|
|
220
230
|
updated_at: z.ZodString;
|
|
@@ -227,6 +237,8 @@ export declare const assetPutUpload: z.ZodObject<{
|
|
|
227
237
|
"image/jpeg": "image/jpeg";
|
|
228
238
|
"image/png": "image/png";
|
|
229
239
|
"video/mp4": "video/mp4";
|
|
240
|
+
"video/quicktime": "video/quicktime";
|
|
241
|
+
"video/webm": "video/webm";
|
|
230
242
|
}>;
|
|
231
243
|
"content-length": z.ZodString;
|
|
232
244
|
}, z.core.$strict>;
|
|
@@ -276,6 +288,8 @@ export declare const pendingAsset: z.ZodObject<{
|
|
|
276
288
|
"image/jpeg": "image/jpeg";
|
|
277
289
|
"image/png": "image/png";
|
|
278
290
|
"video/mp4": "video/mp4";
|
|
291
|
+
"video/quicktime": "video/quicktime";
|
|
292
|
+
"video/webm": "video/webm";
|
|
279
293
|
}>;
|
|
280
294
|
"content-length": z.ZodString;
|
|
281
295
|
}, z.core.$strict>;
|
|
@@ -339,6 +353,7 @@ export declare const assetItem: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
339
353
|
}, z.core.$strict>>;
|
|
340
354
|
url: z.ZodString;
|
|
341
355
|
preview_url: z.ZodOptional<z.ZodString>;
|
|
356
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
342
357
|
expires_at: z.ZodString;
|
|
343
358
|
created_at: z.ZodString;
|
|
344
359
|
updated_at: z.ZodString;
|
|
@@ -384,6 +399,8 @@ export declare const assetItem: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
384
399
|
"image/jpeg": "image/jpeg";
|
|
385
400
|
"image/png": "image/png";
|
|
386
401
|
"video/mp4": "video/mp4";
|
|
402
|
+
"video/quicktime": "video/quicktime";
|
|
403
|
+
"video/webm": "video/webm";
|
|
387
404
|
}>;
|
|
388
405
|
"content-length": z.ZodString;
|
|
389
406
|
}, z.core.$strict>;
|
|
@@ -472,6 +489,7 @@ export declare const assetList: z.ZodObject<{
|
|
|
472
489
|
}, z.core.$strict>>;
|
|
473
490
|
url: z.ZodString;
|
|
474
491
|
preview_url: z.ZodOptional<z.ZodString>;
|
|
492
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
475
493
|
expires_at: z.ZodString;
|
|
476
494
|
created_at: z.ZodString;
|
|
477
495
|
updated_at: z.ZodString;
|
|
@@ -518,6 +536,8 @@ export declare const assetList: z.ZodObject<{
|
|
|
518
536
|
"image/jpeg": "image/jpeg";
|
|
519
537
|
"image/png": "image/png";
|
|
520
538
|
"video/mp4": "video/mp4";
|
|
539
|
+
"video/quicktime": "video/quicktime";
|
|
540
|
+
"video/webm": "video/webm";
|
|
521
541
|
}>;
|
|
522
542
|
"content-length": z.ZodString;
|
|
523
543
|
}, z.core.$strict>;
|
|
@@ -562,6 +582,7 @@ export declare const assetRead: z.ZodObject<{
|
|
|
562
582
|
}, z.core.$strict>>;
|
|
563
583
|
url: z.ZodString;
|
|
564
584
|
preview_url: z.ZodOptional<z.ZodString>;
|
|
585
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
565
586
|
expires_at: z.ZodString;
|
|
566
587
|
created_at: z.ZodString;
|
|
567
588
|
updated_at: z.ZodString;
|
|
@@ -622,6 +643,7 @@ export declare const assetItemRead: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
622
643
|
}, z.core.$strict>>;
|
|
623
644
|
url: z.ZodString;
|
|
624
645
|
preview_url: z.ZodOptional<z.ZodString>;
|
|
646
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
625
647
|
expires_at: z.ZodString;
|
|
626
648
|
created_at: z.ZodString;
|
|
627
649
|
updated_at: z.ZodString;
|
|
@@ -683,6 +705,7 @@ export declare const assetListRead: z.ZodObject<{
|
|
|
683
705
|
}, z.core.$strict>>;
|
|
684
706
|
url: z.ZodString;
|
|
685
707
|
preview_url: z.ZodOptional<z.ZodString>;
|
|
708
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
686
709
|
expires_at: z.ZodString;
|
|
687
710
|
created_at: z.ZodString;
|
|
688
711
|
updated_at: z.ZodString;
|
|
@@ -722,6 +745,7 @@ export declare const assetListRead: z.ZodObject<{
|
|
|
722
745
|
}, z.core.$loose>;
|
|
723
746
|
}, z.core.$loose>;
|
|
724
747
|
export type AssetListRead = z.infer<typeof assetListRead>;
|
|
748
|
+
export declare function transcodedClipWarning(from: string): string;
|
|
725
749
|
export declare function assetKey(accountId: string, id: string, sha256: string, mediaType: AssetMediaType): string;
|
|
726
750
|
export declare function assetCapMessage(cap: "count" | "bytes", usage: {
|
|
727
751
|
count: number;
|
package/dist/assets.js
CHANGED
|
@@ -26,7 +26,10 @@ export const ASSET_BYTES_ROUTE_VIDEO_MAX_BYTES = 32 * 1024 * 1024;
|
|
|
26
26
|
export const ASSET_PROCESSING_SECONDS = 600;
|
|
27
27
|
export const ASSET_VIDEO_DOWNLOAD_DEADLINE_MS = 90_000;
|
|
28
28
|
export const ASSET_INGEST_TASK_MAX_DURATION_SECONDS = 300;
|
|
29
|
-
export const
|
|
29
|
+
export const ASSET_PUT_VIDEO_TYPES = ["video/mp4", "video/quicktime", "video/webm"];
|
|
30
|
+
export const ASSET_PUT_MEDIA_TYPES = ["image/png", "image/jpeg", ...ASSET_PUT_VIDEO_TYPES];
|
|
31
|
+
export const isAssetPutVideoType = (mediaType) => ASSET_PUT_VIDEO_TYPES.includes(mediaType);
|
|
32
|
+
export const assetPutStoredType = (mediaType) => mediaType === "image/png" || mediaType === "image/jpeg" ? mediaType : "video/mp4";
|
|
30
33
|
export const INGEST_ASSET_MEDIA_TASK = "ingest-asset-media";
|
|
31
34
|
export const ASSET_PREVIEW_TASK = "make-asset-preview";
|
|
32
35
|
export const ASSET_PREVIEW_MAX_SIDE = 512;
|
|
@@ -46,7 +49,7 @@ export const assetPutSource = z.strictObject({
|
|
|
46
49
|
media_type: z.enum(ASSET_PUT_MEDIA_TYPES),
|
|
47
50
|
bytes: z.number().int().positive().max(ASSET_VIDEO_MAX_BYTES),
|
|
48
51
|
sha256: sha256Hex,
|
|
49
|
-
}).refine((put) => put.media_type
|
|
52
|
+
}).refine((put) => isAssetPutVideoType(put.media_type) || put.bytes <= UPLOAD_MAX_BYTES, `a picture is at most ${UPLOAD_MAX_BYTES} bytes`);
|
|
50
53
|
export const assetSource = z.union([
|
|
51
54
|
z.strictObject({ run_id: runId }),
|
|
52
55
|
z.strictObject({ upload_id: uploadId }),
|
|
@@ -106,6 +109,7 @@ export const asset = z.strictObject({
|
|
|
106
109
|
mascot: mascotSummary.optional(),
|
|
107
110
|
url: z.string().url().startsWith("https://"),
|
|
108
111
|
preview_url: z.string().url().startsWith("https://").optional(),
|
|
112
|
+
warnings: z.array(z.string().min(1)).optional(),
|
|
109
113
|
expires_at: z.string().datetime(),
|
|
110
114
|
created_at: z.string().datetime(),
|
|
111
115
|
updated_at: z.string().datetime(),
|
|
@@ -171,6 +175,11 @@ export const assetItemRead = z.union([assetRead, pendingAssetRead]);
|
|
|
171
175
|
export const assetListRead = assetList.extend({
|
|
172
176
|
assets: z.array(assetRead), pending: z.array(pendingAssetRead).optional(), usage: assetUsage.loose(),
|
|
173
177
|
}).loose();
|
|
178
|
+
export function transcodedClipWarning(from) {
|
|
179
|
+
const sdr = from.startsWith("HDR ") ? ", tone-mapped from HDR to SDR BT.709" : "";
|
|
180
|
+
return `the clip was ${from}; it was re-encoded to an 8-bit H.264 MP4 (yuv420p${sdr}) when it was saved, at its own size and frame ` +
|
|
181
|
+
"rate, so its bytes, content_digest, codec and pix_fmt are those of the re-encoded file";
|
|
182
|
+
}
|
|
174
183
|
export function assetKey(accountId, id, sha256, mediaType) {
|
|
175
184
|
const extension = { "image/png": "png", "image/jpeg": "jpg", "image/webp": "webp", "video/mp4": "mp4" }[mediaType];
|
|
176
185
|
return `assets/${accountId}/${id}/${sha256}.${extension}`;
|
|
@@ -188,11 +197,13 @@ export const ASSET_TOOL_TERMS = "Assets are free: creating, storing and using on
|
|
|
188
197
|
export const CREATE_ASSET_DESCRIPTION = "Save a picture or a clip as an asset of this account, kept until you delete it: a character, location, style, prop " +
|
|
189
198
|
"or other, with a name. source is {run_id} of a succeeded generate_image or generate_video run of this account, " +
|
|
190
199
|
"{upload_id} from upload_image or create_upload, a public https {url} the server downloads (add " +
|
|
191
|
-
`kind: "video" for
|
|
200
|
+
`kind: "video" for a clip), {base64, media_type} of a PNG or JPEG up to ${ASSET_BASE64_MAX_BYTES} bytes, or ` +
|
|
192
201
|
"{put: {media_type, bytes, sha256}} to PUT a local file: the answer carries upload.put_url and put_headers; " +
|
|
193
|
-
"run `curl -X PUT -H 'content-type: <
|
|
194
|
-
"get_asset. On a server running on your machine also {path} of a local PNG, JPEG or MP4. A clip is an MP4
|
|
195
|
-
`
|
|
202
|
+
"run `curl -X PUT -H 'content-type: <put_headers content-type>' --data-binary @<file> '<put_url>'` within 15 minutes, then call " +
|
|
203
|
+
"get_asset. On a server running on your machine also {path} of a local PNG, JPEG or MP4. A clip is an MP4, MOV or WebM " +
|
|
204
|
+
`up to ${ASSET_VIDEO_MAX_SECONDS} seconds and 100 MB; one in another codec than H.264 or HEVC (such as AV1 or VP9), or a ` +
|
|
205
|
+
"fragmented MP4, is re-encoded to an H.264 MP4 when it is saved, and so is 10-bit or HDR video, tone-mapped to SDR; get_asset " +
|
|
206
|
+
"says so in warnings. A url clip or a PUT is checked in the background " +
|
|
196
207
|
"(state \"processing\" or \"awaiting_upload\"; get_asset says ready or failed within minutes). For your own material " +
|
|
197
208
|
"pass rights_confirmed: true, stating once that you may use the people and works in it. A reference only to analyse, " +
|
|
198
209
|
"such as someone else's ad for analyze_reference, takes analysis_only: true instead: no rights claim, and no render " +
|
|
@@ -205,7 +216,8 @@ export const LIST_ASSETS_DESCRIPTION = "List the assets of this account, newest
|
|
|
205
216
|
"still awaiting their upload or processing, and those that failed today with the reason. usage says how much " +
|
|
206
217
|
`of the ${ASSET_ACCOUNT_MAX_COUNT} assets and of the storage (${STORAGE_TERMS}) is used. Free.`;
|
|
207
218
|
export const GET_ASSET_DESCRIPTION = "Read one asset by asset_id with a freshly signed url (valid for an hour), its role, name, media_type, bytes, " +
|
|
208
|
-
"width, height, content_digest and, for a clip, duration_frames, fps, codec and pix_fmt
|
|
219
|
+
"width, height, content_digest and, for a clip, duration_frames, fps, codec and pix_fmt (warnings says when it was re-encoded), " +
|
|
220
|
+
"plus a small preview " +
|
|
209
221
|
"picture of it to look at when one is ready. An asset still in " +
|
|
210
222
|
"progress answers state awaiting_upload (PUT the file, then read again) or processing (read again in a few " +
|
|
211
223
|
"seconds); a refused one answers state failed with error.code. A deleted asset answers asset_not_found. Free.";
|
package/dist/cuts.d.ts
CHANGED
|
@@ -172,6 +172,7 @@ export declare const cutRecord: z.ZodObject<{
|
|
|
172
172
|
finding: z.ZodNullable<z.ZodString>;
|
|
173
173
|
shake: z.ZodNullable<z.ZodString>;
|
|
174
174
|
}, z.core.$strict>>;
|
|
175
|
+
speech: z.ZodOptional<z.ZodBoolean>;
|
|
175
176
|
against: z.ZodOptional<z.ZodEnum<{
|
|
176
177
|
motion: "motion";
|
|
177
178
|
picture: "picture";
|
package/dist/design.d.ts
CHANGED
|
@@ -941,6 +941,18 @@ export declare const extractBrandResponse: z.ZodObject<{
|
|
|
941
941
|
}, z.core.$strict>>;
|
|
942
942
|
brand_name: z.ZodOptional<z.ZodString>;
|
|
943
943
|
prompt_block: z.ZodOptional<z.ZodString>;
|
|
944
|
+
niches: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
945
|
+
keywords: z.ZodString;
|
|
946
|
+
platform: z.ZodLiteral<"mix">;
|
|
947
|
+
language: z.ZodOptional<z.ZodString>;
|
|
948
|
+
from: z.ZodEnum<{
|
|
949
|
+
category: "category";
|
|
950
|
+
description: "description";
|
|
951
|
+
heading: "heading";
|
|
952
|
+
keywords: "keywords";
|
|
953
|
+
title: "title";
|
|
954
|
+
}>;
|
|
955
|
+
}, z.core.$strict>>>;
|
|
944
956
|
evidence: z.ZodObject<{
|
|
945
957
|
colors: z.ZodArray<z.ZodObject<{
|
|
946
958
|
hex: z.ZodString;
|
package/dist/design.js
CHANGED
|
@@ -4,6 +4,7 @@ import { filmLookDescription, filmLookTag } from "./film-look.js";
|
|
|
4
4
|
import { MOTION_STYLE_IDS } from "./motion-styles.js";
|
|
5
5
|
import { scriptVoice } from "./script-voice.js";
|
|
6
6
|
import { contrastRatio } from "./templates/theme.js";
|
|
7
|
+
import { SITE_NICHES_DESCRIPTION, SITE_NICHES_MAX, siteTrendNiche } from "./trend-keywords.js";
|
|
7
8
|
const HEX = /^#[0-9A-Fa-f]{6}$/;
|
|
8
9
|
export const DESIGN_MIN_CONTRAST = 4.5;
|
|
9
10
|
export const CAPTION_ACCENT_GROUND = "#000000";
|
|
@@ -154,6 +155,7 @@ export const extractBrandResponse = z.object({
|
|
|
154
155
|
"brand_kit saves it."),
|
|
155
156
|
prompt_block: brandPromptBlock.optional().describe("A proposed prompt block from that name and the proposed palette: third-party text, " +
|
|
156
157
|
"for the user to confirm before brand_kit saves it."),
|
|
158
|
+
niches: z.array(siteTrendNiche).max(SITE_NICHES_MAX).optional().describe(SITE_NICHES_DESCRIPTION),
|
|
157
159
|
evidence: z.object({
|
|
158
160
|
colors: z.array(z.object({ hex, count: z.number().int().positive() })).max(12),
|
|
159
161
|
fonts: z.array(z.string()).max(8),
|
package/dist/edit-music.js
CHANGED
|
@@ -68,7 +68,8 @@ export const editMusic = z.strictObject({
|
|
|
68
68
|
'delivery: "auto" takes the mood from the captions and the voice, { mood } says it in your words, such as "moody deep house"; it may ' +
|
|
69
69
|
"carry an invisible watermark"),
|
|
70
70
|
volume: z.number().min(EDIT_MUSIC_MIN_VOLUME_DB).max(EDIT_MUSIC_MAX_VOLUME_DB).default(0)
|
|
71
|
-
.describe("dB from the music's own level: 0 plays it at full level where no voice
|
|
71
|
+
.describe("dB from the music's own level, against the voice and the clips' own sound: 0 plays it at full level where no voice " +
|
|
72
|
+
"speaks, -6 half as loud. Every cut is delivered at one loudness, so music with nothing else to sound under plays the same at any volume"),
|
|
72
73
|
at: z.number().min(0).max(600).default(0).describe("The second of the edit the music starts at"),
|
|
73
74
|
fade_out: z.number().min(0).max(EDIT_MUSIC_LONGEST_FADE_OUT).default(EDIT_MUSIC_DEFAULT_FADE_OUT)
|
|
74
75
|
.describe("Seconds the music fades out over at the cut's end"),
|
package/dist/errors.d.ts
CHANGED
|
@@ -271,7 +271,7 @@ export type EditCeilingReachedError = z.infer<typeof editCeilingReachedError>;
|
|
|
271
271
|
export declare function editCeilingReachedBody(args: Omit<EditCeilingReachedError["error"], "code" | "message">, counting?: "revision" | "candidate"): EditCeilingReachedError;
|
|
272
272
|
export declare function unusableSourceMessage(errorClass: string, detail: string): string;
|
|
273
273
|
export declare const MALFORMED_BODY_MESSAGE: string;
|
|
274
|
-
declare const BARE_ERROR_CODES: readonly ["analysis_enqueue_failed", "aspect_conflict", "actor_unavailable", "actor_format_unavailable", "actor_storage_unavailable", "actor_generation_disabled", "actor_in_use", "ad_limited", "ad_not_found", "ad_slot_in_use", "ad_slot_unchecked", "asset_cap_exceeded", "asset_ingest_cap_exceeded", "asset_not_found", "asset_not_ready", "assets_disabled", "creator_profile_limited", "creator_profile_not_found", "creator_url_unsupported", "cut_limited", "cut_not_found", "cut_preview_limited", "cut_slot_in_use", "deletion_held", "editing_window_not_set", "explainer_busy", "feedback_limited", "film_draft_limited", "film_draft_not_found", "film_draft_stale", "film_run_not_found", "film_voice_not_ready", "generations_disabled", "generations_marking_pending", "idempotency_key_required", "idempotency_key_reused", "ingest_enqueue_failed", "insufficient_scope", "internal_error", "invalid_image", "invalid_request", "malformed_body", "no_changes", "not_found", "own_agent_disabled", "own_agent_marking_pending", "paid_render_disabled", "payload_too_large", "reference_analysis_disabled", "reference_analysis_limited", "reference_analysis_not_found", "reference_not_analyzable", "reference_not_usable", "reference_url_unsupported", "revision_needs_generated_unit", "rights_not_confirmed", "run_media_in_use", "run_not_finished", "run_not_found", "source_aspect_mismatch", "source_not_usable", "take_check_limited", "take_frames_limited", "trend_page_unavailable", "trend_search_limited", "trend_search_not_found", "trends_unavailable", "unauthorized", "unsupported_combination", "unsupported_media_type", "unusable_source", "upload_cap_exceeded", "upload_digest_mismatch", "upload_expired", "upload_in_use", "upload_not_finished", "upload_size_mismatch", "upstream_error", "url_fetch_busy", "url_fetch_failed", "url_fetch_rate_limited", "url_fetch_refused", "url_import_disabled"];
|
|
274
|
+
declare const BARE_ERROR_CODES: readonly ["analysis_enqueue_failed", "aspect_conflict", "actor_unavailable", "actor_format_unavailable", "actor_storage_unavailable", "actor_generation_disabled", "actor_in_use", "ad_limited", "ad_not_found", "ad_slot_in_use", "ad_slot_unchecked", "asset_cap_exceeded", "asset_ingest_cap_exceeded", "asset_not_found", "asset_not_ready", "assets_disabled", "creator_profile_limited", "creator_profile_not_found", "creator_url_unsupported", "cut_limited", "cut_not_found", "cut_preview_limited", "cut_slot_in_use", "deletion_held", "editing_window_not_set", "explainer_busy", "feedback_limited", "film_draft_limited", "film_draft_not_found", "film_draft_stale", "film_hero_limited", "film_run_not_found", "film_voice_not_ready", "generations_disabled", "generations_marking_pending", "idempotency_key_required", "idempotency_key_reused", "ingest_enqueue_failed", "insufficient_scope", "internal_error", "invalid_image", "invalid_request", "malformed_body", "no_changes", "not_found", "own_agent_disabled", "own_agent_marking_pending", "paid_render_disabled", "payload_too_large", "reference_analysis_disabled", "reference_analysis_limited", "reference_analysis_not_found", "reference_not_analyzable", "reference_not_usable", "reference_url_unsupported", "revision_needs_generated_unit", "rights_not_confirmed", "run_media_in_use", "run_not_finished", "run_not_found", "source_aspect_mismatch", "source_not_usable", "take_check_limited", "take_frames_limited", "trend_page_unavailable", "trend_search_limited", "trend_search_not_found", "trends_unavailable", "unauthorized", "unsupported_combination", "unsupported_media_type", "unusable_source", "upload_cap_exceeded", "upload_digest_mismatch", "upload_expired", "upload_in_use", "upload_not_finished", "upload_size_mismatch", "upstream_error", "url_fetch_busy", "url_fetch_failed", "url_fetch_rate_limited", "url_fetch_refused", "url_import_disabled"];
|
|
275
275
|
export type BareApiErrorCode = (typeof BARE_ERROR_CODES)[number];
|
|
276
276
|
export declare const API_ERROR_CODES: readonly string[];
|
|
277
277
|
export declare function apiErrorBody(args: {
|
package/dist/errors.js
CHANGED
|
@@ -6640,6 +6640,7 @@ export declare const facelessStoredInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
6640
6640
|
}, z.core.$strict>>;
|
|
6641
6641
|
rig: z.ZodOptional<z.ZodString>;
|
|
6642
6642
|
photo: z.ZodOptional<z.ZodLiteral<true>>;
|
|
6643
|
+
unread: z.ZodOptional<z.ZodLiteral<true>>;
|
|
6643
6644
|
}, z.core.$strict>>;
|
|
6644
6645
|
}, z.core.$strict>>;
|
|
6645
6646
|
workflow_directions: z.ZodOptional<z.ZodObject<{
|
package/dist/film-cut.js
CHANGED
|
@@ -5,6 +5,7 @@ import { diyBlocked, diyNext } from "./diy-next.js";
|
|
|
5
5
|
import { FACELESS_BEAT_KINDS, FACELESS_CAMERA_MOVES, FACELESS_CUT_LOOKS, FACELESS_SHOT_SIZES, FACELESS_SPEEDS } from "./faceless-direction-summary.js";
|
|
6
6
|
import { filmLookDescription, filmLookTag } from "./film-look.js";
|
|
7
7
|
import { maxCreditsField } from "./max-credits.js";
|
|
8
|
+
import { OWN_CUT_MAX_BEATS } from "./own-agent-price.js";
|
|
8
9
|
import { runId } from "./runs.js";
|
|
9
10
|
import { uploadId } from "./uploads.js";
|
|
10
11
|
export const FILM_CUT_CHECK_PATH = "/v1/film-cuts/check";
|
|
@@ -65,7 +66,7 @@ const beat = z.strictObject({
|
|
|
65
66
|
.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"),
|
|
66
67
|
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([])
|
|
67
68
|
.describe("Quick zooms on words of this beat"),
|
|
68
|
-
priority: z.number().int().min(1).max(
|
|
69
|
+
priority: z.number().int().min(1).max(OWN_CUT_MAX_BEATS).default(20).describe("1 is the beat that matters most"),
|
|
69
70
|
why,
|
|
70
71
|
technique_ids: z.array(line(64)).min(1).max(6).describe("Short names of the techniques this beat uses"),
|
|
71
72
|
text_visible: z.boolean().optional().describe("On a live beat: its frame shows readable text, a logo or a sign"),
|
|
@@ -107,7 +108,7 @@ export const filmCutInput = z.strictObject({
|
|
|
107
108
|
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
109
|
effect_colours: line(240).describe("The colours of sparkles, glows and outlines, named"),
|
|
109
110
|
}),
|
|
110
|
-
beats: z.array(beat).min(2).max(
|
|
111
|
+
beats: z.array(beat).min(2).max(OWN_CUT_MAX_BEATS).describe("The beats in order, covering every word of the voice once"),
|
|
111
112
|
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
113
|
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
114
|
why: line(160) })).max(160).default([])
|
|
@@ -115,7 +116,7 @@ export const filmCutInput = z.strictObject({
|
|
|
115
116
|
captions: z.strictObject({ on: z.boolean().default(true).describe("Burn the captions in; false for none"),
|
|
116
117
|
accents: z.array(word).max(80).default([]).describe("The word of each caption phrase that carries its point") })
|
|
117
118
|
.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(
|
|
119
|
+
transitions: z.array(z.strictObject({ after_word: word.describe("A beat's last word"), look: z.enum(FACELESS_CUT_LOOKS) })).max(OWN_CUT_MAX_BEATS).default([])
|
|
119
120
|
.describe("Cuts other than hard, after a beat's last word"),
|
|
120
121
|
sound: z.strictObject({
|
|
121
122
|
bed: filmCutBed.nullable().describe(`One ambience under the whole voice, or null; ${FILM_CUT_BED_RULE}`),
|
package/dist/generations.js
CHANGED
|
@@ -46,7 +46,7 @@ function draft480p(unit_credits) {
|
|
|
46
46
|
return video("480p", 496, 864, unit_credits, H264, { vertical: true, horizontal: true })
|
|
47
47
|
.map((row) => ({ ...row, warning: DRAFT_480P[row.aspect_ratio] }));
|
|
48
48
|
}
|
|
49
|
-
const OMNI_DRAFT_360P = "360p is
|
|
49
|
+
const OMNI_DRAFT_360P = "360p is softer than 720p: a draft for trying a move cheaply, or a final take the user chose for its price";
|
|
50
50
|
function only(rows, aspect, change) {
|
|
51
51
|
return rows.map((row) => (row.aspect_ratio === aspect ? { ...row, ...change } : row));
|
|
52
52
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/mascots.d.ts
CHANGED
|
@@ -24,8 +24,12 @@ export declare const mascotPose: z.ZodObject<{
|
|
|
24
24
|
}, z.core.$strict>>;
|
|
25
25
|
rig: z.ZodOptional<z.ZodString>;
|
|
26
26
|
photo: z.ZodOptional<z.ZodLiteral<true>>;
|
|
27
|
+
unread: z.ZodOptional<z.ZodLiteral<true>>;
|
|
27
28
|
}, z.core.$strict>;
|
|
28
29
|
export type MascotPose = z.infer<typeof mascotPose>;
|
|
30
|
+
export type MascotPoseFace = "works" | "still" | "faceless";
|
|
31
|
+
export declare function mascotPoseFace(pose: unknown): MascotPoseFace;
|
|
32
|
+
export declare const mascotPoseWorks: (pose: unknown) => boolean;
|
|
29
33
|
export declare const mascotPoses: z.ZodRecord<z.ZodEnum<{
|
|
30
34
|
celebrate: "celebrate";
|
|
31
35
|
neutral: "neutral";
|
|
@@ -59,6 +63,7 @@ export declare const mascotPoses: z.ZodRecord<z.ZodEnum<{
|
|
|
59
63
|
}, z.core.$strict>>;
|
|
60
64
|
rig: z.ZodOptional<z.ZodString>;
|
|
61
65
|
photo: z.ZodOptional<z.ZodLiteral<true>>;
|
|
66
|
+
unread: z.ZodOptional<z.ZodLiteral<true>>;
|
|
62
67
|
}, z.core.$strict>>;
|
|
63
68
|
export type MascotPoses = z.infer<typeof mascotPoses>;
|
|
64
69
|
export declare const pinnedMascot: z.ZodObject<{
|
|
@@ -96,6 +101,7 @@ export declare const pinnedMascot: z.ZodObject<{
|
|
|
96
101
|
}, z.core.$strict>>;
|
|
97
102
|
rig: z.ZodOptional<z.ZodString>;
|
|
98
103
|
photo: z.ZodOptional<z.ZodLiteral<true>>;
|
|
104
|
+
unread: z.ZodOptional<z.ZodLiteral<true>>;
|
|
99
105
|
}, z.core.$strict>>;
|
|
100
106
|
}, z.core.$strict>;
|
|
101
107
|
export type PinnedMascot = z.infer<typeof pinnedMascot>;
|
package/dist/mascots.js
CHANGED
|
@@ -12,7 +12,22 @@ export const mascotPose = z.strictObject({
|
|
|
12
12
|
eyes: z.strictObject({ points: z.array(z.strictObject({ x: share, y: share })).min(1).max(4), w: share, h: share, skin: z.string().min(1).max(40) }).optional(),
|
|
13
13
|
rig: z.string().min(1).max(300).optional(),
|
|
14
14
|
photo: z.literal(true).optional(),
|
|
15
|
+
unread: z.literal(true).optional(),
|
|
15
16
|
});
|
|
17
|
+
export function mascotPoseFace(pose) {
|
|
18
|
+
if (typeof pose !== "object" || pose === null)
|
|
19
|
+
return "faceless";
|
|
20
|
+
const { photo, mouth, eyes, unread } = pose;
|
|
21
|
+
if (photo === true)
|
|
22
|
+
return "works";
|
|
23
|
+
if (typeof mouth === "object" && mouth !== null) {
|
|
24
|
+
const ink = mouth.ink;
|
|
25
|
+
return typeof ink === "string" ? "works" : !Object.hasOwn(mouth, "ink") ? "still" : "faceless";
|
|
26
|
+
}
|
|
27
|
+
const points = typeof eyes === "object" && eyes !== null ? eyes.points : undefined;
|
|
28
|
+
return unread === true || (Array.isArray(points) && points.length > 0) ? "still" : "faceless";
|
|
29
|
+
}
|
|
30
|
+
export const mascotPoseWorks = (pose) => mascotPoseFace(pose) === "works";
|
|
16
31
|
export const mascotPoses = z.partialRecord(z.enum(MASCOT_POSES), mascotPose)
|
|
17
32
|
.refine((poses) => poses.neutral !== undefined, { message: "a mascot holds its neutral pose" });
|
|
18
33
|
export const pinnedMascot = z.strictObject({ asset_id: assetId, poses: mascotPoses });
|
|
@@ -14,6 +14,9 @@ export declare const OWN_EDIT_CREDITS = 10, OWN_EDIT_MAX_SECONDS = 60;
|
|
|
14
14
|
export declare const OWN_TAKE_FRAMES_MAX = 96, TAKE_FRAMES_PER_HOUR = 60, TAKE_FRAMES_WINDOW_SECONDS = 3600;
|
|
15
15
|
export declare const TAKE_PICTURE_CHECKS_PER_HOUR = 30;
|
|
16
16
|
export declare const TAKE_MOTION_CHECKS_PER_HOUR = 30;
|
|
17
|
+
export declare const HERO_RUNS_PER_HOUR = 10;
|
|
18
|
+
export declare const OWN_HERO_FREE_POSES_PER_DAY = 27;
|
|
19
|
+
export declare const OWN_HERO_FREE_POSES_WINDOW_HOURS = 24;
|
|
17
20
|
export declare const CUT_PREVIEWS_PER_HOUR = 20;
|
|
18
21
|
export declare const OWN_TAKE_CHECK_CREDITS = 10;
|
|
19
22
|
export declare const OWN_TAKE_CHECK_PICTURE_CREDITS = 20;
|
|
@@ -23,7 +26,8 @@ export declare const OWN_CUT_MIN_SECONDS = 10;
|
|
|
23
26
|
export declare const OWN_CUT_BED_CREDITS = 35;
|
|
24
27
|
export declare const OWN_CUT_TAKE_SOUND_CREDITS_PER_SECOND = 4;
|
|
25
28
|
export declare const OWN_CUT_MAX_NEW_SOUNDS = 8;
|
|
26
|
-
export declare const
|
|
29
|
+
export declare const OWN_CUT_MAX_BEATS = 96;
|
|
30
|
+
export declare const OWN_CUT_MAX_SOURCES = 96, OWN_CUT_MAX_SOURCE_BYTES = 1000000000;
|
|
27
31
|
export declare const ownCutParts: z.ZodObject<{
|
|
28
32
|
bed: z.ZodBoolean;
|
|
29
33
|
take_sound_seconds: z.ZodNumber;
|
package/dist/own-agent-price.js
CHANGED
|
@@ -16,6 +16,9 @@ export const OWN_EDIT_CREDITS = 10, OWN_EDIT_MAX_SECONDS = 60;
|
|
|
16
16
|
export const OWN_TAKE_FRAMES_MAX = 96, TAKE_FRAMES_PER_HOUR = 60, TAKE_FRAMES_WINDOW_SECONDS = 3600;
|
|
17
17
|
export const TAKE_PICTURE_CHECKS_PER_HOUR = 30;
|
|
18
18
|
export const TAKE_MOTION_CHECKS_PER_HOUR = 30;
|
|
19
|
+
export const HERO_RUNS_PER_HOUR = 10;
|
|
20
|
+
export const OWN_HERO_FREE_POSES_PER_DAY = 27;
|
|
21
|
+
export const OWN_HERO_FREE_POSES_WINDOW_HOURS = 24;
|
|
19
22
|
export const CUT_PREVIEWS_PER_HOUR = 20;
|
|
20
23
|
export const OWN_TAKE_CHECK_CREDITS = 10;
|
|
21
24
|
export const OWN_TAKE_CHECK_PICTURE_CREDITS = 20;
|
|
@@ -25,7 +28,8 @@ export const OWN_CUT_MIN_SECONDS = 10;
|
|
|
25
28
|
export const OWN_CUT_BED_CREDITS = 35;
|
|
26
29
|
export const OWN_CUT_TAKE_SOUND_CREDITS_PER_SECOND = 4;
|
|
27
30
|
export const OWN_CUT_MAX_NEW_SOUNDS = 8;
|
|
28
|
-
export const
|
|
31
|
+
export const OWN_CUT_MAX_BEATS = 96;
|
|
32
|
+
export const OWN_CUT_MAX_SOURCES = 96, OWN_CUT_MAX_SOURCE_BYTES = 1_000_000_000;
|
|
29
33
|
export const ownCutParts = z.strictObject({ bed: z.boolean(), take_sound_seconds: z.number().nonnegative(), music: z.boolean() });
|
|
30
34
|
export const ownAgentTerms = z.strictObject({
|
|
31
35
|
tariff: z.enum([OWN_AGENT_TARIFF_V1, OWN_AGENT_TARIFF]),
|
package/dist/own-agent-runs.d.ts
CHANGED
|
@@ -90,6 +90,7 @@ export declare const FILM_EDIT_MAX_CLIPS = 24, FILM_EDIT_MAX_PIECES = 24, FILM_E
|
|
|
90
90
|
export declare const FILM_EDIT_CAPTION_POSITIONS: readonly ["top", "middle", "bottom", "low"];
|
|
91
91
|
export declare const FILM_EDIT_CAPTION_STYLES: readonly ["outline", "banner", "badge"];
|
|
92
92
|
export declare const FILM_EDIT_CAPTION_ALIGNS: readonly ["center", "left"];
|
|
93
|
+
export declare const EDIT_CLIP_MIN_VOLUME_DB = -24, EDIT_CLIP_MAX_VOLUME_DB = 3;
|
|
93
94
|
export declare const filmEditInput: z.ZodObject<{
|
|
94
95
|
clips: z.ZodArray<z.ZodObject<{
|
|
95
96
|
run_id: z.ZodOptional<z.ZodString>;
|
|
@@ -98,6 +99,8 @@ export declare const filmEditInput: z.ZodObject<{
|
|
|
98
99
|
to: z.ZodNumber;
|
|
99
100
|
speed: z.ZodDefault<z.ZodNumber>;
|
|
100
101
|
sound: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
speech: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
101
104
|
slot: z.ZodOptional<z.ZodString>;
|
|
102
105
|
}, z.core.$strict>>;
|
|
103
106
|
voice: z.ZodOptional<z.ZodObject<{
|
|
@@ -353,6 +356,7 @@ export declare const takeCheckVerdict: z.ZodObject<{
|
|
|
353
356
|
finding: z.ZodNullable<z.ZodString>;
|
|
354
357
|
shake: z.ZodNullable<z.ZodString>;
|
|
355
358
|
}, z.core.$strict>>;
|
|
359
|
+
speech: z.ZodOptional<z.ZodBoolean>;
|
|
356
360
|
against: z.ZodOptional<z.ZodEnum<{
|
|
357
361
|
motion: "motion";
|
|
358
362
|
picture: "picture";
|
|
@@ -583,6 +587,7 @@ export declare const filmRun: z.ZodObject<{
|
|
|
583
587
|
finding: z.ZodNullable<z.ZodString>;
|
|
584
588
|
shake: z.ZodNullable<z.ZodString>;
|
|
585
589
|
}, z.core.$strict>>;
|
|
590
|
+
speech: z.ZodOptional<z.ZodBoolean>;
|
|
586
591
|
against: z.ZodOptional<z.ZodEnum<{
|
|
587
592
|
motion: "motion";
|
|
588
593
|
picture: "picture";
|
package/dist/own-agent-runs.js
CHANGED
|
@@ -67,20 +67,27 @@ export const FILM_EDIT_CAPTION_POSITIONS = ["top", "middle", "bottom", "low"];
|
|
|
67
67
|
export const FILM_EDIT_CAPTION_STYLES = ["outline", "banner", "badge"];
|
|
68
68
|
export const FILM_EDIT_CAPTION_ALIGNS = ["center", "left"];
|
|
69
69
|
const editSecond = z.number().min(0).max(600);
|
|
70
|
+
export const EDIT_CLIP_MIN_VOLUME_DB = -24, EDIT_CLIP_MAX_VOLUME_DB = 3;
|
|
70
71
|
const editClip = z.strictObject({
|
|
71
72
|
run_id: runId.optional().describe("A delivered generate_video run of this account"),
|
|
72
73
|
asset_id: assetId.optional().describe("Instead of run_id: a video asset of this account"),
|
|
73
74
|
from: editSecond.describe("The second of the clip the cut starts at"),
|
|
74
75
|
to: editSecond.describe("The second of the clip the cut ends at, after from"),
|
|
75
76
|
speed: z.number().min(0.5).max(2).default(1).describe("Play speed; the clip lasts (to - from) / speed in the edit. 1.2 lifts a slow beat"),
|
|
76
|
-
sound: z.boolean().optional().describe("Play this window's own sound (a clip made with audio: true) at
|
|
77
|
-
"
|
|
77
|
+
sound: z.boolean().optional().describe("Play this window's own sound (a clip made with audio: true); at speed 1, never over the voice's " +
|
|
78
|
+
"words. speech and volume say how it sits in the mix"),
|
|
79
|
+
speech: z.boolean().optional().describe("With sound: true. true: the window's sound is someone speaking, so it plays at the level of " +
|
|
80
|
+
"speech and the music goes lower under it as under the voice. false: room sound or effects, which never lower the music. Omitted: " +
|
|
81
|
+
"what the clip's latest check_take heard, else false"),
|
|
82
|
+
volume: z.number().min(EDIT_CLIP_MIN_VOLUME_DB).max(EDIT_CLIP_MAX_VOLUME_DB).optional()
|
|
83
|
+
.describe("With sound: true. dB from the level the edit gives this window's sound: 0 (the default) near the voice, -10 well under it"),
|
|
78
84
|
slot: adSlotId.optional().describe("With ad_id: the slot of the ad this clip fills. A clip made with generate_video must have passed " +
|
|
79
85
|
"check_take in that slot; your own footage needs no check"),
|
|
80
86
|
}).refine(clip => (clip.run_id === undefined) !== (clip.asset_id === undefined), "name the clip by run_id or by asset_id, one of them")
|
|
81
87
|
.refine(clip => clip.to > clip.from, "to must be after from")
|
|
82
88
|
.refine(clip => clip.sound !== true || clip.run_id !== undefined, { path: ["sound"], message: "a clip's own sound is kept only from a generate_video run made with audio: true" })
|
|
83
|
-
.refine(clip => clip.sound !== true || clip.speed === 1, { path: ["sound"], message: "a clip's own sound plays at speed 1 only" })
|
|
89
|
+
.refine(clip => clip.sound !== true || clip.speed === 1, { path: ["sound"], message: "a clip's own sound plays at speed 1 only" })
|
|
90
|
+
.refine(clip => clip.sound === true || (clip.speech === undefined && clip.volume === undefined), { path: ["sound"], message: "speech and volume describe a clip's own sound: they need sound: true" });
|
|
84
91
|
const voicePiece = z.strictObject({
|
|
85
92
|
from: editSecond.describe("The second of the take the piece starts at (make_voice words give each word's start and end)"),
|
|
86
93
|
to: editSecond.describe("The second of the take the piece ends at, after from"),
|
|
@@ -225,6 +232,8 @@ export const takeCheckVerdict = z.strictObject({ duration_sec: z.number().positi
|
|
|
225
232
|
whole_take: z.boolean(), why: z.string().nullable() })),
|
|
226
233
|
clean: z.array(takeWindow),
|
|
227
234
|
motion: takeMotion.optional(),
|
|
235
|
+
speech: z.boolean().optional().describe("A take with its own sound: whether someone speaks in it, on screen or off. render_edit plays " +
|
|
236
|
+
"a window of this take as speech when its speech is not given"),
|
|
228
237
|
against: z.enum(TAKE_CHECK_AGAINST).optional(),
|
|
229
238
|
action_at_s: z.number().min(0).nullable().optional().describe("Against picture: the second the first asked change shows; null when it never does"),
|
|
230
239
|
subject: z.strictObject({ x: z.number().min(0).max(1), y: z.number().min(0).max(1), w: z.number().min(0).max(1), h: z.number().min(0).max(1) })
|
package/dist/prices.js
CHANGED
|
@@ -11,7 +11,7 @@ import { REFERENCE_ANALYSIS_CREDITS, REFERENCE_DATA_CREDITS } from "./reference-
|
|
|
11
11
|
import { CREATOR_PROFILE_CREDITS, CREATOR_PROFILE_VIDEOS } from "./creator-profile.js";
|
|
12
12
|
import { TREND_FREE_PAGES_PER_DAY, TREND_FREE_SEARCHES_PER_MONTH, TREND_PAGE_PAID_CREDITS, TREND_PAGE_WINDOW_SECONDS, TREND_SEARCH_CREDITS, TREND_SEARCH_MAX_PAGES, TREND_SEARCH_REELS, } from "./trend-search.js";
|
|
13
13
|
import { isMusicEnabled, MUSIC_BED_CREDITS } from "./music.js";
|
|
14
|
-
import { isOwnAgentEnabled, OWN_FILM_EXTRA_SECOND_CREDITS, OWN_FILM_INCLUDED_SECONDS, OWN_FILM_RENDER_CREDITS, OWN_HERO_POSE_CREDITS, OWN_HERO_POSES, OWN_FREE_STILLS, OWN_FREE_STILLS_WINDOW_HOURS, OWN_STILL_CREDITS, OWN_STILLS_MAX_PER_CALL, OWN_VOICE_CREDITS_PER_SECOND, OWN_EDIT_CREDITS, OWN_EDIT_MAX_SECONDS, OWN_TAKE_CHECK_CREDITS, OWN_CUT_BED_CREDITS, OWN_CUT_CREDITS, OWN_CUT_EXTRA_SECOND_CREDITS, OWN_CUT_INCLUDED_SECONDS, OWN_CUT_MAX_NEW_SOUNDS, OWN_CUT_MAX_SECONDS, OWN_CUT_MIN_SECONDS, OWN_CUT_TAKE_SOUND_CREDITS_PER_SECOND, OWN_TAKE_CHECK_PICTURE_CREDITS, OWN_TAKE_CHECK_PICTURE_LONG_CREDITS, TAKE_PICTURE_SHORT_TIER_SECONDS } from "./own-agent-price.js";
|
|
14
|
+
import { HERO_RUNS_PER_HOUR, isOwnAgentEnabled, OWN_FILM_EXTRA_SECOND_CREDITS, OWN_FILM_INCLUDED_SECONDS, OWN_FILM_RENDER_CREDITS, OWN_HERO_POSE_CREDITS, OWN_HERO_POSES, OWN_HERO_FREE_POSES_PER_DAY, OWN_HERO_FREE_POSES_WINDOW_HOURS, OWN_FREE_STILLS, OWN_FREE_STILLS_WINDOW_HOURS, OWN_STILL_CREDITS, OWN_STILLS_MAX_PER_CALL, OWN_VOICE_CREDITS_PER_SECOND, OWN_EDIT_CREDITS, OWN_EDIT_MAX_SECONDS, OWN_TAKE_CHECK_CREDITS, OWN_CUT_BED_CREDITS, OWN_CUT_CREDITS, OWN_CUT_EXTRA_SECOND_CREDITS, OWN_CUT_INCLUDED_SECONDS, OWN_CUT_MAX_NEW_SOUNDS, OWN_CUT_MAX_SECONDS, OWN_CUT_MIN_SECONDS, OWN_CUT_TAKE_SOUND_CREDITS_PER_SECOND, OWN_TAKE_CHECK_PICTURE_CREDITS, OWN_TAKE_CHECK_PICTURE_LONG_CREDITS, TAKE_PICTURE_SHORT_TIER_SECONDS } from "./own-agent-price.js";
|
|
15
15
|
import { CUT_PREVIEW_MAX_STILLS } from "./film-cut.js";
|
|
16
16
|
export const PRICES_PATH = "/v1/public/prices";
|
|
17
17
|
export const PRICE_UNITS = ["call", "second", "face_second", "image", "clip", "clip_second", "still", "scene", "track"];
|
|
@@ -215,7 +215,7 @@ function buildPriceList(liveShots, scenes, facelessShots = false, facelessScenes
|
|
|
215
215
|
notes: `tier ${tier}${tier === "standard" ? " (the default)" : ""}. A drawn explainer film, made in about half an hour and charged only when ` +
|
|
216
216
|
"delivered, by its length. A mascot is the hero for free; a character you name, or one we draw to fit the script, adds its " +
|
|
217
217
|
`${FACELESS_EXPLAINER_POSE_PICTURES} pose pictures, ${FACELESS_IMAGE_CREDITS} credits each for the pictures made, charged only with a ` +
|
|
218
|
-
"delivered video." })) : []),
|
|
218
|
+
"delivered video; a drawn pose whose mouth cannot move with the voice is shown with a warning and not charged." })) : []),
|
|
219
219
|
...(ownAgent ? [
|
|
220
220
|
paid({ tool: "preview_stills", route: "POST /v1/film-stills", quote_tool: "quote_stills", unit: "still", credits: OWN_STILL_CREDITS,
|
|
221
221
|
notes: `Up to ${OWN_STILLS_MAX_PER_CALL} stills of a film draft per call. The first ${OWN_FREE_STILLS} stills drawn of each draft in any ` +
|
|
@@ -228,7 +228,10 @@ function buildPriceList(liveShots, scenes, facelessShots = false, facelessScenes
|
|
|
228
228
|
{ label: `each second over ${OWN_FILM_INCLUDED_SECONDS} s`, unit: "second", credits: OWN_FILM_EXTRA_SECOND_CREDITS }],
|
|
229
229
|
notes: "Charged only for a delivered film, by its length; a render that fails costs nothing." }),
|
|
230
230
|
paid({ tool: "make_film_hero", route: "POST /v1/film-heroes", quote_tool: "quote_film_hero", unit: "image", credits: OWN_HERO_POSE_CREDITS,
|
|
231
|
-
notes: `A hero in up to ${OWN_HERO_POSES} pose pictures, saved as a mascot of your assets; each pose is charged once it is published,
|
|
231
|
+
notes: `A hero in up to ${OWN_HERO_POSES} pose pictures, saved as a mascot of your assets; each pose is charged once it is published, except ` +
|
|
232
|
+
"a drawn pose whose face shows but whose mouth cannot move with the voice, or whose face could not be read, which is published " +
|
|
233
|
+
`with a warning and not charged (a pose with no face to animate is charged); at most ${HERO_RUNS_PER_HOUR} heroes an hour, and ` +
|
|
234
|
+
`none while the account has received ${OWN_HERO_FREE_POSES_PER_DAY} such uncharged poses in the last ${OWN_HERO_FREE_POSES_WINDOW_HOURS} hours; a ` +
|
|
232
235
|
"film that uses the mascot makes and charges none again. Completing a saved mascot charges only the poses it adds. A hero that " +
|
|
233
236
|
"publishes no pose costs nothing." }),
|
|
234
237
|
] : []),
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const trendKeywords: z.ZodString;
|
|
3
|
+
export declare const trendLanguageCode: z.ZodString;
|
|
4
|
+
export declare const SITE_NICHES_MAX = 3;
|
|
5
|
+
export declare const SITE_NICHE_SOURCES: readonly ["title", "keywords", "category", "heading", "description"];
|
|
6
|
+
export type SiteNicheSource = (typeof SITE_NICHE_SOURCES)[number];
|
|
7
|
+
export declare const siteTrendNiche: z.ZodObject<{
|
|
8
|
+
keywords: z.ZodString;
|
|
9
|
+
platform: z.ZodLiteral<"mix">;
|
|
10
|
+
language: z.ZodOptional<z.ZodString>;
|
|
11
|
+
from: z.ZodEnum<{
|
|
12
|
+
category: "category";
|
|
13
|
+
description: "description";
|
|
14
|
+
heading: "heading";
|
|
15
|
+
keywords: "keywords";
|
|
16
|
+
title: "title";
|
|
17
|
+
}>;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export type SiteTrendNiche = z.infer<typeof siteTrendNiche>;
|
|
20
|
+
export declare const SITE_NICHES_DESCRIPTION: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const trendKeywords = z.string().min(2).max(100).refine((value) => value.trim().length >= 2, "keywords needs at least 2 characters besides spaces");
|
|
3
|
+
export const trendLanguageCode = z.string().regex(/^[a-z]{2}$/);
|
|
4
|
+
export const SITE_NICHES_MAX = 3;
|
|
5
|
+
export const SITE_NICHE_SOURCES = ["title", "keywords", "category", "heading", "description"];
|
|
6
|
+
export const siteTrendNiche = z.strictObject({
|
|
7
|
+
keywords: trendKeywords.describe("The niche's words, read from the site."),
|
|
8
|
+
platform: z.literal("mix").describe("mix: TikTok and Instagram together."),
|
|
9
|
+
language: trendLanguageCode.optional().describe("The page's language, ISO 639-1; absent when the page names none."),
|
|
10
|
+
from: z.enum(SITE_NICHE_SOURCES).describe("Where the words stand: the page title, its keywords, a product category, a heading or the description."),
|
|
11
|
+
});
|
|
12
|
+
export const SITE_NICHES_DESCRIPTION = `Up to ${SITE_NICHES_MAX} proposed trend niches from the page's own words: third-party text. ` +
|
|
13
|
+
"Show them; save only the ones the user confirms, with trend_niches as {keywords, platform, language}, from left out.";
|
package/dist/trend-niches.js
CHANGED
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { CREATOR_PLATFORMS } from "./creator-profile.js";
|
|
3
3
|
import { findTrendsRequest, TREND_FREE_PAGES_PER_DAY, TREND_LANGUAGE_DESCRIPTION, TREND_PAGE_PAID_CREDITS, TREND_PAGE_WINDOW_SECONDS, TREND_PLATFORMS, TREND_SEARCH_DEFAULT_DAYS, TREND_SEARCH_MAX_DAYS, TREND_SEARCH_MAX_PAGES, TREND_SEARCH_MIN_DAYS, trendPage, trendSearchId, } from "./trend-search.js";
|
|
4
4
|
import { maxCreditsField } from "./max-credits.js";
|
|
5
|
+
import { SITE_NICHES_MAX } from "./trend-keywords.js";
|
|
5
6
|
export const TREND_NICHES_PATH = "/v1/trend-niches";
|
|
6
7
|
export const TREND_NICHES_MAX = 3;
|
|
7
8
|
const keywords = findTrendsRequest.shape.keywords;
|
|
@@ -130,4 +131,5 @@ export const digestReels = (reels) => reels.filter((reel) => reel.top || reel.ta
|
|
|
130
131
|
export const TREND_NICHES_DESCRIPTION = "Free. With no niches: the account's saved niches, the first the primary. niches: save the user's confirmed list " +
|
|
131
132
|
`(at most ${TREND_NICHES_MAX}, it replaces the saved one; [] clears it). find_trends and quote_trends with no keywords search the primary niche. ` +
|
|
132
133
|
`The read also answers suggested: up to ${TREND_NICHE_SUGGESTIONS_MAX} niches from the hashtags of creators this account analysed. Show them; ` +
|
|
133
|
-
"a niche is saved only once the user confirms it. With no suggestions,
|
|
134
|
+
"a niche is saved only once the user confirms it. With no suggestions, ask for the user's site: extract_brand answers niches, up to " +
|
|
135
|
+
`${SITE_NICHES_MAX} read from its own words.`;
|
package/dist/trend-search.js
CHANGED
|
@@ -3,6 +3,7 @@ import { CAPTION_FUNNEL_MAX_CHARS, captionFunnelWord } from "./caption-funnel.js
|
|
|
3
3
|
import { CREATOR_CAPTION_MAX_CHARS, CREATOR_PLATFORMS, CREATOR_TOP_X, creatorAuthorUrl, medianOf, xToMedian } from "./creator-profile.js";
|
|
4
4
|
import { quoteThirdParty as quote } from "./markdown-quote.js";
|
|
5
5
|
import { REFERENCE_WAIT_MAX_SECONDS } from "./reference-analysis.js";
|
|
6
|
+
import { trendKeywords, trendLanguageCode } from "./trend-keywords.js";
|
|
6
7
|
export const TREND_SEARCHES_PATH = "/v1/trend-searches";
|
|
7
8
|
export const TREND_SEARCH_PATH = "/v1/trend-searches/:id";
|
|
8
9
|
export const TREND_SEARCH_QUOTE_PATH = "/v1/trend-searches/quote";
|
|
@@ -82,10 +83,9 @@ export const findTrendsPayload = z.strictObject({ searchId: trendSearchId, accou
|
|
|
82
83
|
export const TREND_LANGUAGE_DESCRIPTION = "ISO 639-1: keeps reels in this language, read from the platform's label or the caption; " +
|
|
83
84
|
"a reel whose language cannot be told is kept.";
|
|
84
85
|
export const findTrendsRequest = z.strictObject({
|
|
85
|
-
keywords:
|
|
86
|
-
.describe("The topic in a few words."),
|
|
86
|
+
keywords: trendKeywords.describe("The topic in a few words."),
|
|
87
87
|
platform: z.enum(TREND_PLATFORMS).default("mix"),
|
|
88
|
-
language:
|
|
88
|
+
language: trendLanguageCode.optional().describe(TREND_LANGUAGE_DESCRIPTION),
|
|
89
89
|
posted_within_days: z.number().int().min(TREND_SEARCH_MIN_DAYS).max(TREND_SEARCH_MAX_DAYS).default(TREND_SEARCH_DEFAULT_DAYS)
|
|
90
90
|
.describe(`Reels posted within this many days: ${TREND_SEARCH_MIN_DAYS} is the last 24 hours, ${TREND_SEARCH_DEFAULT_DAYS} by default, ` +
|
|
91
91
|
`at most ${TREND_SEARCH_MAX_DAYS}.`),
|