@contractspec/lib.video-gen 1.44.0 → 1.46.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 (61) hide show
  1. package/README.md +37 -0
  2. package/dist/browser/docs/rendering.docblock.js +4 -4
  3. package/dist/browser/docs/video-gen.docblock.js +1 -1
  4. package/dist/browser/generators/index.js +601 -192
  5. package/dist/browser/generators/scene-planner.js +527 -23
  6. package/dist/browser/generators/script-generator.js +528 -18
  7. package/dist/browser/generators/video-generator.js +601 -191
  8. package/dist/browser/i18n/catalogs/en.js +160 -0
  9. package/dist/browser/i18n/catalogs/es.js +160 -0
  10. package/dist/browser/i18n/catalogs/fr.js +160 -0
  11. package/dist/browser/i18n/catalogs/index.js +462 -0
  12. package/dist/browser/i18n/index.js +534 -0
  13. package/dist/browser/i18n/keys.js +54 -0
  14. package/dist/browser/i18n/locale.js +21 -0
  15. package/dist/browser/i18n/messages.js +474 -0
  16. package/dist/browser/index.js +601 -192
  17. package/dist/docs/rendering.docblock.js +4 -4
  18. package/dist/docs/video-gen.docblock.js +1 -1
  19. package/dist/generators/index.d.ts +0 -2
  20. package/dist/generators/index.js +601 -192
  21. package/dist/generators/scene-planner.d.ts +2 -0
  22. package/dist/generators/scene-planner.js +527 -23
  23. package/dist/generators/script-generator.d.ts +2 -0
  24. package/dist/generators/script-generator.js +528 -18
  25. package/dist/generators/video-generator.d.ts +6 -5
  26. package/dist/generators/video-generator.js +601 -191
  27. package/dist/i18n/catalogs/en.d.ts +8 -0
  28. package/dist/i18n/catalogs/en.js +155 -0
  29. package/dist/i18n/catalogs/es.d.ts +6 -0
  30. package/dist/i18n/catalogs/es.js +155 -0
  31. package/dist/i18n/catalogs/fr.d.ts +6 -0
  32. package/dist/i18n/catalogs/fr.js +155 -0
  33. package/dist/i18n/catalogs/index.d.ts +8 -0
  34. package/dist/i18n/catalogs/index.js +457 -0
  35. package/dist/i18n/i18n.test.d.ts +1 -0
  36. package/dist/i18n/index.d.ts +22 -0
  37. package/dist/i18n/index.js +529 -0
  38. package/dist/i18n/keys.d.ts +116 -0
  39. package/dist/i18n/keys.js +49 -0
  40. package/dist/i18n/locale.d.ts +8 -0
  41. package/dist/i18n/locale.js +16 -0
  42. package/dist/i18n/messages.d.ts +14 -0
  43. package/dist/i18n/messages.js +469 -0
  44. package/dist/index.js +601 -192
  45. package/dist/node/docs/rendering.docblock.js +4 -4
  46. package/dist/node/docs/video-gen.docblock.js +1 -1
  47. package/dist/node/generators/index.js +601 -192
  48. package/dist/node/generators/scene-planner.js +527 -23
  49. package/dist/node/generators/script-generator.js +528 -18
  50. package/dist/node/generators/video-generator.js +601 -191
  51. package/dist/node/i18n/catalogs/en.js +155 -0
  52. package/dist/node/i18n/catalogs/es.js +155 -0
  53. package/dist/node/i18n/catalogs/fr.js +155 -0
  54. package/dist/node/i18n/catalogs/index.js +457 -0
  55. package/dist/node/i18n/index.js +529 -0
  56. package/dist/node/i18n/keys.js +49 -0
  57. package/dist/node/i18n/locale.js +16 -0
  58. package/dist/node/i18n/messages.js +469 -0
  59. package/dist/node/index.js +601 -192
  60. package/dist/types.d.ts +14 -3
  61. package/package.json +149 -6
@@ -1,15 +1,526 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
+ // src/i18n/catalogs/en.ts
5
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
6
+ var enMessages = defineTranslation({
7
+ meta: {
8
+ key: "video-gen.messages",
9
+ version: "1.0.0",
10
+ domain: "video-gen",
11
+ description: "All user-facing, LLM-facing, and developer-facing strings for the video-gen package",
12
+ owners: ["platform"],
13
+ stability: "experimental"
14
+ },
15
+ locale: "en",
16
+ fallback: "en",
17
+ messages: {
18
+ "prompt.script.system": {
19
+ value: `You are a video narration script writer.
20
+ Write a narration script for a short video (30-60 seconds).
21
+ {styleGuide}
22
+
23
+ Return JSON with shape:
24
+ {
25
+ "segments": [{ "sceneId": string, "text": string }],
26
+ "fullText": string
27
+ }
28
+
29
+ Scene IDs should be: "intro", "problems", "solutions", "metrics", "cta".
30
+ Only include segments that are relevant to the brief content.`,
31
+ description: "Script generator LLM system prompt",
32
+ placeholders: [{ name: "styleGuide", type: "string" }]
33
+ },
34
+ "prompt.scenePlanner.system": {
35
+ value: `You are a video scene planner for ContractSpec marketing/documentation videos.
36
+ Given a content brief, break it into video scenes.
37
+
38
+ Each scene must have:
39
+ - compositionId: one of "ApiOverview", "SocialClip", "TerminalDemo"
40
+ - props: the input props for that composition (see type definitions)
41
+ - durationInFrames: duration at {fps}fps
42
+ - narrationText: what the narrator says during this scene
43
+
44
+ Return a JSON object with shape:
45
+ {
46
+ "scenes": [{ "compositionId": string, "props": object, "durationInFrames": number, "narrationText": string }],
47
+ "narrationScript": string
48
+ }
49
+
50
+ Keep the total duration around {targetSeconds} seconds.
51
+ Prioritize clarity and pacing. Each scene should communicate one idea.`,
52
+ description: "Scene planner LLM system prompt",
53
+ placeholders: [
54
+ { name: "fps", type: "number" },
55
+ { name: "targetSeconds", type: "number" }
56
+ ]
57
+ },
58
+ "prompt.style.professional": {
59
+ value: "Use a clear, authoritative, professional tone. Be concise and direct.",
60
+ description: "Style guide for professional narration"
61
+ },
62
+ "prompt.style.casual": {
63
+ value: "Use a friendly, conversational tone. Be approachable and relatable.",
64
+ description: "Style guide for casual narration"
65
+ },
66
+ "prompt.style.technical": {
67
+ value: "Use precise technical language. Be detailed and accurate.",
68
+ description: "Style guide for technical narration"
69
+ },
70
+ "script.segment.challenge": {
71
+ value: "The challenge: {content}",
72
+ description: "Narration segment prefix for problems",
73
+ placeholders: [{ name: "content", type: "string" }]
74
+ },
75
+ "script.segment.solution": {
76
+ value: "The solution: {content}",
77
+ description: "Narration segment prefix for solutions",
78
+ placeholders: [{ name: "content", type: "string" }]
79
+ },
80
+ "script.segment.results": {
81
+ value: "The results: {content}",
82
+ description: "Narration segment prefix for metrics",
83
+ placeholders: [{ name: "content", type: "string" }]
84
+ },
85
+ "scene.cta.default": {
86
+ value: "Learn more",
87
+ description: "Default call-to-action text for scenes"
88
+ },
89
+ "scene.hook.problem": {
90
+ value: "The Problem",
91
+ description: "Scene hook label for problem statement"
92
+ },
93
+ "scene.narration.problem": {
94
+ value: "The problem: {content}",
95
+ description: "Scene narration for problem statement",
96
+ placeholders: [{ name: "content", type: "string" }]
97
+ },
98
+ "scene.hook.solution": {
99
+ value: "The Solution",
100
+ description: "Scene hook label for solution"
101
+ },
102
+ "scene.narration.solution": {
103
+ value: "The solution: {content}",
104
+ description: "Scene narration for solution",
105
+ placeholders: [{ name: "content", type: "string" }]
106
+ },
107
+ "scene.hook.results": {
108
+ value: "Results",
109
+ description: "Scene hook label for results/metrics"
110
+ },
111
+ "composition.apiOverview.generates": {
112
+ value: "Generates:",
113
+ description: "ApiOverview heading for generated outputs"
114
+ },
115
+ "composition.apiOverview.tagline": {
116
+ value: "One spec. Every surface.",
117
+ description: "ApiOverview default tagline"
118
+ },
119
+ "composition.apiOverview.output.rest": {
120
+ value: "REST Endpoint",
121
+ description: "Generated output label: REST"
122
+ },
123
+ "composition.apiOverview.output.graphql": {
124
+ value: "GraphQL Mutation",
125
+ description: "Generated output label: GraphQL"
126
+ },
127
+ "composition.apiOverview.output.prisma": {
128
+ value: "Prisma Model",
129
+ description: "Generated output label: Prisma"
130
+ },
131
+ "composition.apiOverview.output.typescript": {
132
+ value: "TypeScript SDK",
133
+ description: "Generated output label: TypeScript SDK"
134
+ },
135
+ "composition.apiOverview.output.mcp": {
136
+ value: "MCP Tool",
137
+ description: "Generated output label: MCP Tool"
138
+ },
139
+ "composition.apiOverview.output.openapi": {
140
+ value: "OpenAPI Spec",
141
+ description: "Generated output label: OpenAPI"
142
+ },
143
+ "composition.socialClip.cta": {
144
+ value: "Learn more",
145
+ description: "SocialClip default CTA"
146
+ },
147
+ "composition.terminal.title": {
148
+ value: "Terminal",
149
+ description: "TerminalDemo default window title"
150
+ }
151
+ }
152
+ });
153
+
154
+ // src/i18n/catalogs/fr.ts
155
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
156
+ var frMessages = defineTranslation2({
157
+ meta: {
158
+ key: "video-gen.messages",
159
+ version: "1.0.0",
160
+ domain: "video-gen",
161
+ description: "French translations for the video-gen package",
162
+ owners: ["platform"],
163
+ stability: "experimental"
164
+ },
165
+ locale: "fr",
166
+ fallback: "en",
167
+ messages: {
168
+ "prompt.script.system": {
169
+ value: `Vous \xEAtes un r\xE9dacteur de scripts de narration vid\xE9o.
170
+ \xC9crivez un script de narration pour une courte vid\xE9o (30-60 secondes).
171
+ {styleGuide}
172
+
173
+ Retournez du JSON avec la forme\xA0:
174
+ {
175
+ "segments": [{ "sceneId": string, "text": string }],
176
+ "fullText": string
177
+ }
178
+
179
+ Les identifiants de sc\xE8ne doivent \xEAtre\xA0: "intro", "problems", "solutions", "metrics", "cta".
180
+ N'incluez que les segments pertinents au brief.`,
181
+ description: "Script generator LLM system prompt",
182
+ placeholders: [{ name: "styleGuide", type: "string" }]
183
+ },
184
+ "prompt.scenePlanner.system": {
185
+ value: `Vous \xEAtes un planificateur de sc\xE8nes vid\xE9o pour les vid\xE9os marketing/documentation de ContractSpec.
186
+ \xC0 partir d'un brief, d\xE9composez-le en sc\xE8nes vid\xE9o.
187
+
188
+ Chaque sc\xE8ne doit avoir\xA0:
189
+ - compositionId\xA0: un parmi "ApiOverview", "SocialClip", "TerminalDemo"
190
+ - props\xA0: les propri\xE9t\xE9s d'entr\xE9e de cette composition
191
+ - durationInFrames\xA0: dur\xE9e \xE0 {fps}\xA0fps
192
+ - narrationText\xA0: ce que le narrateur dit pendant cette sc\xE8ne
193
+
194
+ Retournez un objet JSON avec la forme\xA0:
195
+ {
196
+ "scenes": [{ "compositionId": string, "props": object, "durationInFrames": number, "narrationText": string }],
197
+ "narrationScript": string
198
+ }
199
+
200
+ Gardez la dur\xE9e totale autour de {targetSeconds} secondes.
201
+ Privil\xE9giez la clart\xE9 et le rythme. Chaque sc\xE8ne doit communiquer une id\xE9e.`,
202
+ description: "Scene planner LLM system prompt",
203
+ placeholders: [
204
+ { name: "fps", type: "number" },
205
+ { name: "targetSeconds", type: "number" }
206
+ ]
207
+ },
208
+ "prompt.style.professional": {
209
+ value: "Utilisez un ton clair, autoritaire et professionnel. Soyez concis et direct.",
210
+ description: "Style guide for professional narration"
211
+ },
212
+ "prompt.style.casual": {
213
+ value: "Utilisez un ton amical et conversationnel. Soyez accessible et proche.",
214
+ description: "Style guide for casual narration"
215
+ },
216
+ "prompt.style.technical": {
217
+ value: "Utilisez un langage technique pr\xE9cis. Soyez d\xE9taill\xE9 et exact.",
218
+ description: "Style guide for technical narration"
219
+ },
220
+ "script.segment.challenge": {
221
+ value: "Le d\xE9fi\xA0: {content}",
222
+ description: "Narration segment prefix for problems",
223
+ placeholders: [{ name: "content", type: "string" }]
224
+ },
225
+ "script.segment.solution": {
226
+ value: "La solution\xA0: {content}",
227
+ description: "Narration segment prefix for solutions",
228
+ placeholders: [{ name: "content", type: "string" }]
229
+ },
230
+ "script.segment.results": {
231
+ value: "Les r\xE9sultats\xA0: {content}",
232
+ description: "Narration segment prefix for metrics",
233
+ placeholders: [{ name: "content", type: "string" }]
234
+ },
235
+ "scene.cta.default": {
236
+ value: "En savoir plus",
237
+ description: "Default call-to-action text for scenes"
238
+ },
239
+ "scene.hook.problem": {
240
+ value: "Le probl\xE8me",
241
+ description: "Scene hook label for problem statement"
242
+ },
243
+ "scene.narration.problem": {
244
+ value: "Le probl\xE8me\xA0: {content}",
245
+ description: "Scene narration for problem statement",
246
+ placeholders: [{ name: "content", type: "string" }]
247
+ },
248
+ "scene.hook.solution": {
249
+ value: "La solution",
250
+ description: "Scene hook label for solution"
251
+ },
252
+ "scene.narration.solution": {
253
+ value: "La solution\xA0: {content}",
254
+ description: "Scene narration for solution",
255
+ placeholders: [{ name: "content", type: "string" }]
256
+ },
257
+ "scene.hook.results": {
258
+ value: "R\xE9sultats",
259
+ description: "Scene hook label for results/metrics"
260
+ },
261
+ "composition.apiOverview.generates": {
262
+ value: "G\xE9n\xE8re\xA0:",
263
+ description: "ApiOverview heading for generated outputs"
264
+ },
265
+ "composition.apiOverview.tagline": {
266
+ value: "Un spec. Toutes les surfaces.",
267
+ description: "ApiOverview default tagline"
268
+ },
269
+ "composition.apiOverview.output.rest": {
270
+ value: "Endpoint REST",
271
+ description: "Generated output label: REST"
272
+ },
273
+ "composition.apiOverview.output.graphql": {
274
+ value: "Mutation GraphQL",
275
+ description: "Generated output label: GraphQL"
276
+ },
277
+ "composition.apiOverview.output.prisma": {
278
+ value: "Mod\xE8le Prisma",
279
+ description: "Generated output label: Prisma"
280
+ },
281
+ "composition.apiOverview.output.typescript": {
282
+ value: "SDK TypeScript",
283
+ description: "Generated output label: TypeScript SDK"
284
+ },
285
+ "composition.apiOverview.output.mcp": {
286
+ value: "Outil MCP",
287
+ description: "Generated output label: MCP Tool"
288
+ },
289
+ "composition.apiOverview.output.openapi": {
290
+ value: "Spec OpenAPI",
291
+ description: "Generated output label: OpenAPI"
292
+ },
293
+ "composition.socialClip.cta": {
294
+ value: "En savoir plus",
295
+ description: "SocialClip default CTA"
296
+ },
297
+ "composition.terminal.title": {
298
+ value: "Terminal",
299
+ description: "TerminalDemo default window title"
300
+ }
301
+ }
302
+ });
303
+
304
+ // src/i18n/catalogs/es.ts
305
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
306
+ var esMessages = defineTranslation3({
307
+ meta: {
308
+ key: "video-gen.messages",
309
+ version: "1.0.0",
310
+ domain: "video-gen",
311
+ description: "Spanish translations for the video-gen package",
312
+ owners: ["platform"],
313
+ stability: "experimental"
314
+ },
315
+ locale: "es",
316
+ fallback: "en",
317
+ messages: {
318
+ "prompt.script.system": {
319
+ value: `Eres un redactor de guiones de narraci\xF3n para v\xEDdeo.
320
+ Escribe un gui\xF3n de narraci\xF3n para un v\xEDdeo corto (30-60 segundos).
321
+ {styleGuide}
322
+
323
+ Devuelve JSON con la forma:
324
+ {
325
+ "segments": [{ "sceneId": string, "text": string }],
326
+ "fullText": string
327
+ }
328
+
329
+ Los identificadores de escena deben ser: "intro", "problems", "solutions", "metrics", "cta".
330
+ Incluye solo los segmentos relevantes para el brief.`,
331
+ description: "Script generator LLM system prompt",
332
+ placeholders: [{ name: "styleGuide", type: "string" }]
333
+ },
334
+ "prompt.scenePlanner.system": {
335
+ value: `Eres un planificador de escenas de v\xEDdeo para v\xEDdeos de marketing/documentaci\xF3n de ContractSpec.
336
+ Dado un brief de contenido, div\xEDdelo en escenas de v\xEDdeo.
337
+
338
+ Cada escena debe tener:
339
+ - compositionId: uno de "ApiOverview", "SocialClip", "TerminalDemo"
340
+ - props: las propiedades de entrada de esa composici\xF3n
341
+ - durationInFrames: duraci\xF3n a {fps} fps
342
+ - narrationText: lo que dice el narrador durante esta escena
343
+
344
+ Devuelve un objeto JSON con la forma:
345
+ {
346
+ "scenes": [{ "compositionId": string, "props": object, "durationInFrames": number, "narrationText": string }],
347
+ "narrationScript": string
348
+ }
349
+
350
+ Mant\xE9n la duraci\xF3n total alrededor de {targetSeconds} segundos.
351
+ Prioriza la claridad y el ritmo. Cada escena debe comunicar una idea.`,
352
+ description: "Scene planner LLM system prompt",
353
+ placeholders: [
354
+ { name: "fps", type: "number" },
355
+ { name: "targetSeconds", type: "number" }
356
+ ]
357
+ },
358
+ "prompt.style.professional": {
359
+ value: "Usa un tono claro, autoritario y profesional. S\xE9 conciso y directo.",
360
+ description: "Style guide for professional narration"
361
+ },
362
+ "prompt.style.casual": {
363
+ value: "Usa un tono amigable y conversacional. S\xE9 accesible y cercano.",
364
+ description: "Style guide for casual narration"
365
+ },
366
+ "prompt.style.technical": {
367
+ value: "Usa un lenguaje t\xE9cnico preciso. S\xE9 detallado y exacto.",
368
+ description: "Style guide for technical narration"
369
+ },
370
+ "script.segment.challenge": {
371
+ value: "El desaf\xEDo: {content}",
372
+ description: "Narration segment prefix for problems",
373
+ placeholders: [{ name: "content", type: "string" }]
374
+ },
375
+ "script.segment.solution": {
376
+ value: "La soluci\xF3n: {content}",
377
+ description: "Narration segment prefix for solutions",
378
+ placeholders: [{ name: "content", type: "string" }]
379
+ },
380
+ "script.segment.results": {
381
+ value: "Los resultados: {content}",
382
+ description: "Narration segment prefix for metrics",
383
+ placeholders: [{ name: "content", type: "string" }]
384
+ },
385
+ "scene.cta.default": {
386
+ value: "M\xE1s informaci\xF3n",
387
+ description: "Default call-to-action text for scenes"
388
+ },
389
+ "scene.hook.problem": {
390
+ value: "El problema",
391
+ description: "Scene hook label for problem statement"
392
+ },
393
+ "scene.narration.problem": {
394
+ value: "El problema: {content}",
395
+ description: "Scene narration for problem statement",
396
+ placeholders: [{ name: "content", type: "string" }]
397
+ },
398
+ "scene.hook.solution": {
399
+ value: "La soluci\xF3n",
400
+ description: "Scene hook label for solution"
401
+ },
402
+ "scene.narration.solution": {
403
+ value: "La soluci\xF3n: {content}",
404
+ description: "Scene narration for solution",
405
+ placeholders: [{ name: "content", type: "string" }]
406
+ },
407
+ "scene.hook.results": {
408
+ value: "Resultados",
409
+ description: "Scene hook label for results/metrics"
410
+ },
411
+ "composition.apiOverview.generates": {
412
+ value: "Genera:",
413
+ description: "ApiOverview heading for generated outputs"
414
+ },
415
+ "composition.apiOverview.tagline": {
416
+ value: "Una spec. Todas las superficies.",
417
+ description: "ApiOverview default tagline"
418
+ },
419
+ "composition.apiOverview.output.rest": {
420
+ value: "Endpoint REST",
421
+ description: "Generated output label: REST"
422
+ },
423
+ "composition.apiOverview.output.graphql": {
424
+ value: "Mutaci\xF3n GraphQL",
425
+ description: "Generated output label: GraphQL"
426
+ },
427
+ "composition.apiOverview.output.prisma": {
428
+ value: "Modelo Prisma",
429
+ description: "Generated output label: Prisma"
430
+ },
431
+ "composition.apiOverview.output.typescript": {
432
+ value: "SDK TypeScript",
433
+ description: "Generated output label: TypeScript SDK"
434
+ },
435
+ "composition.apiOverview.output.mcp": {
436
+ value: "Herramienta MCP",
437
+ description: "Generated output label: MCP Tool"
438
+ },
439
+ "composition.apiOverview.output.openapi": {
440
+ value: "Spec OpenAPI",
441
+ description: "Generated output label: OpenAPI"
442
+ },
443
+ "composition.socialClip.cta": {
444
+ value: "M\xE1s informaci\xF3n",
445
+ description: "SocialClip default CTA"
446
+ },
447
+ "composition.terminal.title": {
448
+ value: "Terminal",
449
+ description: "TerminalDemo default window title"
450
+ }
451
+ }
452
+ });
453
+
454
+ // src/i18n/messages.ts
455
+ import {
456
+ createI18nFactory
457
+ } from "@contractspec/lib.contracts-spec/translations";
458
+ var factory = createI18nFactory({
459
+ specKey: "video-gen.messages",
460
+ catalogs: [enMessages, frMessages, esMessages]
461
+ });
462
+ var createVideoGenI18n = factory.create;
463
+ var getDefaultI18n = factory.getDefault;
464
+ var resetI18nRegistry = factory.resetRegistry;
465
+
466
+ // src/i18n/locale.ts
467
+ import {
468
+ DEFAULT_LOCALE,
469
+ SUPPORTED_LOCALES,
470
+ resolveLocale,
471
+ isSupportedLocale
472
+ } from "@contractspec/lib.contracts-spec/translations";
473
+
474
+ // src/i18n/keys.ts
475
+ var PROMPT_KEYS = {
476
+ "prompt.script.system": "prompt.script.system",
477
+ "prompt.scenePlanner.system": "prompt.scenePlanner.system",
478
+ "prompt.style.professional": "prompt.style.professional",
479
+ "prompt.style.casual": "prompt.style.casual",
480
+ "prompt.style.technical": "prompt.style.technical"
481
+ };
482
+ var SCRIPT_KEYS = {
483
+ "script.segment.challenge": "script.segment.challenge",
484
+ "script.segment.solution": "script.segment.solution",
485
+ "script.segment.results": "script.segment.results"
486
+ };
487
+ var SCENE_KEYS = {
488
+ "scene.cta.default": "scene.cta.default",
489
+ "scene.hook.problem": "scene.hook.problem",
490
+ "scene.narration.problem": "scene.narration.problem",
491
+ "scene.hook.solution": "scene.hook.solution",
492
+ "scene.narration.solution": "scene.narration.solution",
493
+ "scene.hook.results": "scene.hook.results"
494
+ };
495
+ var COMPOSITION_KEYS = {
496
+ "composition.apiOverview.generates": "composition.apiOverview.generates",
497
+ "composition.apiOverview.tagline": "composition.apiOverview.tagline",
498
+ "composition.apiOverview.output.rest": "composition.apiOverview.output.rest",
499
+ "composition.apiOverview.output.graphql": "composition.apiOverview.output.graphql",
500
+ "composition.apiOverview.output.prisma": "composition.apiOverview.output.prisma",
501
+ "composition.apiOverview.output.typescript": "composition.apiOverview.output.typescript",
502
+ "composition.apiOverview.output.mcp": "composition.apiOverview.output.mcp",
503
+ "composition.apiOverview.output.openapi": "composition.apiOverview.output.openapi",
504
+ "composition.socialClip.cta": "composition.socialClip.cta",
505
+ "composition.terminal.title": "composition.terminal.title"
506
+ };
507
+ var I18N_KEYS = {
508
+ ...PROMPT_KEYS,
509
+ ...SCRIPT_KEYS,
510
+ ...SCENE_KEYS,
511
+ ...COMPOSITION_KEYS
512
+ };
4
513
  // src/generators/script-generator.ts
5
514
  class ScriptGenerator {
6
515
  llm;
7
516
  model;
8
517
  temperature;
518
+ i18n;
9
519
  constructor(options) {
10
520
  this.llm = options?.llm;
11
521
  this.model = options?.model;
12
522
  this.temperature = options?.temperature ?? 0.5;
523
+ this.i18n = createVideoGenI18n(options?.locale);
13
524
  }
14
525
  async generate(brief, config) {
15
526
  const style = config?.style ?? "professional";
@@ -19,6 +530,7 @@ class ScriptGenerator {
19
530
  return this.generateDeterministic(brief, style);
20
531
  }
21
532
  generateDeterministic(brief, style) {
533
+ const { t } = this.i18n;
22
534
  const segments = [];
23
535
  const intro = this.formatForStyle(`${brief.title}. ${brief.summary}`, style);
24
536
  segments.push({
@@ -27,7 +539,9 @@ class ScriptGenerator {
27
539
  estimatedDurationSeconds: this.estimateDuration(intro)
28
540
  });
29
541
  if (brief.problems.length > 0) {
30
- const problemText = this.formatForStyle(`The challenge: ${brief.problems.join(". ")}`, style);
542
+ const problemText = this.formatForStyle(t("script.segment.challenge", {
543
+ content: brief.problems.join(". ")
544
+ }), style);
31
545
  segments.push({
32
546
  sceneId: "problems",
33
547
  text: problemText,
@@ -35,7 +549,9 @@ class ScriptGenerator {
35
549
  });
36
550
  }
37
551
  if (brief.solutions.length > 0) {
38
- const solutionText = this.formatForStyle(`The solution: ${brief.solutions.join(". ")}`, style);
552
+ const solutionText = this.formatForStyle(t("script.segment.solution", {
553
+ content: brief.solutions.join(". ")
554
+ }), style);
39
555
  segments.push({
40
556
  sceneId: "solutions",
41
557
  text: solutionText,
@@ -43,7 +559,9 @@ class ScriptGenerator {
43
559
  });
44
560
  }
45
561
  if (brief.metrics && brief.metrics.length > 0) {
46
- const metricsText = this.formatForStyle(`The results: ${brief.metrics.join(". ")}`, style);
562
+ const metricsText = this.formatForStyle(t("script.segment.results", {
563
+ content: brief.metrics.join(". ")
564
+ }), style);
47
565
  segments.push({
48
566
  sceneId: "metrics",
49
567
  text: metricsText,
@@ -68,10 +586,11 @@ class ScriptGenerator {
68
586
  };
69
587
  }
70
588
  async generateWithLlm(brief, style) {
589
+ const { t } = this.i18n;
71
590
  const styleGuide = {
72
- professional: "Use a clear, authoritative, professional tone. Be concise and direct.",
73
- casual: "Use a friendly, conversational tone. Be approachable and relatable.",
74
- technical: "Use precise technical language. Be detailed and accurate."
591
+ professional: t("prompt.style.professional"),
592
+ casual: t("prompt.style.casual"),
593
+ technical: t("prompt.style.technical")
75
594
  };
76
595
  const styleKey = style ?? "professional";
77
596
  const messages = [
@@ -80,18 +599,9 @@ class ScriptGenerator {
80
599
  content: [
81
600
  {
82
601
  type: "text",
83
- text: `You are a video narration script writer.
84
- Write a narration script for a short video (30-60 seconds).
85
- ${styleGuide[styleKey]}
86
-
87
- Return JSON with shape:
88
- {
89
- "segments": [{ "sceneId": string, "text": string }],
90
- "fullText": string
91
- }
92
-
93
- Scene IDs should be: "intro", "problems", "solutions", "metrics", "cta".
94
- Only include segments that are relevant to the brief content.`
602
+ text: t("prompt.script.system", {
603
+ styleGuide: styleGuide[styleKey]
604
+ })
95
605
  }
96
606
  ]
97
607
  },
@@ -2,9 +2,9 @@ import type { VideoProject } from '@contractspec/lib.contracts-integrations/inte
2
2
  import type { VideoBrief, VideoGeneratorOptions } from '../types';
3
3
  export declare class VideoGenerator {
4
4
  private readonly scenePlanner;
5
- private readonly scriptGenerator;
6
5
  private readonly voice?;
7
- private readonly defaultVoiceId?;
6
+ private readonly transcriber?;
7
+ private readonly image?;
8
8
  private readonly fps;
9
9
  constructor(options?: VideoGeneratorOptions);
10
10
  /**
@@ -12,9 +12,10 @@ export declare class VideoGenerator {
12
12
  *
13
13
  * Pipeline:
14
14
  * 1. Plan scenes from the content brief
15
- * 2. Generate narration script
16
- * 3. (Optional) Synthesize voice audio via VoiceProvider
17
- * 4. Assemble into a VideoProject
15
+ * 2. (Optional) Synthesize voice with scene awareness via VoiceSynthesizer
16
+ * 3. (Optional) Generate subtitles via Transcriber
17
+ * 4. (Optional) Generate thumbnail via ImageGenerator
18
+ * 5. Assemble into a VideoProject
18
19
  */
19
20
  generate(brief: VideoBrief): Promise<VideoProject>;
20
21
  }