@clipwright/core 0.62.0 → 0.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ads.d.ts CHANGED
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  export { adId, adSlotId } from "./ad-ids.js";
3
3
  export declare const ADS_PATH = "/v1/ads";
4
4
  export declare const AD_PATH = "/v1/ads/:id";
5
- export declare const DIY_RECORD_KINDS: readonly ["ad"];
5
+ export declare const DIY_RECORD_KINDS: readonly ["ad", "faceless"];
6
6
  export type DiyRecordKind = (typeof DIY_RECORD_KINDS)[number];
7
7
  export declare const DIY_MAX_SLOTS: Readonly<Record<DiyRecordKind, number>>;
8
8
  export declare const AD_MAX_SLOTS: number;
@@ -46,6 +46,71 @@ export declare const updateAdInput: z.ZodObject<{
46
46
  }, z.core.$strict>;
47
47
  export type UpdateAdInput = z.infer<typeof updateAdInput>;
48
48
  export declare const AD_SLOT_STATES: readonly ["no_take", "checking", "failed", "passed"];
49
+ export declare const adTake: z.ZodObject<{
50
+ run_id: z.ZodNullable<z.ZodString>;
51
+ asset_id: z.ZodNullable<z.ZodString>;
52
+ own_footage: z.ZodBoolean;
53
+ passed: z.ZodBoolean;
54
+ checks: z.ZodArray<z.ZodObject<{
55
+ run_id: z.ZodString;
56
+ state: z.ZodString;
57
+ passed: z.ZodNullable<z.ZodBoolean>;
58
+ verdict: z.ZodNullable<z.ZodObject<{
59
+ duration_sec: z.ZodNumber;
60
+ findings: z.ZodArray<z.ZodObject<{
61
+ code: z.ZodString;
62
+ level: z.ZodEnum<{
63
+ action: "action";
64
+ asset: "asset";
65
+ camera: "camera";
66
+ roll: "roll";
67
+ }>;
68
+ from: z.ZodNumber;
69
+ to: z.ZodNumber;
70
+ whole_take: z.ZodBoolean;
71
+ why: z.ZodNullable<z.ZodString>;
72
+ }, z.core.$strict>>;
73
+ clean: z.ZodArray<z.ZodObject<{
74
+ from: z.ZodNumber;
75
+ to: z.ZodNumber;
76
+ }, z.core.$strict>>;
77
+ motion: z.ZodOptional<z.ZodObject<{
78
+ subject: z.ZodNumber;
79
+ camera: z.ZodNumber;
80
+ jitter: z.ZodNumber;
81
+ format: z.ZodEnum<{
82
+ fashion: "fashion";
83
+ product: "product";
84
+ }>;
85
+ target: z.ZodObject<{
86
+ subject: z.ZodNumber;
87
+ camera: z.ZodNullable<z.ZodNumber>;
88
+ }, z.core.$strict>;
89
+ windows: z.ZodArray<z.ZodObject<{
90
+ subject: z.ZodNumber;
91
+ camera: z.ZodNumber;
92
+ jitter: z.ZodNumber;
93
+ from: z.ZodNumber;
94
+ to: z.ZodNumber;
95
+ }, z.core.$strict>>;
96
+ finding: z.ZodNullable<z.ZodString>;
97
+ shake: z.ZodNullable<z.ZodString>;
98
+ }, z.core.$strict>>;
99
+ against: z.ZodOptional<z.ZodEnum<{
100
+ motion: "motion";
101
+ picture: "picture";
102
+ }>>;
103
+ action_at_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
104
+ subject: z.ZodOptional<z.ZodNullable<z.ZodObject<{
105
+ x: z.ZodNumber;
106
+ y: z.ZodNumber;
107
+ w: z.ZodNumber;
108
+ h: z.ZodNumber;
109
+ }, z.core.$strict>>>;
110
+ }, z.core.$strict>>;
111
+ created_at: z.ZodString;
112
+ }, z.core.$strict>>;
113
+ }, z.core.$strict>;
49
114
  export declare const adRecord: z.ZodObject<{
50
115
  ad_id: z.ZodString;
51
116
  brief: z.ZodObject<{
@@ -67,6 +132,7 @@ export declare const adRecord: z.ZodObject<{
67
132
  takes: z.ZodArray<z.ZodObject<{
68
133
  run_id: z.ZodNullable<z.ZodString>;
69
134
  asset_id: z.ZodNullable<z.ZodString>;
135
+ own_footage: z.ZodBoolean;
70
136
  passed: z.ZodBoolean;
71
137
  checks: z.ZodArray<z.ZodObject<{
72
138
  run_id: z.ZodString;
@@ -113,6 +179,17 @@ export declare const adRecord: z.ZodObject<{
113
179
  finding: z.ZodNullable<z.ZodString>;
114
180
  shake: z.ZodNullable<z.ZodString>;
115
181
  }, z.core.$strict>>;
182
+ against: z.ZodOptional<z.ZodEnum<{
183
+ motion: "motion";
184
+ picture: "picture";
185
+ }>>;
186
+ action_at_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
187
+ subject: z.ZodOptional<z.ZodNullable<z.ZodObject<{
188
+ x: z.ZodNumber;
189
+ y: z.ZodNumber;
190
+ w: z.ZodNumber;
191
+ h: z.ZodNumber;
192
+ }, z.core.$strict>>>;
116
193
  }, z.core.$strict>>;
117
194
  created_at: z.ZodString;
118
195
  }, z.core.$strict>>;
package/dist/ads.js CHANGED
@@ -7,8 +7,8 @@ import { runId } from "./runs.js";
7
7
  export { adId, adSlotId } from "./ad-ids.js";
8
8
  export const ADS_PATH = "/v1/ads";
9
9
  export const AD_PATH = "/v1/ads/:id";
10
- export const DIY_RECORD_KINDS = ["ad"];
11
- export const DIY_MAX_SLOTS = { ad: FILM_EDIT_MAX_CLIPS };
10
+ export const DIY_RECORD_KINDS = ["ad", "faceless"];
11
+ export const DIY_MAX_SLOTS = { ad: FILM_EDIT_MAX_CLIPS, faceless: 40 };
12
12
  export const AD_MAX_SLOTS = DIY_MAX_SLOTS.ad;
13
13
  export const AD_RECORDS_PER_DAY = 50;
14
14
  export const adBrief = z.strictObject({
@@ -37,9 +37,10 @@ const adCheck = z.strictObject({
37
37
  verdict: takeCheckVerdict.nullable(),
38
38
  created_at: z.string(),
39
39
  });
40
- const adTake = z.strictObject({
40
+ export const adTake = z.strictObject({
41
41
  run_id: runId.nullable().describe("The take's generate_video run, or null for a video asset"),
42
42
  asset_id: assetId.nullable(),
43
+ own_footage: z.boolean().describe("Your own footage, not a clip made with generate_video: the edit needs no check of it, and its checks are advice"),
43
44
  passed: z.boolean(),
44
45
  checks: z.array(adCheck),
45
46
  });
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ export declare const cutId: z.ZodString;
3
+ export declare const cutSlotId: z.ZodString;
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+ export const cutId = z.string().regex(/^fv_[a-f0-9]{32}$/, "a cut id is fv_ and 32 hex characters").describe("A cut record of this account (create_cut)");
3
+ export const cutSlotId = z.string().regex(/^[a-z0-9][a-z0-9_-]{0,23}$/, "a slot id is up to 24 lowercase letters, digits, - or _")
4
+ .describe("A slot of the cut record: one shot of its plan, such as hook or s2");
package/dist/cuts.d.ts ADDED
@@ -0,0 +1,221 @@
1
+ import { z } from "zod";
2
+ export { cutId, cutSlotId } from "./cut-ids.js";
3
+ export declare const CUTS_PATH = "/v1/cuts";
4
+ export declare const CUT_PATH = "/v1/cuts/:id";
5
+ export declare const CUT_MAX_SLOTS: number;
6
+ export declare const CUT_RECORDS_PER_DAY = 50;
7
+ export declare const CUT_SLOT_NEEDS: readonly ["take", "picture", "card", "footage"];
8
+ export declare const facelessBrief: z.ZodObject<{
9
+ format: z.ZodEnum<{
10
+ cartoon: "cartoon";
11
+ list: "list";
12
+ own_pictures: "own_pictures";
13
+ story: "story";
14
+ }>;
15
+ topic: z.ZodString;
16
+ look: z.ZodOptional<z.ZodString>;
17
+ language: z.ZodOptional<z.ZodString>;
18
+ script: z.ZodOptional<z.ZodString>;
19
+ voice_run_id: z.ZodOptional<z.ZodString>;
20
+ notes: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strict>;
22
+ export type FacelessBrief = z.infer<typeof facelessBrief>;
23
+ export declare const cutSlot: z.ZodObject<{
24
+ id: z.ZodString;
25
+ needs: z.ZodEnum<{
26
+ card: "card";
27
+ footage: "footage";
28
+ picture: "picture";
29
+ take: "take";
30
+ }>;
31
+ shot: z.ZodString;
32
+ }, z.core.$strict>;
33
+ export type CutSlot = z.infer<typeof cutSlot>;
34
+ export declare const createCutInput: z.ZodObject<{
35
+ brief: z.ZodObject<{
36
+ format: z.ZodEnum<{
37
+ cartoon: "cartoon";
38
+ list: "list";
39
+ own_pictures: "own_pictures";
40
+ story: "story";
41
+ }>;
42
+ topic: z.ZodString;
43
+ look: z.ZodOptional<z.ZodString>;
44
+ language: z.ZodOptional<z.ZodString>;
45
+ script: z.ZodOptional<z.ZodString>;
46
+ voice_run_id: z.ZodOptional<z.ZodString>;
47
+ notes: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strict>;
49
+ slots: z.ZodArray<z.ZodObject<{
50
+ id: z.ZodString;
51
+ needs: z.ZodEnum<{
52
+ card: "card";
53
+ footage: "footage";
54
+ picture: "picture";
55
+ take: "take";
56
+ }>;
57
+ shot: z.ZodString;
58
+ }, z.core.$strict>>;
59
+ }, z.core.$strict>;
60
+ export type CreateCutInput = z.infer<typeof createCutInput>;
61
+ export declare const updateCutInput: z.ZodObject<{
62
+ brief: z.ZodOptional<z.ZodObject<{
63
+ format: z.ZodEnum<{
64
+ cartoon: "cartoon";
65
+ list: "list";
66
+ own_pictures: "own_pictures";
67
+ story: "story";
68
+ }>;
69
+ topic: z.ZodString;
70
+ look: z.ZodOptional<z.ZodString>;
71
+ language: z.ZodOptional<z.ZodString>;
72
+ script: z.ZodOptional<z.ZodString>;
73
+ voice_run_id: z.ZodOptional<z.ZodString>;
74
+ notes: z.ZodOptional<z.ZodString>;
75
+ }, z.core.$strict>>;
76
+ slots: z.ZodOptional<z.ZodArray<z.ZodObject<{
77
+ id: z.ZodString;
78
+ needs: z.ZodEnum<{
79
+ card: "card";
80
+ footage: "footage";
81
+ picture: "picture";
82
+ take: "take";
83
+ }>;
84
+ shot: z.ZodString;
85
+ }, z.core.$strict>>>;
86
+ }, z.core.$strict>;
87
+ export type UpdateCutInput = z.infer<typeof updateCutInput>;
88
+ export declare const cutRecord: z.ZodObject<{
89
+ cut_id: z.ZodString;
90
+ brief: z.ZodObject<{
91
+ format: z.ZodEnum<{
92
+ cartoon: "cartoon";
93
+ list: "list";
94
+ own_pictures: "own_pictures";
95
+ story: "story";
96
+ }>;
97
+ topic: z.ZodString;
98
+ look: z.ZodOptional<z.ZodString>;
99
+ language: z.ZodOptional<z.ZodString>;
100
+ script: z.ZodOptional<z.ZodString>;
101
+ voice_run_id: z.ZodOptional<z.ZodString>;
102
+ notes: z.ZodOptional<z.ZodString>;
103
+ }, z.core.$strict>;
104
+ guide_version: z.ZodString;
105
+ voice: z.ZodNullable<z.ZodObject<{
106
+ run_id: z.ZodString;
107
+ state: z.ZodString;
108
+ duration_sec: z.ZodNullable<z.ZodNumber>;
109
+ }, z.core.$strict>>;
110
+ slots: z.ZodArray<z.ZodObject<{
111
+ id: z.ZodString;
112
+ needs: z.ZodEnum<{
113
+ card: "card";
114
+ footage: "footage";
115
+ picture: "picture";
116
+ take: "take";
117
+ }>;
118
+ shot: z.ZodString;
119
+ state: z.ZodNullable<z.ZodEnum<{
120
+ checking: "checking";
121
+ failed: "failed";
122
+ no_take: "no_take";
123
+ passed: "passed";
124
+ }>>;
125
+ takes: z.ZodOptional<z.ZodArray<z.ZodObject<{
126
+ run_id: z.ZodNullable<z.ZodString>;
127
+ asset_id: z.ZodNullable<z.ZodString>;
128
+ own_footage: z.ZodBoolean;
129
+ passed: z.ZodBoolean;
130
+ checks: z.ZodArray<z.ZodObject<{
131
+ run_id: z.ZodString;
132
+ state: z.ZodString;
133
+ passed: z.ZodNullable<z.ZodBoolean>;
134
+ verdict: z.ZodNullable<z.ZodObject<{
135
+ duration_sec: z.ZodNumber;
136
+ findings: z.ZodArray<z.ZodObject<{
137
+ code: z.ZodString;
138
+ level: z.ZodEnum<{
139
+ action: "action";
140
+ asset: "asset";
141
+ camera: "camera";
142
+ roll: "roll";
143
+ }>;
144
+ from: z.ZodNumber;
145
+ to: z.ZodNumber;
146
+ whole_take: z.ZodBoolean;
147
+ why: z.ZodNullable<z.ZodString>;
148
+ }, z.core.$strict>>;
149
+ clean: z.ZodArray<z.ZodObject<{
150
+ from: z.ZodNumber;
151
+ to: z.ZodNumber;
152
+ }, z.core.$strict>>;
153
+ motion: z.ZodOptional<z.ZodObject<{
154
+ subject: z.ZodNumber;
155
+ camera: z.ZodNumber;
156
+ jitter: z.ZodNumber;
157
+ format: z.ZodEnum<{
158
+ fashion: "fashion";
159
+ product: "product";
160
+ }>;
161
+ target: z.ZodObject<{
162
+ subject: z.ZodNumber;
163
+ camera: z.ZodNullable<z.ZodNumber>;
164
+ }, z.core.$strict>;
165
+ windows: z.ZodArray<z.ZodObject<{
166
+ subject: z.ZodNumber;
167
+ camera: z.ZodNumber;
168
+ jitter: z.ZodNumber;
169
+ from: z.ZodNumber;
170
+ to: z.ZodNumber;
171
+ }, z.core.$strict>>;
172
+ finding: z.ZodNullable<z.ZodString>;
173
+ shake: z.ZodNullable<z.ZodString>;
174
+ }, z.core.$strict>>;
175
+ against: z.ZodOptional<z.ZodEnum<{
176
+ motion: "motion";
177
+ picture: "picture";
178
+ }>>;
179
+ action_at_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
180
+ subject: z.ZodOptional<z.ZodNullable<z.ZodObject<{
181
+ x: z.ZodNumber;
182
+ y: z.ZodNumber;
183
+ w: z.ZodNumber;
184
+ h: z.ZodNumber;
185
+ }, z.core.$strict>>>;
186
+ }, z.core.$strict>>;
187
+ created_at: z.ZodString;
188
+ }, z.core.$strict>>;
189
+ }, z.core.$strict>>>;
190
+ }, z.core.$strict>>;
191
+ previews: z.ZodArray<z.ZodObject<{
192
+ run_id: z.ZodString;
193
+ state: z.ZodString;
194
+ credits_charged: z.ZodNullable<z.ZodNumber>;
195
+ created_at: z.ZodString;
196
+ }, z.core.$strict>>;
197
+ renders: z.ZodArray<z.ZodObject<{
198
+ run_id: z.ZodString;
199
+ state: z.ZodString;
200
+ credits_charged: z.ZodNullable<z.ZodNumber>;
201
+ created_at: z.ZodString;
202
+ }, z.core.$strict>>;
203
+ next: z.ZodNullable<z.ZodObject<{
204
+ action: z.ZodString;
205
+ method: z.ZodEnum<{
206
+ GET: "GET";
207
+ POST: "POST";
208
+ }>;
209
+ path: z.ZodString;
210
+ body: z.ZodRecord<z.ZodString, z.ZodUnknown>;
211
+ add: z.ZodArray<z.ZodString>;
212
+ note: z.ZodString;
213
+ }, z.core.$strict>>;
214
+ blocked: z.ZodNullable<z.ZodObject<{
215
+ reason: z.ZodString;
216
+ unblock: z.ZodString;
217
+ }, z.core.$strict>>;
218
+ created_at: z.ZodString;
219
+ updated_at: z.ZodString;
220
+ }, z.core.$strict>;
221
+ export type CutRecord = z.infer<typeof cutRecord>;
package/dist/cuts.js ADDED
@@ -0,0 +1,51 @@
1
+ import { z } from "zod";
2
+ import { AD_SLOT_STATES, adTake, DIY_MAX_SLOTS } from "./ads.js";
3
+ import { cutId, cutSlotId } from "./cut-ids.js";
4
+ import { diyBlocked, diyNext } from "./diy-next.js";
5
+ import { FILM_CUT_FORMATS } from "./film-cut.js";
6
+ import { runId } from "./runs.js";
7
+ export { cutId, cutSlotId } from "./cut-ids.js";
8
+ export const CUTS_PATH = "/v1/cuts";
9
+ export const CUT_PATH = "/v1/cuts/:id";
10
+ export const CUT_MAX_SLOTS = DIY_MAX_SLOTS.faceless;
11
+ export const CUT_RECORDS_PER_DAY = 50;
12
+ export const CUT_SLOT_NEEDS = ["take", "picture", "card", "footage"];
13
+ export const facelessBrief = z.strictObject({
14
+ format: z.enum(FILM_CUT_FORMATS).describe("The video: story, list (facts, tips or steps), own_pictures or cartoon"),
15
+ topic: z.string().trim().min(1).max(200).describe("What the video is about, in a line"),
16
+ look: z.string().regex(/^[a-z][a-z0-9_]{1,31}$/u, "a short snake_case tag, such as flat_2d").optional()
17
+ .describe("The look picked from the guide's menu, by its tag"),
18
+ language: z.string().trim().min(1).max(40).optional().describe("The language the voice speaks"),
19
+ script: z.string().trim().min(1).max(5000).optional().describe("The script as approved"),
20
+ voice_run_id: runId.optional().describe("A delivered make_voice run of this account: the video's voice"),
21
+ notes: z.string().trim().min(1).max(2000).optional().describe("Anything else the video must keep: the user's wishes, the reference it follows"),
22
+ });
23
+ export const cutSlot = z.strictObject({
24
+ id: cutSlotId,
25
+ needs: z.enum(CUT_SLOT_NEEDS).describe("take: a clip made with generate_video, checked against its picture; picture: a picture; card: a " +
26
+ "text card; footage: the user's own video, which needs no check"),
27
+ shot: z.string().trim().min(1).max(500).describe("What the shot shows, in a line, and the words it plays on"),
28
+ });
29
+ const slots = z.array(cutSlot).min(1).max(CUT_MAX_SLOTS)
30
+ .refine(list => new Set(list.map(slot => slot.id)).size === list.length, "each slot id is used once")
31
+ .describe(`The shot plan in order, 1 to ${CUT_MAX_SLOTS} slots`);
32
+ export const createCutInput = z.strictObject({ brief: facelessBrief, slots });
33
+ export const updateCutInput = z.strictObject({
34
+ brief: facelessBrief.optional().describe("Replaces the brief"),
35
+ slots: slots.optional().describe("Replaces the shot plan; a slot that already has a checked take stays in it"),
36
+ }).refine(change => change.brief !== undefined || change.slots !== undefined, "send brief, slots or both");
37
+ const cutRun = z.strictObject({ run_id: runId, state: z.string(), credits_charged: z.number().int().nonnegative().nullable(), created_at: z.string() });
38
+ export const cutRecord = z.strictObject({
39
+ cut_id: cutId,
40
+ brief: facelessBrief,
41
+ guide_version: z.string(),
42
+ voice: z.strictObject({ run_id: runId, state: z.string(), duration_sec: z.number().positive().nullable() }).nullable(),
43
+ slots: z.array(z.strictObject({ id: cutSlotId, needs: z.enum(CUT_SLOT_NEEDS), shot: z.string(), state: z.enum(AD_SLOT_STATES).nullable(),
44
+ takes: z.array(adTake).optional() })),
45
+ previews: z.array(cutRun),
46
+ renders: z.array(cutRun),
47
+ next: diyNext.nullable(),
48
+ blocked: diyBlocked.nullable(),
49
+ created_at: z.string(),
50
+ updated_at: z.string(),
51
+ });
package/dist/endpoints.js CHANGED
@@ -9,6 +9,8 @@ import { TREND_NICHES_PATH } from "./trend-niches.js";
9
9
  import { FEEDBACK_PATH } from "./feedback.js";
10
10
  import { FILM_DRAFT_CHECK_PATH, FILM_DRAFT_FILES_PATH, FILM_DRAFT_PATH, FILM_DRAFTS_PATH } from "./film-drafts.js";
11
11
  import { FILM_GUIDE_PATH, FILM_KIT_PATH } from "./film-guide.js";
12
+ import { CUT_PREVIEWS_PATH, CUT_PREVIEWS_QUOTE_PATH, FILM_CUT_CHECK_PATH, FILM_CUTS_PATH, FILM_CUTS_QUOTE_PATH } from "./film-cut.js";
13
+ import { CUT_PATH, CUTS_PATH } from "./cuts.js";
12
14
  import { AD_GUIDE_PATH } from "./ad-guide.js";
13
15
  import { AD_PATH, ADS_PATH } from "./ads.js";
14
16
  import { FILM_EDITS_PATH, FILM_EDITS_QUOTE_PATH, FILM_HEROES_PATH, FILM_HEROES_QUOTE_PATH, FILM_RENDERS_PATH, FILM_RENDERS_QUOTE_PATH, FILM_RUN_PATH, FILM_STILLS_PATH, FILM_STILLS_QUOTE_PATH, FILM_VOICES_PATH, FILM_VOICES_QUOTE_PATH, TAKE_CHECKS_PATH, TAKE_CHECKS_QUOTE_PATH, TAKE_FRAMES_PATH, TAKE_FRAMES_QUOTE_PATH } from "./own-agent-runs.js";
@@ -124,6 +126,14 @@ export const API_ENDPOINTS = [
124
126
  { method: "POST", path: TAKE_CHECKS_QUOTE_PATH, billed: false, onQuickstart: false, jsonBody: true, cabinet: false, mcp: true },
125
127
  { method: "POST", path: TAKE_CHECKS_PATH, billed: true, onQuickstart: false, jsonBody: true, cabinet: false, mcp: true },
126
128
  { method: "GET", path: FILM_RUN_PATH, billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: true },
129
+ { method: "POST", path: FILM_CUT_CHECK_PATH, billed: false, onQuickstart: false, jsonBody: true, cabinet: false, mcp: true },
130
+ { method: "POST", path: FILM_CUTS_QUOTE_PATH, billed: false, onQuickstart: false, jsonBody: true, cabinet: false, mcp: true },
131
+ { method: "POST", path: FILM_CUTS_PATH, billed: true, onQuickstart: false, jsonBody: true, cabinet: false, mcp: true },
132
+ { method: "POST", path: CUT_PREVIEWS_QUOTE_PATH, billed: false, onQuickstart: false, jsonBody: true, cabinet: false, mcp: true },
133
+ { method: "POST", path: CUT_PREVIEWS_PATH, billed: true, onQuickstart: false, jsonBody: true, cabinet: false, mcp: true },
134
+ { method: "POST", path: CUTS_PATH, billed: false, onQuickstart: false, jsonBody: true, cabinet: false, mcp: true },
135
+ { method: "POST", path: CUT_PATH, billed: false, onQuickstart: false, jsonBody: true, cabinet: false, mcp: true },
136
+ { method: "GET", path: CUT_PATH, billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: true },
127
137
  { method: "GET", path: FILM_GUIDE_PATH, billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: true },
128
138
  { method: "GET", path: FILM_KIT_PATH, billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: true },
129
139
  { method: "GET", path: AD_GUIDE_PATH, billed: false, onQuickstart: false, jsonBody: false, cabinet: false, mcp: true },
package/dist/errors.d.ts CHANGED
@@ -260,7 +260,7 @@ export type EditCeilingReachedError = z.infer<typeof editCeilingReachedError>;
260
260
  export declare function editCeilingReachedBody(args: Omit<EditCeilingReachedError["error"], "code" | "message">, counting?: "revision" | "candidate"): EditCeilingReachedError;
261
261
  export declare function unusableSourceMessage(errorClass: string, detail: string): string;
262
262
  export declare const MALFORMED_BODY_MESSAGE: string;
263
- 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", "deletion_held", "editing_window_not_set", "explainer_busy", "feedback_limited", "film_draft_limited", "film_draft_not_found", "film_draft_stale", "film_run_not_found", "film_voice_not_ready", "generations_disabled", "generations_marking_pending", "idempotency_key_required", "idempotency_key_reused", "ingest_enqueue_failed", "insufficient_scope", "internal_error", "invalid_image", "invalid_request", "malformed_body", "no_changes", "not_found", "own_agent_disabled", "own_agent_marking_pending", "paid_render_disabled", "proposal_expired", "proposal_not_found", "proposal_not_ready", "proposal_stale", "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_frames_limited", "trend_page_unavailable", "trend_search_limited", "trend_search_not_found", "trends_unavailable", "unauthorized", "unsupported_combination", "unsupported_media_type", "unusable_source", "upload_cap_exceeded", "upload_digest_mismatch", "upload_expired", "upload_in_use", "upload_not_finished", "upload_size_mismatch", "upstream_error", "url_fetch_busy", "url_fetch_failed", "url_fetch_rate_limited", "url_fetch_refused", "url_import_disabled"];
263
+ declare const BARE_ERROR_CODES: readonly ["analysis_enqueue_failed", "aspect_conflict", "actor_unavailable", "actor_format_unavailable", "actor_storage_unavailable", "actor_generation_disabled", "actor_in_use", "ad_limited", "ad_not_found", "ad_slot_in_use", "ad_slot_unchecked", "asset_cap_exceeded", "asset_ingest_cap_exceeded", "asset_not_found", "asset_not_ready", "assets_disabled", "creator_profile_limited", "creator_profile_not_found", "creator_url_unsupported", "cut_limited", "cut_not_found", "cut_preview_limited", "cut_slot_in_use", "deletion_held", "editing_window_not_set", "explainer_busy", "feedback_limited", "film_draft_limited", "film_draft_not_found", "film_draft_stale", "film_run_not_found", "film_voice_not_ready", "generations_disabled", "generations_marking_pending", "idempotency_key_required", "idempotency_key_reused", "ingest_enqueue_failed", "insufficient_scope", "internal_error", "invalid_image", "invalid_request", "malformed_body", "no_changes", "not_found", "own_agent_disabled", "own_agent_marking_pending", "paid_render_disabled", "proposal_expired", "proposal_not_found", "proposal_not_ready", "proposal_stale", "payload_too_large", "reference_analysis_disabled", "reference_analysis_limited", "reference_analysis_not_found", "reference_not_analyzable", "reference_not_usable", "reference_url_unsupported", "revision_needs_generated_unit", "rights_not_confirmed", "run_media_in_use", "run_not_finished", "run_not_found", "source_aspect_mismatch", "source_not_usable", "take_check_limited", "take_frames_limited", "trend_page_unavailable", "trend_search_limited", "trend_search_not_found", "trends_unavailable", "unauthorized", "unsupported_combination", "unsupported_media_type", "unusable_source", "upload_cap_exceeded", "upload_digest_mismatch", "upload_expired", "upload_in_use", "upload_not_finished", "upload_size_mismatch", "upstream_error", "url_fetch_busy", "url_fetch_failed", "url_fetch_rate_limited", "url_fetch_refused", "url_import_disabled"];
264
264
  export type BareApiErrorCode = (typeof BARE_ERROR_CODES)[number];
265
265
  export declare const API_ERROR_CODES: readonly string[];
266
266
  export declare function apiErrorBody(args: {
package/dist/errors.js CHANGED
@@ -313,6 +313,10 @@ const BARE_ERROR_CODES = [
313
313
  "creator_profile_limited",
314
314
  "creator_profile_not_found",
315
315
  "creator_url_unsupported",
316
+ "cut_limited",
317
+ "cut_not_found",
318
+ "cut_preview_limited",
319
+ "cut_slot_in_use",
316
320
  "deletion_held",
317
321
  "editing_window_not_set",
318
322
  "explainer_busy",
@@ -355,6 +359,7 @@ const BARE_ERROR_CODES = [
355
359
  "run_not_found",
356
360
  "source_aspect_mismatch",
357
361
  "source_not_usable",
362
+ "take_check_limited",
358
363
  "take_frames_limited",
359
364
  "trend_page_unavailable",
360
365
  "trend_search_limited",
@@ -1,6 +1,9 @@
1
1
  import { z } from "zod";
2
2
  export declare const FACELESS_BEAT_KINDS: readonly ["live", "still_move", "static_insert", "customer_image", "card"];
3
3
  export declare const FACELESS_SHOT_SIZES: readonly ["ecu", "cu", "mcu", "ms", "mws", "ws", "ews"];
4
+ export declare const FACELESS_CAMERA_MOVES: readonly ["hold", "push_in", "pull_out", "pan_left", "pan_right", "tilt_up", "tilt_down", "handheld"];
5
+ export declare const FACELESS_SPEEDS: readonly ["steady", "brisk", "punch"];
6
+ export declare const FACELESS_CUT_LOOKS: readonly ["hard", "flash", "whip"];
4
7
  export declare const facelessDirectionSummary: z.ZodObject<{
5
8
  beats: z.ZodArray<z.ZodObject<{
6
9
  words: z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
@@ -1,6 +1,9 @@
1
1
  import { z } from "zod";
2
2
  export const FACELESS_BEAT_KINDS = ["live", "still_move", "static_insert", "customer_image", "card"];
3
3
  export const FACELESS_SHOT_SIZES = ["ecu", "cu", "mcu", "ms", "mws", "ws", "ews"];
4
+ export const FACELESS_CAMERA_MOVES = ["hold", "push_in", "pull_out", "pan_left", "pan_right", "tilt_up", "tilt_down", "handheld"];
5
+ export const FACELESS_SPEEDS = ["steady", "brisk", "punch"];
6
+ export const FACELESS_CUT_LOOKS = ["hard", "flash", "whip"];
4
7
  const word = z.number().int().nonnegative().safe();
5
8
  export const facelessDirectionSummary = z.strictObject({
6
9
  beats: z.array(z.strictObject({ words: z.tuple([word, word]).nullable(), kind: z.enum(FACELESS_BEAT_KINDS), shot_size: z.enum(FACELESS_SHOT_SIZES) })),
@@ -3,6 +3,7 @@ import { FACELESS_MAX_OUTPUT_FRAMES, FACELESS_MIN_OUTPUT_FRAMES } from "./facele
3
3
  import { parseCutStyle } from "./faceless-cut-style.js";
4
4
  import { assertStoryboardWords } from "./faceless-storyboard.js";
5
5
  import { facelessCutScore } from "./faceless-storyboard-v2-timing.js";
6
+ import { LEXICAL_WORD } from "./speech-words.js";
6
7
  const index = z.number().int().nonnegative().safe();
7
8
  const phrase = z.strictObject({ wordStart: index, wordEnd: index, accentWord: index });
8
9
  const storySchema = z.strictObject({
@@ -17,10 +18,9 @@ const storySchema = z.strictObject({
17
18
  })).min(2),
18
19
  captionPhrases: z.array(phrase).min(1).optional(),
19
20
  });
20
- const lexicalWordPattern = /[\p{L}\p{N}\p{M}]+(?:['’][\p{L}\p{N}\p{M}]+)*/gu;
21
21
  export function facelessSpeechWordSpans(script) {
22
- const matches = [...script.matchAll(lexicalWordPattern)];
23
- const normalizedCount = script.normalize("NFKC").match(lexicalWordPattern)?.length ?? 0;
22
+ const matches = [...script.matchAll(LEXICAL_WORD)];
23
+ const normalizedCount = script.normalize("NFKC").match(LEXICAL_WORD)?.length ?? 0;
24
24
  if (!matches.length || matches.length !== normalizedCount)
25
25
  throw new Error("unsupported faceless script word boundaries");
26
26
  const compactOffset = Array(script.length + 1).fill(0);
@@ -34,7 +34,7 @@ export function facelessSpeechWordSpans(script) {
34
34
  }
35
35
  export function facelessSpeechLexicalWords(script) {
36
36
  return facelessSpeechWordSpans(script).map(({ word }) => {
37
- const normalized = word.normalize("NFKC").match(lexicalWordPattern);
37
+ const normalized = word.normalize("NFKC").match(LEXICAL_WORD);
38
38
  if (normalized?.length !== 1)
39
39
  throw new Error("unsupported faceless lexical word");
40
40
  return normalized[0].replace(/[’]/gu, "'").normalize("NFD")
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- const tokenPattern = /[\p{L}\p{N}\p{M}]+(?:['’][\p{L}\p{N}\p{M}]+)*/gu;
2
+ import { lexicalWords as tokens } from "./speech-words.js";
3
3
  const nonblank = z.string().trim().min(1);
4
4
  const index = z.number().int().nonnegative();
5
5
  const sha256 = z.string().regex(/^[0-9a-fA-F]{64}$/);
@@ -32,9 +32,6 @@ const proposalSchema = z.strictObject({
32
32
  accentWord: index,
33
33
  })).min(1),
34
34
  });
35
- function tokens(input) {
36
- return input.normalize("NFKC").match(tokenPattern) ?? [];
37
- }
38
35
  function lexical(input) {
39
36
  return input.normalize("NFKC").replace(/[’]/gu, "'").normalize("NFD")
40
37
  .replace(/\p{M}/gu, "").toLocaleLowerCase("und");
@@ -76,15 +73,17 @@ export function parseStoryboardProposal(input) {
76
73
  }
77
74
  export function assertStoryboardWords(script, words) {
78
75
  const scriptWords = tokens(script);
76
+ const differs = (i) => { const measured = tokens(words[i].word); return measured.length !== 1 || lexical(measured[0]) !== lexical(scriptWords[i]); };
77
+ const quoted = (i) => `"${words[i].word.slice(0, 40)}" in the voice, "${scriptWords[i].slice(0, 40)}" in the text`;
79
78
  if (scriptWords.length === 0 || scriptWords.length !== words.length) {
80
- throw new Error("storyboard word count mismatch");
79
+ const shared = Math.min(words.length, scriptWords.length), at = Array.from({ length: shared }, (_, i) => i).find(differs);
80
+ throw new Error(`storyboard word count mismatch: the voice has ${words.length} words and its text ${scriptWords.length}` +
81
+ (at === undefined ? "" : `; word ${at} is the first that differs: ${quoted(at)}`));
81
82
  }
82
83
  for (let i = 0; i < words.length; i++) {
83
84
  const timed = words[i];
84
- const measured = tokens(timed.word);
85
- if (measured.length !== 1 || lexical(measured[0]) !== lexical(scriptWords[i])) {
86
- throw new Error(`storyboard word ${i} differs from script`);
87
- }
85
+ if (differs(i))
86
+ throw new Error(`storyboard word ${i} differs from script: ${quoted(i)}`);
88
87
  if (!Number.isFinite(timed.startSec) || !Number.isFinite(timed.endSec) ||
89
88
  timed.startSec < 0 || timed.endSec <= timed.startSec ||
90
89
  (i > 0 && timed.startSec < words[i - 1].endSec)) {