@clipwright/core 0.62.0 → 0.64.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 (45) hide show
  1. package/dist/ad-guide.d.ts +8 -0
  2. package/dist/ad-guide.js +2 -0
  3. package/dist/ads.d.ts +78 -1
  4. package/dist/ads.js +4 -3
  5. package/dist/brand-styles.d.ts +6 -0
  6. package/dist/cut-ids.d.ts +3 -0
  7. package/dist/cut-ids.js +4 -0
  8. package/dist/cuts.d.ts +221 -0
  9. package/dist/cuts.js +51 -0
  10. package/dist/design.d.ts +30 -0
  11. package/dist/design.js +29 -1
  12. package/dist/endpoints.js +10 -0
  13. package/dist/errors.d.ts +1 -1
  14. package/dist/errors.js +5 -0
  15. package/dist/faceless-direction-summary.d.ts +3 -0
  16. package/dist/faceless-direction-summary.js +3 -0
  17. package/dist/faceless-public-plan.js +4 -4
  18. package/dist/faceless-storyboard.js +8 -9
  19. package/dist/film-cut.d.ts +851 -0
  20. package/dist/film-cut.js +168 -0
  21. package/dist/film-guide.d.ts +35 -0
  22. package/dist/film-guide.js +12 -0
  23. package/dist/film-look.d.ts +3 -0
  24. package/dist/film-look.js +3 -0
  25. package/dist/generations.d.ts +2 -1
  26. package/dist/generations.js +9 -1
  27. package/dist/idempotency.js +2 -1
  28. package/dist/index.d.ts +3 -0
  29. package/dist/index.js +3 -0
  30. package/dist/openapi.js +8 -0
  31. package/dist/own-agent-price.d.ts +40 -3
  32. package/dist/own-agent-price.js +48 -10
  33. package/dist/own-agent-runs.d.ts +79 -1
  34. package/dist/own-agent-runs.js +60 -10
  35. package/dist/prices.d.ts +1 -0
  36. package/dist/prices.js +27 -2
  37. package/dist/runs.d.ts +1 -0
  38. package/dist/runs.js +3 -0
  39. package/dist/speech-words.d.ts +4 -0
  40. package/dist/speech-words.js +30 -0
  41. package/dist/trend-niches.d.ts +57 -0
  42. package/dist/trend-niches.js +59 -4
  43. package/dist/trend-search.d.ts +1 -0
  44. package/dist/trend-search.js +3 -1
  45. package/package.json +1 -1
@@ -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)) {