@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
@@ -0,0 +1,457 @@
1
+ import { createRequire } from "node:module";
2
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
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 êtes un rédacteur de scripts de narration vidéo.
170
+ Écrivez un script de narration pour une courte vidéo (30-60 secondes).
171
+ {styleGuide}
172
+
173
+ Retournez du JSON avec la forme :
174
+ {
175
+ "segments": [{ "sceneId": string, "text": string }],
176
+ "fullText": string
177
+ }
178
+
179
+ Les identifiants de scène doivent être : "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 êtes un planificateur de scènes vidéo pour les vidéos marketing/documentation de ContractSpec.
186
+ À partir d'un brief, décomposez-le en scènes vidéo.
187
+
188
+ Chaque scène doit avoir :
189
+ - compositionId : un parmi "ApiOverview", "SocialClip", "TerminalDemo"
190
+ - props : les propriétés d'entrée de cette composition
191
+ - durationInFrames : durée à {fps} fps
192
+ - narrationText : ce que le narrateur dit pendant cette scène
193
+
194
+ Retournez un objet JSON avec la forme :
195
+ {
196
+ "scenes": [{ "compositionId": string, "props": object, "durationInFrames": number, "narrationText": string }],
197
+ "narrationScript": string
198
+ }
199
+
200
+ Gardez la durée totale autour de {targetSeconds} secondes.
201
+ Privilégiez la clarté et le rythme. Chaque scène doit communiquer une idée.`,
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écis. Soyez détaillé et exact.",
218
+ description: "Style guide for technical narration"
219
+ },
220
+ "script.segment.challenge": {
221
+ value: "Le défi : {content}",
222
+ description: "Narration segment prefix for problems",
223
+ placeholders: [{ name: "content", type: "string" }]
224
+ },
225
+ "script.segment.solution": {
226
+ value: "La solution : {content}",
227
+ description: "Narration segment prefix for solutions",
228
+ placeholders: [{ name: "content", type: "string" }]
229
+ },
230
+ "script.segment.results": {
231
+ value: "Les résultats : {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ème",
241
+ description: "Scene hook label for problem statement"
242
+ },
243
+ "scene.narration.problem": {
244
+ value: "Le problème : {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 : {content}",
254
+ description: "Scene narration for solution",
255
+ placeholders: [{ name: "content", type: "string" }]
256
+ },
257
+ "scene.hook.results": {
258
+ value: "Résultats",
259
+ description: "Scene hook label for results/metrics"
260
+ },
261
+ "composition.apiOverview.generates": {
262
+ value: "Génère :",
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èle 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ón para vídeo.
320
+ Escribe un guión de narración para un vídeo 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ídeo para vídeos de marketing/documentación de ContractSpec.
336
+ Dado un brief de contenido, divídelo en escenas de vídeo.
337
+
338
+ Cada escena debe tener:
339
+ - compositionId: uno de "ApiOverview", "SocialClip", "TerminalDemo"
340
+ - props: las propiedades de entrada de esa composición
341
+ - durationInFrames: duración 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én la duración 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é conciso y directo.",
360
+ description: "Style guide for professional narration"
361
+ },
362
+ "prompt.style.casual": {
363
+ value: "Usa un tono amigable y conversacional. Sé accesible y cercano.",
364
+ description: "Style guide for casual narration"
365
+ },
366
+ "prompt.style.technical": {
367
+ value: "Usa un lenguaje técnico preciso. Sé detallado y exacto.",
368
+ description: "Style guide for technical narration"
369
+ },
370
+ "script.segment.challenge": {
371
+ value: "El desafío: {content}",
372
+ description: "Narration segment prefix for problems",
373
+ placeholders: [{ name: "content", type: "string" }]
374
+ },
375
+ "script.segment.solution": {
376
+ value: "La solución: {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ás información",
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ón",
400
+ description: "Scene hook label for solution"
401
+ },
402
+ "scene.narration.solution": {
403
+ value: "La solución: {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ón 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ás información",
445
+ description: "SocialClip default CTA"
446
+ },
447
+ "composition.terminal.title": {
448
+ value: "Terminal",
449
+ description: "TerminalDemo default window title"
450
+ }
451
+ }
452
+ });
453
+ export {
454
+ frMessages,
455
+ esMessages,
456
+ enMessages
457
+ };