@clipwright/core 0.86.0 → 0.88.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 (47) hide show
  1. package/dist/agent-rules.d.ts +11 -0
  2. package/dist/agent-rules.js +17 -0
  3. package/dist/api-failure.d.ts +1 -0
  4. package/dist/api-failure.js +1 -1
  5. package/dist/contracts/v1/workflow-execution.d.ts +32 -0
  6. package/dist/contracts/v1/workflow-next.d.ts +16 -0
  7. package/dist/endpoint-notes.js +7 -0
  8. package/dist/endpoints.d.ts +6 -0
  9. package/dist/endpoints.js +8 -0
  10. package/dist/errors.d.ts +1 -1
  11. package/dist/errors.js +2 -0
  12. package/dist/faceless-public.d.ts +12 -0
  13. package/dist/faceless-public.js +5 -1
  14. package/dist/faceless-voices.d.ts +19 -0
  15. package/dist/faceless-voices.js +34 -5
  16. package/dist/film-guide.js +1 -1
  17. package/dist/generations.d.ts +1 -0
  18. package/dist/generations.js +4 -3
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.js +2 -0
  21. package/dist/openapi.d.ts +1 -0
  22. package/dist/openapi.js +21 -0
  23. package/dist/own-agent-price.d.ts +5 -2
  24. package/dist/own-agent-price.js +10 -6
  25. package/dist/own-agent-runs.d.ts +1 -0
  26. package/dist/own-agent-runs.js +4 -3
  27. package/dist/parts-pricing.d.ts +1 -1
  28. package/dist/parts-pricing.js +1 -1
  29. package/dist/prices.js +14 -8
  30. package/dist/rate-limit.d.ts +6 -0
  31. package/dist/rate-limit.js +14 -0
  32. package/dist/reference-analysis.d.ts +2 -0
  33. package/dist/reference-analysis.js +4 -2
  34. package/dist/run-list.d.ts +94 -0
  35. package/dist/run-list.js +56 -0
  36. package/dist/script-voice.d.ts +1 -0
  37. package/dist/script-voice.js +2 -1
  38. package/dist/skills.d.ts +6 -2
  39. package/dist/skills.js +33 -30
  40. package/dist/trend-niches.d.ts +1 -0
  41. package/dist/trend-niches.js +6 -5
  42. package/dist/trend-search.d.ts +17 -6
  43. package/dist/trend-search.js +15 -10
  44. package/dist/uploads.js +3 -2
  45. package/dist/workflows/reference-remake.d.ts +15 -0
  46. package/dist/workflows/reference-remake.js +101 -25
  47. package/package.json +1 -1
@@ -0,0 +1,11 @@
1
+ export declare const AGENT_RULES: {
2
+ readonly goAhead: "get the user's go-ahead";
3
+ readonly estimate: "Its price is an estimate: the charge follows the finished video's measured length, above or below it; say so before the run.";
4
+ readonly ceiling: "Its total is the most the video can cost: the charge counts what is made and delivered.";
5
+ readonly ways: "show each with its price and let the user pick; an estimate is not a go-ahead";
6
+ readonly photo: "A photo attached in chat never reaches Clipwright";
7
+ readonly openings: "For several videos, never repeat an opening line.";
8
+ readonly links: "A finished file's link expires after 7 days: tell the user to download it.";
9
+ };
10
+ export type AgentRule = keyof typeof AGENT_RULES;
11
+ export declare const AGENT_RULE_TOOLS: Readonly<Record<Exclude<AgentRule, "goAhead">, readonly string[]>>;
@@ -0,0 +1,17 @@
1
+ export const AGENT_RULES = {
2
+ goAhead: "get the user's go-ahead",
3
+ estimate: "Its price is an estimate: the charge follows the finished video's measured length, above or below it; say so before the run.",
4
+ ceiling: "Its total is the most the video can cost: the charge counts what is made and delivered.",
5
+ ways: "show each with its price and let the user pick; an estimate is not a go-ahead",
6
+ photo: "A photo attached in chat never reaches Clipwright",
7
+ openings: "For several videos, never repeat an opening line.",
8
+ links: "A finished file's link expires after 7 days: tell the user to download it.",
9
+ };
10
+ export const AGENT_RULE_TOOLS = {
11
+ estimate: ["quote_ugc"],
12
+ ceiling: ["quote_faceless"],
13
+ ways: ["quote_faceless"],
14
+ photo: ["create_upload"],
15
+ openings: ["quote_ugc", "quote_faceless"],
16
+ links: ["get_run"],
17
+ };
@@ -97,6 +97,7 @@ export interface ServerFailure extends WorkflowDiagnostics {
97
97
  status: number;
98
98
  message: string;
99
99
  retryAfterSeconds: number | undefined;
100
+ code?: string;
100
101
  }
101
102
  export interface ClientFailure extends WorkflowDiagnostics {
102
103
  kind: "client_error";
@@ -238,7 +238,7 @@ export function parseApiFailure(input) {
238
238
  return { kind: "client_error", ...diagnostics, status, message, code };
239
239
  }
240
240
  if (status >= 500) {
241
- return { kind: "server_error", ...diagnostics, status, message, retryAfterSeconds: headerSeconds };
241
+ return { kind: "server_error", ...diagnostics, status, message, retryAfterSeconds: headerSeconds, ...(code !== undefined && { code }) };
242
242
  }
243
243
  const next = generic.success ? generic.data.error.next : undefined;
244
244
  return { kind: "client_error", ...diagnostics, status, message, code, ...(next && { next }) };
@@ -108,6 +108,10 @@ export declare const workflowQuoteBinding: z.ZodObject<{
108
108
  "1:1": "1:1";
109
109
  "9:16": "9:16";
110
110
  }>;
111
+ resolution: z.ZodOptional<z.ZodEnum<{
112
+ "1080p": "1080p";
113
+ "720p": "720p";
114
+ }>>;
111
115
  tts_model: z.ZodString;
112
116
  design: z.ZodOptional<z.ZodObject<{
113
117
  look: z.ZodOptional<z.ZodEnum<{
@@ -262,6 +266,18 @@ export declare const workflowQuoteBinding: z.ZodObject<{
262
266
  }, z.core.$strict>>>;
263
267
  note: z.ZodString;
264
268
  }, z.core.$strict>>>;
269
+ resolution: z.ZodOptional<z.ZodEnum<{
270
+ "1080p": "1080p";
271
+ "720p": "720p";
272
+ }>>;
273
+ voice: z.ZodOptional<z.ZodObject<{
274
+ name: z.ZodString;
275
+ source: z.ZodEnum<{
276
+ asked: "asked";
277
+ default: "default";
278
+ language: "language";
279
+ }>;
280
+ }, z.core.$strict>>;
265
281
  warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
266
282
  contract_version: z.ZodString;
267
283
  }, z.core.$strict>;
@@ -351,6 +367,10 @@ export declare const workflowQuoteBindingRead: z.ZodObject<{
351
367
  duration_estimate_sec: z.ZodNumber;
352
368
  warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
353
369
  contract_version: z.ZodString;
370
+ resolution: z.ZodOptional<z.ZodEnum<{
371
+ "1080p": "1080p";
372
+ "720p": "720p";
373
+ }>>;
354
374
  tts_model: z.ZodString;
355
375
  design: z.ZodOptional<z.ZodObject<{
356
376
  look: z.ZodOptional<z.ZodEnum<{
@@ -511,6 +531,18 @@ export declare const workflowQuoteBindingRead: z.ZodObject<{
511
531
  }, z.core.$strict>>>;
512
532
  note: z.ZodString;
513
533
  }, z.core.$strict>>>;
534
+ resolution: z.ZodOptional<z.ZodEnum<{
535
+ "1080p": "1080p";
536
+ "720p": "720p";
537
+ }>>;
538
+ voice: z.ZodOptional<z.ZodObject<{
539
+ name: z.ZodString;
540
+ source: z.ZodEnum<{
541
+ asked: "asked";
542
+ default: "default";
543
+ language: "language";
544
+ }>;
545
+ }, z.core.$strict>>;
514
546
  warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
515
547
  contract_version: z.ZodString;
516
548
  tariffId: z.ZodString;
@@ -102,6 +102,10 @@ export declare const workflowQuoteAnswer: z.ZodObject<{
102
102
  "1:1": "1:1";
103
103
  "9:16": "9:16";
104
104
  }>;
105
+ resolution: z.ZodOptional<z.ZodEnum<{
106
+ "1080p": "1080p";
107
+ "720p": "720p";
108
+ }>>;
105
109
  tts_model: z.ZodString;
106
110
  design: z.ZodOptional<z.ZodObject<{
107
111
  look: z.ZodOptional<z.ZodEnum<{
@@ -256,6 +260,18 @@ export declare const workflowQuoteAnswer: z.ZodObject<{
256
260
  }, z.core.$strict>>>;
257
261
  note: z.ZodString;
258
262
  }, z.core.$strict>>>;
263
+ resolution: z.ZodOptional<z.ZodEnum<{
264
+ "1080p": "1080p";
265
+ "720p": "720p";
266
+ }>>;
267
+ voice: z.ZodOptional<z.ZodObject<{
268
+ name: z.ZodString;
269
+ source: z.ZodEnum<{
270
+ asked: "asked";
271
+ default: "default";
272
+ language: "language";
273
+ }>;
274
+ }, z.core.$strict>>;
259
275
  warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
260
276
  contract_version: z.ZodString;
261
277
  }, z.core.$strict>;
@@ -40,6 +40,7 @@ export const ENDPOINT_NOTES = {
40
40
  "transition and caption habits, never its logo, characters or frames. Free. Draw sample stills with its theme_overrides before you save it.",
41
41
  "POST /v1/brand-styles": "Saves a confirmed style under a name, beside the brand kit; saving a name again replaces it. A film draft names it in " +
42
42
  "brand_style. Free.",
43
+ "GET /v1/runs": "The account's runs, newest first: the tool that started each, its state, length and a link to its file while the file is kept. Filter by kind and state; page with cursor. Free.",
43
44
  "GET /v1/runs/{id}": "State of one run of any skill, its warnings and its video url.",
44
45
  "GET /v1/runs/{id}/shots": "The shots of one run: each shot's span, words, description and preview, and whether the run can be edited.",
45
46
  "GET /v1/runs/{id}/edit": "The saved draft of an edit of one run, with its version. Version 0 is a run with no draft: its document changes nothing.",
@@ -111,6 +112,12 @@ export const ENDPOINT_NOTES = {
111
112
  "POST /v1/skills/create_actor/run": "Starts an actor run and answers at once with a run_id. Poll the run for the result.",
112
113
  "POST /v1/skills/make_faceless/quote": "Prices a make_faceless call with this input. Charges nothing.",
113
114
  "POST /v1/skills/make_faceless/run": "Starts a faceless video run and answers at once with a run_id. Poll the run for the result.",
115
+ "POST /v1/public/skills/make_faceless/quote": "Prices a make_faceless call without a key: the same body and answer as the keyed quote, for a new account. Charges nothing. " +
116
+ "Send no Authorization header here; fields that name your own uploads, assets, runs or mascots need the keyed quote.",
117
+ "POST /v1/public/skills/generate_image/quote": "Prices one image without a key: the same body and answer as the keyed quote, for a new account. Charges nothing. " +
118
+ "Send no Authorization header here; references to your own pictures need the keyed quote.",
119
+ "POST /v1/public/skills/generate_video/quote": "Prices one clip without a key: the same body and answer as the keyed quote, for a new account. Charges nothing. " +
120
+ "Send no Authorization header here; frames and references from your own pictures need the keyed quote.",
114
121
  "GET /v1/generations/models": "The models generate_image and generate_video take, with their measured modes, aspect ratios, resolutions, durations, output size and credits per image or per second. Free. While generations are closed it answers generations_disabled.",
115
122
  "POST /v1/skills/generate_image/quote": "Prices one image with this request: credits, width, height and warnings. Charges nothing.",
116
123
  "POST /v1/skills/generate_image/run": "Starts one image generation and answers at once with a run_id; the run's generation block holds the image once delivered. A failed generation is charged nothing. While generations are closed it answers generations_disabled and charges nothing.",
@@ -7,6 +7,12 @@ export declare const WORKFLOW_REVISIONS_PATH = "/v1/workflow-plans/:id/revisions
7
7
  export declare const WORKFLOW_APPROVE_PATH = "/v1/workflow-plans/:id/approve";
8
8
  export declare const WORKFLOW_QUOTE_PATH = "/v1/workflow-plans/:id/quote";
9
9
  export declare const WORKFLOW_RUN_PATH = "/v1/workflow-plans/:id/run";
10
+ export declare const KEYLESS_QUOTE_PATHS: {
11
+ readonly make_faceless: "/v1/public/skills/make_faceless/quote";
12
+ readonly generate_image: "/v1/public/skills/generate_image/quote";
13
+ readonly generate_video: "/v1/public/skills/generate_video/quote";
14
+ };
15
+ export type KeylessQuoteSkill = keyof typeof KEYLESS_QUOTE_PATHS;
10
16
  export declare const OPENAPI_PATH = "/openapi.json";
11
17
  export interface ApiEndpoint {
12
18
  method: "GET" | "POST" | "DELETE";
package/dist/endpoints.js CHANGED
@@ -19,6 +19,7 @@ import { UPSCALE_QUOTE_PATH, UPSCALE_RUN_PATH } from "./upscale.js";
19
19
  import { PRICES_PATH } from "./prices.js";
20
20
  import { REFERENCE_ANALYSES_PATH, REFERENCE_ANALYSIS_PATH, REFERENCE_ANALYSIS_QUOTE_PATH } from "./reference-analysis.js";
21
21
  import { RUN_MEDIA_PATH } from "./run-media.js";
22
+ import { RUNS_PATH } from "./run-list.js";
22
23
  import { TEMPLATE_SOUNDS_PATH } from "./templates/sounds.js";
23
24
  import { MOVES_PATH } from "./moves.js";
24
25
  export const PUBLIC_WORKFLOWS_PATH = "/v1/public/workflows";
@@ -30,6 +31,11 @@ export const WORKFLOW_REVISIONS_PATH = "/v1/workflow-plans/:id/revisions";
30
31
  export const WORKFLOW_APPROVE_PATH = "/v1/workflow-plans/:id/approve";
31
32
  export const WORKFLOW_QUOTE_PATH = "/v1/workflow-plans/:id/quote";
32
33
  export const WORKFLOW_RUN_PATH = "/v1/workflow-plans/:id/run";
34
+ export const KEYLESS_QUOTE_PATHS = {
35
+ make_faceless: "/v1/public/skills/make_faceless/quote",
36
+ generate_image: "/v1/public/skills/generate_image/quote",
37
+ generate_video: "/v1/public/skills/generate_video/quote",
38
+ };
33
39
  export const OPENAPI_PATH = "/openapi.json";
34
40
  export const API_ENDPOINTS = [
35
41
  { method: "POST", path: "/v1/skills/make_faceless/quote", billed: false, onQuickstart: true, jsonBody: true, cabinet: false, mcp: true },
@@ -43,6 +49,7 @@ export const API_ENDPOINTS = [
43
49
  { method: "GET", path: MOVES_PATH, billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: true },
44
50
  { method: "GET", path: "/v1/account", billed: false, onQuickstart: true, jsonBody: false, cabinet: false, mcp: true },
45
51
  { method: "POST", path: "/v1/skills/make_ugc/quote", billed: false, onQuickstart: true, jsonBody: true, cabinet: false, mcp: true },
52
+ { method: "GET", path: RUNS_PATH, billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: true },
46
53
  { method: "GET", path: "/v1/runs/:id", billed: false, onQuickstart: true, jsonBody: false, cabinet: true, mcp: true },
47
54
  { method: "GET", path: "/v1/runs/:id/shots", billed: false, onQuickstart: false, jsonBody: false, cabinet: true, mcp: true },
48
55
  { method: "GET", path: "/v1/runs/:id/edit", billed: false, onQuickstart: false, jsonBody: false, cabinet: true, mcp: false },
@@ -56,6 +63,7 @@ export const API_ENDPOINTS = [
56
63
  { method: "POST", path: "/v1/skills/make_ugc/run", billed: true, onQuickstart: true, jsonBody: true, cabinet: false, mcp: true },
57
64
  { method: "GET", path: "/v1/public/skills", billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: false },
58
65
  { method: "GET", path: PRICES_PATH, billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: false },
66
+ ...Object.values(KEYLESS_QUOTE_PATHS).map((path) => ({ method: "POST", path, billed: false, onQuickstart: false, jsonBody: true, cabinet: false, mcp: false })),
59
67
  { method: "GET", path: "/v1/actors", billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: true },
60
68
  { method: "GET", path: ACTOR_PREVIEW_PATH, billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: false },
61
69
  { method: "DELETE", path: "/v1/actors/:id", billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: true },
package/dist/errors.d.ts CHANGED
@@ -250,7 +250,7 @@ export type EditCeilingReachedError = z.infer<typeof editCeilingReachedError>;
250
250
  export declare function editCeilingReachedBody(args: Omit<EditCeilingReachedError["error"], "code" | "message">, counting?: "revision" | "candidate"): EditCeilingReachedError;
251
251
  export declare function unusableSourceMessage(errorClass: string, detail: string): string;
252
252
  export declare const MALFORMED_BODY_MESSAGE: string;
253
- 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_busy", "cut_limited", "cut_not_found", "cut_preview_limited", "cut_slot_in_use", "deletion_held", "editing_window_not_set", "explainer_busy", "feedback_limited", "film_asset_not_ready", "film_busy", "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", "trial_excludes_generation", "unauthorized", "unsupported_combination", "unsupported_media_type", "unusable_source", "upload_cap_exceeded", "upload_digest_mismatch", "upload_expired", "upload_in_use", "upload_not_finished", "upload_page_rate_limited", "upload_page_used", "upload_size_mismatch", "upstream_error", "url_fetch_busy", "url_fetch_failed", "url_fetch_rate_limited", "url_fetch_refused", "url_import_disabled", "voice_busy"];
253
+ 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_busy", "cut_limited", "cut_not_found", "cut_preview_limited", "cut_slot_in_use", "deletion_held", "editing_window_not_set", "explainer_busy", "feedback_limited", "film_asset_not_ready", "film_busy", "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", "key_not_accepted_here", "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", "requires_api_key", "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", "trial_excludes_generation", "unauthorized", "unsupported_combination", "unsupported_media_type", "unusable_source", "upload_cap_exceeded", "upload_digest_mismatch", "upload_expired", "upload_in_use", "upload_not_finished", "upload_page_rate_limited", "upload_page_used", "upload_size_mismatch", "upstream_error", "url_fetch_busy", "url_fetch_failed", "url_fetch_rate_limited", "url_fetch_refused", "url_import_disabled", "voice_busy"];
254
254
  export type BareApiErrorCode = (typeof BARE_ERROR_CODES)[number];
255
255
  export declare const API_ERROR_CODES: readonly string[];
256
256
  export declare function apiErrorBody(args: {
package/dist/errors.js CHANGED
@@ -334,6 +334,7 @@ const BARE_ERROR_CODES = [
334
334
  "internal_error",
335
335
  "invalid_image",
336
336
  "invalid_request",
337
+ "key_not_accepted_here",
337
338
  "malformed_body",
338
339
  "no_changes",
339
340
  "not_found",
@@ -347,6 +348,7 @@ const BARE_ERROR_CODES = [
347
348
  "reference_not_analyzable",
348
349
  "reference_not_usable",
349
350
  "reference_url_unsupported",
351
+ "requires_api_key",
350
352
  "revision_needs_generated_unit",
351
353
  "rights_not_confirmed",
352
354
  "run_media_in_use",
@@ -7366,6 +7366,18 @@ export declare const facelessQuoteResponse: z.ZodObject<{
7366
7366
  }, z.core.$strict>>>;
7367
7367
  note: z.ZodString;
7368
7368
  }, z.core.$strict>>>;
7369
+ resolution: z.ZodOptional<z.ZodEnum<{
7370
+ "1080p": "1080p";
7371
+ "720p": "720p";
7372
+ }>>;
7373
+ voice: z.ZodOptional<z.ZodObject<{
7374
+ name: z.ZodString;
7375
+ source: z.ZodEnum<{
7376
+ asked: "asked";
7377
+ default: "default";
7378
+ language: "language";
7379
+ }>;
7380
+ }, z.core.$strict>>;
7369
7381
  warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
7370
7382
  contract_version: z.ZodString;
7371
7383
  }, z.core.$strict>;
@@ -304,7 +304,8 @@ export const offeredFacelessInputShape = {
304
304
  pause_trim: z.unknown().optional().describe("Script only: as make_ugc pause_trim, same default with templates, scenes or shots."),
305
305
  voice: common.voice
306
306
  .describe("Narration voice: a name from list_voices with skill=make_faceless (kind faceless_voice). " +
307
- `Omitted means ${DEFAULT_FACELESS_VOICE}. Choose a voice in the language of the narration: a voice reads any ` +
307
+ "Omitted: a voice for the script's language, else the brief's; the quote names it. " +
308
+ `${DEFAULT_FACELESS_VOICE} where we have no voice for that language. Choose a voice in the language of the narration: a voice reads any ` +
308
309
  "language, with the accent of its own. The API refuses an unknown name and a make_ugc voice before any charge. " +
309
310
  "A raw voice_id is not accepted here."),
310
311
  resolution: common.resolution,
@@ -336,6 +337,9 @@ export const facelessQuoteResponse = facelessQuote.extend({
336
337
  explainer_tiers: z.strictObject({ tier: z.enum(EXPLAINER_TIERS), standard: z.number().int().positive(), pro: z.number().int().positive() }).optional(),
337
338
  alternatives: z.array(facelessAlternative).optional().describe("The ways to make this video, this quote first as route pictures, each " +
338
339
  `with the credits it starts from and the price of each add-on. Beside this quote, each is ${FACELESS_ROUTE_ESTIMATE_TEXT}.`),
340
+ resolution: offeredResolution.optional().describe("The frame the video renders at: the asked one, else 720p (720x1280)"),
341
+ voice: z.strictObject({ name: z.string().min(1), source: z.enum(["asked", "language", "default"]) }).optional()
342
+ .describe("The narration voice: asked by name, picked by the language of the script or brief, or the default voice"),
339
343
  warnings: z.array(z.string()).default([]),
340
344
  contract_version: z.string().min(1),
341
345
  }).strict();
@@ -114,10 +114,29 @@ export declare const DEFAULT_FACELESS_VOICE = "narrator_en_wise_lady";
114
114
  export declare function isFacelessVoiceName(name: string): name is FacelessVoiceName;
115
115
  export declare const FACELESS_MEASURED_WORDS_PER_SECOND: Partial<Record<FacelessVoiceName, number>>;
116
116
  export declare const FACELESS_MEASURED_CHARACTERS_PER_SECOND: Partial<Record<FacelessVoiceName, number>>;
117
+ export declare const FACELESS_LANGUAGE_VOICES: {
118
+ readonly en: "narrator_en_wise_lady";
119
+ readonly ru: "narrator_ru_ambitious_woman";
120
+ readonly es: "narrator_es_serene_woman";
121
+ readonly pt: "narrator_pt_wise_lady";
122
+ readonly fr: "narrator_fr_classic_man";
123
+ readonly it: "narrator_it_calm_woman";
124
+ readonly tr: "narrator_tr_confident_woman";
125
+ };
117
126
  export declare function facelessDefaultVoiceName(input: {
118
127
  format?: string | undefined;
119
128
  script?: string | undefined;
129
+ brief?: string | undefined;
120
130
  } | undefined): FacelessVoiceName;
131
+ export declare function facelessVoiceChoice(input: {
132
+ voice?: string | undefined;
133
+ format?: string | undefined;
134
+ script?: string | undefined;
135
+ brief?: string | undefined;
136
+ }): {
137
+ name: string;
138
+ source: "asked" | "language" | "default";
139
+ };
121
140
  export declare function facelessSpeechWordsPerSecond(input: {
122
141
  voice?: string | undefined;
123
142
  format?: string | undefined;
@@ -1,4 +1,6 @@
1
1
  import { scriptLanguageOf } from "./caption-language.js";
2
+ import { namingLanguageOf } from "./naming.js";
3
+ import { SCRIPT_VOICE_NOTE_HEAD } from "./script-voice.js";
2
4
  import { countWords, estimateWordsPerSecond } from "./pacing.js";
3
5
  import { detectScriptFamily, scriptLetterCounts } from "./voices.js";
4
6
  export const FACELESS_SPEECH_MODEL = "narrator-v1";
@@ -39,19 +41,38 @@ export const FACELESS_MEASURED_CHARACTERS_PER_SECOND = {
39
41
  narrator_en_deep_gentleman: 15.229, narrator_en_storyteller: 13.908, narrator_en_brisk_man: 17.608,
40
42
  narrator_tr_confident_woman: 16.05, narrator_tr_mature_man: 15.118,
41
43
  };
44
+ export const FACELESS_LANGUAGE_VOICES = {
45
+ en: DEFAULT_FACELESS_VOICE, ru: "narrator_ru_ambitious_woman", es: "narrator_es_serene_woman", pt: "narrator_pt_wise_lady",
46
+ fr: "narrator_fr_classic_man", it: "narrator_it_calm_woman", tr: "narrator_tr_confident_woman",
47
+ };
48
+ const isVoiceLanguage = (language) => Object.hasOwn(FACELESS_LANGUAGE_VOICES, language);
49
+ function textLanguageOf(text) {
50
+ const letters = scriptLanguageOf(text), language = namingLanguageOf(text, letters);
51
+ return language === "und" ? letters : language;
52
+ }
53
+ function spokenLanguageOf(input) {
54
+ const text = input.script ?? input.brief?.split(`\n\n${SCRIPT_VOICE_NOTE_HEAD}`)[0];
55
+ return text === undefined ? undefined : textLanguageOf(text);
56
+ }
42
57
  export function facelessDefaultVoiceName(input) {
43
- if (input?.format !== "explainer" || input.script === undefined)
44
- return DEFAULT_FACELESS_VOICE;
45
- const language = scriptLanguageOf(input.script);
58
+ const { name } = facelessVoiceChoice({ ...input, voice: undefined });
59
+ return isFacelessVoiceName(name) ? name : DEFAULT_FACELESS_VOICE;
60
+ }
61
+ export function facelessVoiceChoice(input) {
62
+ if (input.voice !== undefined)
63
+ return { name: input.voice, source: "asked" };
64
+ const language = spokenLanguageOf(input);
65
+ if (language === undefined || !isVoiceLanguage(language))
66
+ return { name: DEFAULT_FACELESS_VOICE, source: "default" };
46
67
  let fastest;
47
- for (const name of FACELESS_VOICE_NAMES) {
68
+ for (const name of input.format === "explainer" && input.script !== undefined ? FACELESS_VOICE_NAMES : []) {
48
69
  const pace = FACELESS_MEASURED_WORDS_PER_SECOND[name];
49
70
  if (FACELESS_VOICES[name].language !== language || pace === undefined)
50
71
  continue;
51
72
  if (fastest === undefined || pace > FACELESS_MEASURED_WORDS_PER_SECOND[fastest])
52
73
  fastest = name;
53
74
  }
54
- return fastest ?? DEFAULT_FACELESS_VOICE;
75
+ return { name: fastest ?? FACELESS_LANGUAGE_VOICES[language], source: "language" };
55
76
  }
56
77
  export function facelessSpeechWordsPerSecond(input) {
57
78
  const voice = measuredSpeaker(input);
@@ -78,7 +99,15 @@ const VOICE_LANGUAGE = {
78
99
  };
79
100
  const ALPHABET_LETTERS = { cyrillic: "Cyrillic letters", latin: "Latin letters" };
80
101
  const LIST_HINT = "list_voices with skill=make_faceless names the voices of each language";
102
+ const UNVOICED_LANGUAGES = { el: "Greek", ja: "Japanese", zh: "Chinese", ko: "Korean", ar: "Arabic", hi: "Hindi", ta: "Tamil" };
81
103
  export function buildFacelessVoiceWarnings(input) {
104
+ const spoken = spokenLanguageOf(input), text = input.script === undefined ? "brief" : "script";
105
+ if (input.voice === undefined && spoken !== undefined && !isVoiceLanguage(spoken)) {
106
+ const unvoiced = UNVOICED_LANGUAGES[spoken];
107
+ return [`${unvoiced === undefined ? `the language of the ${text} could not be told as one we have a narration voice for`
108
+ : `no narration voice of ours speaks ${unvoiced}, the language of the ${text}`}: ${DEFAULT_FACELESS_VOICE} reads it with its own ` +
109
+ `accent; pass voice to pick another; ${LIST_HINT}`];
110
+ }
82
111
  if (input.voice === undefined || !isFacelessVoiceName(input.voice))
83
112
  return [];
84
113
  const language = VOICE_LANGUAGE[FACELESS_VOICES[input.voice].language];
@@ -74,7 +74,7 @@ const kitVersion = z.string().regex(/^[a-f0-9]{12}$/).describe("The kit's versio
74
74
  export const filmGuide = z.strictObject({
75
75
  brand: brandGuideBlock.optional(),
76
76
  guide: z.string().min(1).describe("The explainer guide, Markdown: the steps, the tools and routes, the rules the checks refuse"),
77
- method: z.string().min(1).describe("Its appendix, Markdown: the craft behind every step"),
77
+ method: z.string().min(1).describe("Its appendix, Markdown: the craft behind every step; one line for a story, list, own_pictures or cartoon"),
78
78
  kit_version: kitVersion,
79
79
  kit_files: z.array(z.strictObject({ path: kitPath, bytes: z.number().int().positive() }))
80
80
  .describe("The scene kit's files get_film_kit serves, in reading order"),
@@ -14,6 +14,7 @@ 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"];
16
16
  export declare const GENERATION_CAMERAS: readonly ["static", "push_in", "pull_back", "pan", "turntable"];
17
+ export declare const TURNTABLE_MODELS: readonly string[];
17
18
  export type GenerationCamera = (typeof GENERATION_CAMERAS)[number];
18
19
  export type GenerationImageAspect = (typeof GENERATION_IMAGE_ASPECTS)[number];
19
20
  export type GenerationVideoAspect = (typeof GENERATION_VIDEO_ASPECTS)[number];
@@ -21,10 +21,11 @@ export const GENERATION_VIDEO_ASPECTS = ["9:16", "16:9"];
21
21
  export const GENERATION_RESOLUTIONS = ["360p", "480p", "720p", "1080p"];
22
22
  export const GENERATION_VIDEO_MODES = ["text", "first_frame", "reference"];
23
23
  export const GENERATION_CAMERAS = ["static", "push_in", "pull_back", "pan", "turntable"];
24
+ export const TURNTABLE_MODELS = ["seedance-2.5", "gemini-omni-flash-1.1", "gemini-omni-flash-1.2"];
24
25
  const GENERATION_CAMERA_DESCRIPTION = "The camera, written as the prompt's first line: static, push_in, pull_back, pan, or turntable " +
25
- "(the camera stays still while the subject turns in place, for a product shot). For a product turntable pass the product's " +
26
- "picture as first_frame and again as last_frame, so the clip ends where it began and loops; seedance-2.0-mini makes the " +
27
- "full turn, while kling-3.0 given the same last frame barely turns. The price does not depend on it.";
26
+ "(the camera stays still while the subject turns in place, for a round product). Pass the product's picture as first_frame " +
27
+ "and again as last_frame, so the clip ends where it began and loops. Turn it on seedance-2.5 or gemini-omni-flash-1.2: other " +
28
+ "models fake the turn or lose the print. The price does not depend on it.";
28
29
  export const GENERATION_MAX_REFERENCES = 4;
29
30
  export const GENERATION_VIDEO_FPS = 24;
30
31
  export const GENERATION_PROMPT_MAX_CHARS = 5000;
package/dist/index.d.ts CHANGED
@@ -61,6 +61,7 @@ export * from "./account.js";
61
61
  export * from "./uploads.js";
62
62
  export * from "./assets.js";
63
63
  export * from "./run-media.js";
64
+ export * from "./run-list.js";
64
65
  export * from "./pacing.js";
65
66
  export * from "./render-backend.js";
66
67
  export * from "./tts-backend.js";
@@ -70,6 +71,7 @@ export * from "./endpoints.js";
70
71
  export * from "./endpoint-notes.js";
71
72
  export * from "./public-responses.js";
72
73
  export * from "./prices.js";
74
+ export * from "./agent-rules.js";
73
75
  export * from "./feedback.js";
74
76
  export * from "./run-static-warnings.js";
75
77
  export * from "./run-preflight.js";
package/dist/index.js CHANGED
@@ -61,6 +61,7 @@ export * from "./account.js";
61
61
  export * from "./uploads.js";
62
62
  export * from "./assets.js";
63
63
  export * from "./run-media.js";
64
+ export * from "./run-list.js";
64
65
  export * from "./pacing.js";
65
66
  export * from "./render-backend.js";
66
67
  export * from "./tts-backend.js";
@@ -70,6 +71,7 @@ export * from "./endpoints.js";
70
71
  export * from "./endpoint-notes.js";
71
72
  export * from "./public-responses.js";
72
73
  export * from "./prices.js";
74
+ export * from "./agent-rules.js";
73
75
  export * from "./feedback.js";
74
76
  export * from "./run-static-warnings.js";
75
77
  export * from "./run-preflight.js";
package/dist/openapi.d.ts CHANGED
@@ -17,6 +17,7 @@ export interface PublicRoute {
17
17
  readonly params?: Readonly<Record<string, z.ZodType>>;
18
18
  readonly optionalIdempotencyKey?: true;
19
19
  readonly billedWithoutKey?: string;
20
+ readonly refusals?: Readonly<Partial<Record<400 | 429, string>>>;
20
21
  readonly responses: Readonly<Partial<Record<SuccessStatus, NamedSchema | null>>> & ({
21
22
  200: unknown;
22
23
  } | {
package/dist/openapi.js CHANGED
@@ -34,6 +34,7 @@ import { analyzeCreatorRequest, creatorProfileAnswer, creatorProfileId, creatorP
34
34
  import { TREND_SEARCH_REPLAY_SECONDS, trendSearchAnswer, trendSearchId, trendSearchQuery, trendSearchQuote } from "./trend-search.js";
35
35
  import { findTrendsInput, trendNiches, trendNichesInput } from "./trend-niches.js";
36
36
  import { runId, runQuery } from "./runs.js";
37
+ import { runList, runListQuery } from "./run-list.js";
37
38
  import { quoteResponse } from "./skills.js";
38
39
  import { templateSoundsList } from "./templates/sounds.js";
39
40
  import { motionMovesList, motionMovesQuery } from "./moves.js";
@@ -71,6 +72,12 @@ const RUN = { id: runId };
71
72
  const ACTOR = { id: personalActorId };
72
73
  const ASSET = { id: assetId };
73
74
  const PLAN = { id: workflowId };
75
+ const KEYLESS_QUOTE_REFUSALS = {
76
+ 400: "An Authorization header was sent (key_not_accepted_here: use the keyed quote), or a field names something of an account " +
77
+ "(requires_api_key), or the body is not a valid request. Nothing was charged.",
78
+ 429: "Too many quotes without a key, from this address or in all, or too many at once; retry after Retry-After seconds or quote " +
79
+ "with your key. Nothing was charged.",
80
+ };
74
81
  const openApiDocumentShape = z.looseObject({ openapi: z.string(), info: z.looseObject({}), paths: z.record(z.string(), z.unknown()) });
75
82
  export const OPENAPI_ROUTES = {
76
83
  "POST /v1/skills/make_faceless/quote": { exposure: "public", operationId: "quoteMakeFaceless", tag: "Skills",
@@ -92,6 +99,7 @@ export const OPENAPI_ROUTES = {
92
99
  "GET /v1/account": { exposure: "public", operationId: "getAccount", tag: "Account", responses: { 200: named("Account", account) } },
93
100
  "POST /v1/skills/make_ugc/quote": { exposure: "public", operationId: "quoteMakeUgc", tag: "Skills",
94
101
  body: MakeUgcInput, responses: { 200: named("UgcQuote", quoteResponse) } },
102
+ "GET /v1/runs": { exposure: "public", operationId: "listRuns", tag: "Runs", query: runListQuery, responses: { 200: named("RunList", runList) } },
95
103
  "GET /v1/runs/{id}": { exposure: "public", operationId: "getRun", tag: "Runs", params: RUN, query: runQuery, responses: { 200: Run } },
96
104
  "GET /v1/runs/{id}/shots": { exposure: "public", operationId: "getRunShots", tag: "Runs", params: RUN,
97
105
  responses: { 200: named("RunShots", runShots) } },
@@ -115,6 +123,15 @@ export const OPENAPI_ROUTES = {
115
123
  responses: { 200: named("PublicSkills", publicSkillsResponse) } },
116
124
  "GET /v1/public/prices": { exposure: "public", operationId: "listPrices", tag: "Catalogs", anonymous: true,
117
125
  responses: { 200: named("Prices", pricesResponse) } },
126
+ "POST /v1/public/skills/make_faceless/quote": { exposure: "public", operationId: "quoteMakeFacelessWithoutKey", tag: "Skills", anonymous: true,
127
+ refusals: KEYLESS_QUOTE_REFUSALS, body: named("MakeFacelessInput", serverFacelessInput),
128
+ responses: { 200: named("FacelessQuote", facelessQuoteResponse) } },
129
+ "POST /v1/public/skills/generate_image/quote": { exposure: "public", operationId: "quoteImageWithoutKey", tag: "Skills", anonymous: true,
130
+ refusals: KEYLESS_QUOTE_REFUSALS, body: named("GenerateImageRequest", generateImageRequest),
131
+ responses: { 200: named("GenerationQuote", generationQuote) } },
132
+ "POST /v1/public/skills/generate_video/quote": { exposure: "public", operationId: "quoteVideoWithoutKey", tag: "Skills", anonymous: true,
133
+ refusals: KEYLESS_QUOTE_REFUSALS, body: named("GenerateVideoRequest", generateVideoRequest),
134
+ responses: { 200: named("GenerationQuote", generationQuote) } },
118
135
  "GET /v1/actors": { exposure: "public", operationId: "listActors", tag: "Actors", responses: { 200: named("Actors", actorsResponse) } },
119
136
  "GET /v1/public/actor-previews/{actor_id}/{version}/{file}": { exposure: "excluded",
120
137
  reason: "A PNG that list_actors and quotes link to; a client loads it as a picture, not as a JSON operation." },
@@ -370,6 +387,10 @@ export function buildOpenApiDocument() {
370
387
  responses["401"] = { $ref: "#/components/responses/Unauthorized" };
371
388
  responses["429"] = { $ref: "#/components/responses/RateLimited" };
372
389
  }
390
+ for (const [status, description] of Object.entries(route.refusals ?? {})) {
391
+ responses[status] = { description, content: { "application/json": { schema: { $ref: `${SCHEMA_REF}ErrorEnvelope` } } },
392
+ ...(status === "429" && { headers: { "Retry-After": { schema: { type: "integer", minimum: 0 }, description: "Seconds until a retry can succeed." } } }) };
393
+ }
373
394
  responses.default = { $ref: "#/components/responses/Error" };
374
395
  const body = route.body === undefined ? undefined : "mediaTypes" in route.body
375
396
  ? { required: true, content: Object.fromEntries(route.body.mediaTypes.map((type) => [type, {}])) }
@@ -30,7 +30,8 @@ export declare const FILMS_IN_FLIGHT_PER_ACCOUNT = 3;
30
30
  export declare const FILM_BUSY_RETRY_SECONDS = 120;
31
31
  export declare const VOICES_IN_FLIGHT_PER_ACCOUNT = 2;
32
32
  export declare const VOICE_BUSY_RETRY_SECONDS = 60;
33
- export declare const OWN_TAKE_CHECK_CREDITS = 10;
33
+ export declare const OWN_TAKE_CHECK_CREDITS = 15;
34
+ export declare const OWN_TAKE_CHECK_SPEED_CREDITS = 5;
34
35
  export declare const OWN_TAKE_CHECK_PICTURE_CREDITS = 20;
35
36
  export declare const OWN_TAKE_CHECK_PICTURE_LONG_CREDITS = 38, TAKE_PICTURE_SHORT_TIER_SECONDS = 4.1;
36
37
  export declare const OWN_CUT_CREDITS = 45, OWN_CUT_INCLUDED_SECONDS = 60, OWN_CUT_EXTRA_SECOND_CREDITS = 1, OWN_CUT_MAX_SECONDS = 90;
@@ -64,6 +65,7 @@ export declare const ownAgentTerms: z.ZodObject<{
64
65
  music_credits: z.ZodOptional<z.ZodNumber>;
65
66
  film_music_credits: z.ZodOptional<z.ZodNumber>;
66
67
  take_check_credits: z.ZodOptional<z.ZodNumber>;
68
+ take_check_speed_credits: z.ZodOptional<z.ZodNumber>;
67
69
  picture_check_credits: z.ZodOptional<z.ZodNumber>;
68
70
  picture_check_long_credits: z.ZodOptional<z.ZodNumber>;
69
71
  cut_credits: z.ZodOptional<z.ZodNumber>;
@@ -118,6 +120,7 @@ export type OwnAgentDelivery = {
118
120
  checks: number;
119
121
  against?: "motion" | "picture";
120
122
  long?: boolean;
123
+ speed?: boolean;
121
124
  } | ({
122
125
  skill: "film_cut";
123
126
  seconds: number;
@@ -125,6 +128,6 @@ export type OwnAgentDelivery = {
125
128
  export declare function ownCutCredits(cut: {
126
129
  seconds: number;
127
130
  } & OwnCutParts, terms?: OwnAgentTerms): number;
128
- export declare function ownTakeCheckCredits(n: number, terms?: OwnAgentTerms, against?: "motion" | "picture", long?: boolean): number;
131
+ export declare function ownTakeCheckCredits(n: number, terms?: OwnAgentTerms, against?: "motion" | "picture", long?: boolean, speed?: boolean): number;
129
132
  export declare function ownTakeFramesCredits(sheets: number): number;
130
133
  export declare function ownAgentCharge(delivery: OwnAgentDelivery, terms: OwnAgentTerms, heldCredits: number): number;