@koda-sl/baker-cli 0.443.0-dev.043c1d4ac → 0.444.0-dev.77f6afa0e
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/{canvas-KEXE5P6S.js → canvas-I6UOCL3M.js} +11 -11
- package/dist/{chunk-Y5ZGWLWP.js → chunk-3KBCO5LK.js} +5 -5
- package/dist/{chunk-L3OLEAJN.js → chunk-5IDWGK5Q.js} +2 -2
- package/dist/{chunk-ICM2OXZV.js → chunk-CRYUEDIE.js} +2 -2
- package/dist/{chunk-URIYUZIN.js → chunk-ELVSBTHT.js} +2 -2
- package/dist/{chunk-TCNNOLVZ.js → chunk-MMEGP6PX.js} +3 -3
- package/dist/{chunk-IKGWQBKJ.js → chunk-O36RHBTA.js} +4 -4
- package/dist/{chunk-QHLB5V7J.js → chunk-RMSRKXEN.js} +2 -2
- package/dist/{chunk-2CD5ZP7M.js → chunk-S7PMGBMG.js} +9 -3
- package/dist/{chunk-2CD5ZP7M.js.map → chunk-S7PMGBMG.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{creatives-QXMBEA2V.js → creatives-OOGFEJMB.js} +5 -5
- package/dist/{critique-O5VNNBPB.js → critique-RIVL5E34.js} +2 -2
- package/dist/{feedback-3FQYLADC.js → feedback-DS2LAGNV.js} +2 -2
- package/dist/{feedback-record-DTRZC73R.js → feedback-record-3TDEWYIS.js} +4 -4
- package/dist/{make-ANPR2D2L.js → make-25QFTC3S.js} +6 -6
- package/dist/{rerun-3FEOYNG2.js → rerun-S43IY6ES.js} +6 -6
- package/dist/{run-2IM2QOCI.js → run-G5RKPZII.js} +6 -6
- package/dist/{scaffold-ad-YYUVL4IP.js → scaffold-ad-4BLTIK6L.js} +4 -4
- package/dist/{scaffold-static-ad-SUEYXLOR.js → scaffold-static-ad-QIRUSQ5R.js} +7 -7
- package/dist/{scaffold-video-IBH2YJZD.js → scaffold-video-3E2LVSAW.js} +4 -4
- package/dist/{select-ZWDEVAH2.js → select-YHN6I22X.js} +4 -4
- package/dist/{set-prompt-SBEOQGCF.js → set-prompt-FNFAKIXJ.js} +2 -2
- package/dist/{stale-QRO3M5R2.js → stale-NWS2K6VC.js} +3 -3
- package/dist/{sync-definition-YBDM7D4M.js → sync-definition-GKSRIFNP.js} +4 -4
- package/dist/{translate-H7O5K3RC.js → translate-EMZEVMXW.js} +27 -6
- package/dist/translate-EMZEVMXW.js.map +1 -0
- package/dist/{validate-2PLHIP6I.js → validate-P4RGJUCE.js} +2 -2
- package/package.json +1 -1
- package/dist/translate-H7O5K3RC.js.map +0 -1
- /package/dist/{canvas-KEXE5P6S.js.map → canvas-I6UOCL3M.js.map} +0 -0
- /package/dist/{chunk-Y5ZGWLWP.js.map → chunk-3KBCO5LK.js.map} +0 -0
- /package/dist/{chunk-L3OLEAJN.js.map → chunk-5IDWGK5Q.js.map} +0 -0
- /package/dist/{chunk-ICM2OXZV.js.map → chunk-CRYUEDIE.js.map} +0 -0
- /package/dist/{chunk-URIYUZIN.js.map → chunk-ELVSBTHT.js.map} +0 -0
- /package/dist/{chunk-TCNNOLVZ.js.map → chunk-MMEGP6PX.js.map} +0 -0
- /package/dist/{chunk-IKGWQBKJ.js.map → chunk-O36RHBTA.js.map} +0 -0
- /package/dist/{chunk-QHLB5V7J.js.map → chunk-RMSRKXEN.js.map} +0 -0
- /package/dist/{creatives-QXMBEA2V.js.map → creatives-OOGFEJMB.js.map} +0 -0
- /package/dist/{critique-O5VNNBPB.js.map → critique-RIVL5E34.js.map} +0 -0
- /package/dist/{feedback-3FQYLADC.js.map → feedback-DS2LAGNV.js.map} +0 -0
- /package/dist/{feedback-record-DTRZC73R.js.map → feedback-record-3TDEWYIS.js.map} +0 -0
- /package/dist/{make-ANPR2D2L.js.map → make-25QFTC3S.js.map} +0 -0
- /package/dist/{rerun-3FEOYNG2.js.map → rerun-S43IY6ES.js.map} +0 -0
- /package/dist/{run-2IM2QOCI.js.map → run-G5RKPZII.js.map} +0 -0
- /package/dist/{scaffold-ad-YYUVL4IP.js.map → scaffold-ad-4BLTIK6L.js.map} +0 -0
- /package/dist/{scaffold-static-ad-SUEYXLOR.js.map → scaffold-static-ad-QIRUSQ5R.js.map} +0 -0
- /package/dist/{scaffold-video-IBH2YJZD.js.map → scaffold-video-3E2LVSAW.js.map} +0 -0
- /package/dist/{select-ZWDEVAH2.js.map → select-YHN6I22X.js.map} +0 -0
- /package/dist/{set-prompt-SBEOQGCF.js.map → set-prompt-FNFAKIXJ.js.map} +0 -0
- /package/dist/{stale-QRO3M5R2.js.map → stale-NWS2K6VC.js.map} +0 -0
- /package/dist/{sync-definition-YBDM7D4M.js.map → sync-definition-GKSRIFNP.js.map} +0 -0
- /package/dist/{validate-2PLHIP6I.js.map → validate-P4RGJUCE.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/creatives/translate.ts","../src/commands/creatives/translate-ad.ts","../src/commands/creatives/translate-model.ts"],"sourcesContent":["/**\n * `baker creatives translate --slug <ad> --to es-MX,es-CO`: the command around `translateAd`. Local\n * file work and one text call, so no backend route: the new ads reach the dashboard through\n * `canvas sync-definition`, as `creatives make --series` does, and the call's spend waits in the\n * canvas cache for the next run record to bill (`holdUnbilledSpend`).\n */\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { defineCommand } from \"citty\";\nimport { askJev } from \"../../engine/nodes/local/lib/jev.ts\";\nimport { askAboutImages, RENDER_REVIEW_MODEL, type ReviewUsage } from \"../../engine/nodes/local/lib/render-review.ts\";\nimport { optionalChatId } from \"../../env.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { runBaker as baker } from \"../baker-child.ts\";\nimport { findWorkspaceRoot } from \"../canvas/normalize-paths.ts\";\nimport { holdUnbilledSpend } from \"../canvas/unbilled-spend.ts\";\nimport { translateAd, translateEnvelope } from \"./translate-ad.ts\";\nimport { type Failure, quoteLineQuestion } from \"./translate-model.ts\";\n\n/** How long the one call for every language may take. */\nconst TRANSLATE_TIMEOUT_MS = 120_000;\n\nconst DESCRIPTION = `The same static ad in other languages. Each language becomes its own creative, <ad>-<lang>, made as an ad of the series <ad> leads: its ready picture with only the words changed, so the design is never made again per language. Every language is translated in one call (transcreated for the market, same role and length per line, brand names, prices and numbers kept); seconds, nothing rendered. The ad must have a ready version.\n\nStart here:\n baker creatives translate --slug spring-offer --to es-MX,es-CO,pt-BR # one ad per country: Mexico and Colombia are two ads\n baker creatives translate --slug spring-offer --to de,fr # a language with no country: its neutral variety\n baker creatives translate --slug spring-offer --to de --copy-file de.json # your own lines: {\"de\": [\"line 1\", \"line 2\"]}\nTen angle ads in three languages: one design (the lead), the angle ads (creatives make <idea> --series <lead>), then translate each angle ad. Never a new canvas or a new design per language.\nThen: baker canvas run --series spring-offer (renders every language at once). Adding a language later leaves the ones made as they are.`;\n\nconst ARGS = {\n slug: {\n type: \"string\",\n required: true,\n description: \"The ad to translate (its creative slug); it must have a ready version\",\n },\n to: {\n type: \"string\",\n required: true,\n description:\n \"The languages, comma-separated BCP-47 codes: es-MX,es-CO,pt-BR (a country's own variety) or de,fr. One new creative each: <slug>-<tag in lowercase>\",\n },\n \"copy-file\": {\n type: \"string\",\n required: false,\n description:\n 'A JSON file with the lines yourself, no model asked: {\"es\": [\"line 1\", \"line 2\"]}, one line per line of the ad, in its order',\n },\n again: {\n type: \"boolean\",\n required: false,\n default: false,\n description:\n \"Translate a language already made again (after the ad's words changed); without it, a made language is left as it is\",\n },\n} as const;\n\nregisterSchema({ command: \"creatives.translate\", description: DESCRIPTION, args: ARGS });\n\nfunction fail(error: Failure): never {\n writeJson({ ok: false, error });\n process.exit(1);\n}\n\nasync function readCopyFile(file: string): Promise<unknown> {\n try {\n return JSON.parse(await readFile(path.resolve(file), \"utf8\"));\n } catch (e) {\n fail({\n code: \"translate_copy_file_unreadable\",\n message: `The copy file ${file} could not be read as JSON (${e instanceof Error ? e.message : String(e)}).`,\n fix: 'Write it as {\"<lang>\": [\"line 1\", \"line 2\"]}, one array per language.',\n });\n }\n}\n\nexport const translateCommand = defineCommand({\n meta: { name: \"translate\", description: DESCRIPTION },\n args: ARGS,\n async run({ args }) {\n const root = findWorkspaceRoot(process.cwd()) ?? process.cwd();\n const copyFile = typeof args[\"copy-file\"] === \"string\" && args[\"copy-file\"] ? args[\"copy-file\"] : undefined;\n const copy = copyFile ? await readCopyFile(copyFile) : undefined;\n const spent: ReviewUsage[] = [];\n const result = await translateAd(root, String(args.slug), String(args.to), {\n ask: (prompt) =>\n askAboutImages(RENDER_REVIEW_MODEL, [], prompt, (usage) => spent.push(usage), TRANSLATE_TIMEOUT_MS).catch(\n () => null,\n ),\n ...(copy !== undefined ? { copy } : {}),\n again: args.again === true,\n sync: (dir) => baker([\"canvas\", \"sync-definition\", dir, \"--title\"]),\n chatId: optionalChatId() ?? null,\n judgeQuotes: (texts) => askJev(texts.map(quoteLineQuestion), (usage) => spent.push(usage)),\n });\n // No run record carries this call: the next render of this workspace bills it. The ads are made\n // by now, so a cache that cannot be written never costs the command its answer.\n await holdUnbilledSpend(path.join(root, \"canvas\", \".cache\"), spent).catch(() => undefined);\n if (\"code\" in result) fail(result);\n writeJson(translateEnvelope(result));\n },\n});\n","/**\n * `baker creatives translate --slug <ad> --to es,de`: the same ad in other languages. Each\n * language is a new creative, `<ad>-<lang>`, made as an ad of the series `<ad>` leads: the ad's\n * ready picture with only its words changed to theirs, so the design is never made again per\n * language. Every language is translated in one text call (or read from the agent's own file);\n * nothing is rendered here: `baker canvas run --series <ad>` renders them all at once.\n */\nimport { mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type { CreativesRunData } from \"@baker/api\";\nimport { readAdSpec } from \"../../engine/scaffold/static-ad-spec.ts\";\nimport { languageName, languageTag, sameTag, tagSlug } from \"../../language.ts\";\nimport { parseDefinitionStrategyFields } from \"../canvas/creative-definition.ts\";\nimport { claimNewCreativeInWorkspace, creativeLimitRefusal } from \"../canvas/creative-limit.ts\";\nimport { leadVersion, seriesLeadsAbove, writeSeriesMemberCanvas } from \"../canvas/series-member.ts\";\nimport {\n acceptTranslations,\n buildTranslatePrompt,\n customersWordsAmong,\n type Failure,\n MESSAGE_ROLE,\n parseLanguages,\n translatedDefinition,\n translatedSpec,\n} from \"./translate-model.ts\";\n\n/** What became of one language. */\nexport type Translation = {\n language: string;\n creative: string;\n status: \"made\" | \"exists\" | \"refused\";\n error?: Failure;\n};\n\nexport type Translated = { source: string; sourceLanguage?: string; leadsAbove: string[]; translations: Translation[] };\n\ntype Deps = {\n /** The text model, asked once for every language; its parsed JSON answer, or null. */\n ask: (prompt: string) => Promise<unknown>;\n /** The lines the agent wrote itself (`--copy-file`): no model is asked. */\n copy?: unknown;\n /** Translate a language already made again (its words), instead of leaving it as it is. */\n again?: boolean;\n sync: (dir: string) => Promise<unknown>;\n chatId: string | null;\n fetchRecord?: (runId: string) => Promise<CreativesRunData | null>;\n /** Jev: how likely each line is a customer's own words; null when it could not answer. */\n judgeQuotes?: (texts: string[]) => Promise<number[] | null>;\n};\n\n/** The creative a language of `source` is: `<source>-<tag>`, the tag lowercase (`spring-offer-es-mx`). */\nexport const translationSlug = (source: string, language: string) => `${source}-${tagSlug(language)}`;\n\nconst creativeDir = (root: string, slug: string) => path.join(root, \"src\", \"creatives\", slug);\n\nfunction definitionOf(root: string, slug: string): Promise<string | null> {\n return readFile(path.join(creativeDir(root, slug), \"_definition.md\"), \"utf8\").catch(() => null);\n}\n\n/** The language the source is in: its `_definition.md`'s, else its market's. */\nfunction sourceLanguageOf(definition: string, spec: Record<string, unknown>): string | undefined {\n const market = (spec.viewer as { market?: { language?: unknown } } | undefined)?.market?.language;\n return (\n parseDefinitionStrategyFields(definition).language ??\n (typeof market === \"string\" ? (languageTag(market) ?? undefined) : undefined)\n );\n}\n\n/**\n * What each language asked comes to before any words are written: already made (left as it is\n * unless `again`), its slug taken by another creative, or to translate.\n */\nasync function planLanguages(\n root: string,\n source: string,\n languages: readonly string[],\n again: boolean,\n): Promise<{ settled: Translation[]; pending: string[] }> {\n const settled: Translation[] = [];\n const pending: string[] = [];\n for (const language of languages) {\n const creative = translationSlug(source, language);\n const existing = await definitionOf(root, creative);\n const fields = existing === null ? null : parseDefinitionStrategyFields(existing);\n const ours = fields?.seriesLead === source && sameTag(fields.language ?? \"\", language);\n if (!fields || (again && ours)) {\n pending.push(language);\n } else if (ours) {\n settled.push({ language, creative, status: \"exists\" });\n } else {\n settled.push({\n language,\n creative,\n status: \"refused\",\n error: {\n code: \"translate_slug_taken\",\n message: `\"${creative}\" is already another creative, not the ${languageName(language) ?? language} version of \"${source}\".`,\n fix: `Rename or remove src/creatives/${creative}/ if it is a leftover, then translate again.`,\n },\n });\n }\n }\n return { settled, pending };\n}\n\n/** Each pending language's lines: the agent's own (`copy`), else one model call for all of them. */\nasync function wordsFor(\n pending: readonly string[],\n lines: ReadonlyArray<{ text: string; role?: string }>,\n context: { from?: string; brand?: string },\n deps: Pick<Deps, \"ask\" | \"copy\">,\n): Promise<Record<string, string[]>> {\n if (pending.length === 0) return {};\n const answer = deps.copy ?? (await deps.ask(buildTranslatePrompt(lines, pending, context)));\n const full = acceptTranslations(answer, pending, lines.length);\n // An agent's own file may give the printed lines alone: the message then stays the source's.\n const asked = lines.filter((l) => l.role !== MESSAGE_ROLE).length;\n const printedOnly = deps.copy !== undefined && asked < lines.length ? acceptTranslations(answer, pending, asked) : {};\n return { ...printedOnly, ...full };\n}\n\n/** The ad `source` in each language `to` names, or why none could be made. */\nexport async function translateAd(root: string, source: string, to: string, deps: Deps): Promise<Translated | Failure> {\n const version = await leadVersion(root, source, deps.fetchRecord);\n if (\"refused\" in version) return version.refused;\n const spec = version.spec as Record<string, unknown>;\n if (spec.native) {\n return {\n code: \"translate_native_unsupported\",\n message: `\"${source}\" is a copy of a screen people know (a post, a chat, a review wall): its words are not lines of copy to translate.`,\n fix: \"Make it in the other language as its own ad: baker creatives make <idea> with the words written in that language.\",\n };\n }\n const sourceDefinition = (await definitionOf(root, source)) ?? \"---\\nkind: static\\n---\\n\";\n const sourceLanguage = sourceLanguageOf(sourceDefinition, spec);\n const asked = parseLanguages(to, sourceLanguage);\n if (\"code\" in asked) return asked;\n\n const { settled, pending } = await planLanguages(root, source, asked.languages, deps.again === true);\n const lines = version.lead.copy;\n // A customer's words stay theirs: translated, they would be words nobody said under their name.\n const quoted = pending.length > 0 ? await customersWordsAmong(lines, deps.judgeQuotes) : new Set<number>();\n const brand = readAdSpec(spec).brand?.name;\n // What the ad says is asked in the same call, so the team reads it in the ad's own language.\n const message = parseDefinitionStrategyFields(sourceDefinition).message;\n const marked = lines.map((line, i) => (quoted.has(i) ? { ...line, customersWords: true } : line));\n const asks = message ? [...marked, { text: message, role: MESSAGE_ROLE }] : marked;\n const words = await wordsFor(\n pending,\n asks,\n { ...(sourceLanguage ? { from: sourceLanguage } : {}), ...(brand ? { brand } : {}) },\n deps,\n );\n const translations = [...settled];\n for (const language of pending) {\n translations.push(\n await makeTranslation(\n root,\n { source, language, sourceDefinition, spec, lines, quoted, words: words[language] },\n deps,\n ),\n );\n }\n const order = new Map(asked.languages.map((l, i) => [l, i]));\n translations.sort((a, b) => (order.get(a.language) ?? 0) - (order.get(b.language) ?? 0));\n return {\n source,\n ...(sourceLanguage ? { sourceLanguage } : {}),\n leadsAbove: await seriesLeadsAbove(root, source),\n translations,\n };\n}\n\n/** One language written as an ad of the source's series: its words, its definition and its canvas. */\nasync function makeTranslation(\n root: string,\n t: {\n source: string;\n language: string;\n sourceDefinition: string;\n spec: Record<string, unknown>;\n lines: ReadonlyArray<{ text: string; role?: string }>;\n quoted: ReadonlySet<number>;\n words: string[] | undefined;\n },\n deps: Deps,\n): Promise<Translation> {\n const creative = translationSlug(t.source, t.language);\n const refused = (error: Failure): Translation => ({ language: t.language, creative, status: \"refused\", error });\n const name = languageName(t.language) ?? t.language;\n if (!t.words) {\n return refused(\n deps.copy !== undefined\n ? {\n code: \"translate_copy_missing\",\n message: `The copy file has no ${name} lines, or not one for each of the ad's ${t.lines.length} lines.`,\n fix: `Give \"${t.language}\" an array of ${t.lines.length} lines in the ad's order in the copy file.`,\n }\n : {\n code: \"translate_failed\",\n message: `The ${name} words could not be written.`,\n fix: `Write them yourself: --copy-file <json> with {\"${t.language}\": [${t.lines.length} lines in the ad's order]}.`,\n },\n );\n }\n const dir = creativeDir(root, creative);\n const definitionPath = path.join(dir, \"_definition.md\");\n const claim = await claimNewCreativeInWorkspace(path.join(root, \"canvas\"), creative, deps.chatId, definitionPath);\n if (!claim.allowed) return refused(creativeLimitRefusal(creative).error);\n await mkdir(dir, { recursive: true });\n await writeFile(\n path.join(dir, \"prompt.json\"),\n `${JSON.stringify(translatedSpec(t.spec, t.words, t.language, t.quoted), null, 2)}\\n`,\n \"utf8\",\n );\n const headline = Math.max(\n 0,\n t.lines.findIndex((l) => l.role === \"headline\"),\n );\n await writeFile(\n definitionPath,\n translatedDefinition(t.sourceDefinition, {\n source: t.source,\n language: t.language,\n title: t.words[headline] ?? creative,\n ...(t.words.length > t.lines.length ? { message: t.words[t.lines.length] } : {}),\n }),\n \"utf8\",\n );\n const made = await writeSeriesMemberCanvas(root, creative, {\n leadWords: true,\n ...(deps.fetchRecord ? { fetchRecord: deps.fetchRecord } : {}),\n });\n if (made === null || \"refused\" in made) {\n return refused(made?.refused ?? { code: \"translate_not_made\", message: `\"${creative}\" could not be made.` });\n }\n // The dashboard learns the translation and its series now, not at Publish.\n await deps.sync(dir);\n return { language: t.language, creative, status: \"made\" };\n}\n\n/** What `translate` prints: each language's ad, then the one series run that renders them all. Pure. */\nexport function translateEnvelope(result: Translated) {\n const made = result.translations.filter((t) => t.status !== \"refused\").map((t) => t.creative);\n const refused = result.translations.filter((t) => t.status === \"refused\");\n const order = [...result.leadsAbove].reverse().concat(result.source);\n return {\n ok: true as const,\n data: {\n source: result.source,\n made,\n translations: result.translations.map((t) => ({ ...t, name: languageName(t.language) ?? t.language })),\n },\n hints: [\n ...(made.length > 0\n ? [\n `Next: baker canvas run --series ${result.source} renders every language at once, each the ${result.source} picture with its own words, reviewed and corrected on its own. A language already rendered from the current version of ${result.source} is not rendered again.`,\n ]\n : []),\n `A later change to ${result.source} (its picture or design) reaches every language on the next ${order.map((slug) => `baker canvas run --series ${slug}`).join(\", then \")}. A change to its words does not: translate again with --again for the languages to update.`,\n ...refused.map((t) => `${t.creative}: ${t.error?.message ?? \"not made\"}${t.error?.fix ? ` ${t.error.fix}` : \"\"}`),\n ],\n };\n}\n","/**\n * `baker creatives translate`, its decisions: which languages, what the model is asked, which\n * answer is kept, and what each translation is on disk (its words in the source's spec, its\n * `_definition.md`). A translation is an ad of the series the source leads: the source's picture\n * with only its words changed, so ten ads in three languages stay one design. Pure.\n */\nimport { z } from \"zod\";\nimport { isAdSpec, readAdSpec } from \"../../engine/scaffold/static-ad-spec.ts\";\nimport { isCustomersWords, isSignatureLine, maybeSigned } from \"../../engine/scaffold/static-proof.ts\";\nimport { languageName, languageRegion, languageTag, sameTag } from \"../../language.ts\";\nimport { setDefinitionFields } from \"./make-model.ts\";\nimport { withoutFields } from \"./make-series.ts\";\n\nexport type Failure = { code: string; message: string; fix?: string };\n\n/** The languages `--to` names, as lowercase tags, once each; refused when one names none or is the ad's own. */\nexport function parseLanguages(raw: string, sourceLanguage: string | undefined): { languages: string[] } | Failure {\n const asked = raw\n .split(\",\")\n .map((code) => code.trim())\n .filter(Boolean);\n if (asked.length === 0) {\n return {\n code: \"translate_language_invalid\",\n message: \"No language was named.\",\n fix: \"Name each language as a code, comma-separated: --to es,de,fr (pt-BR, es-MX for a regional variant).\",\n };\n }\n const languages: string[] = [];\n for (const code of asked) {\n const tag = languageTag(code);\n if (!tag) {\n return {\n code: \"translate_language_invalid\",\n message: `\"${code}\" is not a language code.`,\n fix: \"Name each language as a BCP-47 code: es, de, fr, pt-BR, es-MX.\",\n };\n }\n if (sourceLanguage && sameTag(tag, sourceLanguage)) {\n return {\n code: \"translate_same_language\",\n message: `The ad is already in ${languageName(tag) ?? tag}.`,\n fix: `Leave ${code} out of --to.`,\n };\n }\n if (!languages.some((l) => sameTag(l, tag))) languages.push(tag);\n }\n return { languages };\n}\n\ntype Line = { text: string; role?: string; customersWords?: boolean };\n\n/** Jev's question for one copy line: whether it is a customer's own words, the advertiser's copy aside. */\nexport const quoteLineQuestion = (text: string) => ({\n instructions: {\n question:\n \"Is `line` a customer's or reviewer's own words (a testimonial, or a quote signed with the name of the person who said it), rather than the advertiser's own copy, in whatever language it is written?\",\n line: text,\n },\n});\n\n/** At or above, Jev holds a line to be a customer's own words (scripts/quote-line-evals). */\nexport const CUSTOMERS_WORDS = 0.5;\n\n/**\n * The indexes of `lines` that are a customer's own words: set as a quote, signed by its shape\n * alone or by a signature on the line below it, else held so by `judge` (Jev, one probability per\n * text), a line below that may sign it asked with it. Without a judge only the shape and the role\n * decide: a line nobody can tell is translated, as the advertiser's copy is.\n */\nexport async function customersWordsAmong(\n lines: readonly Line[],\n judge?: (texts: string[]) => Promise<number[] | null>,\n): Promise<Set<number>> {\n const kept = new Set<number>();\n const open: number[] = [];\n lines.forEach((line, i) => {\n if (line.role === MESSAGE_ROLE) return;\n // A signature on a line of its own signs the line right above it: that line is the quote.\n const below = lines[i + 1];\n if (isCustomersWords(line) || (below !== undefined && isSignatureLine(below))) kept.add(i);\n else open.push(i);\n });\n if (!judge || open.length === 0) return kept;\n // A hyphen opening the line below may sign this one or be the advertiser's own: asked together.\n const asked = (i: number) => {\n const text = lines[i]?.text ?? \"\";\n const below = lines[i + 1]?.text;\n return below !== undefined && maybeSigned(below) && !maybeSigned(text) ? `${text}\\n${below}` : text;\n };\n const answers = await judge(open.map(asked));\n if (answers?.length !== open.length) return kept;\n for (const [k, i] of open.entries()) if ((answers[k] ?? 0) >= CUSTOMERS_WORDS) kept.add(i);\n return kept;\n}\n\n/** The role of the extra line a translation asks for: the ad's message, said in the language for the team. */\nexport const MESSAGE_ROLE = \"message\";\n\nconst Answer = z.object({ translations: z.record(z.string(), z.array(z.string()).catch([])) });\n\n/**\n * The languages the model translated fully: each line of the source answered by one non-empty\n * line, in order. A language answered short or blank is left out (refused, never half an ad). Pure.\n */\nexport function acceptTranslations(\n answer: unknown,\n languages: readonly string[],\n lineCount: number,\n): Record<string, string[]> {\n // `--copy-file` may hold the languages bare; a model may answer \"pt-BR\" for \"pt-br\".\n const wrapped =\n answer && typeof answer === \"object\" && !(\"translations\" in answer) ? { translations: answer } : answer;\n const parsed = Answer.safeParse(wrapped);\n if (!parsed.success) return {};\n const byTag = new Map(Object.entries(parsed.data.translations).map(([key, lines]) => [key.toLowerCase(), lines]));\n const kept: Record<string, string[]> = {};\n for (const language of languages) {\n const lines = byTag.get(language.toLowerCase())?.map((line) => line.trim());\n if (lines && lines.length === lineCount && lines.every(Boolean)) kept[language] = lines;\n }\n return kept;\n}\n\n/** What the model is asked: every language at once, line by line, for the same picture. Pure. */\nexport function buildTranslatePrompt(\n lines: readonly Line[],\n languages: readonly string[],\n context: { from?: string; brand?: string },\n): string {\n const from = context.from ? languageName(context.from) : null;\n return [\n `These are the lines of copy printed on a finished static ad${from ? `, written in ${from}` : \"\"}. Translate them${from ? ` from ${from}` : \"\"} into each of these languages: ${languages.map((l) => `${l} (${languageName(l) ?? l})`).join(\", \")}.`,\n \"\",\n ...lines.map(\n (line, i) =>\n `${i + 1}. ${line.role === MESSAGE_ROLE ? \"[not printed: what the ad says, in one sentence, for the team that runs it] \" : line.role ? `[${line.role}] ` : \"\"}${line.customersWords ? \"[a customer's own words: copy it exactly as written, untranslated] \" : \"\"}${JSON.stringify(line.text)}`,\n ),\n \"\",\n \"Rules:\",\n \"- Transcreate as a native copywriter of that market would write the ad, not word for word: the same promise and tone, natural for the people who will see it.\",\n \"- Each line keeps its role: a headline stays a headline, a button stays a short button.\",\n \"- Keep each line about as long as the original: it is set in the same layout, in the same space, so a much longer line will not fit.\",\n `- Keep brand names${context.brand ? ` (${JSON.stringify(context.brand)})` : \"\"}, product names, numbers, prices, currencies, percentages and URLs exactly as they are.`,\n \"- Use the language's own accents and punctuation (¿ ¡ « » ß ç ã).\",\n ...varieties(languages),\n \"\",\n `Reply with only this JSON, one array per language with exactly ${lines.length} lines in the order above: {\"translations\": {${languages.map((l) => `\"${l}\": [\"...\"]`).join(\", \")}}}`,\n ].join(\"\\n\");\n}\n\n/**\n * The translation's spec: the source's as it was drawn, each line's words replaced in place (its\n * role, lettering and placement kept) and, when the source names its market, that market's\n * language set, and its country when the tag names one (es-MX: Mexico). The currency stays the\n * source's: its prices are kept as they are. Everything else is the source's: the design is never the translation's own. Pure.\n */\nexport function translatedSpec(\n source: Record<string, unknown>,\n lines: readonly string[],\n language: string,\n customersWords: ReadonlySet<number> = new Set(),\n): Record<string, unknown> {\n // An older blueprint carries its words in its own shape: it is written as the ad spec it reads as.\n const spec: Record<string, unknown> = isAdSpec(source) ? source : readAdSpec(source);\n const copy = Array.isArray(spec.copy) ? (spec.copy as Array<Record<string, unknown>>) : [];\n const viewer = spec.viewer as { market?: Record<string, unknown> } | undefined;\n return {\n ...spec,\n // A customer's words stay theirs: translated, they would be words nobody said under their name.\n copy: copy.map((line, i) => (customersWords.has(i) ? line : { ...line, text: lines[i] ?? line.text })),\n ...(viewer?.market ? { viewer: { ...viewer, market: { ...viewer.market, ...marketOf(language) } } } : {}),\n };\n}\n\n/** What a translation's `_definition.md` keeps of its source's: everything but these, which are its own. */\nconst OWN_FIELDS = [\"series\", \"language\", \"title\", \"status\"];\n\n/** The translation's `_definition.md`: the source's reasons, as an ad of the source's series in `language`. Pure. */\nexport function translatedDefinition(\n source: string,\n translation: { source: string; language: string; title: string; message?: string },\n): string {\n return setDefinitionFields(withoutFields(source, OWN_FIELDS), {\n title: translation.title.slice(0, 120),\n series: translation.source,\n language: translation.language,\n status: \"draft\",\n ...(translation.message ? { message: translation.message } : {}),\n });\n}\n\n/** For each tag naming a country, the instruction to write as people there write ads. */\nfunction varieties(languages: readonly string[]): string[] {\n const regional = languages.flatMap((tag) => {\n const region = languageRegion(tag);\n return region\n ? [\n `- ${tag}: write it as people in ${region.name} write ads: its own vocabulary, spelling, idioms and form of address (tú, usted or vos as ads there use it), not a neutral one and not a neighbouring country's variety of the same language.`,\n ]\n : [];\n });\n return regional.length > 0 ? [\"\", \"Each regional variant is its own ad:\", ...regional] : [];\n}\n\n/** The market fields a tag decides: its language, and its country when it names one. */\nfunction marketOf(language: string): { language: string; country?: string } {\n const region = languageRegion(language);\n return region ? { language, country: region.code } : { language };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,SAAS,YAAAA,iBAAgB;AACzB,OAAOC,WAAU;AACjB,SAAS,qBAAqB;;;ACD9B,SAAS,OAAO,UAAU,iBAAiB;AAC3C,OAAO,UAAU;;;ACFjB,SAAS,SAAS;AAUX,SAAS,eAAe,KAAa,gBAAuE;AACjH,QAAM,QAAQ,IACX,MAAM,GAAG,EACT,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,OAAO;AACjB,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,MACT,KAAK;AAAA,IACP;AAAA,EACF;AACA,QAAM,YAAsB,CAAC;AAC7B,aAAW,QAAQ,OAAO;AACxB,UAAM,MAAM,YAAY,IAAI;AAC5B,QAAI,CAAC,KAAK;AACR,aAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS,IAAI,IAAI;AAAA,QACjB,KAAK;AAAA,MACP;AAAA,IACF;AACA,QAAI,kBAAkB,QAAQ,KAAK,cAAc,GAAG;AAClD,aAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS,wBAAwB,aAAa,GAAG,KAAK,GAAG;AAAA,QACzD,KAAK,SAAS,IAAI;AAAA,MACpB;AAAA,IACF;AACA,QAAI,CAAC,UAAU,KAAK,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC,EAAG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AA,EACN,MAAM,IAAI,EAAE,KAAK,GAAG;AAClB,UAAM,OAAO,kBAAkB,QAAQ,IAAI,CAAC,KAAK,QAAQ,IAAI;AAC7D,UAAM,WAAW,OAAO,KAAK,WAAW,MAAM,YAAY,KAAK,WAAW,IAAI,KAAK,WAAW,IAAI;AAClG,UAAM,OAAO,WAAW,MAAM,aAAa,QAAQ,IAAI;AACvD,UAAM,QAAuB,CAAC;AAC9B,UAAM,SAAS,MAAM,YAAY,MAAM,OAAO,KAAK,IAAI,GAAG,OAAO,KAAK,EAAE,GAAG;AAAA,MACzE,KAAK,CAAC,WACJ,eAAe,qBAAqB,CAAC,GAAG,QAAQ,CAAC,UAAU,MAAM,KAAK,KAAK,GAAG,oBAAoB,EAAE;AAAA,QAClG,MAAM;AAAA,MACR;AAAA,MACF,GAAI,SAAS,SAAY,EAAE,KAAK,IAAI,CAAC;AAAA,MACrC,OAAO,KAAK,UAAU;AAAA,MACtB,MAAM,CAAC,QAAQ,SAAM,CAAC,UAAU,mBAAmB,KAAK,SAAS,CAAC;AAAA,MAClE,QAAQ,eAAe,KAAK;AAAA,MAC5B,aAAa,CAAC,UAAU,OAAO,MAAM,IAAI,iBAAiB,GAAG,CAAC,UAAU,MAAM,KAAK,KAAK,CAAC;AAAA,IAC3F,CAAC;AAGD,UAAM,kBAAkBA,MAAK,KAAK,MAAM,UAAU,QAAQ,GAAG,KAAK,EAAE,MAAM,MAAM,MAAS;AACzF,QAAI,UAAU,OAAQ,MAAK,MAAM;AACjC,cAAU,kBAAkB,MAAM,CAAC;AAAA,EACrC;AACF,CAAC;","names":["readFile","path","readFile","path"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|