@clipwright/core 0.63.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 (54) hide show
  1. package/dist/ad-guide.d.ts +23 -0
  2. package/dist/ad-guide.js +4 -0
  3. package/dist/api-failure.d.ts +1 -0
  4. package/dist/api-failure.js +10 -3
  5. package/dist/brand-styles.d.ts +6 -0
  6. package/dist/contract-dispositions.d.ts +1 -41
  7. package/dist/contract-dispositions.js +0 -9
  8. package/dist/contracts/v1/workflow-brief.d.ts +0 -96
  9. package/dist/contracts/v1/workflow-catalog.d.ts +0 -96
  10. package/dist/contracts/v1/workflow-client.d.ts +0 -48
  11. package/dist/contracts/v1/workflow-execution.d.ts +0 -172
  12. package/dist/contracts/v1/workflow-next.d.ts +0 -86
  13. package/dist/contracts/v1/workflow-plan.d.ts +0 -144
  14. package/dist/design.d.ts +30 -0
  15. package/dist/design.js +29 -1
  16. package/dist/endpoint-notes.js +1 -1
  17. package/dist/errors.d.ts +13 -1
  18. package/dist/errors.js +3 -5
  19. package/dist/faceless-price.d.ts +0 -27
  20. package/dist/faceless-price.js +0 -28
  21. package/dist/faceless-public.d.ts +8 -120
  22. package/dist/faceless-public.js +9 -23
  23. package/dist/film-cut.js +3 -3
  24. package/dist/film-guide.d.ts +51 -0
  25. package/dist/film-guide.js +13 -0
  26. package/dist/film-look.d.ts +3 -0
  27. package/dist/film-look.js +3 -0
  28. package/dist/generations.d.ts +9 -2
  29. package/dist/generations.js +18 -5
  30. package/dist/index.d.ts +0 -1
  31. package/dist/index.js +0 -1
  32. package/dist/openapi.d.ts +11 -0
  33. package/dist/openapi.js +3 -1
  34. package/dist/own-agent-price.d.ts +4 -1
  35. package/dist/own-agent-price.js +7 -4
  36. package/dist/parts-pricing.d.ts +0 -2
  37. package/dist/parts-pricing.js +0 -2
  38. package/dist/prices.js +8 -3
  39. package/dist/scene-bible.d.ts +4 -12
  40. package/dist/scene-bible.js +6 -17
  41. package/dist/skills.d.ts +223 -223
  42. package/dist/skills.js +11 -13
  43. package/dist/voice-admission.d.ts +0 -48
  44. package/dist/workflows/methods/faceless-explainer.d.ts +0 -39
  45. package/dist/workflows/methods/kinetic-launch.d.ts +0 -78
  46. package/dist/workflows/methods/product-image-story.d.ts +0 -39
  47. package/dist/workflows/methods/reference-remake.d.ts +0 -39
  48. package/dist/workflows/methods/shared.d.ts +0 -39
  49. package/dist/workflows/methods/ugc-faq-answer.d.ts +0 -39
  50. package/dist/workflows/methods/ugc-product-intro.d.ts +0 -39
  51. package/dist/workflows/methods/website-proof-demo.d.ts +0 -78
  52. package/package.json +1 -1
  53. package/dist/scene-proposal.d.ts +0 -79
  54. package/dist/scene-proposal.js +0 -50
@@ -7,6 +7,23 @@ export declare const FILM_GUIDE_FORMATS: readonly ["explainer", "story", "list",
7
7
  export type FilmGuideFormat = (typeof FILM_GUIDE_FORMATS)[number];
8
8
  export declare const FILM_GUIDE_SECTIONS: readonly ["steps", "story", "words", "captions", "voice", "consistency", "pictures", "motion", "density", "repair"];
9
9
  export type FilmGuideSection = (typeof FILM_GUIDE_SECTIONS)[number];
10
+ export declare const RECENT_LOOKS_MAX = 5;
11
+ export declare const guideCatalog: z.ZodArray<z.ZodObject<{
12
+ tool: z.ZodEnum<{
13
+ get_ad_guide: "get_ad_guide";
14
+ get_film_guide: "get_film_guide";
15
+ }>;
16
+ format: z.ZodOptional<z.ZodEnum<{
17
+ cartoon: "cartoon";
18
+ explainer: "explainer";
19
+ list: "list";
20
+ own_pictures: "own_pictures";
21
+ story: "story";
22
+ }>>;
23
+ use_when: z.ZodString;
24
+ version: z.ZodString;
25
+ }, z.core.$strict>>;
26
+ export type GuideCatalog = z.infer<typeof guideCatalog>;
10
27
  export declare const filmGuideQuery: z.ZodObject<{
11
28
  format: z.ZodOptional<z.ZodEnum<{
12
29
  cartoon: "cartoon";
@@ -31,6 +48,14 @@ export declare const filmGuideQuery: z.ZodObject<{
31
48
  export type FilmGuideQuery = z.infer<typeof filmGuideQuery>;
32
49
  export declare const FILM_KEPT_SOUNDS_MAX = 60;
33
50
  export declare const filmGuide: z.ZodObject<{
51
+ brand: z.ZodOptional<z.ZodNullable<z.ZodObject<{
52
+ brand_name: z.ZodNullable<z.ZodString>;
53
+ look: z.ZodNullable<z.ZodObject<{
54
+ tag: z.ZodString;
55
+ description: z.ZodPipe<z.ZodString, z.ZodString>;
56
+ }, z.core.$strict>>;
57
+ prompt_block: z.ZodNullable<z.ZodString>;
58
+ }, z.core.$strict>>>;
34
59
  guide: z.ZodString;
35
60
  method: z.ZodString;
36
61
  kit_version: z.ZodString;
@@ -55,6 +80,32 @@ export declare const filmGuide: z.ZodObject<{
55
80
  }, z.core.$strict>>;
56
81
  kept_sounds: z.ZodArray<z.ZodString>;
57
82
  version: z.ZodOptional<z.ZodString>;
83
+ guides: z.ZodOptional<z.ZodArray<z.ZodObject<{
84
+ tool: z.ZodEnum<{
85
+ get_ad_guide: "get_ad_guide";
86
+ get_film_guide: "get_film_guide";
87
+ }>;
88
+ format: z.ZodOptional<z.ZodEnum<{
89
+ cartoon: "cartoon";
90
+ explainer: "explainer";
91
+ list: "list";
92
+ own_pictures: "own_pictures";
93
+ story: "story";
94
+ }>>;
95
+ use_when: z.ZodString;
96
+ version: z.ZodString;
97
+ }, z.core.$strict>>>;
98
+ recent_looks: z.ZodOptional<z.ZodArray<z.ZodObject<{
99
+ look: z.ZodString;
100
+ format: z.ZodEnum<{
101
+ cartoon: "cartoon";
102
+ explainer: "explainer";
103
+ list: "list";
104
+ own_pictures: "own_pictures";
105
+ story: "story";
106
+ }>;
107
+ made_on: z.ZodString;
108
+ }, z.core.$strict>>>;
58
109
  }, z.core.$strict>;
59
110
  export type FilmGuide = z.infer<typeof filmGuide>;
60
111
  export declare const filmKitQuery: z.ZodObject<{
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { brandGuideBlock } from "./design.js";
2
3
  export const FILM_GUIDE_PATH = "/v1/film-guide";
3
4
  export const FILM_KIT_PATH = "/v1/film-kit";
4
5
  export const FILM_KIT_FILES = [
@@ -19,6 +20,13 @@ export const FILM_KIT_FILES = [
19
20
  ];
20
21
  export const FILM_GUIDE_FORMATS = ["explainer", "story", "list", "own_pictures", "cartoon"];
21
22
  export const FILM_GUIDE_SECTIONS = ["steps", "story", "words", "captions", "voice", "consistency", "pictures", "motion", "density", "repair"];
23
+ export const RECENT_LOOKS_MAX = 5;
24
+ export const guideCatalog = z.array(z.strictObject({
25
+ tool: z.enum(["get_ad_guide", "get_film_guide"]),
26
+ format: z.enum(FILM_GUIDE_FORMATS).optional(),
27
+ use_when: z.string().min(1),
28
+ version: z.string().regex(/^[a-f0-9]{12}$/),
29
+ })).describe("Every guide this account can read, each with its version: read the one that fits the video before its first tool call");
22
30
  export const filmGuideQuery = z.strictObject({
23
31
  format: z.enum(FILM_GUIDE_FORMATS).optional().describe("The video to make: explainer (the default, a coded film), story, list (facts or " +
24
32
  "tips), own_pictures (the user's own pictures) or cartoon (a drawn hero in generated pictures)"),
@@ -28,6 +36,7 @@ export const filmGuideQuery = z.strictObject({
28
36
  export const FILM_KEPT_SOUNDS_MAX = 60;
29
37
  const kitVersion = z.string().regex(/^[a-f0-9]{12}$/).describe("The kit's version: a digest of its files, which changes when any of them does");
30
38
  export const filmGuide = z.strictObject({
39
+ brand: brandGuideBlock.optional(),
31
40
  guide: z.string().min(1).describe("The explainer guide, Markdown: the steps, the tools and routes, the rules the checks refuse"),
32
41
  method: z.string().min(1).describe("Its appendix, Markdown: the craft behind every step"),
33
42
  kit_version: kitVersion,
@@ -37,6 +46,10 @@ export const filmGuide = z.strictObject({
37
46
  .describe("Sounds your account's films made and kept, newest first: name one exactly in sfx and it plays again, made nothing new"),
38
47
  version: z.string().regex(/^[a-f0-9]{12}$/).optional()
39
48
  .describe("The guide's version: a digest of the whole guide of this format, the same whichever section is read"),
49
+ guides: guideCatalog.optional(),
50
+ recent_looks: z.array(z.strictObject({ look: z.string(), format: z.enum(FILM_GUIDE_FORMATS), made_on: z.string().regex(/^\d{4}-\d{2}-\d{2}$/) }))
51
+ .max(RECENT_LOOKS_MAX).optional()
52
+ .describe("The looks this account's latest faceless videos used, newest first: pick another unless the user keeps their style"),
40
53
  });
41
54
  export const filmKitQuery = z.strictObject({
42
55
  path: z.enum(FILM_KIT_FILES).optional().describe("One kit file; every file when omitted"),
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ export declare const filmLookTag: z.ZodString;
3
+ export declare const filmLookDescription: z.ZodString;
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ export const filmLookTag = z.string().regex(/^[a-z][a-z0-9_]{1,31}$/u, "a short snake_case tag, such as flat_2d");
3
+ export const filmLookDescription = z.string().trim().min(1).max(300);
@@ -9,7 +9,7 @@ export declare const GENERATION_VIDEO_MODELS: readonly ["seedance-2.0", "seedanc
9
9
  export type GenerationImageModel = (typeof GENERATION_IMAGE_MODELS)[number];
10
10
  export type GenerationVideoModel = (typeof GENERATION_VIDEO_MODELS)[number];
11
11
  export type GenerationModel = GenerationImageModel | GenerationVideoModel;
12
- export declare const GENERATION_IMAGE_ASPECTS: readonly ["9:16", "16:9", "1:1"];
12
+ export declare const GENERATION_IMAGE_ASPECTS: readonly ["9:16", "16:9", "1:1", "21:9"];
13
13
  export declare const GENERATION_VIDEO_ASPECTS: readonly ["9:16", "16:9"];
14
14
  export declare const GENERATION_RESOLUTIONS: readonly ["360p", "480p", "720p", "1080p"];
15
15
  export declare const GENERATION_VIDEO_MODES: readonly ["text", "first_frame", "reference"];
@@ -57,6 +57,7 @@ export interface GenerationVideoCapability {
57
57
  duration_values?: readonly number[];
58
58
  last_frame?: false;
59
59
  last_frame_max_s?: number;
60
+ audio?: true;
60
61
  rows: readonly GenerationVideoRow[];
61
62
  }
62
63
  type GenerationCapabilities = {
@@ -90,6 +91,7 @@ export declare const generateImageRequest: z.ZodObject<{
90
91
  aspect_ratio: z.ZodEnum<{
91
92
  "16:9": "16:9";
92
93
  "1:1": "1:1";
94
+ "21:9": "21:9";
93
95
  "9:16": "9:16";
94
96
  }>;
95
97
  references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
@@ -231,6 +233,7 @@ export declare const generateVideoRequest: z.ZodObject<{
231
233
  static: "static";
232
234
  turntable: "turntable";
233
235
  }>>;
236
+ audio: z.ZodOptional<z.ZodBoolean>;
234
237
  max_credits: z.ZodOptional<z.ZodNumber>;
235
238
  }, z.core.$strict>;
236
239
  export type GenerateVideoRequest = z.infer<typeof generateVideoRequest>;
@@ -298,6 +301,7 @@ declare const listedModel: z.ZodObject<{
298
301
  }, z.core.$strict>>;
299
302
  duration_values: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
300
303
  max_references: z.ZodNumber;
304
+ audio: z.ZodOptional<z.ZodLiteral<true>>;
301
305
  rows: z.ZodArray<z.ZodObject<{
302
306
  aspect_ratio: z.ZodString;
303
307
  resolution: z.ZodNullable<z.ZodEnum<{
@@ -334,6 +338,7 @@ export declare const generationModels: z.ZodObject<{
334
338
  }, z.core.$strict>>;
335
339
  duration_values: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
336
340
  max_references: z.ZodNumber;
341
+ audio: z.ZodOptional<z.ZodLiteral<true>>;
337
342
  rows: z.ZodArray<z.ZodObject<{
338
343
  aspect_ratio: z.ZodString;
339
344
  resolution: z.ZodNullable<z.ZodEnum<{
@@ -352,5 +357,7 @@ export declare const generationModels: z.ZodObject<{
352
357
  }, z.core.$strict>;
353
358
  export type GenerationModels = z.infer<typeof generationModels>;
354
359
  export type ListedGenerationModel = z.infer<typeof listedModel>;
355
- export declare function listGenerationModels(): ListedGenerationModel[];
360
+ export declare function listGenerationModels(options?: {
361
+ audio?: boolean;
362
+ }): ListedGenerationModel[];
356
363
  export {};
@@ -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,6 +17,7 @@ export declare const TAKE_MOTION_CHECKS_PER_HOUR = 30;
17
17
  export declare const CUT_PREVIEWS_PER_HOUR = 20;
18
18
  export declare const OWN_TAKE_CHECK_CREDITS = 10;
19
19
  export declare const OWN_TAKE_CHECK_PICTURE_CREDITS = 20;
20
+ export declare const OWN_TAKE_CHECK_PICTURE_LONG_CREDITS = 38, TAKE_PICTURE_SHORT_TIER_SECONDS = 4.1;
20
21
  export declare const OWN_CUT_CREDITS = 45, OWN_CUT_INCLUDED_SECONDS = 60, OWN_CUT_EXTRA_SECOND_CREDITS = 1, OWN_CUT_MAX_SECONDS = 90;
21
22
  export declare const OWN_CUT_MIN_SECONDS = 10;
22
23
  export declare const OWN_CUT_BED_CREDITS = 35;
@@ -44,6 +45,7 @@ export declare const ownAgentTerms: z.ZodObject<{
44
45
  music_credits: z.ZodOptional<z.ZodNumber>;
45
46
  take_check_credits: z.ZodOptional<z.ZodNumber>;
46
47
  picture_check_credits: z.ZodOptional<z.ZodNumber>;
48
+ picture_check_long_credits: z.ZodOptional<z.ZodNumber>;
47
49
  cut_credits: z.ZodOptional<z.ZodNumber>;
48
50
  cut_included_seconds: z.ZodOptional<z.ZodNumber>;
49
51
  cut_extra_second_credits: z.ZodOptional<z.ZodNumber>;
@@ -89,6 +91,7 @@ export type OwnAgentDelivery = {
89
91
  skill: "film_take_check";
90
92
  checks: number;
91
93
  against?: "motion" | "picture";
94
+ long?: boolean;
92
95
  } | ({
93
96
  skill: "film_cut";
94
97
  seconds: number;
@@ -96,6 +99,6 @@ export type OwnAgentDelivery = {
96
99
  export declare function ownCutCredits(cut: {
97
100
  seconds: number;
98
101
  } & OwnCutParts, terms?: OwnAgentTerms): number;
99
- export declare function ownTakeCheckCredits(n: number, terms?: OwnAgentTerms, against?: "motion" | "picture"): number;
102
+ export declare function ownTakeCheckCredits(n: number, terms?: OwnAgentTerms, against?: "motion" | "picture", long?: boolean): number;
100
103
  export declare function ownTakeFramesCredits(sheets: number): number;
101
104
  export declare function ownAgentCharge(delivery: OwnAgentDelivery, terms: OwnAgentTerms, heldCredits: number): number;
@@ -19,6 +19,7 @@ export const TAKE_MOTION_CHECKS_PER_HOUR = 30;
19
19
  export const CUT_PREVIEWS_PER_HOUR = 20;
20
20
  export const OWN_TAKE_CHECK_CREDITS = 10;
21
21
  export const OWN_TAKE_CHECK_PICTURE_CREDITS = 20;
22
+ export const OWN_TAKE_CHECK_PICTURE_LONG_CREDITS = 38, TAKE_PICTURE_SHORT_TIER_SECONDS = 4.1;
22
23
  export const OWN_CUT_CREDITS = 45, OWN_CUT_INCLUDED_SECONDS = 60, OWN_CUT_EXTRA_SECOND_CREDITS = 1, OWN_CUT_MAX_SECONDS = 90;
23
24
  export const OWN_CUT_MIN_SECONDS = 10;
24
25
  export const OWN_CUT_BED_CREDITS = 35;
@@ -38,6 +39,7 @@ export const ownAgentTerms = z.strictObject({
38
39
  music_credits: z.number().int().nonnegative().optional(),
39
40
  take_check_credits: z.number().int().nonnegative().optional(),
40
41
  picture_check_credits: z.number().int().nonnegative().optional(),
42
+ picture_check_long_credits: z.number().int().nonnegative().optional(),
41
43
  cut_credits: z.number().int().nonnegative().optional(),
42
44
  cut_included_seconds: z.number().int().positive().optional(),
43
45
  cut_extra_second_credits: z.number().int().nonnegative().optional(),
@@ -53,7 +55,7 @@ const CUT_TERMS = ["cut_credits", "cut_included_seconds", "cut_extra_second_cred
53
55
  export const ownAgentTermsNow = () => ({ tariff: OWN_AGENT_TARIFF, still_credits: OWN_STILL_CREDITS, render_credits: OWN_FILM_RENDER_CREDITS,
54
56
  included_seconds: OWN_FILM_INCLUDED_SECONDS, extra_second_credits: OWN_FILM_EXTRA_SECOND_CREDITS, voice_credits_per_second: OWN_VOICE_CREDITS_PER_SECOND,
55
57
  pose_credits: OWN_HERO_POSE_CREDITS, edit_credits: OWN_EDIT_CREDITS, music_credits: MUSIC_BED_CREDITS, take_check_credits: OWN_TAKE_CHECK_CREDITS,
56
- picture_check_credits: OWN_TAKE_CHECK_PICTURE_CREDITS, free_stills: OWN_FREE_STILLS, free_stills_window_hours: OWN_FREE_STILLS_WINDOW_HOURS, cut_credits: OWN_CUT_CREDITS, cut_included_seconds: OWN_CUT_INCLUDED_SECONDS,
58
+ picture_check_credits: OWN_TAKE_CHECK_PICTURE_CREDITS, picture_check_long_credits: OWN_TAKE_CHECK_PICTURE_LONG_CREDITS, free_stills: OWN_FREE_STILLS, free_stills_window_hours: OWN_FREE_STILLS_WINDOW_HOURS, cut_credits: OWN_CUT_CREDITS, cut_included_seconds: OWN_CUT_INCLUDED_SECONDS,
57
59
  cut_extra_second_credits: OWN_CUT_EXTRA_SECOND_CREDITS, cut_bed_credits: OWN_CUT_BED_CREDITS,
58
60
  cut_take_sound_credits_per_second: OWN_CUT_TAKE_SOUND_CREDITS_PER_SECOND, cut_music_credits: MUSIC_BED_CREDITS });
59
61
  export const isOwnAgentEnabled = (env) => env.CLIPWRIGHT_OWN_AGENT === "1";
@@ -98,10 +100,11 @@ export function ownCutCredits(cut, terms = ownAgentTermsNow()) {
98
100
  return terms.cut_credits + terms.cut_extra_second_credits * Math.max(0, s - terms.cut_included_seconds) + (cut.bed ? terms.cut_bed_credits : 0)
99
101
  + terms.cut_take_sound_credits_per_second * Math.ceil(cut.take_sound_seconds - 1e-9) + (cut.music ? terms.cut_music_credits : 0);
100
102
  }
101
- export function ownTakeCheckCredits(n, terms = ownAgentTermsNow(), against = "motion") {
103
+ export function ownTakeCheckCredits(n, terms = ownAgentTermsNow(), against = "motion", long = false) {
102
104
  if (n !== 0 && n !== 1)
103
105
  throw new Error(`${n} take verdicts is outside 0–1`);
104
- const unit = against === "picture" ? terms.picture_check_credits : terms.take_check_credits;
106
+ const longPrice = against === "picture" && long && terms.picture_check_long_credits !== undefined;
107
+ const unit = longPrice ? terms.picture_check_long_credits : against === "picture" ? terms.picture_check_credits : terms.take_check_credits;
105
108
  if (unit === undefined)
106
109
  throw new Error(against === "picture" ? "these terms price no picture check" : "these terms price no take check");
107
110
  return unit * n;
@@ -117,7 +120,7 @@ export function ownAgentCharge(delivery, terms, heldCredits) {
117
120
  : delivery.skill === "film_hero" ? ownHeroCredits(delivery.poses, terms)
118
121
  : delivery.skill === "film_edit" ? ownEditCredits(delivery.seconds, terms, delivery.music === true)
119
122
  : delivery.skill === "film_take_frames" ? ownTakeFramesCredits(delivery.sheets)
120
- : delivery.skill === "film_take_check" ? ownTakeCheckCredits(delivery.checks, terms, delivery.against)
123
+ : delivery.skill === "film_take_check" ? ownTakeCheckCredits(delivery.checks, terms, delivery.against, delivery.long === true)
121
124
  : delivery.skill === "film_cut" ? ownCutCredits(delivery, terms) : ownFilmRenderCredits(delivery.seconds, terms);
122
125
  if (!Number.isSafeInteger(heldCredits) || charge > heldCredits)
123
126
  throw new Error(`${delivery.skill} charge ${charge} is over its hold ${heldCredits}`);
@@ -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),
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 } from "./own-agent-price.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";
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"];
@@ -142,8 +142,13 @@ export const FACELESS_DIY_PRICES = Object.freeze([
142
142
  "fails costs nothing." }),
143
143
  paid({ tool: "check_take", variant: "against a picture", route: "POST /v1/take-checks", quote_tool: "quote_take_check", unit: "call",
144
144
  credits: OWN_TAKE_CHECK_PICTURE_CREDITS,
145
- notes: "One take of your cut record judged against the picture it was made from: each defect with its seconds, the clean windows, the " +
146
- "second its action shows and where its subject stands. Charged only for a delivered verdict; a check that delivers no verdict costs nothing." }),
145
+ notes: `One take of your cut record, up to ${TAKE_PICTURE_SHORT_TIER_SECONDS} s long, judged against the picture it was made from: each ` +
146
+ "defect with its seconds, the clean windows, the second its action shows and where its subject stands. Charged only for a delivered " +
147
+ "verdict; a check that delivers no verdict costs nothing." }),
148
+ paid({ tool: "check_take", variant: `against a picture, a take over ${TAKE_PICTURE_SHORT_TIER_SECONDS} s`, route: "POST /v1/take-checks",
149
+ quote_tool: "quote_take_check", unit: "call", credits: OWN_TAKE_CHECK_PICTURE_LONG_CREDITS,
150
+ notes: `The same check of a take longer than ${TAKE_PICTURE_SHORT_TIER_SECONDS} s. Charged only for a delivered verdict; a check that ` +
151
+ "delivers no verdict costs nothing." }),
147
152
  paid({ tool: "preview_cut", route: "POST /v1/cut-previews", quote_tool: "quote_cut_preview", unit: "still", credits: OWN_STILL_CREDITS,
148
153
  notes: `Up to ${CUT_PREVIEW_MAX_STILLS} frames of your checked cut sheet as the video draws them, on the words you name. The first ` +
149
154
  `${OWN_FREE_STILLS} preview stills of an account in any ${OWN_FREE_STILLS_WINDOW_HOURS} h are free; a preview that fails costs nothing.` }),
@@ -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
- }