@clipwright/core 0.67.0 → 0.68.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 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/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 ASSET_PUT_MEDIA_TYPES: readonly ["image/png", "image/jpeg", "video/mp4"];
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 ASSET_PUT_MEDIA_TYPES = ["image/png", "image/jpeg", "video/mp4"];
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 === "video/mp4" || put.bytes <= UPLOAD_MAX_BYTES, `a picture is at most ${UPLOAD_MAX_BYTES} bytes`);
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 an MP4), {base64, media_type} of a PNG or JPEG up to ${ASSET_BASE64_MAX_BYTES} bytes, or ` +
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: <media_type>' --data-binary @<file> '<put_url>'` within 15 minutes, then call " +
194
- "get_asset. On a server running on your machine also {path} of a local PNG, JPEG or MP4. A clip is an MP4 in h264 " +
195
- `or hevc, up to ${ASSET_VIDEO_MAX_SECONDS} seconds and 100 MB; a url clip or a PUT is checked in the background ` +
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, plus a small preview " +
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/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
@@ -325,6 +325,7 @@ const BARE_ERROR_CODES = [
325
325
  "film_draft_limited",
326
326
  "film_draft_not_found",
327
327
  "film_draft_stale",
328
+ "film_hero_limited",
328
329
  "film_run_not_found",
329
330
  "film_voice_not_ready",
330
331
  "generations_disabled",
@@ -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<{
@@ -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 a draft: softer than 720p, for trying a move cheaply; make the final take at 720p";
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/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;
@@ -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;
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, and a ` +
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
  ] : []),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clipwright/core",
3
- "version": "0.67.0",
3
+ "version": "0.68.0",
4
4
  "description": "Zod schemas and the shared request/response contract of the Clipwright UGC video API",
5
5
  "repository": {
6
6
  "type": "git",