@koda-sl/baker-cli 0.281.9-dev.1f1c09c80 → 0.281.11-dev.0c0293389

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/cli.js CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  ulid,
59
59
  validateCanvasDeep,
60
60
  ytDlpBlockSignal
61
- } from "./chunk-XSGYVQXF.js";
61
+ } from "./chunk-YNUBWTLR.js";
62
62
  import {
63
63
  csvOrJson,
64
64
  daysAgoIso,
@@ -27372,6 +27372,11 @@ var VideoBlueprint = z27.object({
27372
27372
  // on_camera | mixed → mouths are on screen (lip-sync candidates);
27373
27373
  // voiceover | none → narration over the picture (no lip-sync).
27374
27374
  mode: z27.string().optional(),
27375
+ // Which variety of the language the speech is in. Stated because the model
27376
+ // picks one otherwise: ads set in Spain came back in Latin American Spanish,
27377
+ // and the pinned peninsular voice could not undo it — the re-voicing is
27378
+ // speech-to-speech, so it carries the accent across and swaps only the timbre.
27379
+ accent: z27.string().optional(),
27375
27380
  voice_description: z27.string().optional(),
27376
27381
  persona: z27.string().optional()
27377
27382
  }).loose().optional(),
@@ -27953,10 +27958,10 @@ function visualBriefParts(scene, sceneIndex, plate) {
27953
27958
  }
27954
27959
  return parts;
27955
27960
  }
27956
- function spokenTextParts(scene, nativeLine, loc, profile) {
27961
+ function spokenTextParts(scene, nativeLine, loc, profile, spokenAccent) {
27957
27962
  const parts = [];
27958
27963
  if (nativeLine) {
27959
- parts.push(profile.dialogueDirective(loc(nativeLine)));
27964
+ parts.push(profile.dialogueDirective(loc(nativeLine), spokenAccent));
27960
27965
  } else {
27961
27966
  const lines = (scene.dialogue ?? []).map((d) => d.line?.trim()).filter((l) => Boolean(l));
27962
27967
  if (lines.length > 0)
@@ -27966,7 +27971,7 @@ function spokenTextParts(scene, nativeLine, loc, profile) {
27966
27971
  if (transcript) parts.push(`Transcript: ${loc(transcript)}`);
27967
27972
  return parts;
27968
27973
  }
27969
- function buildSeedancePrompt(scene, sceneIndex, present2, mode, audio, nativeLine, nativeLang, uiRouted, videoModel) {
27974
+ function buildSeedancePrompt(scene, sceneIndex, present2, mode, audio, nativeLine, nativeLang, uiRouted, videoModel, spokenAccent) {
27970
27975
  const profile = (videoModel ? clipProfileFor(videoModel) : void 0) ?? SEEDANCE_PROFILE;
27971
27976
  const loc = (s) => nativeLine ? localizeNumeralsForNative(s, nativeLang) : s;
27972
27977
  const routed = uiRouted ?? (compositeRegionsOf(scene) !== null && isUiOnlyComposite(compositeRegionsOf(scene) ?? []));
@@ -27978,7 +27983,7 @@ function buildSeedancePrompt(scene, sceneIndex, present2, mode, audio, nativeLin
27978
27983
  `Keep these consistent with their references: ${refs.map((s) => `${s.label} (${s.description ?? s.type})`).join("; ")}`
27979
27984
  );
27980
27985
  }
27981
- parts.push(...spokenTextParts(scene, nativeLine, loc, profile));
27986
+ parts.push(...spokenTextParts(scene, nativeLine, loc, profile, spokenAccent));
27982
27987
  const audioLine = seedanceAudioLine(scene, mode, audio, nativeLine);
27983
27988
  if (audioLine) parts.push(audioLine);
27984
27989
  parts.push(
@@ -28123,7 +28128,8 @@ function emitSceneClip(i, scene, present2, mode, nativeTurn, ambientBroll, frame
28123
28128
  nativeTurn?.text,
28124
28129
  opts.nativeLang,
28125
28130
  opts.uiRouted,
28126
- opts.videoModel
28131
+ opts.videoModel,
28132
+ opts.spokenAccent
28127
28133
  ),
28128
28134
  ...videoDurationParam(opts.videoModel, lengths.genDur),
28129
28135
  ...videoResolutionParam(opts.videoModel, opts.resolution),
@@ -28310,7 +28316,8 @@ function buildCompositeScene(layout, regions, comp, scene, i, present2, mode, na
28310
28316
  genAr: opts.genAr,
28311
28317
  videoModel: opts.videoModel,
28312
28318
  resolution: opts.resolution,
28313
- nativeLang: opts.nativeLang
28319
+ nativeLang: opts.nativeLang,
28320
+ spokenAccent: opts.spokenAccent
28314
28321
  },
28315
28322
  nodes,
28316
28323
  tag
@@ -28889,7 +28896,8 @@ function emitPhraseClip(phrase, voiceNode, env, nodes, out) {
28889
28896
  phrase.text,
28890
28897
  env.ttsLanguageCode,
28891
28898
  env.uiRouted.has(anchor),
28892
- env.opts.videoModel
28899
+ env.opts.videoModel,
28900
+ env.spokenAccent
28893
28901
  ),
28894
28902
  ...videoDurationParam(env.opts.videoModel, genDur),
28895
28903
  ...videoResolutionParam(env.opts.videoModel, env.opts.resolution),
@@ -29039,7 +29047,8 @@ function emitCompositeInTimeline(composite, scene, i, isLast, env, canonical2, e
29039
29047
  imageModel: env.opts.imageModel,
29040
29048
  videoModel: env.opts.videoModel,
29041
29049
  resolution: env.opts.resolution,
29042
- nativeLang: env.ttsLanguageCode
29050
+ nativeLang: env.ttsLanguageCode,
29051
+ spokenAccent: env.spokenAccent
29043
29052
  },
29044
29053
  env.clock,
29045
29054
  nodes,
@@ -29175,6 +29184,7 @@ function emitBrollScene(scene, i, isLast, env, nodes, out, prevEndFrame) {
29175
29184
  videoModel: env.opts.videoModel,
29176
29185
  resolution: env.opts.resolution,
29177
29186
  nativeLang: env.ttsLanguageCode,
29187
+ spokenAccent: env.spokenAccent,
29178
29188
  uiRouted: env.uiRouted.has(i)
29179
29189
  },
29180
29190
  nodes,
@@ -29236,7 +29246,8 @@ function buildTimeline(blueprint, slots, opts, nodes) {
29236
29246
  uiRouted,
29237
29247
  graphicScenes: fullFrameGraphicScenes(blueprint),
29238
29248
  surfaceIngests: /* @__PURE__ */ new Map(),
29239
- ttsLanguageCode: deriveTtsLanguageCode(blueprint)
29249
+ ttsLanguageCode: deriveTtsLanguageCode(blueprint),
29250
+ spokenAccent: blueprint.global?.voiceover?.accent?.trim() || void 0
29240
29251
  };
29241
29252
  const out = {
29242
29253
  routes: /* @__PURE__ */ new Map(),
@@ -33033,6 +33044,11 @@ function staticTranscript(spec) {
33033
33044
  }
33034
33045
  return out;
33035
33046
  }
33047
+ function spokenVariety(spec) {
33048
+ const market = marketFor(spec);
33049
+ if (!market) return null;
33050
+ return `the local accent of ${market} \u2014 the way people there actually speak, not a neighbouring country's variety of the same language`;
33051
+ }
33036
33052
  function musicBed(spec) {
33037
33053
  if (spec.music === false) return null;
33038
33054
  if (typeof spec.music === "string") return spec.music;
@@ -33121,6 +33137,7 @@ function adSpecToBlueprint(spec) {
33121
33137
  transcript: spec.beats.map((b) => b.say).join(" "),
33122
33138
  voiceover: {
33123
33139
  mode: voiceoverMode(spec, nativeSpeech),
33140
+ ...spokenVariety(spec) ? { accent: spokenVariety(spec) } : {},
33124
33141
  ...spec.voice?.description ? { voice_description: spec.voice.description } : {}
33125
33142
  },
33126
33143
  ...spec.cast ? {
@@ -33326,11 +33343,29 @@ function svgIsLiveText(svg) {
33326
33343
  return /<text[\s>]/i.test(svg);
33327
33344
  }
33328
33345
  async function markIsReal(markPath, root = ".") {
33329
- const brandLogos = path22.join(root, BRAND_DIR, "logos");
33330
- const brandFiles = await readdir8(brandLogos).catch(() => null);
33331
- if (brandFiles) return await markDirectoryIsReal(brandLogos);
33346
+ const brandLogos = await findBrandLogosDir(markPath, root);
33347
+ if (brandLogos) return await markDirectoryIsReal(brandLogos);
33332
33348
  return await markDirectoryIsReal(path22.dirname(markPath));
33333
33349
  }
33350
+ async function findBrandLogosDir(markPath, root) {
33351
+ const candidates = [];
33352
+ let dir = path22.resolve(path22.dirname(markPath));
33353
+ for (; ; ) {
33354
+ candidates.push(path22.join(dir, BRAND_DIR, "logos"));
33355
+ const parent = path22.dirname(dir);
33356
+ if (parent === dir) break;
33357
+ dir = parent;
33358
+ }
33359
+ candidates.push(path22.join(root, BRAND_DIR, "logos"));
33360
+ for (const candidate of candidates) {
33361
+ if (await readdir8(candidate).then(
33362
+ () => true,
33363
+ () => false
33364
+ ))
33365
+ return candidate;
33366
+ }
33367
+ return null;
33368
+ }
33334
33369
  async function markDirectoryIsReal(dir) {
33335
33370
  const files = await readdir8(dir).catch(() => null);
33336
33371
  if (!files) return false;