@clipwright/core 0.64.0 → 0.65.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.
Files changed (45) hide show
  1. package/dist/ad-guide.d.ts +15 -0
  2. package/dist/ad-guide.js +2 -0
  3. package/dist/api-failure.d.ts +1 -0
  4. package/dist/api-failure.js +10 -3
  5. package/dist/contract-dispositions.d.ts +1 -41
  6. package/dist/contract-dispositions.js +0 -9
  7. package/dist/contracts/v1/workflow-brief.d.ts +0 -96
  8. package/dist/contracts/v1/workflow-catalog.d.ts +0 -96
  9. package/dist/contracts/v1/workflow-client.d.ts +0 -48
  10. package/dist/contracts/v1/workflow-execution.d.ts +0 -172
  11. package/dist/contracts/v1/workflow-next.d.ts +0 -86
  12. package/dist/contracts/v1/workflow-plan.d.ts +0 -144
  13. package/dist/endpoint-notes.js +1 -1
  14. package/dist/errors.d.ts +13 -1
  15. package/dist/errors.js +3 -5
  16. package/dist/faceless-price.d.ts +0 -27
  17. package/dist/faceless-price.js +0 -28
  18. package/dist/faceless-public.d.ts +8 -120
  19. package/dist/faceless-public.js +9 -23
  20. package/dist/film-guide.d.ts +43 -0
  21. package/dist/film-guide.js +11 -0
  22. package/dist/generations.d.ts +9 -2
  23. package/dist/generations.js +18 -5
  24. package/dist/index.d.ts +0 -1
  25. package/dist/index.js +0 -1
  26. package/dist/openapi.d.ts +11 -0
  27. package/dist/openapi.js +3 -1
  28. package/dist/parts-pricing.d.ts +0 -2
  29. package/dist/parts-pricing.js +0 -2
  30. package/dist/scene-bible.d.ts +4 -12
  31. package/dist/scene-bible.js +6 -17
  32. package/dist/skills.d.ts +223 -223
  33. package/dist/skills.js +11 -13
  34. package/dist/voice-admission.d.ts +0 -48
  35. package/dist/workflows/methods/faceless-explainer.d.ts +0 -39
  36. package/dist/workflows/methods/kinetic-launch.d.ts +0 -78
  37. package/dist/workflows/methods/product-image-story.d.ts +0 -39
  38. package/dist/workflows/methods/reference-remake.d.ts +0 -39
  39. package/dist/workflows/methods/shared.d.ts +0 -39
  40. package/dist/workflows/methods/ugc-faq-answer.d.ts +0 -39
  41. package/dist/workflows/methods/ugc-product-intro.d.ts +0 -39
  42. package/dist/workflows/methods/website-proof-demo.d.ts +0 -78
  43. package/package.json +1 -1
  44. package/dist/scene-proposal.d.ts +0 -79
  45. package/dist/scene-proposal.js +0 -50
@@ -15,7 +15,7 @@ export const GENERATION_VIDEO_MODELS = [
15
15
  "seedance-2.0", "seedance-2.0-mini", "seedance-2.0-fast", "seedance-2.5", "seedance-2.5-flash", "kling-3.0", "kling-4.0", "kling-4.0-flash",
16
16
  "gemini-omni-flash-1.1", "gemini-omni-flash-1.2",
17
17
  ];
18
- export const GENERATION_IMAGE_ASPECTS = ["9:16", "16:9", "1:1"];
18
+ export const GENERATION_IMAGE_ASPECTS = ["9:16", "16:9", "1:1", "21:9"];
19
19
  export const GENERATION_VIDEO_ASPECTS = ["9:16", "16:9"];
20
20
  export const GENERATION_RESOLUTIONS = ["360p", "480p", "720p", "1080p"];
21
21
  export const GENERATION_VIDEO_MODES = ["text", "first_frame", "reference"];
@@ -46,6 +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
50
  function only(rows, aspect, change) {
50
51
  return rows.map((row) => (row.aspect_ratio === aspect ? { ...row, ...change } : row));
51
52
  }
@@ -57,7 +58,7 @@ export const GENERATION_CAPABILITIES = deepFreeze({
57
58
  },
58
59
  flare: {
59
60
  kind: "image",
60
- rows: [image("9:16", 1008, 1792, 6, true), image("16:9", 1792, 1008, 6), image("1:1", 1024, 1024, 6)],
61
+ rows: [image("9:16", 1008, 1792, 6, true), image("16:9", 1792, 1008, 6), image("1:1", 1024, 1024, 6), image("21:9", 2352, 1008, 15, true)],
61
62
  },
62
63
  "gemini-3-pro-image": {
63
64
  kind: "image",
@@ -99,6 +100,7 @@ export const GENERATION_CAPABILITIES = deepFreeze({
99
100
  fps: GENERATION_VIDEO_FPS,
100
101
  modes: { text: false, first_frame: true, reference: true },
101
102
  duration_s: { min: 4, max: 30 },
103
+ audio: true,
102
104
  rows: [...referenceVertical(video("480p", 480, 854, 26, H264, { vertical: true, horizontal: true })),
103
105
  ...referenceVertical(video("720p", 720, 1280, 59, H264, { vertical: true, horizontal: true })),
104
106
  ...video("1080p", 1080, 1920, 143, HEVC10, { vertical: true }, "seedance-2.5 at 1080p is HEVC 10-bit (yuv420p10le); some browsers and editors do not play it")],
@@ -108,6 +110,7 @@ export const GENERATION_CAPABILITIES = deepFreeze({
108
110
  fps: GENERATION_VIDEO_FPS,
109
111
  modes: { text: false, first_frame: true, reference: true },
110
112
  duration_s: { min: 4, max: 30 },
113
+ audio: true,
111
114
  rows: [...referenceVertical(video("480p", 480, 854, 17, H264, { vertical: true, horizontal: true })),
112
115
  ...referenceVertical(video("720p", 720, 1280, 38, H264, { vertical: true, horizontal: true }))],
113
116
  },
@@ -149,7 +152,9 @@ export const GENERATION_CAPABILITIES = deepFreeze({
149
152
  modes: { text: true, first_frame: true, reference: true },
150
153
  duration_s: { min: 3, max: 15 },
151
154
  last_frame_max_s: 10,
152
- rows: referenceVertical(video("720p", 720, 1280, 12, H264, { vertical: true, horizontal: true })),
155
+ audio: true,
156
+ rows: [...referenceVertical(video("360p", 360, 640, 5, H264, { vertical: true }, OMNI_DRAFT_360P)),
157
+ ...referenceVertical(video("720p", 720, 1280, 12, H264, { vertical: true, horizontal: true }))],
153
158
  },
154
159
  });
155
160
  function deepFreeze(value) {
@@ -190,6 +195,7 @@ export const generateImageRequest = z.strictObject({
190
195
  });
191
196
  const SHOT_DESCRIPTION = "The clip as a shot, in place of prompt: framing, subject, start_state, timed beats, camera, light and " +
192
197
  "continuity. Write every field as what the frame shows: a state reads \"her fingertips are clean\", never as an absence.";
198
+ const AUDIO_DESCRIPTION = "Keep the model's own sound (words in prompt spoken, effects): models listed audio: true, same price. Else silent.";
193
199
  export const generateVideoRequest = z.strictObject({
194
200
  prompt: prompt.optional().describe("What the clip shows, in your words; or pass shot instead."),
195
201
  shot: generationShot.optional().describe(SHOT_DESCRIPTION),
@@ -203,10 +209,13 @@ export const generateVideoRequest = z.strictObject({
203
209
  last_frame: generationReference.optional(),
204
210
  references: z.array(generationReference).min(1).max(GENERATION_MAX_REFERENCES).optional(),
205
211
  camera: z.enum(GENERATION_CAMERAS).optional().describe(GENERATION_CAMERA_DESCRIPTION),
212
+ audio: z.boolean().optional().describe(AUDIO_DESCRIPTION),
206
213
  max_credits: maxCreditsField,
207
214
  }).superRefine((request, context) => {
208
215
  const issue = (path, message) => context.addIssue({ code: z.ZodIssueCode.custom, path: [path], message });
209
216
  const capability = GENERATION_CAPABILITIES[request.model];
217
+ if (request.audio === true && capability.audio !== true)
218
+ issue("audio", `${request.model} makes no sound`);
210
219
  const { min, max } = capability.duration_s;
211
220
  if (request.duration_s < min || request.duration_s > max) {
212
221
  issue("duration_s", `${request.model} takes ${min} to ${max} seconds`);
@@ -250,6 +259,8 @@ export function findCapabilityRow(request) {
250
259
  const { min, max } = capability.duration_s;
251
260
  if (!capability.modes[request.mode] || request.duration_s < min || request.duration_s > max)
252
261
  return null;
262
+ if (request.audio === true && capability.audio !== true)
263
+ return null;
253
264
  if (request.last_frame !== undefined && capability.last_frame === false)
254
265
  return null;
255
266
  if (request.last_frame !== undefined && request.duration_s > (capability.last_frame_max_s ?? max))
@@ -302,13 +313,14 @@ const listedModel = z.strictObject({
302
313
  duration_s: z.strictObject({ min: z.number().int().positive(), max: z.number().int().positive() }).nullable(),
303
314
  duration_values: z.array(z.number().int().positive()).min(1).optional(),
304
315
  max_references: z.number().int().nonnegative(),
316
+ audio: z.literal(true).optional().describe("Present on a clip model that keeps its own sound on audio: true, at the same price."),
305
317
  rows: z.array(listedRow).min(1),
306
318
  });
307
319
  export const generationModels = z.strictObject({
308
320
  models: z.array(listedModel),
309
321
  contract_version: z.string().min(1),
310
322
  });
311
- export function listGenerationModels() {
323
+ export function listGenerationModels(options = {}) {
312
324
  return Object.keys(GENERATION_CAPABILITIES).flatMap((model) => {
313
325
  const capability = GENERATION_CAPABILITIES[model];
314
326
  if (capability.kind === "image") {
@@ -324,6 +336,7 @@ export function listGenerationModels() {
324
336
  return rows.length === 0 || modes.length === 0 ? [] : [{ model, kind: "video", unit: "second", modes,
325
337
  duration_s: { ...capability.duration_s },
326
338
  ...(capability.duration_values ? { duration_values: [...capability.duration_values] } : {}),
327
- max_references: modes.includes("reference") ? GENERATION_MAX_REFERENCES : 0, rows }];
339
+ max_references: modes.includes("reference") ? GENERATION_MAX_REFERENCES : 0,
340
+ ...(options.audio === true && capability.audio === true ? { audio: true } : {}), rows }];
328
341
  });
329
342
  }
package/dist/index.d.ts CHANGED
@@ -91,7 +91,6 @@ export * from "./workflows/index.js";
91
91
  export * from "./output-provenance.js";
92
92
  export * from "./generation-shot.js";
93
93
  export * from "./scene-bible.js";
94
- export * from "./scene-proposal.js";
95
94
  export * from "./generations.js";
96
95
  export * from "./generations-output.js";
97
96
  export * from "./reference-profile.js";
package/dist/index.js CHANGED
@@ -91,7 +91,6 @@ export * from "./workflows/index.js";
91
91
  export * from "./output-provenance.js";
92
92
  export * from "./generation-shot.js";
93
93
  export * from "./scene-bible.js";
94
- export * from "./scene-proposal.js";
95
94
  export * from "./generations.js";
96
95
  export * from "./generations-output.js";
97
96
  export * from "./reference-profile.js";
package/dist/openapi.d.ts CHANGED
@@ -55,6 +55,17 @@ export declare const errorEnvelope: z.ZodObject<{
55
55
  [x: string]: string;
56
56
  }>;
57
57
  message: z.ZodString;
58
+ next: z.ZodOptional<z.ZodObject<{
59
+ action: z.ZodString;
60
+ method: z.ZodEnum<{
61
+ GET: "GET";
62
+ POST: "POST";
63
+ }>;
64
+ path: z.ZodString;
65
+ body: z.ZodRecord<z.ZodString, z.ZodUnknown>;
66
+ add: z.ZodArray<z.ZodString>;
67
+ note: z.ZodString;
68
+ }, z.core.$strict>>;
58
69
  }, z.core.$loose>;
59
70
  }, z.core.$strip>;
60
71
  export declare const OPENAPI_ROUTES: Readonly<Record<string, OpenApiRoute>>;
package/dist/openapi.js CHANGED
@@ -20,6 +20,7 @@ import { revisionQuote, revisionRequest } from "./edit-revision.js";
20
20
  import { runShots } from "./edit-shots.js";
21
21
  import { ENDPOINT_NOTES } from "./endpoint-notes.js";
22
22
  import { API_ERROR_CODES } from "./errors.js";
23
+ import { diyNext } from "./diy-next.js";
23
24
  import { API_ENDPOINTS, endpointLabel } from "./endpoints.js";
24
25
  import { facelessQuoteResponse } from "./faceless-public.js";
25
26
  import { feedbackRequest, feedbackResponse } from "./feedback.js";
@@ -58,7 +59,8 @@ const TAGS = {
58
59
  Feedback: "What is missing, confusing, wrong or slow; we read every one.",
59
60
  };
60
61
  export const errorEnvelope = z.object({
61
- error: z.looseObject({ code: z.enum(API_ERROR_CODES), message: z.string().min(1) }),
62
+ error: z.looseObject({ code: z.enum(API_ERROR_CODES), message: z.string().min(1),
63
+ next: diyNext.optional().describe("The one call that fixes this refusal, when there is one") }),
62
64
  });
63
65
  const Run = named("Run", workflowRun);
64
66
  const MakeUgcInput = named("MakeUgcInput", offeredUgcInput.strict());
@@ -17,8 +17,6 @@ export declare const PARTS_OMNI_PRICING_VERSION = "parts-v3";
17
17
  export declare const PARTS_OMNI_FACE_TARIFF: PartsFaceTariff;
18
18
  export declare const PARTS_METHOD_PRICING_VERSION = "parts-v4";
19
19
  export declare function partsMethodFaceTariff(resolution: Resolution): PartsFaceTariff;
20
- export declare const partsFaceTariffFor: (omni: boolean, resolution: Resolution) => PartsFaceTariff;
21
- export declare const PRE_PRODUCTION_CREDITS = 270;
22
20
  export declare const FACE_BILLING_TARIFFS: readonly PartsFaceTariff[];
23
21
  export declare const durationPartsTariffSchema: z.ZodReadonly<z.ZodObject<{
24
22
  version: z.ZodLiteral<1>;
@@ -39,8 +39,6 @@ export function partsMethodFaceTariff(resolution) {
39
39
  return Object.freeze({ ...PARTS_OMNI_FACE_TARIFF, pricingVersion: PARTS_METHOD_PRICING_VERSION,
40
40
  shotCreditsPerSecond: Object.freeze({ ...PARTS_OMNI_FACE_TARIFF.shotCreditsPerSecond, ...METHOD_SHOT_CREDITS_PER_SECOND[resolution] }) });
41
41
  }
42
- export const partsFaceTariffFor = (omni, resolution) => (omni ? partsMethodFaceTariff(resolution) : PARTS_FACE_TARIFF);
43
- export const PRE_PRODUCTION_CREDITS = 270;
44
42
  export const FACE_BILLING_TARIFFS = Object.freeze([PARTS_FACE_TARIFF]);
45
43
  export const durationPartsTariffSchema = z.object({
46
44
  version: z.literal(1),
@@ -16,12 +16,11 @@ export declare const sceneBible: z.ZodObject<{
16
16
  light: z.ZodOptional<z.ZodString>;
17
17
  }, z.core.$strict>;
18
18
  export type SceneBible = z.infer<typeof sceneBible>;
19
- export declare const SCENE_DESCRIPTION: string;
20
19
  export declare const shotStart: z.ZodString;
21
- export declare const FACELESS_SCENE_DESCRIPTION: string;
22
- export declare const SCENE_DIRECTOR_DISABLED_MESSAGE = "scene is not available right now; omit scene and each shot's start";
23
- export declare const FACELESS_SCENE_DIRECTOR_DISABLED_MESSAGE = "scene is not available on make_faceless right now; omit scene";
24
- export declare const SCENE_UNUSED_WARNING = "scene has no effect on this video: it has no live shots";
20
+ export declare const storedSceneProposal: z.ZodObject<{
21
+ id: z.ZodString;
22
+ accept: z.ZodDefault<z.ZodArray<z.ZodString>>;
23
+ }, z.core.$strict>;
25
24
  export declare const sceneDirectionMark: z.ZodObject<{
26
25
  mode: z.ZodLiteral<"complete">;
27
26
  proposal: z.ZodOptional<z.ZodObject<{
@@ -47,11 +46,4 @@ export type RunSpeech = z.infer<typeof runSpeech>;
47
46
  export declare const speechActions: z.ZodArray<z.ZodString>;
48
47
  export declare function speechActionsOf(storedInput: unknown): ReadonlySet<string>;
49
48
  export declare function runSpeechOf(storedInput: unknown): RunSpeech | undefined;
50
- export declare function sceneDirectorAccounts(env: Record<string, string | undefined>): "all" | ReadonlySet<string> | null;
51
49
  export declare function listedAccounts(raw: string | undefined): "all" | ReadonlySet<string> | null;
52
- export declare function asksSceneDirection(input: {
53
- scene?: unknown;
54
- shots?: readonly {
55
- start?: unknown;
56
- }[] | undefined;
57
- }): boolean;
@@ -27,21 +27,16 @@ export const sceneBible = z.strictObject({
27
27
  });
28
28
  }
29
29
  }).refine(scene => Object.keys(scene).length > 0, { message: "scene needs at least one field" });
30
- export const SCENE_DESCRIPTION = "One scene for the whole video, written once: where it happens, how the presenter stands or sits, what " +
31
- "they wear, how the product looks, the props and the light. The presenter and every live shot of the video are drawn in it; a presenter " +
32
- "photo of your own (image) is kept as it is. Omitted, one is written from the script and the presenter's picture; free.";
33
30
  export const shotStart = sceneText(MAX_SHOT_START).superRefine((text, context) => {
34
31
  const word = negationIn(text);
35
32
  if (word)
36
33
  context.addIssue({ code: z.ZodIssueCode.custom, message: absentMessage(word) });
37
- }).describe("talking_action and action: the first frame, where the actor is and what they hold as the shot begins; omitted, written from " +
38
- "the scene and the action.");
39
- export const FACELESS_SCENE_DESCRIPTION = "One scene for the whole video, written once: where it happens, how the main character stands or " +
40
- "sits, what they wear, how the product looks, the props and the light. Every picture and moving clip of the video is drawn in it; with " +
41
- "format explainer, the film's scenes are set in it. Omitted, a picture video gets one written with its story; free.";
42
- export const SCENE_DIRECTOR_DISABLED_MESSAGE = "scene is not available right now; omit scene and each shot's start";
43
- export const FACELESS_SCENE_DIRECTOR_DISABLED_MESSAGE = "scene is not available on make_faceless right now; omit scene";
44
- export const SCENE_UNUSED_WARNING = "scene has no effect on this video: it has no live shots";
34
+ });
35
+ export const storedSceneProposal = z.strictObject({
36
+ id: z.string().regex(/^sp_[a-z0-9]{20}$/),
37
+ accept: z.array(z.string().regex(/^o[1-9][0-9]?$/)).max(12)
38
+ .refine(ids => new Set(ids).size === ids.length, { message: "each option id once" }).default([]),
39
+ });
45
40
  export const sceneDirectionMark = z.strictObject({ mode: z.literal("complete"),
46
41
  proposal: z.strictObject({ id: z.string().regex(/^sp_[a-z0-9]{20}$/), content_digest: z.string().regex(/^[a-f0-9]{64}$/),
47
42
  accepted: z.array(z.string().regex(/^o[1-9][0-9]?$/)).max(12) }).optional(),
@@ -61,9 +56,6 @@ export function runSpeechOf(storedInput) {
61
56
  const parsed = runSpeech.safeParse(storedInput.speech);
62
57
  return parsed.success ? parsed.data : undefined;
63
58
  }
64
- export function sceneDirectorAccounts(env) {
65
- return listedAccounts(env.CLIPWRIGHT_SCENE_DIRECTOR);
66
- }
67
59
  export function listedAccounts(raw) {
68
60
  const value = raw?.trim();
69
61
  if (value === "1")
@@ -71,6 +63,3 @@ export function listedAccounts(raw) {
71
63
  const ids = (value ?? "").split(",").map(id => id.trim()).filter(id => /^acc_[A-Za-z0-9_-]+$/.test(id));
72
64
  return ids.length ? new Set(ids) : null;
73
65
  }
74
- export function asksSceneDirection(input) {
75
- return input.scene !== undefined || (input.shots ?? []).some(shot => shot.start !== undefined);
76
- }