@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,8 @@
1
+ /**
2
+ * English (en) translation catalog for @contractspec/lib.video-gen.
3
+ *
4
+ * This is the primary / reference locale. All message keys must be present here.
5
+ *
6
+ * @module i18n/catalogs/en
7
+ */
8
+ export declare const enMessages: import("@contractspec/lib.contracts-spec/translations").TranslationSpec;
@@ -0,0 +1,155 @@
1
+ // @bun
2
+ var __require = import.meta.require;
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
+ export {
154
+ enMessages
155
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Spanish (es) translation catalog for @contractspec/lib.video-gen.
3
+ *
4
+ * @module i18n/catalogs/es
5
+ */
6
+ export declare const esMessages: import("@contractspec/lib.contracts-spec/translations").TranslationSpec;
@@ -0,0 +1,155 @@
1
+ // @bun
2
+ var __require = import.meta.require;
3
+
4
+ // src/i18n/catalogs/es.ts
5
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
6
+ var esMessages = defineTranslation({
7
+ meta: {
8
+ key: "video-gen.messages",
9
+ version: "1.0.0",
10
+ domain: "video-gen",
11
+ description: "Spanish translations for the video-gen package",
12
+ owners: ["platform"],
13
+ stability: "experimental"
14
+ },
15
+ locale: "es",
16
+ fallback: "en",
17
+ messages: {
18
+ "prompt.script.system": {
19
+ value: `Eres un redactor de guiones de narraci\xF3n para v\xEDdeo.
20
+ Escribe un gui\xF3n de narraci\xF3n para un v\xEDdeo corto (30-60 segundos).
21
+ {styleGuide}
22
+
23
+ Devuelve JSON con la forma:
24
+ {
25
+ "segments": [{ "sceneId": string, "text": string }],
26
+ "fullText": string
27
+ }
28
+
29
+ Los identificadores de escena deben ser: "intro", "problems", "solutions", "metrics", "cta".
30
+ Incluye solo los segmentos relevantes para el brief.`,
31
+ description: "Script generator LLM system prompt",
32
+ placeholders: [{ name: "styleGuide", type: "string" }]
33
+ },
34
+ "prompt.scenePlanner.system": {
35
+ value: `Eres un planificador de escenas de v\xEDdeo para v\xEDdeos de marketing/documentaci\xF3n de ContractSpec.
36
+ Dado un brief de contenido, div\xEDdelo en escenas de v\xEDdeo.
37
+
38
+ Cada escena debe tener:
39
+ - compositionId: uno de "ApiOverview", "SocialClip", "TerminalDemo"
40
+ - props: las propiedades de entrada de esa composici\xF3n
41
+ - durationInFrames: duraci\xF3n a {fps} fps
42
+ - narrationText: lo que dice el narrador durante esta escena
43
+
44
+ Devuelve un objeto JSON con la forma:
45
+ {
46
+ "scenes": [{ "compositionId": string, "props": object, "durationInFrames": number, "narrationText": string }],
47
+ "narrationScript": string
48
+ }
49
+
50
+ Mant\xE9n la duraci\xF3n total alrededor de {targetSeconds} segundos.
51
+ Prioriza la claridad y el ritmo. Cada escena debe comunicar una 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: "Usa un tono claro, autoritario y profesional. S\xE9 conciso y directo.",
60
+ description: "Style guide for professional narration"
61
+ },
62
+ "prompt.style.casual": {
63
+ value: "Usa un tono amigable y conversacional. S\xE9 accesible y cercano.",
64
+ description: "Style guide for casual narration"
65
+ },
66
+ "prompt.style.technical": {
67
+ value: "Usa un lenguaje t\xE9cnico preciso. S\xE9 detallado y exacto.",
68
+ description: "Style guide for technical narration"
69
+ },
70
+ "script.segment.challenge": {
71
+ value: "El desaf\xEDo: {content}",
72
+ description: "Narration segment prefix for problems",
73
+ placeholders: [{ name: "content", type: "string" }]
74
+ },
75
+ "script.segment.solution": {
76
+ value: "La soluci\xF3n: {content}",
77
+ description: "Narration segment prefix for solutions",
78
+ placeholders: [{ name: "content", type: "string" }]
79
+ },
80
+ "script.segment.results": {
81
+ value: "Los resultados: {content}",
82
+ description: "Narration segment prefix for metrics",
83
+ placeholders: [{ name: "content", type: "string" }]
84
+ },
85
+ "scene.cta.default": {
86
+ value: "M\xE1s informaci\xF3n",
87
+ description: "Default call-to-action text for scenes"
88
+ },
89
+ "scene.hook.problem": {
90
+ value: "El problema",
91
+ description: "Scene hook label for problem statement"
92
+ },
93
+ "scene.narration.problem": {
94
+ value: "El problema: {content}",
95
+ description: "Scene narration for problem statement",
96
+ placeholders: [{ name: "content", type: "string" }]
97
+ },
98
+ "scene.hook.solution": {
99
+ value: "La soluci\xF3n",
100
+ description: "Scene hook label for solution"
101
+ },
102
+ "scene.narration.solution": {
103
+ value: "La soluci\xF3n: {content}",
104
+ description: "Scene narration for solution",
105
+ placeholders: [{ name: "content", type: "string" }]
106
+ },
107
+ "scene.hook.results": {
108
+ value: "Resultados",
109
+ description: "Scene hook label for results/metrics"
110
+ },
111
+ "composition.apiOverview.generates": {
112
+ value: "Genera:",
113
+ description: "ApiOverview heading for generated outputs"
114
+ },
115
+ "composition.apiOverview.tagline": {
116
+ value: "Una spec. Todas las superficies.",
117
+ description: "ApiOverview default tagline"
118
+ },
119
+ "composition.apiOverview.output.rest": {
120
+ value: "Endpoint REST",
121
+ description: "Generated output label: REST"
122
+ },
123
+ "composition.apiOverview.output.graphql": {
124
+ value: "Mutaci\xF3n GraphQL",
125
+ description: "Generated output label: GraphQL"
126
+ },
127
+ "composition.apiOverview.output.prisma": {
128
+ value: "Modelo Prisma",
129
+ description: "Generated output label: Prisma"
130
+ },
131
+ "composition.apiOverview.output.typescript": {
132
+ value: "SDK TypeScript",
133
+ description: "Generated output label: TypeScript SDK"
134
+ },
135
+ "composition.apiOverview.output.mcp": {
136
+ value: "Herramienta MCP",
137
+ description: "Generated output label: MCP Tool"
138
+ },
139
+ "composition.apiOverview.output.openapi": {
140
+ value: "Spec OpenAPI",
141
+ description: "Generated output label: OpenAPI"
142
+ },
143
+ "composition.socialClip.cta": {
144
+ value: "M\xE1s informaci\xF3n",
145
+ description: "SocialClip default CTA"
146
+ },
147
+ "composition.terminal.title": {
148
+ value: "Terminal",
149
+ description: "TerminalDemo default window title"
150
+ }
151
+ }
152
+ });
153
+ export {
154
+ esMessages
155
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * French (fr) translation catalog for @contractspec/lib.video-gen.
3
+ *
4
+ * @module i18n/catalogs/fr
5
+ */
6
+ export declare const frMessages: import("@contractspec/lib.contracts-spec/translations").TranslationSpec;
@@ -0,0 +1,155 @@
1
+ // @bun
2
+ var __require = import.meta.require;
3
+
4
+ // src/i18n/catalogs/fr.ts
5
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
6
+ var frMessages = defineTranslation({
7
+ meta: {
8
+ key: "video-gen.messages",
9
+ version: "1.0.0",
10
+ domain: "video-gen",
11
+ description: "French translations for the video-gen package",
12
+ owners: ["platform"],
13
+ stability: "experimental"
14
+ },
15
+ locale: "fr",
16
+ fallback: "en",
17
+ messages: {
18
+ "prompt.script.system": {
19
+ value: `Vous \xEAtes un r\xE9dacteur de scripts de narration vid\xE9o.
20
+ \xC9crivez un script de narration pour une courte vid\xE9o (30-60 secondes).
21
+ {styleGuide}
22
+
23
+ Retournez du JSON avec la forme\xA0:
24
+ {
25
+ "segments": [{ "sceneId": string, "text": string }],
26
+ "fullText": string
27
+ }
28
+
29
+ Les identifiants de sc\xE8ne doivent \xEAtre\xA0: "intro", "problems", "solutions", "metrics", "cta".
30
+ N'incluez que les segments pertinents au brief.`,
31
+ description: "Script generator LLM system prompt",
32
+ placeholders: [{ name: "styleGuide", type: "string" }]
33
+ },
34
+ "prompt.scenePlanner.system": {
35
+ value: `Vous \xEAtes un planificateur de sc\xE8nes vid\xE9o pour les vid\xE9os marketing/documentation de ContractSpec.
36
+ \xC0 partir d'un brief, d\xE9composez-le en sc\xE8nes vid\xE9o.
37
+
38
+ Chaque sc\xE8ne doit avoir\xA0:
39
+ - compositionId\xA0: un parmi "ApiOverview", "SocialClip", "TerminalDemo"
40
+ - props\xA0: les propri\xE9t\xE9s d'entr\xE9e de cette composition
41
+ - durationInFrames\xA0: dur\xE9e \xE0 {fps}\xA0fps
42
+ - narrationText\xA0: ce que le narrateur dit pendant cette sc\xE8ne
43
+
44
+ Retournez un objet JSON avec la forme\xA0:
45
+ {
46
+ "scenes": [{ "compositionId": string, "props": object, "durationInFrames": number, "narrationText": string }],
47
+ "narrationScript": string
48
+ }
49
+
50
+ Gardez la dur\xE9e totale autour de {targetSeconds} secondes.
51
+ Privil\xE9giez la clart\xE9 et le rythme. Chaque sc\xE8ne doit communiquer une id\xE9e.`,
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: "Utilisez un ton clair, autoritaire et professionnel. Soyez concis et direct.",
60
+ description: "Style guide for professional narration"
61
+ },
62
+ "prompt.style.casual": {
63
+ value: "Utilisez un ton amical et conversationnel. Soyez accessible et proche.",
64
+ description: "Style guide for casual narration"
65
+ },
66
+ "prompt.style.technical": {
67
+ value: "Utilisez un langage technique pr\xE9cis. Soyez d\xE9taill\xE9 et exact.",
68
+ description: "Style guide for technical narration"
69
+ },
70
+ "script.segment.challenge": {
71
+ value: "Le d\xE9fi\xA0: {content}",
72
+ description: "Narration segment prefix for problems",
73
+ placeholders: [{ name: "content", type: "string" }]
74
+ },
75
+ "script.segment.solution": {
76
+ value: "La solution\xA0: {content}",
77
+ description: "Narration segment prefix for solutions",
78
+ placeholders: [{ name: "content", type: "string" }]
79
+ },
80
+ "script.segment.results": {
81
+ value: "Les r\xE9sultats\xA0: {content}",
82
+ description: "Narration segment prefix for metrics",
83
+ placeholders: [{ name: "content", type: "string" }]
84
+ },
85
+ "scene.cta.default": {
86
+ value: "En savoir plus",
87
+ description: "Default call-to-action text for scenes"
88
+ },
89
+ "scene.hook.problem": {
90
+ value: "Le probl\xE8me",
91
+ description: "Scene hook label for problem statement"
92
+ },
93
+ "scene.narration.problem": {
94
+ value: "Le probl\xE8me\xA0: {content}",
95
+ description: "Scene narration for problem statement",
96
+ placeholders: [{ name: "content", type: "string" }]
97
+ },
98
+ "scene.hook.solution": {
99
+ value: "La solution",
100
+ description: "Scene hook label for solution"
101
+ },
102
+ "scene.narration.solution": {
103
+ value: "La solution\xA0: {content}",
104
+ description: "Scene narration for solution",
105
+ placeholders: [{ name: "content", type: "string" }]
106
+ },
107
+ "scene.hook.results": {
108
+ value: "R\xE9sultats",
109
+ description: "Scene hook label for results/metrics"
110
+ },
111
+ "composition.apiOverview.generates": {
112
+ value: "G\xE9n\xE8re\xA0:",
113
+ description: "ApiOverview heading for generated outputs"
114
+ },
115
+ "composition.apiOverview.tagline": {
116
+ value: "Un spec. Toutes les surfaces.",
117
+ description: "ApiOverview default tagline"
118
+ },
119
+ "composition.apiOverview.output.rest": {
120
+ value: "Endpoint REST",
121
+ description: "Generated output label: REST"
122
+ },
123
+ "composition.apiOverview.output.graphql": {
124
+ value: "Mutation GraphQL",
125
+ description: "Generated output label: GraphQL"
126
+ },
127
+ "composition.apiOverview.output.prisma": {
128
+ value: "Mod\xE8le Prisma",
129
+ description: "Generated output label: Prisma"
130
+ },
131
+ "composition.apiOverview.output.typescript": {
132
+ value: "SDK TypeScript",
133
+ description: "Generated output label: TypeScript SDK"
134
+ },
135
+ "composition.apiOverview.output.mcp": {
136
+ value: "Outil MCP",
137
+ description: "Generated output label: MCP Tool"
138
+ },
139
+ "composition.apiOverview.output.openapi": {
140
+ value: "Spec OpenAPI",
141
+ description: "Generated output label: OpenAPI"
142
+ },
143
+ "composition.socialClip.cta": {
144
+ value: "En savoir plus",
145
+ description: "SocialClip default CTA"
146
+ },
147
+ "composition.terminal.title": {
148
+ value: "Terminal",
149
+ description: "TerminalDemo default window title"
150
+ }
151
+ }
152
+ });
153
+ export {
154
+ frMessages
155
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Translation catalog barrel exports.
3
+ *
4
+ * @module i18n/catalogs
5
+ */
6
+ export { enMessages } from './en';
7
+ export { frMessages } from './fr';
8
+ export { esMessages } from './es';