@clipwright/core 0.85.0 → 0.87.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.
@@ -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
+ };
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { accountNotAdmittedError, apiError, debtOutstandingError, editCeilingReachedError, editConflictError, editingDisabledError, editingNotPricedError, editInvalidError, insufficientCreditsError, maxCreditsExceededError, runNotEditableError, } from "./errors.js";
3
- import { PUBLIC_APP_BASE_URL } from "./public-endpoints.js";
2
+ import { accountNotAdmittedError, apiError, creditsShort, debtOutstandingError, editCeilingReachedError, editConflictError, editingDisabledError, editingNotPricedError, editInvalidError, insufficientCreditsError, maxCreditsExceededError, runNotEditableError, } from "./errors.js";
3
+ import { PUBLIC_APP_BASE_URL, PUBLIC_BILLING_URL } from "./public-endpoints.js";
4
4
  import { rateLimitedError } from "./rate-limit.js";
5
5
  import { workflowCommandErrorRead } from "./contracts/v1/workflow-execution.js";
6
6
  export function isRetryableFailure(failure) {
@@ -265,7 +265,8 @@ export const UNAUTHORIZED_NEXT_ACTION = "STOP. Clipwright did not accept this co
265
265
  "CLIPWRIGHT_API_KEY, never in the chat, and restarts the host. With the hosted connector, the human reconnects it and " +
266
266
  "signs in again. Then call get_account, which is free, to confirm.";
267
267
  export const PURCHASE_NEEDED_NEXT_ACTION = "STOP. Do NOT retry: this call needs bought credits, and repeating it gives the same answer. Tell the user to buy a " +
268
- `credit pack or pick a plan at ${PUBLIC_APP_BASE_URL}/billing, then call again. Nothing was charged and no run was created.`;
268
+ `credit pack or pick a plan at ${PUBLIC_BILLING_URL}, then call again. Nothing was charged and no run was created.`;
269
+ const shortBy = (need) => creditsShort(need) > 0 ? ` (${creditsShort(need)} short)` : "";
269
270
  export function refusalNextAction(next) {
270
271
  const fields = next.add.length ? ` Change ${next.add.join(", ")} first.` : "";
271
272
  return `STOP. Do NOT retry unchanged: ${next.note}${fields} Then call ${next.action} (next has its route and arguments). ` +
@@ -298,8 +299,8 @@ export function agentFailureReport(failure) {
298
299
  code: "insufficient_credits",
299
300
  retryable: false,
300
301
  next_action: `STOP. Do NOT retry: this account has ${failure.balanceCredits} credits and the call ` +
301
- `needs ${failure.requiredCredits}. Retrying cannot change that. Tell the user to top up ` +
302
- "the balance, then call again. Nothing was charged and no run was created.",
302
+ `needs ${failure.requiredCredits}${shortBy(failure)}. Retrying cannot change that. Tell the user to buy a credit ` +
303
+ `pack or pick a plan at ${PUBLIC_BILLING_URL}, then call again. Nothing was charged and no run was created.`,
303
304
  balance_credits: failure.balanceCredits,
304
305
  required_credits: failure.requiredCredits,
305
306
  };
@@ -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.",
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";
@@ -43,6 +44,7 @@ export const API_ENDPOINTS = [
43
44
  { method: "GET", path: MOVES_PATH, billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: true },
44
45
  { method: "GET", path: "/v1/account", billed: false, onQuickstart: true, jsonBody: false, cabinet: false, mcp: true },
45
46
  { method: "POST", path: "/v1/skills/make_ugc/quote", billed: false, onQuickstart: true, jsonBody: true, cabinet: false, mcp: true },
47
+ { method: "GET", path: RUNS_PATH, billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: true },
46
48
  { method: "GET", path: "/v1/runs/:id", billed: false, onQuickstart: true, jsonBody: false, cabinet: true, mcp: true },
47
49
  { method: "GET", path: "/v1/runs/:id/shots", billed: false, onQuickstart: false, jsonBody: false, cabinet: true, mcp: true },
48
50
  { method: "GET", path: "/v1/runs/:id/edit", billed: false, onQuickstart: false, jsonBody: false, cabinet: true, mcp: false },
package/dist/errors.d.ts CHANGED
@@ -74,6 +74,10 @@ export declare function insufficientCreditsBody(args: {
74
74
  requiredCredits: number;
75
75
  note?: string | undefined;
76
76
  }): InsufficientCreditsError;
77
+ export declare function creditsShort(args: {
78
+ balanceCredits: number;
79
+ requiredCredits: number;
80
+ }): number;
77
81
  export declare function creditsNeededSentence(args: {
78
82
  balanceCredits: number;
79
83
  requiredCredits: number;
package/dist/errors.js CHANGED
@@ -2,6 +2,7 @@ import { z } from "zod";
2
2
  import { diyNext } from "./diy-next.js";
3
3
  import { EDIT_ISSUE_CODES } from "./edit-validate.js";
4
4
  import { workflowCommandError } from "./contracts/v1/workflow-execution.js";
5
+ import { PUBLIC_BILLING_URL } from "./public-endpoints.js";
5
6
  import { actorCreationLimitedError, rateLimitedError } from "./rate-limit.js";
6
7
  export const apiError = z.object({
7
8
  error: z.object({
@@ -59,19 +60,23 @@ export function insufficientCreditsBody(args) {
59
60
  error: {
60
61
  code: "insufficient_credits",
61
62
  message: `${creditsNeededSentence(args)} ` +
62
- "Top up the balance and retry; nothing was charged and no run was created." + (args.note === undefined ? "" : ` ${args.note}`),
63
+ `Buy credits at ${PUBLIC_BILLING_URL} and retry; nothing was charged and no run was created.` +
64
+ (args.note === undefined ? "" : ` ${args.note}`),
63
65
  balance_credits: args.balanceCredits,
64
66
  required_credits: args.requiredCredits,
65
67
  },
66
68
  });
67
69
  }
70
+ export function creditsShort(args) {
71
+ return Math.max(0, args.requiredCredits - args.balanceCredits);
72
+ }
68
73
  export function creditsNeededSentence(args) {
69
- const short = args.requiredCredits - args.balanceCredits;
74
+ const short = creditsShort(args);
70
75
  return (`This run needs ${args.requiredCredits} credits, the account has ${args.balanceCredits}` +
71
76
  (short > 0 ? ` (${short} short).` : "."));
72
77
  }
73
78
  export function insufficientCreditsWarning(args) {
74
- return (`${creditsNeededSentence(args)} make_ugc will be refused with insufficient_credits ` +
79
+ return (`${creditsNeededSentence(args)} Starting it will be refused with insufficient_credits ` +
75
80
  "until the account buys credits.");
76
81
  }
77
82
  export function debtOutstandingWarning(args) {
@@ -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];
@@ -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.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";
@@ -92,6 +93,7 @@ export const OPENAPI_ROUTES = {
92
93
  "GET /v1/account": { exposure: "public", operationId: "getAccount", tag: "Account", responses: { 200: named("Account", account) } },
93
94
  "POST /v1/skills/make_ugc/quote": { exposure: "public", operationId: "quoteMakeUgc", tag: "Skills",
94
95
  body: MakeUgcInput, responses: { 200: named("UgcQuote", quoteResponse) } },
96
+ "GET /v1/runs": { exposure: "public", operationId: "listRuns", tag: "Runs", query: runListQuery, responses: { 200: named("RunList", runList) } },
95
97
  "GET /v1/runs/{id}": { exposure: "public", operationId: "getRun", tag: "Runs", params: RUN, query: runQuery, responses: { 200: Run } },
96
98
  "GET /v1/runs/{id}/shots": { exposure: "public", operationId: "getRunShots", tag: "Runs", params: RUN,
97
99
  responses: { 200: named("RunShots", runShots) } },
@@ -492,6 +492,7 @@ export declare const ownAgentQuote: z.ZodObject<{
492
492
  free_units: z.ZodOptional<z.ZodNumber>;
493
493
  free_left: z.ZodOptional<z.ZodNumber>;
494
494
  frames: z.ZodOptional<z.ZodNumber>;
495
+ voice: z.ZodOptional<z.ZodString>;
495
496
  min_credits: z.ZodOptional<z.ZodNumber>;
496
497
  items: z.ZodOptional<z.ZodArray<z.ZodObject<{
497
498
  item: z.ZodEnum<{
@@ -175,8 +175,8 @@ const oneTake = (take) => (take.run_id === undefined) !== (take.asset_id === und
175
175
  const ONE_TAKE = "name the take by run_id or by asset_id, one of them";
176
176
  export const takeFramesInput = z.strictObject({
177
177
  ...takeSource,
178
- run_id: runId.optional().describe("The take: a delivered generate_video run of this account, or a delivered render_edit run to read the " +
179
- "finished edit"),
178
+ run_id: runId.optional().describe("The take: any delivered video run of this account (generate_video, make_ugc, make_faceless, " +
179
+ "render_film, render_edit, render_cut)"),
180
180
  fps: z.number().int().min(TAKE_FRAMES_MIN_FPS).max(TAKE_FRAMES_MAX_FPS).default(TAKE_FRAMES_DEFAULT_FPS)
181
181
  .describe("Frames a second: 8 to read the whole take, 12 to 24 on a contact"),
182
182
  from: takeSecond.optional().describe("The second of the take the frames start at; omitted, its start"),
@@ -309,6 +309,7 @@ export const ownAgentQuote = z.strictObject({
309
309
  `${OWN_FREE_STILLS_WINDOW_HOURS} h are`),
310
310
  free_left: z.number().int().nonnegative().optional().describe("Free stills the draft, or the account's previews, have left in the rolling day after this call"),
311
311
  frames: z.number().int().positive().optional(),
312
+ voice: z.string().min(1).optional().describe("A voice: the narrator that reads the text; the named one, else one for the text's language"),
312
313
  min_credits: z.number().int().nonnegative().optional()
313
314
  .describe("A voice: the least this take is charged, by its script's length, however short it plays"),
314
315
  items: z.array(z.strictObject({ item: z.enum(["cut", "extra_seconds", "bed", "take_sound", "music"]), units: z.number().int().nonnegative(),
package/dist/prices.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { AGENT_RULES } from "./agent-rules.js";
2
3
  import { ACTOR_PORTRAIT_ASPECT, ACTOR_UNIT_CREDITS, ACTOR_VIEW_PORTRAIT_CREDITS } from "./account-actors.js";
3
4
  import { CANDIDATE_CHARGE_TEXT } from "./edit-candidate.js";
4
5
  import { EDIT_RENDER_PRICE, EDIT_UNIT_PRICES, EDIT_ZERO_UNIT_PRICE } from "./edit-billing.js";
@@ -64,6 +65,7 @@ const FREE_TOOLS = {
64
65
  quote_revision: "POST /v1/runs/{id}/revisions/quote",
65
66
  quote_candidate: "POST /v1/runs/{id}/candidates/quote",
66
67
  quote_workflow_plan: "POST /v1/workflow-plans/{id}/quote",
68
+ list_runs: "GET /v1/runs",
67
69
  get_run: "GET /v1/runs/{id}",
68
70
  get_run_shots: "GET /v1/runs/{id}/shots",
69
71
  delete_run_media: "DELETE /v1/runs/{id}/media",
@@ -354,7 +356,7 @@ export function priceLine(tool, list) {
354
356
  ? `${entries.map((entry) => `${entry.variant === null ? "" : `${entry.variant}: `}${lineText(entry.lines[0])}`).join("; ")}; each plus ` +
355
357
  `${first.lines.slice(1).map(lineText).join(" plus ")}${first.minimum_credits === null ? "" : `, at least ${first.minimum_credits}`}`
356
358
  : entries.map((entry) => `${entry.variant === null ? "" : `${entry.variant}: `}${priceText(entry)}`).join("; ");
357
- return `Price: ${text}. Quote first with ${first.quote_tool}.`;
359
+ return `Price: ${text}. Quote first with ${first.quote_tool} and ${AGENT_RULES.goAhead}.`;
358
360
  }
359
361
  export const withPriceLine = (tool, description, list) => {
360
362
  const line = priceLine(tool, list);
@@ -1,5 +1,6 @@
1
1
  export declare const PUBLIC_API_BASE_URL = "https://api.clipwright.io";
2
2
  export declare const PUBLIC_APP_BASE_URL = "https://app.clipwright.io";
3
+ export declare const PUBLIC_BILLING_URL = "https://app.clipwright.io/billing";
3
4
  export declare const PUBLIC_SITE_BASE_URL = "https://clipwright.io";
4
5
  export declare const PUBLIC_MCP_URL = "https://mcp.clipwright.io/mcp";
5
6
  export declare const MCP_SERVER_TITLE = "Clipwright.io";
@@ -1,5 +1,6 @@
1
1
  export const PUBLIC_API_BASE_URL = "https://api.clipwright.io";
2
2
  export const PUBLIC_APP_BASE_URL = "https://app.clipwright.io";
3
+ export const PUBLIC_BILLING_URL = `${PUBLIC_APP_BASE_URL}/billing`;
3
4
  export const PUBLIC_SITE_BASE_URL = "https://clipwright.io";
4
5
  export const PUBLIC_MCP_URL = "https://mcp.clipwright.io/mcp";
5
6
  export const MCP_SERVER_TITLE = "Clipwright.io";
@@ -0,0 +1,94 @@
1
+ import { z } from "zod";
2
+ import { type RunSkill } from "./runs.js";
3
+ export declare const RUNS_PATH = "/v1/runs";
4
+ export declare const RUN_LIST_KINDS: Readonly<Record<RunSkill, string>>;
5
+ export declare const RUN_LIST_KIND_NAMES: [string, ...string[]];
6
+ export declare const runListSkills: (kind: string) => string[];
7
+ export declare const RUN_LIST_STATES: readonly ["running", "succeeded", "failed"];
8
+ export declare const RUN_LIST_DEFAULT_LIMIT = 20;
9
+ export declare const RUN_LIST_MAX_LIMIT = 50;
10
+ export declare const RUN_LIST_ABOUT_CHARS = 80;
11
+ export declare const runListQuery: z.ZodObject<{
12
+ kind: z.ZodOptional<z.ZodEnum<{
13
+ [x: string]: string;
14
+ }>>;
15
+ state: z.ZodOptional<z.ZodEnum<{
16
+ failed: "failed";
17
+ running: "running";
18
+ succeeded: "succeeded";
19
+ }>>;
20
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
21
+ cursor: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strict>;
23
+ export type RunListQuery = z.infer<typeof runListQuery>;
24
+ export declare const runListItem: z.ZodObject<{
25
+ run_id: z.ZodString;
26
+ kind: z.ZodString;
27
+ state: z.ZodEnum<{
28
+ avatar: "avatar";
29
+ compositing: "compositing";
30
+ failed: "failed";
31
+ generating: "generating";
32
+ queued: "queued";
33
+ scripting: "scripting";
34
+ succeeded: "succeeded";
35
+ tts: "tts";
36
+ uploading: "uploading";
37
+ }>;
38
+ created_at: z.ZodString;
39
+ finished_at: z.ZodNullable<z.ZodString>;
40
+ credits_charged: z.ZodNullable<z.ZodNumber>;
41
+ duration_seconds: z.ZodNullable<z.ZodNumber>;
42
+ file_url: z.ZodNullable<z.ZodString>;
43
+ about: z.ZodNullable<z.ZodString>;
44
+ read: z.ZodEnum<{
45
+ get_film_run: "get_film_run";
46
+ get_run: "get_run";
47
+ }>;
48
+ }, z.core.$strict>;
49
+ export type RunListItem = z.infer<typeof runListItem>;
50
+ export declare const runList: z.ZodObject<{
51
+ runs: z.ZodArray<z.ZodObject<{
52
+ run_id: z.ZodString;
53
+ kind: z.ZodString;
54
+ state: z.ZodEnum<{
55
+ avatar: "avatar";
56
+ compositing: "compositing";
57
+ failed: "failed";
58
+ generating: "generating";
59
+ queued: "queued";
60
+ scripting: "scripting";
61
+ succeeded: "succeeded";
62
+ tts: "tts";
63
+ uploading: "uploading";
64
+ }>;
65
+ created_at: z.ZodString;
66
+ finished_at: z.ZodNullable<z.ZodString>;
67
+ credits_charged: z.ZodNullable<z.ZodNumber>;
68
+ duration_seconds: z.ZodNullable<z.ZodNumber>;
69
+ file_url: z.ZodNullable<z.ZodString>;
70
+ about: z.ZodNullable<z.ZodString>;
71
+ read: z.ZodEnum<{
72
+ get_film_run: "get_film_run";
73
+ get_run: "get_run";
74
+ }>;
75
+ }, z.core.$strict>>;
76
+ next_cursor: z.ZodNullable<z.ZodString>;
77
+ }, z.core.$strict>;
78
+ export type RunList = z.infer<typeof runList>;
79
+ export declare const runListRead: z.ZodObject<{
80
+ next_cursor: z.ZodNullable<z.ZodString>;
81
+ runs: z.ZodArray<z.ZodObject<{
82
+ run_id: z.ZodString;
83
+ kind: z.ZodString;
84
+ created_at: z.ZodString;
85
+ finished_at: z.ZodNullable<z.ZodString>;
86
+ credits_charged: z.ZodNullable<z.ZodNumber>;
87
+ duration_seconds: z.ZodNullable<z.ZodNumber>;
88
+ file_url: z.ZodNullable<z.ZodString>;
89
+ about: z.ZodNullable<z.ZodString>;
90
+ state: z.ZodString;
91
+ read: z.ZodString;
92
+ }, z.core.$loose>>;
93
+ }, z.core.$loose>;
94
+ export type RunListRead = z.infer<typeof runListRead>;
@@ -0,0 +1,56 @@
1
+ import { z } from "zod";
2
+ import { runId, runState } from "./runs.js";
3
+ export const RUNS_PATH = "/v1/runs";
4
+ export const RUN_LIST_KINDS = Object.freeze({
5
+ make_ugc: "make_ugc",
6
+ create_actor: "create_actor",
7
+ make_faceless: "make_faceless",
8
+ edit_shot: "create_candidate",
9
+ revise_long_form: "revise_run",
10
+ generate_image: "generate_image",
11
+ generate_video: "generate_video",
12
+ film_stills: "preview_stills",
13
+ film_voice: "make_voice",
14
+ film_render: "render_film",
15
+ film_hero: "make_film_hero",
16
+ film_edit: "render_edit",
17
+ film_take_frames: "take_frames",
18
+ film_take_check: "check_take",
19
+ film_cut: "render_cut",
20
+ film_cut_preview: "preview_cut",
21
+ analyze_reference: "analyze_reference",
22
+ analyze_creator: "analyze_creator",
23
+ find_trends: "find_trends",
24
+ });
25
+ export const RUN_LIST_KIND_NAMES = [...new Set(Object.values(RUN_LIST_KINDS))];
26
+ export const runListSkills = (kind) => Object.entries(RUN_LIST_KINDS).filter(([, k]) => k === kind).map(([skill]) => skill);
27
+ export const RUN_LIST_STATES = ["running", "succeeded", "failed"];
28
+ export const RUN_LIST_DEFAULT_LIMIT = 20;
29
+ export const RUN_LIST_MAX_LIMIT = 50;
30
+ export const RUN_LIST_ABOUT_CHARS = 80;
31
+ export const runListQuery = z.strictObject({
32
+ kind: z.enum(RUN_LIST_KIND_NAMES).optional().describe("Only runs of this tool"),
33
+ state: z.enum(RUN_LIST_STATES).optional().describe("running, succeeded or failed"),
34
+ limit: z.coerce.number().int().min(1).max(RUN_LIST_MAX_LIMIT).optional()
35
+ .describe(`Runs a page, ${RUN_LIST_DEFAULT_LIMIT} unless set`),
36
+ cursor: z.string().regex(/^[A-Za-z0-9_-]{1,200}$/).optional().describe("next_cursor of the previous page"),
37
+ });
38
+ export const runListItem = z.strictObject({
39
+ run_id: runId,
40
+ kind: z.string().min(1),
41
+ state: runState,
42
+ created_at: z.string().datetime(),
43
+ finished_at: z.string().datetime().nullable(),
44
+ credits_charged: z.number().int().nonnegative().nullable(),
45
+ duration_seconds: z.number().positive().nullable(),
46
+ file_url: z.string().url().startsWith("https://").nullable(),
47
+ about: z.string().max(RUN_LIST_ABOUT_CHARS + 1).nullable(),
48
+ read: z.enum(["get_run", "get_film_run"]),
49
+ });
50
+ export const runList = z.strictObject({
51
+ runs: z.array(runListItem),
52
+ next_cursor: z.string().nullable(),
53
+ });
54
+ export const runListRead = runList.extend({
55
+ runs: z.array(runListItem.extend({ state: z.string().min(1), read: z.string().min(1) }).loose()),
56
+ }).loose();
@@ -31,4 +31,5 @@ export declare function applyScriptVoice(script: string, voice: Pick<ScriptVoice
31
31
  }): VoicedScript;
32
32
  export declare const bannedPhrasesIn: (value: string, voice: Pick<ScriptVoice, "banned_phrases"> | null | undefined) => string[];
33
33
  export declare const secondLanguageLine: (language: string) => string;
34
+ export declare const SCRIPT_VOICE_NOTE_HEAD = "Script voice of this account: ";
34
35
  export declare function voiceBriefNote(voice: ScriptVoice): string | undefined;
@@ -115,6 +115,7 @@ export function applyScriptVoice(script, voice, options = {}) {
115
115
  export const bannedPhrasesIn = (value, voice) => (voice?.banned_phrases ?? []).filter(phrase => phrasePattern(phrase).test(value));
116
116
  export const secondLanguageLine = (language) => `the saved script voice asks for a second language (${language}): write the ` +
117
117
  `${language} version of this script for the user beside it, free; a video of it is its own plan or run, quoted on its own`;
118
+ export const SCRIPT_VOICE_NOTE_HEAD = "Script voice of this account: ";
118
119
  export function voiceBriefNote(voice) {
119
120
  const parts = [
120
121
  voice.about === undefined ? undefined : `Speaker and audience: ${voice.about}.`,
@@ -122,5 +123,5 @@ export function voiceBriefNote(voice) {
122
123
  voice.sign_off === undefined ? undefined : `End the narration with exactly: "${voice.sign_off}".`,
123
124
  voice.banned_phrases?.length ? `Never use these words or phrases: ${voice.banned_phrases.map(phrase => `"${phrase}"`).join(", ")}.` : undefined,
124
125
  ].filter((part) => part !== undefined);
125
- return parts.length ? `Script voice of this account: ${parts.join(" ")}` : undefined;
126
+ return parts.length ? `${SCRIPT_VOICE_NOTE_HEAD}${parts.join(" ")}` : undefined;
126
127
  }
package/dist/skills.d.ts CHANGED
@@ -25176,6 +25176,10 @@ export declare const quoteResponse: z.ZodObject<{
25176
25176
  "1:1": "1:1";
25177
25177
  "9:16": "9:16";
25178
25178
  }>;
25179
+ resolution: z.ZodOptional<z.ZodEnum<{
25180
+ "1080p": "1080p";
25181
+ "720p": "720p";
25182
+ }>>;
25179
25183
  tts_model: z.ZodString;
25180
25184
  design: z.ZodOptional<z.ZodObject<{
25181
25185
  look: z.ZodOptional<z.ZodEnum<{
package/dist/skills.js CHANGED
@@ -202,8 +202,8 @@ function facelessRoute({ ownAgent, explainer, facelessDiy }) {
202
202
  `explainer${explainer ? ` (yours or ${SOLD_EXPLAINER})` : ""}. ${FACELESS_DIY_INSTRUCTION}`;
203
203
  }
204
204
  export const ROUTER_HEAD = "Pick the format first, then follow its workflow:";
205
- export const AD_ROUTE = "- An ad or a product video: by default a multi-shot ad from generated clips (generate_image, generate_video, " +
206
- "make_voice, render_edit); read get_ad_guide section workflow first. Not for a person talking to camera.";
205
+ export const AD_ROUTE = "- An ad or product video: by default a multi-shot ad from generated clips (generate_image, generate_video, " +
206
+ "make_voice, render_edit); read get_ad_guide section workflow first. Held or worn, English: talking hero.";
207
207
  export const PRESENTER_ROUTE = "- An ad, a product video or a person talking to camera: make_ugc, with the five choices below.";
208
208
  export function formatRouter(modes) {
209
209
  return [ROUTER_HEAD,
@@ -243,8 +243,9 @@ const serverInstructions = (offer, modes) => "Clipwright makes presenter (UGC) a
243
243
  `${HOOK_STOP} ${MUSIC_STOP} ${STOPS_RULE}\n\n${LOOK_STEP}\n\n${adMethodInstruction(false)}\n\n`) +
244
244
  "If no tool fits, or an answer or a result disappoints, offer to tell Clipwright with " +
245
245
  "send_feedback (free; pass run_id). Send it once the user agrees.\n\n" +
246
- `Start from what works. Only a topic, no product: ${facelessQuoteStep(modes.ownAgent)} first. When the user asks for a video with only a ` +
247
- "product, a link or a plain script, don't go " +
246
+ `Start from what works. Only a topic, no product: ${facelessQuoteStep(modes.ownAgent)} first. ` +
247
+ (modes.adGuide ? "For an ad, take steps 1 and 2 first, then follow get_ad_guide's workflow; if the user declines, go on with the ad. " : "") +
248
+ "When the user asks for a video with only a product, a link or a plain script, don't go " +
248
249
  "straight to one talking-head make_ugc; lead this brief. 1. Ask the topic in a few words, then run find_trends on it over the " +
249
250
  "last 7 days (its default) and show 3 to 5 reels that took off, with views and x_median; when few are on topic or took off, " +
250
251
  "try 2 or 3 other wordings of the topic, then a longer window. The user picks one or brings their own reel. 2. Break the " +
@@ -269,8 +270,9 @@ const serverInstructions = (offer, modes) => "Clipwright makes presenter (UGC) a
269
270
  "moves to plan_reference_remake, make_ugc or make_faceless, and quote. A move's credits are on the quote, and one that cannot be " +
270
271
  "drawn on its words is named in warnings[]. The user's own note about a line stays a line_edits item; a line edit's graphic wins " +
271
272
  "over a move on the same words.\n\n" +
272
- "To show the product turning, make a 9:16 picture of it with generate_image (the product photo as a reference), then a " +
273
- "seedance-2.0-mini generate_video clip from that picture with camera turntable and the same picture as its last frame, so the clip loops; " +
273
+ "To show a round product (a jar, a bottle) turning, make a 9:16 picture of it with generate_image (the product photo as a reference), then a " +
274
+ "seedance-2.5 generate_video clip from that picture with camera turntable and the same picture as its last frame, so the clip loops; " +
275
+ "a flat pack (a tube, a box) squashes on a turntable, so show it locked in the hand, the wrist turning its label to the lens; " +
274
276
  "save it with create_asset and place it as an insert on the words that name the product. For a brand mascot across a " +
275
277
  "series, draw it once with generate_image and pass that run as a reference to every later picture of it. A mascot with " +
276
278
  "a human face can present: make it an actor with create_actor from that picture. An animal or object mascot appears " +
@@ -1258,6 +1260,7 @@ export const quoteResponse = z.object({
1258
1260
  })
1259
1261
  .nullable(),
1260
1262
  resolved_aspect_ratio: z.enum(ASPECT_RATIOS),
1263
+ resolution: z.enum(RESOLUTIONS).optional().describe("The resolution the video renders at: the asked one, else 720p"),
1261
1264
  tts_model: z.string().min(1),
1262
1265
  design: resolvedDesign.extend({ source: z.enum(["request", "brand_kit"]) }).optional(),
1263
1266
  });
package/dist/uploads.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { AGENT_RULES } from "./agent-rules.js";
2
3
  export const UPLOAD_MAX_BYTES = 10 * 1024 * 1024;
3
4
  export const UPLOAD_DAILY_CAP = 200;
4
5
  export const UPLOAD_WINDOW_SECONDS = 86_400;
@@ -107,8 +108,8 @@ export const UPLOAD_IMAGE_DESCRIPTION = "Get an upload_id and a signed https url
107
108
  `${UPLOAD_OBJECT_RETENTION_DAYS} days. For ` +
108
109
  "workflow assets the upload_id is both asset_id and content_digest: the SHA-256 of the original " +
109
110
  "bytes. Set `aspect_ratio` to match the picture. For a file on your disk while this server is remote, " +
110
- "use create_upload; for a photo attached in chat, create_upload with no arguments gives a page link to drop it on. Free; 200 uploads per day per account, at most 30 url downloads per hour.";
111
- export const CREATE_UPLOAD_DESCRIPTION = "With no arguments it returns an upload_id and a page_url, a page where a person drops one photo in a browser (PNG or " +
111
+ `use create_upload. ${AGENT_RULES.photo}; create_upload with no arguments gives a page link to drop it on. Free; 200 uploads per day per account, at most 30 url downloads per hour.`;
112
+ export const CREATE_UPLOAD_DESCRIPTION = `${AGENT_RULES.photo}. With no arguments it returns an upload_id and a page_url, a page where a person drops one photo in a browser (PNG or ` +
112
113
  "JPEG; other phone photos are converted). It suits a photo you cannot send yourself, such as one attached in chat: " +
113
114
  "the user opens the page_url, and get_upload with the upload_id answers upload_not_finished until the photo is " +
114
115
  "dropped. The link takes one photo and works for 30 minutes. " +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clipwright/core",
3
- "version": "0.85.0",
3
+ "version": "0.87.0",
4
4
  "description": "Zod schemas and the shared request/response contract of the Clipwright UGC video API",
5
5
  "repository": {
6
6
  "type": "git",