@clipwright/core 0.77.0 → 0.79.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 (66) hide show
  1. package/dist/account.d.ts +1 -0
  2. package/dist/account.js +1 -0
  3. package/dist/actors.js +2 -2
  4. package/dist/ad-guide.d.ts +2 -1
  5. package/dist/ad-guide.js +4 -4
  6. package/dist/api-failure.d.ts +1 -0
  7. package/dist/api-failure.js +6 -3
  8. package/dist/aspect.d.ts +1 -2
  9. package/dist/aspect.js +2 -18
  10. package/dist/contract-dispositions.d.ts +20 -4
  11. package/dist/contract-dispositions.js +3 -0
  12. package/dist/contracts/v1/workflow-brief.d.ts +34 -4
  13. package/dist/contracts/v1/workflow-brief.js +12 -3
  14. package/dist/contracts/v1/workflow-catalog.d.ts +52 -4
  15. package/dist/contracts/v1/workflow-client.d.ts +17 -2
  16. package/dist/contracts/v1/workflow-execution.d.ts +26 -0
  17. package/dist/contracts/v1/workflow-next.d.ts +13 -0
  18. package/dist/contracts/v1/workflow-plan.d.ts +69 -6
  19. package/dist/contracts/v1/workflow-run-read.d.ts +36 -0
  20. package/dist/edit-style-names.d.ts +9 -0
  21. package/dist/edit-style-names.js +4 -0
  22. package/dist/edit-style.d.ts +70 -0
  23. package/dist/edit-style.js +202 -0
  24. package/dist/errors.d.ts +1 -1
  25. package/dist/errors.js +1 -0
  26. package/dist/film-guide.d.ts +2 -1
  27. package/dist/film-guide.js +2 -2
  28. package/dist/index.d.ts +2 -1
  29. package/dist/index.js +2 -1
  30. package/dist/long-form-pricing.d.ts +0 -1
  31. package/dist/long-form-pricing.js +0 -1
  32. package/dist/mcp-ugc-descriptions.d.ts +2 -1
  33. package/dist/mcp-ugc-descriptions.js +5 -3
  34. package/dist/reference-analysis.d.ts +13 -0
  35. package/dist/reference-analysis.js +10 -1
  36. package/dist/reference-display.d.ts +2 -0
  37. package/dist/reference-display.js +9 -1
  38. package/dist/render-backend.d.ts +1 -3
  39. package/dist/render-backend.js +0 -5
  40. package/dist/run-static-warnings.js +2 -2
  41. package/dist/skills.d.ts +186 -111
  42. package/dist/skills.js +97 -39
  43. package/dist/tts-backend.d.ts +1 -2
  44. package/dist/voice-admission.d.ts +33 -27
  45. package/dist/voice-admission.js +2 -2
  46. package/dist/voice-listing.d.ts +1 -2
  47. package/dist/voice-listing.js +2 -4
  48. package/dist/voice-verified-models.d.ts +3 -0
  49. package/dist/voice-verified-models.js +5 -0
  50. package/dist/workflows/methods/faceless-explainer.d.ts +7 -2
  51. package/dist/workflows/methods/kinetic-launch.d.ts +14 -4
  52. package/dist/workflows/methods/product-image-story.d.ts +7 -2
  53. package/dist/workflows/methods/reference-remake.d.ts +7 -2
  54. package/dist/workflows/methods/reference-remake.js +1 -1
  55. package/dist/workflows/methods/shared.d.ts +7 -2
  56. package/dist/workflows/methods/ugc-faq-answer.d.ts +7 -2
  57. package/dist/workflows/methods/ugc-faq-answer.js +1 -1
  58. package/dist/workflows/methods/ugc-product-intro.d.ts +7 -2
  59. package/dist/workflows/methods/ugc-product-intro.js +1 -1
  60. package/dist/workflows/methods/website-proof-demo.d.ts +14 -4
  61. package/dist/workflows/reference-remake.d.ts +9 -1
  62. package/dist/workflows/reference-remake.js +3 -2
  63. package/dist/workflows/validate.js +4 -2
  64. package/package.json +1 -1
  65. package/dist/vendor-response.d.ts +0 -20
  66. package/dist/vendor-response.js +0 -94
@@ -208,8 +208,9 @@ export declare const ugcProductIntro: {
208
208
  name?: string | undefined;
209
209
  broll_url?: string | undefined;
210
210
  broll_policy?: "anyone" | "no_actor" | "no_people" | undefined;
211
- captions: boolean;
212
- caption_style: "accent" | "arcade" | "bassdrop" | "broadcast" | "bubblegum" | "campfire" | "clutch" | "crayon" | "genz" | "headline" | "highlighter" | "hormozi" | "instagram" | "lecture" | "lyrics" | "midnight" | "minimal" | "minimalist" | "neon" | "plottwist" | "promo" | "punch" | "studio" | "tiktok" | "youtube";
211
+ captions?: boolean | undefined;
212
+ caption_style?: "accent" | "arcade" | "bassdrop" | "broadcast" | "bubblegum" | "campfire" | "clutch" | "crayon" | "genz" | "headline" | "highlighter" | "hormozi" | "instagram" | "lecture" | "lyrics" | "midnight" | "minimal" | "minimalist" | "neon" | "plottwist" | "promo" | "punch" | "studio" | "tiktok" | "youtube" | undefined;
213
+ edit_style?: "bare" | "bold-v1" | "calm-v1" | "house-v1" | undefined;
213
214
  caption_mode?: "full" | "highlights" | undefined;
214
215
  caption_position?: "bottom" | "lower" | "middle" | "top" | undefined;
215
216
  caption_place?: {
@@ -4182,6 +4183,10 @@ export declare const ugcProductIntro: {
4182
4183
  added?: string[] | undefined;
4183
4184
  move_warnings?: string[] | undefined;
4184
4185
  voice_warnings?: string[] | undefined;
4186
+ edit_style_default?: {
4187
+ fields: ("caption_emphasis" | "caption_style" | "captions" | "edit_sounds")[];
4188
+ left_out?: string[] | undefined;
4189
+ } | undefined;
4185
4190
  review_notes?: string[] | undefined;
4186
4191
  review_warnings?: string[] | undefined;
4187
4192
  };
@@ -1,6 +1,6 @@
1
1
  import { defineWorkflowMethod, nativeLimitations, nativeQa, verticalOutput } from './shared.js';
2
2
  export const ugcProductIntro = defineWorkflowMethod({
3
- id: 'ugc-product-intro', version: 1, content_digest: 'f3f387e87e99018fd2c99fb674a37a4f47f856f872e6efe542b0f93968a8d2d0', authoring_status: 'ready', title: 'Introduce a product through its benefit',
3
+ id: 'ugc-product-intro', version: 1, content_digest: '50c0e7eb2993e180862b3b7fbdb1f6b32d43e02426cedd28a18cc74eb092498d', authoring_status: 'ready', title: 'Introduce a product through its benefit',
4
4
  purpose: 'Help a defined audience understand one verified product benefit and take one next step.',
5
5
  required_inputs: ['audience', 'message', 'product', 'script'], required_features: ['exact_script', 'actor', 'voice'],
6
6
  script_rules: { structure: ['opening', 'problem', 'solution', 'cta'], instructions: [
@@ -208,8 +208,9 @@ export declare const websiteProofDemo: {
208
208
  name?: string | undefined;
209
209
  broll_url?: string | undefined;
210
210
  broll_policy?: "anyone" | "no_actor" | "no_people" | undefined;
211
- captions: boolean;
212
- caption_style: "accent" | "arcade" | "bassdrop" | "broadcast" | "bubblegum" | "campfire" | "clutch" | "crayon" | "genz" | "headline" | "highlighter" | "hormozi" | "instagram" | "lecture" | "lyrics" | "midnight" | "minimal" | "minimalist" | "neon" | "plottwist" | "promo" | "punch" | "studio" | "tiktok" | "youtube";
211
+ captions?: boolean | undefined;
212
+ caption_style?: "accent" | "arcade" | "bassdrop" | "broadcast" | "bubblegum" | "campfire" | "clutch" | "crayon" | "genz" | "headline" | "highlighter" | "hormozi" | "instagram" | "lecture" | "lyrics" | "midnight" | "minimal" | "minimalist" | "neon" | "plottwist" | "promo" | "punch" | "studio" | "tiktok" | "youtube" | undefined;
213
+ edit_style?: "bare" | "bold-v1" | "calm-v1" | "house-v1" | undefined;
213
214
  caption_mode?: "full" | "highlights" | undefined;
214
215
  caption_position?: "bottom" | "lower" | "middle" | "top" | undefined;
215
216
  caption_place?: {
@@ -4182,6 +4183,10 @@ export declare const websiteProofDemo: {
4182
4183
  added?: string[] | undefined;
4183
4184
  move_warnings?: string[] | undefined;
4184
4185
  voice_warnings?: string[] | undefined;
4186
+ edit_style_default?: {
4187
+ fields: ("caption_emphasis" | "caption_style" | "captions" | "edit_sounds")[];
4188
+ left_out?: string[] | undefined;
4189
+ } | undefined;
4185
4190
  review_notes?: string[] | undefined;
4186
4191
  review_warnings?: string[] | undefined;
4187
4192
  };
@@ -4410,8 +4415,9 @@ export declare const websiteProofDemoFilm: {
4410
4415
  name?: string | undefined;
4411
4416
  broll_url?: string | undefined;
4412
4417
  broll_policy?: "anyone" | "no_actor" | "no_people" | undefined;
4413
- captions: boolean;
4414
- caption_style: "accent" | "arcade" | "bassdrop" | "broadcast" | "bubblegum" | "campfire" | "clutch" | "crayon" | "genz" | "headline" | "highlighter" | "hormozi" | "instagram" | "lecture" | "lyrics" | "midnight" | "minimal" | "minimalist" | "neon" | "plottwist" | "promo" | "punch" | "studio" | "tiktok" | "youtube";
4418
+ captions?: boolean | undefined;
4419
+ caption_style?: "accent" | "arcade" | "bassdrop" | "broadcast" | "bubblegum" | "campfire" | "clutch" | "crayon" | "genz" | "headline" | "highlighter" | "hormozi" | "instagram" | "lecture" | "lyrics" | "midnight" | "minimal" | "minimalist" | "neon" | "plottwist" | "promo" | "punch" | "studio" | "tiktok" | "youtube" | undefined;
4420
+ edit_style?: "bare" | "bold-v1" | "calm-v1" | "house-v1" | undefined;
4415
4421
  caption_mode?: "full" | "highlights" | undefined;
4416
4422
  caption_position?: "bottom" | "lower" | "middle" | "top" | undefined;
4417
4423
  caption_place?: {
@@ -8384,6 +8390,10 @@ export declare const websiteProofDemoFilm: {
8384
8390
  added?: string[] | undefined;
8385
8391
  move_warnings?: string[] | undefined;
8386
8392
  voice_warnings?: string[] | undefined;
8393
+ edit_style_default?: {
8394
+ fields: ("caption_emphasis" | "caption_style" | "captions" | "edit_sounds")[];
8395
+ left_out?: string[] | undefined;
8396
+ } | undefined;
8387
8397
  review_notes?: string[] | undefined;
8388
8398
  review_warnings?: string[] | undefined;
8389
8399
  };
@@ -3,6 +3,7 @@ import { type ReferenceProfileInput as ReferenceProfile } from '../reference-pro
3
3
  import { type GenerationShot } from '../generation-shot.js';
4
4
  import { LIVE_SHOT_PRODUCT_PLACEMENTS } from '../skills.js';
5
5
  import type { CapabilityProfile } from '../contracts/v1/workflow-catalog.js';
6
+ import type { EditStyleField } from '../edit-style.js';
6
7
  import { type WorkflowPlanDocument } from '../contracts/v1/workflow-plan.js';
7
8
  import { type WorkflowIssue } from '../contracts/v1/workflow-primitives.js';
8
9
  import { type RemakeChooser } from './remake-chooser.js';
@@ -2144,5 +2145,12 @@ export declare function sceneBriefOf(graphic: ReferenceGraphic, asked: boolean,
2144
2145
  } | undefined;
2145
2146
  export declare function referenceScriptWords(script: string): ReferenceScriptWord[];
2146
2147
  export declare const proportionalSpans: ReferenceSpanPlanner;
2147
- export declare function compileReferenceRemake(input: unknown, capabilities: CapabilityProfile, planSpans?: ReferenceSpanPlanner, choose?: RemakeChooser, facts?: ReferenceAssetFacts): ReferenceRemakeResult;
2148
+ export type RemakeStyle = (native: Record<string, unknown>) => {
2149
+ input: Record<string, unknown>;
2150
+ pins?: {
2151
+ fields: EditStyleField[];
2152
+ left_out?: string[];
2153
+ };
2154
+ };
2155
+ export declare function compileReferenceRemake(input: unknown, capabilities: CapabilityProfile, planSpans?: ReferenceSpanPlanner, choose?: RemakeChooser, facts?: ReferenceAssetFacts, style?: RemakeStyle): ReferenceRemakeResult;
2148
2156
  export {};
@@ -327,7 +327,7 @@ function callStageOf(profile, listening, note) {
327
327
  note(listening, `the call phone's measured staging (${stage.error.issues[0]?.message ?? 'out of bounds'})`, 'the reference call scene\'s place and rise');
328
328
  return stage.success ? stage.data : undefined;
329
329
  }
330
- export function compileReferenceRemake(input, capabilities, planSpans = proportionalSpans, choose, facts) {
330
+ export function compileReferenceRemake(input, capabilities, planSpans = proportionalSpans, choose, facts, style) {
331
331
  const parsed = planReferenceRemake.safeParse(input);
332
332
  if (!parsed.success)
333
333
  return { kind: 'invalid', issues: parsed.error.issues.map(issue => ({ kind: 'invalid_request', path: issue.path.join('.'), message: issue.message })) };
@@ -1632,11 +1632,12 @@ export function compileReferenceRemake(input, capabilities, planSpans = proporti
1632
1632
  suggested_substitute: 'fewer graphics in the reference, or edit the plan' }];
1633
1633
  })();
1634
1634
  const firstSentence = parts({ start: 0, end: words.length })[0];
1635
+ const styled = style?.(native);
1635
1636
  const document = workflowPlanDocument.safeParse({ v: 1,
1636
1637
  method: { method_id: method.id, version: method.version, content_digest: method.content_digest, capability_digest: capabilities.content_digest },
1637
1638
  brief: { audience: request.audience ?? 'Viewers of short ads in the style of the reference',
1638
1639
  message: request.message ?? script.slice(words[firstSentence.start].from, words[firstSentence.end - 1].to),
1639
- script, native: { skill: 'make_ugc', input: native },
1640
+ script, native: { skill: 'make_ugc', input: styled?.input ?? native }, ...(styled?.pins ? { edit_style_default: styled.pins } : {}),
1640
1641
  reference_profile: { ...withoutWords(profile), music: '', unmapped,
1641
1642
  beats: profile.beats.map((beat, index) => ({ ...beat, spoken_summary: '', graphics: beat.graphics.map((graphic, at) => ({ ...graphic, label_hint: '',
1642
1643
  ...(converted.has(graphic) ? { kind: converted.get(graphic) } : scened.has(`${index}:${at}`) ? { kind: 'scene' } : {}) })) })) },
@@ -5,6 +5,7 @@ import { planSemanticInserts } from '../semantic-inserts.js';
5
5
  import { resolveFacelessCustomerAnchors } from '../faceless-customer-anchors.js';
6
6
  import { FIELD_DISPOSITIONS } from '../contract-dispositions.js';
7
7
  import { admittedUgcResolution, DEFAULT_RESOLUTION, makeUgcInputShape } from '../skills.js';
8
+ import { STYLE_FIELD_DEFAULTS } from '../edit-style-names.js';
8
9
  import { referenceProfileWarnings } from '../reference-profile.js';
9
10
  import { queryWorkflowMethod } from './catalog.js';
10
11
  import { workflowProductReferenceWarnings } from './product-references.js';
@@ -19,8 +20,9 @@ const nativeFieldRequested = (input, field, skill) => {
19
20
  return false;
20
21
  if (skill === 'make_ugc' && field in FIELD_DISPOSITIONS) {
21
22
  const standard = makeUgcInputShape[field].safeParse(undefined);
22
- if (standard.success && standard.data !== undefined)
23
- return input[field] !== standard.data;
23
+ const fallback = standard.success && standard.data !== undefined ? standard.data : STYLE_FIELD_DEFAULTS[field];
24
+ if (fallback !== undefined)
25
+ return input[field] !== fallback;
24
26
  }
25
27
  return true;
26
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clipwright/core",
3
- "version": "0.77.0",
3
+ "version": "0.79.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",
@@ -1,20 +0,0 @@
1
- export type VendorDispatchFact = {
2
- readonly kind: "unsent";
3
- } | {
4
- readonly kind: "responded";
5
- readonly status: number;
6
- };
7
- export declare function markVendorUnsent<E>(error: E): E;
8
- export declare function markVendorResponse<E>(error: E, status: number): E;
9
- export declare function vendorDispatchFact(error: unknown): VendorDispatchFact | undefined;
10
- export type VendorJobVerdict = "succeeded" | "failed";
11
- export declare function markVendorJobVerdict<E>(error: E, verdict: VendorJobVerdict): E;
12
- export declare function vendorJobVerdict(error: unknown): VendorJobVerdict | undefined;
13
- export declare function markVendorJobUnbilled<E>(error: E): E;
14
- export declare function vendorJobUnbilled(error: unknown): boolean;
15
- export type VendorRefusalClass = "account_standing" | "vendor" | "unknown";
16
- export declare function markVendorRefusal<E>(error: E, refusal: VendorRefusalClass): E;
17
- export declare function vendorRefusalClass(error: unknown): VendorRefusalClass;
18
- export declare function withRefusalClass<T>(backend: {
19
- classifyRefusal(error: unknown): VendorRefusalClass;
20
- }, call: () => Promise<T>): Promise<T>;
@@ -1,94 +0,0 @@
1
- const VENDOR_DISPATCH_FACT = "clipwrightVendorDispatchFact";
2
- function mark(error, fact) {
3
- if (typeof error !== "object" || error === null) {
4
- return error;
5
- }
6
- Object.defineProperty(error, VENDOR_DISPATCH_FACT, {
7
- value: fact,
8
- enumerable: false,
9
- writable: false,
10
- configurable: true,
11
- });
12
- return error;
13
- }
14
- export function markVendorUnsent(error) {
15
- return mark(error, { kind: "unsent" });
16
- }
17
- export function markVendorResponse(error, status) {
18
- return mark(error, { kind: "responded", status });
19
- }
20
- export function vendorDispatchFact(error) {
21
- if (typeof error !== "object" || error === null) {
22
- return undefined;
23
- }
24
- const value = error[VENDOR_DISPATCH_FACT];
25
- if (typeof value !== "object" || value === null) {
26
- return undefined;
27
- }
28
- const fact = value;
29
- if (fact.kind === "unsent") {
30
- return { kind: "unsent" };
31
- }
32
- if (fact.kind === "responded" && typeof fact.status === "number") {
33
- return { kind: "responded", status: fact.status };
34
- }
35
- return undefined;
36
- }
37
- const VENDOR_JOB_VERDICT = "clipwrightVendorJobVerdict";
38
- export function markVendorJobVerdict(error, verdict) {
39
- if (typeof error !== "object" || error === null) {
40
- return error;
41
- }
42
- Object.defineProperty(error, VENDOR_JOB_VERDICT, {
43
- value: verdict,
44
- enumerable: false,
45
- writable: false,
46
- configurable: true,
47
- });
48
- return error;
49
- }
50
- export function vendorJobVerdict(error) {
51
- if (typeof error !== "object" || error === null) {
52
- return undefined;
53
- }
54
- const value = error[VENDOR_JOB_VERDICT];
55
- return value === "succeeded" || value === "failed" ? value : undefined;
56
- }
57
- const VENDOR_JOB_UNBILLED = "clipwrightVendorJobUnbilled";
58
- export function markVendorJobUnbilled(error) {
59
- if (typeof error !== "object" || error === null)
60
- return error;
61
- Object.defineProperty(error, VENDOR_JOB_UNBILLED, { value: true, enumerable: false, writable: false, configurable: true });
62
- return error;
63
- }
64
- export function vendorJobUnbilled(error) {
65
- return typeof error === "object" && error !== null && error[VENDOR_JOB_UNBILLED] === true;
66
- }
67
- const VENDOR_REFUSAL_CLASS = "clipwrightVendorRefusalClass";
68
- export function markVendorRefusal(error, refusal) {
69
- if (typeof error !== "object" || error === null) {
70
- return error;
71
- }
72
- Object.defineProperty(error, VENDOR_REFUSAL_CLASS, {
73
- value: refusal,
74
- enumerable: false,
75
- writable: false,
76
- configurable: true,
77
- });
78
- return error;
79
- }
80
- export function vendorRefusalClass(error) {
81
- if (typeof error !== "object" || error === null) {
82
- return "unknown";
83
- }
84
- const value = error[VENDOR_REFUSAL_CLASS];
85
- return value === "account_standing" || value === "vendor" ? value : "unknown";
86
- }
87
- export async function withRefusalClass(backend, call) {
88
- try {
89
- return await call();
90
- }
91
- catch (error) {
92
- throw markVendorRefusal(error, backend.classifyRefusal(error));
93
- }
94
- }