@mevdragon/vidfarm-devcli 0.2.11 → 0.2.13

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 (199) hide show
  1. package/.env.example +37 -1
  2. package/README.md +27 -183
  3. package/SKILL.director.md +293 -0
  4. package/SKILL.platform.md +312 -0
  5. package/auto-create-hyperframe-templates/AUTO_CREATE_HYPERFRAME_TEMPLATES.md +275 -0
  6. package/auto-create-hyperframe-templates/extractor-system-prompt.md +128 -0
  7. package/auto-create-hyperframe-templates/input-manifest.schema.json +56 -0
  8. package/auto-create-hyperframe-templates/lambda-memory-estimator.md +118 -0
  9. package/auto-create-hyperframe-templates/production-graph.schema.json +314 -0
  10. package/auto-create-hyperframe-templates/runbook.md +198 -0
  11. package/auto-create-hyperframe-templates/scripts/create-hyperframe-template.mjs +368 -0
  12. package/auto-create-hyperframe-templates/template-plan.schema.json +311 -0
  13. package/auto-create-hyperframe-templates/template-planner-prompt.md +144 -0
  14. package/auto-create-templates/AUTO_CREATE_TEMPLATES.md +124 -0
  15. package/auto-create-templates/extractor-system-prompt.md +8 -2
  16. package/auto-create-templates/template-plan.schema.json +73 -2
  17. package/auto-create-templates/template-planner-prompt.md +63 -1
  18. package/dist/src/account-pages-legacy.js +361 -89
  19. package/dist/src/account-pages-legacy.js.map +1 -0
  20. package/dist/src/account-pages.js +13 -3
  21. package/dist/src/account-pages.js.map +1 -0
  22. package/dist/src/app.js +7060 -946
  23. package/dist/src/app.js.map +1 -0
  24. package/dist/src/cli.js +111 -29
  25. package/dist/src/cli.js.map +1 -0
  26. package/dist/src/composition-runtime.js +581 -0
  27. package/dist/src/composition-runtime.js.map +1 -0
  28. package/dist/src/config.js +69 -11
  29. package/dist/src/config.js.map +1 -0
  30. package/dist/src/context.js +280 -21
  31. package/dist/src/context.js.map +1 -0
  32. package/dist/src/dev-app-legacy.js +18 -17
  33. package/dist/src/dev-app-legacy.js.map +1 -0
  34. package/dist/src/dev-app.js +1 -0
  35. package/dist/src/dev-app.js.map +1 -0
  36. package/dist/src/domain.js +2 -1
  37. package/dist/src/domain.js.map +1 -0
  38. package/dist/src/editor-chat-history.js +10 -0
  39. package/dist/src/editor-chat-history.js.map +1 -0
  40. package/dist/src/editor-chat.js +133 -24
  41. package/dist/src/editor-chat.js.map +1 -0
  42. package/dist/src/frontend/flockposter-cache-store.js +10 -2
  43. package/dist/src/frontend/flockposter-cache-store.js.map +1 -0
  44. package/dist/src/frontend/homepage-client.js +6 -3
  45. package/dist/src/frontend/homepage-client.js.map +1 -0
  46. package/dist/src/frontend/homepage-shared.js +1 -0
  47. package/dist/src/frontend/homepage-shared.js.map +1 -0
  48. package/dist/src/frontend/homepage-store.js +1 -0
  49. package/dist/src/frontend/homepage-store.js.map +1 -0
  50. package/dist/src/frontend/homepage-view.js +131 -18
  51. package/dist/src/frontend/homepage-view.js.map +1 -0
  52. package/dist/src/frontend/page-runtime-client.js +5 -2
  53. package/dist/src/frontend/page-runtime-client.js.map +1 -0
  54. package/dist/src/frontend/page-runtime-store.js +1 -0
  55. package/dist/src/frontend/page-runtime-store.js.map +1 -0
  56. package/dist/src/frontend/sentry.js +42 -0
  57. package/dist/src/frontend/sentry.js.map +1 -0
  58. package/dist/src/frontend/template-editor-chat.js +1719 -213
  59. package/dist/src/frontend/template-editor-chat.js.map +1 -0
  60. package/dist/src/help-page.js +333 -0
  61. package/dist/src/help-page.js.map +1 -0
  62. package/dist/src/homepage.js +169 -47
  63. package/dist/src/homepage.js.map +1 -0
  64. package/dist/src/hyperframes/composition.js +180 -0
  65. package/dist/src/hyperframes/composition.js.map +1 -0
  66. package/dist/src/index.js +1 -0
  67. package/dist/src/index.js.map +1 -0
  68. package/dist/src/instrument.js +30 -0
  69. package/dist/src/instrument.js.map +1 -0
  70. package/dist/src/lib/crypto.js +1 -0
  71. package/dist/src/lib/crypto.js.map +1 -0
  72. package/dist/src/lib/dev-log.js +54 -0
  73. package/dist/src/lib/dev-log.js.map +1 -0
  74. package/dist/src/lib/display-name.js +11 -0
  75. package/dist/src/lib/display-name.js.map +1 -0
  76. package/dist/src/lib/ids.js +21 -1
  77. package/dist/src/lib/ids.js.map +1 -0
  78. package/dist/src/lib/images.js +1 -0
  79. package/dist/src/lib/images.js.map +1 -0
  80. package/dist/src/lib/json.js +1 -0
  81. package/dist/src/lib/json.js.map +1 -0
  82. package/dist/src/lib/template-dna.js +1 -0
  83. package/dist/src/lib/template-dna.js.map +1 -0
  84. package/dist/src/lib/template-paths.js +1 -0
  85. package/dist/src/lib/template-paths.js.map +1 -0
  86. package/dist/src/lib/template-style-options.js +40 -2
  87. package/dist/src/lib/template-style-options.js.map +1 -0
  88. package/dist/src/lib/time.js +1 -0
  89. package/dist/src/lib/time.js.map +1 -0
  90. package/dist/src/lib/video-quality-harness.js +60 -0
  91. package/dist/src/lib/video-quality-harness.js.map +1 -0
  92. package/dist/src/page-runtime.js +1 -0
  93. package/dist/src/page-runtime.js.map +1 -0
  94. package/dist/src/page-shell.js +1501 -49
  95. package/dist/src/page-shell.js.map +1 -0
  96. package/dist/src/primitive-context.js +144 -8
  97. package/dist/src/primitive-context.js.map +1 -0
  98. package/dist/src/primitive-registry.js +1919 -78
  99. package/dist/src/primitive-registry.js.map +1 -0
  100. package/dist/src/primitive-sdk.js +1 -0
  101. package/dist/src/primitive-sdk.js.map +1 -0
  102. package/dist/src/primitives/remotion/html-image.js +3 -1
  103. package/dist/src/primitives/remotion/html-image.js.map +1 -0
  104. package/dist/src/primitives/remotion/media-slideshow.js +60 -0
  105. package/dist/src/primitives/remotion/media-slideshow.js.map +1 -0
  106. package/dist/src/react-page-shell.js +1 -0
  107. package/dist/src/react-page-shell.js.map +1 -0
  108. package/dist/src/ready-post-schedule-component.js +1 -0
  109. package/dist/src/ready-post-schedule-component.js.map +1 -0
  110. package/dist/src/registry.js +237 -24
  111. package/dist/src/registry.js.map +1 -0
  112. package/dist/src/runtime.js +3 -0
  113. package/dist/src/runtime.js.map +1 -0
  114. package/dist/src/services/api-call-history.js +4 -0
  115. package/dist/src/services/api-call-history.js.map +1 -0
  116. package/dist/src/services/auth.js +40 -50
  117. package/dist/src/services/auth.js.map +1 -0
  118. package/dist/src/services/billing.js +20 -44
  119. package/dist/src/services/billing.js.map +1 -0
  120. package/dist/src/services/chat-threads.js +10 -6
  121. package/dist/src/services/chat-threads.js.map +1 -0
  122. package/dist/src/services/fork-access.js +94 -0
  123. package/dist/src/services/fork-access.js.map +1 -0
  124. package/dist/src/services/ghostcut.js +132 -0
  125. package/dist/src/services/ghostcut.js.map +1 -0
  126. package/dist/src/services/hyperframes.js +1014 -0
  127. package/dist/src/services/hyperframes.js.map +1 -0
  128. package/dist/src/services/job-capacity.js +14 -0
  129. package/dist/src/services/job-capacity.js.map +1 -0
  130. package/dist/src/services/job-logs.js +4 -0
  131. package/dist/src/services/job-logs.js.map +1 -0
  132. package/dist/src/services/jobs.js +99 -91
  133. package/dist/src/services/jobs.js.map +1 -0
  134. package/dist/src/services/media-processing.js +743 -0
  135. package/dist/src/services/media-processing.js.map +1 -0
  136. package/dist/src/services/primitive-media-lambda.js +280 -0
  137. package/dist/src/services/primitive-media-lambda.js.map +1 -0
  138. package/dist/src/services/providers.js +1560 -178
  139. package/dist/src/services/providers.js.map +1 -0
  140. package/dist/src/services/rate-limits.js +3 -2
  141. package/dist/src/services/rate-limits.js.map +1 -0
  142. package/dist/src/services/remotion.js +495 -92
  143. package/dist/src/services/remotion.js.map +1 -0
  144. package/dist/src/services/serverless-auth.js +374 -0
  145. package/dist/src/services/serverless-auth.js.map +1 -0
  146. package/dist/src/services/serverless-jobs.js +1074 -0
  147. package/dist/src/services/serverless-jobs.js.map +1 -0
  148. package/dist/src/services/serverless-provider-keys.js +401 -0
  149. package/dist/src/services/serverless-provider-keys.js.map +1 -0
  150. package/dist/src/services/serverless-records.js +1086 -0
  151. package/dist/src/services/serverless-records.js.map +1 -0
  152. package/dist/src/services/serverless-template-configs.js +67 -0
  153. package/dist/src/services/serverless-template-configs.js.map +1 -0
  154. package/dist/src/services/storage.js +170 -35
  155. package/dist/src/services/storage.js.map +1 -0
  156. package/dist/src/services/template-certification.js +295 -3
  157. package/dist/src/services/template-certification.js.map +1 -0
  158. package/dist/src/services/template-loader.js +45 -1
  159. package/dist/src/services/template-loader.js.map +1 -0
  160. package/dist/src/services/template-runtime-bundles.js +217 -0
  161. package/dist/src/services/template-runtime-bundles.js.map +1 -0
  162. package/dist/src/services/template-sources.js +452 -87
  163. package/dist/src/services/template-sources.js.map +1 -0
  164. package/dist/src/services/video-normalization.js +2 -0
  165. package/dist/src/services/video-normalization.js.map +1 -0
  166. package/dist/src/services/webhooks.js +7 -6
  167. package/dist/src/services/webhooks.js.map +1 -0
  168. package/dist/src/template-editor-pages.js +5637 -1322
  169. package/dist/src/template-editor-pages.js.map +1 -0
  170. package/dist/src/template-editor-shell.js +1376 -170
  171. package/dist/src/template-editor-shell.js.map +1 -0
  172. package/dist/src/template-sdk.js +1 -0
  173. package/dist/src/template-sdk.js.map +1 -0
  174. package/dist/src/worker.js +11 -226
  175. package/dist/src/worker.js.map +1 -0
  176. package/package.json +47 -12
  177. package/public/assets/homepage-client-app.js +34 -8
  178. package/public/assets/page-runtime-client-app.js +44 -18
  179. package/readme.secret.md +89 -0
  180. package/templates/vidfarm_template_0000/README.md +106 -0
  181. package/templates/vidfarm_template_0000/SKILL.md +266 -0
  182. package/templates/vidfarm_template_0000/assets/Abel-Regular.ttf +0 -0
  183. package/templates/vidfarm_template_0000/assets/DMSerifDisplay-Regular.ttf +0 -0
  184. package/templates/vidfarm_template_0000/assets/Montserrat[wght].ttf +0 -0
  185. package/templates/vidfarm_template_0000/assets/SourceCodePro[wght].ttf +0 -0
  186. package/templates/vidfarm_template_0000/assets/TikTokSans-SemiBold.ttf +0 -0
  187. package/templates/vidfarm_template_0000/assets/Yesteryear-Regular.ttf +0 -0
  188. package/templates/vidfarm_template_0000/composition.json +11 -0
  189. package/templates/vidfarm_template_0000/src/lib/images.js +221 -0
  190. package/templates/vidfarm_template_0000/src/remotion/Root.js +33 -0
  191. package/templates/vidfarm_template_0000/src/remotion/index.js +3 -0
  192. package/templates/vidfarm_template_0000/src/sdk.js +3 -0
  193. package/templates/vidfarm_template_0000/src/style-options.js +200 -0
  194. package/templates/vidfarm_template_0000/src/template-dna.js +9 -0
  195. package/templates/vidfarm_template_0000/src/template.js +1566 -0
  196. package/templates/vidfarm_template_0000/template.config.json +21 -0
  197. package/GETTING_STARTED.developers.md +0 -87
  198. package/SKILL.developer.md +0 -1177
  199. package/dist/src/db.js +0 -2007
@@ -0,0 +1,311 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "HyperFrame Template Plan",
4
+ "type": "object",
5
+ "required": [
6
+ "template",
7
+ "composition",
8
+ "source_assets",
9
+ "layers",
10
+ "caption_layout",
11
+ "editor_behavior",
12
+ "lambda",
13
+ "deployment",
14
+ "artifacts",
15
+ "validation",
16
+ "implementation_files"
17
+ ],
18
+ "properties": {
19
+ "template": {
20
+ "type": "object",
21
+ "required": ["slug_id", "title", "description", "source_folder", "source_type"],
22
+ "properties": {
23
+ "slug_id": { "type": "string" },
24
+ "title": { "type": "string" },
25
+ "description": { "type": "string" },
26
+ "source_folder": { "type": "string" },
27
+ "source_type": { "enum": ["single_video", "scene_split_video", "slideshow", "mixed_media"] },
28
+ "viral_dna": { "type": "object" },
29
+ "visual_dna": { "type": "object" }
30
+ },
31
+ "additionalProperties": false
32
+ },
33
+ "composition": {
34
+ "type": "object",
35
+ "required": ["composition_id", "width", "height", "fps", "duration_seconds", "background_color", "root_attributes"],
36
+ "properties": {
37
+ "composition_id": { "type": "string" },
38
+ "width": { "type": "integer", "minimum": 1 },
39
+ "height": { "type": "integer", "minimum": 1 },
40
+ "fps": { "type": "number", "minimum": 1 },
41
+ "duration_seconds": { "type": "number", "minimum": 0 },
42
+ "background_color": { "type": "string" },
43
+ "root_attributes": {
44
+ "type": "array",
45
+ "items": { "type": "string" }
46
+ }
47
+ },
48
+ "additionalProperties": false
49
+ },
50
+ "source_assets": {
51
+ "type": "array",
52
+ "items": { "$ref": "#/$defs/sourceAsset" }
53
+ },
54
+ "layers": {
55
+ "type": "array",
56
+ "items": { "$ref": "#/$defs/layer" }
57
+ },
58
+ "caption_layout": {
59
+ "type": "object",
60
+ "required": ["safe_areas", "default_style", "surfaces", "rules"],
61
+ "properties": {
62
+ "safe_areas": { "$ref": "#/$defs/safeAreas" },
63
+ "default_style": { "$ref": "#/$defs/textStyle" },
64
+ "surfaces": {
65
+ "type": "array",
66
+ "items": {
67
+ "type": "object",
68
+ "required": ["id", "layer_ids", "geometry", "rules"],
69
+ "properties": {
70
+ "id": { "type": "string" },
71
+ "layer_ids": { "type": "array", "items": { "type": "string" } },
72
+ "geometry": { "$ref": "#/$defs/geometry" },
73
+ "rules": { "type": "array", "items": { "type": "string" } }
74
+ },
75
+ "additionalProperties": false
76
+ }
77
+ },
78
+ "rules": { "type": "array", "items": { "type": "string" } }
79
+ },
80
+ "additionalProperties": false
81
+ },
82
+ "editor_behavior": {
83
+ "type": "object",
84
+ "required": ["publish_source_of_truth", "track_collision_policy", "delete_scene_test"],
85
+ "properties": {
86
+ "publish_source_of_truth": { "type": "string" },
87
+ "preview_playback_source_allowed": { "type": "boolean" },
88
+ "track_collision_policy": { "type": "string" },
89
+ "delete_scene_test": { "type": "string" }
90
+ },
91
+ "additionalProperties": false
92
+ },
93
+ "lambda": {
94
+ "type": "object",
95
+ "required": ["memory_estimate", "render_defaults"],
96
+ "properties": {
97
+ "memory_estimate": { "$ref": "#/$defs/lambdaMemoryEstimate" },
98
+ "render_defaults": {
99
+ "type": "object",
100
+ "required": ["width", "height", "fps"],
101
+ "properties": {
102
+ "width": { "type": "integer", "minimum": 1 },
103
+ "height": { "type": "integer", "minimum": 1 },
104
+ "fps": { "type": "number", "minimum": 1 }
105
+ },
106
+ "additionalProperties": false
107
+ },
108
+ "estimated_lambda_gb_seconds": { "type": "number", "minimum": 0 },
109
+ "estimated_cost_usd": { "type": "number", "minimum": 0 }
110
+ },
111
+ "additionalProperties": false
112
+ },
113
+ "deployment": {
114
+ "type": "object",
115
+ "required": ["prod_lambda_site", "output_url_policy"],
116
+ "properties": {
117
+ "prod_lambda_site": {
118
+ "type": "object",
119
+ "required": ["schema", "stack_name", "region", "site_id", "project_dir", "composition_file", "memory_mb"],
120
+ "properties": {
121
+ "schema": { "const": "vidfarm.hyperframe.lambda-site.v1" },
122
+ "stack_name": { "type": "string" },
123
+ "region": { "type": "string" },
124
+ "site_id": { "type": ["string", "null"] },
125
+ "project_dir": { "type": "string" },
126
+ "composition_file": { "type": "string" },
127
+ "memory_mb": { "enum": [2048, 3072, 4096, 6144, 8192, 10240] },
128
+ "render_defaults": {
129
+ "type": "object",
130
+ "properties": {
131
+ "width": { "type": "integer", "minimum": 1 },
132
+ "height": { "type": "integer", "minimum": 1 },
133
+ "fps": { "type": "number", "minimum": 1 }
134
+ },
135
+ "additionalProperties": false
136
+ },
137
+ "output_url_policy": { "enum": ["signed_https_final_output_only"] },
138
+ "prestage_site_requested": { "type": "boolean" },
139
+ "site_upload_command": { "type": "string" },
140
+ "site_upload_api": { "type": "string" },
141
+ "site_upload_stdout": { "type": "string" },
142
+ "site_upload_error": { "type": "string" },
143
+ "estimated_lambda_gb_seconds": { "type": "number", "minimum": 0 },
144
+ "estimated_cost_usd": { "type": "number", "minimum": 0 }
145
+ },
146
+ "additionalProperties": false
147
+ },
148
+ "output_url_policy": { "enum": ["signed_https_final_output_only"] }
149
+ },
150
+ "additionalProperties": false
151
+ },
152
+ "artifacts": {
153
+ "type": "object",
154
+ "required": ["files", "decomposition_shape", "lambda_site_shape"],
155
+ "properties": {
156
+ "files": { "type": "array", "items": { "type": "string" } },
157
+ "decomposition_shape": { "type": "object" },
158
+ "lambda_site_shape": { "type": "object" }
159
+ },
160
+ "additionalProperties": false
161
+ },
162
+ "validation": {
163
+ "type": "object",
164
+ "required": ["artifact_checks", "timeline_checks", "publish_checks", "caption_checks", "lambda_checks", "final_output_checks"],
165
+ "properties": {
166
+ "artifact_checks": { "type": "array", "items": { "type": "string" } },
167
+ "timeline_checks": { "type": "array", "items": { "type": "string" } },
168
+ "publish_checks": { "type": "array", "items": { "type": "string" } },
169
+ "caption_checks": { "type": "array", "items": { "type": "string" } },
170
+ "lambda_checks": { "type": "array", "items": { "type": "string" } },
171
+ "final_output_checks": { "type": "array", "items": { "type": "string" } }
172
+ },
173
+ "additionalProperties": false
174
+ },
175
+ "implementation_files": {
176
+ "type": "array",
177
+ "items": {
178
+ "type": "object",
179
+ "required": ["path", "purpose"],
180
+ "properties": {
181
+ "path": { "type": "string" },
182
+ "purpose": { "type": "string" }
183
+ },
184
+ "additionalProperties": false
185
+ }
186
+ }
187
+ },
188
+ "additionalProperties": false,
189
+ "$defs": {
190
+ "sourceAsset": {
191
+ "type": "object",
192
+ "required": ["id", "type", "path"],
193
+ "properties": {
194
+ "id": { "type": "string" },
195
+ "type": { "enum": ["video", "image", "audio", "font", "json", "html"] },
196
+ "path": { "type": "string" },
197
+ "width": { "type": "integer", "minimum": 0 },
198
+ "height": { "type": "integer", "minimum": 0 },
199
+ "duration_seconds": { "type": "number", "minimum": 0 },
200
+ "role": { "type": "string" }
201
+ },
202
+ "additionalProperties": false
203
+ },
204
+ "geometry": {
205
+ "type": "object",
206
+ "required": ["x", "y", "width", "height"],
207
+ "properties": {
208
+ "x": { "type": "number" },
209
+ "y": { "type": "number" },
210
+ "width": { "type": "number", "exclusiveMinimum": 0 },
211
+ "height": { "type": "number", "exclusiveMinimum": 0 },
212
+ "unit": { "const": "percent" }
213
+ },
214
+ "additionalProperties": false
215
+ },
216
+ "safeAreas": {
217
+ "type": "object",
218
+ "properties": {
219
+ "top_percent": { "type": "number", "minimum": 0 },
220
+ "right_percent": { "type": "number", "minimum": 0 },
221
+ "bottom_percent": { "type": "number", "minimum": 0 },
222
+ "left_percent": { "type": "number", "minimum": 0 },
223
+ "notes": { "type": "array", "items": { "type": "string" } }
224
+ },
225
+ "additionalProperties": false
226
+ },
227
+ "textStyle": {
228
+ "type": "object",
229
+ "properties": {
230
+ "font_family": { "type": "string" },
231
+ "font_weight": { "type": "integer" },
232
+ "font_size_px": { "type": "number" },
233
+ "line_height": { "type": "number" },
234
+ "color": { "type": "string" },
235
+ "background": { "type": "string" },
236
+ "background_style": { "enum": ["plain", "outline", "radial_halo", "highlight_solid", "highlight_translucent", "panel"] },
237
+ "text_align": { "enum": ["left", "center", "right"] },
238
+ "max_lines": { "type": "integer", "minimum": 1 }
239
+ },
240
+ "additionalProperties": false
241
+ },
242
+ "layer": {
243
+ "type": "object",
244
+ "required": ["id", "kind", "start", "duration", "track", "z", "mode", "source_of_truth", "geometry", "viral_alignment"],
245
+ "properties": {
246
+ "id": { "type": "string" },
247
+ "kind": { "enum": ["video", "image", "audio", "caption", "html", "shape", "effect"] },
248
+ "start": { "type": "number", "minimum": 0 },
249
+ "duration": { "type": "number", "exclusiveMinimum": 0 },
250
+ "track": { "type": "integer", "minimum": 0 },
251
+ "z": { "type": "integer" },
252
+ "mode": { "enum": ["both", "editor", "publish"] },
253
+ "source_of_truth": { "enum": ["source_media", "deterministic_html", "generated_asset", "user_asset", "computed_effect"] },
254
+ "geometry": { "$ref": "#/$defs/geometry" },
255
+ "media": {
256
+ "type": "object",
257
+ "properties": {
258
+ "src": { "type": "string" },
259
+ "asset_id": { "type": "string" },
260
+ "media_start": { "type": "number", "minimum": 0 },
261
+ "media_end": { "type": "number", "minimum": 0 },
262
+ "fit": { "enum": ["cover", "contain", "fill", "none"] },
263
+ "muted": { "type": "boolean" },
264
+ "volume": { "type": "number", "minimum": 0 }
265
+ },
266
+ "additionalProperties": false
267
+ },
268
+ "text": {
269
+ "type": "object",
270
+ "properties": {
271
+ "content": { "type": "string" },
272
+ "style": { "$ref": "#/$defs/textStyle" }
273
+ },
274
+ "additionalProperties": false
275
+ },
276
+ "html_contract": {
277
+ "type": "object",
278
+ "properties": {
279
+ "description": { "type": "string" },
280
+ "required_classes": { "type": "array", "items": { "type": "string" } },
281
+ "editable_fields": { "type": "array", "items": { "type": "string" } }
282
+ },
283
+ "additionalProperties": false
284
+ },
285
+ "viral_alignment": { "type": "string" },
286
+ "publish_notes": { "type": "string" }
287
+ },
288
+ "additionalProperties": false
289
+ },
290
+ "lambdaMemoryEstimate": {
291
+ "type": "object",
292
+ "required": ["recommended_memory_mb", "confidence", "complexity_scores", "rationale", "risk_flags"],
293
+ "properties": {
294
+ "recommended_memory_mb": { "enum": [2048, 3072, 4096, 6144, 8192, 10240] },
295
+ "confidence": { "enum": ["low", "medium", "high"] },
296
+ "complexity_scores": { "type": "object", "additionalProperties": { "type": ["number", "integer", "string", "boolean"] } },
297
+ "rationale": { "type": "string" },
298
+ "risk_flags": { "type": "array", "items": { "type": "string" } },
299
+ "benchmark_override": {
300
+ "type": ["object", "null"],
301
+ "properties": {
302
+ "memory_mb": { "enum": [2048, 3072, 4096, 6144, 8192, 10240] },
303
+ "reason": { "type": "string" }
304
+ },
305
+ "additionalProperties": false
306
+ }
307
+ },
308
+ "additionalProperties": false
309
+ }
310
+ }
311
+ }
@@ -0,0 +1,144 @@
1
+ # HyperFrame Template Planner Prompt
2
+
3
+ You are a senior HyperFrames composition engineer.
4
+
5
+ Given a HyperFrames production graph, produce a concrete implementation plan for `composition.html`, `composition.json`, and `lambda-site.json`. Return only JSON matching `template-plan.schema.json`.
6
+
7
+ ## Planning Rules
8
+
9
+ - The output is an editable HyperFrames project, not a Vidfarm operation package.
10
+ - Persist the source format's viral and visual rules inside `composition.json`.
11
+ - Use deterministic HTML/CSS for captions, text, app UI, comments, notifications, overlays, shapes, and simple graphics.
12
+ - Use timed media layers for MP4 scenes and image slides.
13
+ - Separate source audio from source video when audio should continue across cuts.
14
+ - Do not use a permanent background video as the publish source of truth.
15
+ - If an editor-only playback source is included, mark it `mode: "editor"` or `preview_only: true`.
16
+ - Publish-visible media must be represented by timed layers with explicit start/duration.
17
+ - Empty timeline ranges are valid and should render background only.
18
+ - Use percent geometry for layout and seconds for timing.
19
+ - Use approved font families where possible: `TikTok Sans`, `Montserrat`, `Source Code Pro`, `Georgia`, `Abel`, or a documented custom font.
20
+ - Important readable text must be deterministic unless the source format explicitly depends on poster/artifact-native generated text.
21
+ - Include safe-area rules for TikTok/Reels vertical output.
22
+ - Include Lambda memory estimate and production site metadata.
23
+ - The frontend publish UX should expose the final signed output URL only, not S3 Console or Step Functions Console links.
24
+
25
+ ## Required Output Content
26
+
27
+ The plan must include:
28
+
29
+ - template metadata
30
+ - source asset inventory
31
+ - HyperFrames composition root settings
32
+ - layer list
33
+ - caption layout rules
34
+ - safe-area rules
35
+ - editor behavior rules
36
+ - Lambda memory estimate
37
+ - production Lambda site metadata
38
+ - artifact manifest shape
39
+ - validation checklist
40
+ - implementation files to create
41
+
42
+ ## Composition HTML Requirements
43
+
44
+ The root element should include:
45
+
46
+ - `data-composition-id`
47
+ - `data-source-folder`
48
+ - `data-width`
49
+ - `data-height`
50
+ - `data-duration`
51
+
52
+ Layer elements should include:
53
+
54
+ - `data-hf-id`
55
+ - `data-layer-kind`
56
+ - `data-layer-mode`
57
+ - `data-start`
58
+ - `data-duration`
59
+ - `data-track-index`
60
+ - `data-label`
61
+
62
+ Media slices should include:
63
+
64
+ - `data-media-start`
65
+ - `data-playback-start`
66
+ - `src` or `data-src`
67
+
68
+ For timeline proxies, include:
69
+
70
+ - `data-vf-timeline-proxy="video"`
71
+ - `data-src`
72
+
73
+ The publish path must normalize proxies into real timed `<video>` elements.
74
+
75
+ ## Decomposition JSON Requirements
76
+
77
+ The manifest should include:
78
+
79
+ - `schema: "vidfarm.hyperframe-decomposition.v1"`
80
+ - `source_folder`
81
+ - `source_type`
82
+ - `created_at`
83
+ - `source_assets`
84
+ - `summary`
85
+ - `viral_dna`
86
+ - `visual_dna`
87
+ - `editor_layers`
88
+ - `caption_layout`
89
+ - `lambda_memory_estimate`
90
+ - `lambda_site`
91
+ - `validation`
92
+
93
+ Use the same layer IDs in `composition.json` and `composition.html`.
94
+
95
+ ## Lambda Site Requirements
96
+
97
+ Create `lambda-site.json` with:
98
+
99
+ - `schema: "vidfarm.hyperframe.lambda-site.v1"`
100
+ - `stack_name`
101
+ - `region`
102
+ - `site_id`
103
+ - `project_dir`
104
+ - `composition_file`
105
+ - `memory_mb`
106
+ - `render_defaults`
107
+ - `output_url_policy`
108
+ - `site_upload_command` or SDK equivalent when `site_id` is null
109
+
110
+ Default stack settings:
111
+
112
+ - stack: `hyperframes-vidfarm-prod`
113
+ - region: `us-east-1`
114
+ - memory: `3072`
115
+
116
+ The plan may recommend `2048`, `4096`, or higher when justified by the memory estimator.
117
+
118
+ ## Lambda Memory Planning
119
+
120
+ Use `lambda-memory-estimator.md` and return:
121
+
122
+ - `recommended_memory_mb`
123
+ - `estimated_lambda_gb_seconds`
124
+ - `estimated_cost_usd`
125
+ - `confidence`
126
+ - `rationale`
127
+ - `risk_flags`
128
+ - `benchmark_override`
129
+
130
+ Use `3072` MB as the ordinary social-video baseline. Prefer lowering to `2048` only for simple static/slideshow cases or measured lightweight video. Prefer raising to `4096` when active video decode, resolution, or effects justify it.
131
+
132
+ ## Validation Gates
133
+
134
+ The plan is not complete unless it defines:
135
+
136
+ - artifact checks
137
+ - timeline checks
138
+ - layer publish checks
139
+ - caption/safe-area checks
140
+ - Lambda deployment checks
141
+ - final output checks
142
+
143
+ Include a specific test for deleting or disabling one video scene and confirming the final render shows background/overlay only during that time range.
144
+
@@ -37,6 +37,16 @@ The core idea is to avoid asking an agent to "clone this video" in one prompt. T
37
37
 
38
38
  Supporting harness files live beside this entry file in [auto-create-templates](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/auto-create-templates).
39
39
 
40
+ ## Cacheable Context
41
+
42
+ When `vidfarm-devcli autocreate-template` creates a run, it snapshots this harness and the root `SKILL.developer.md` into the run folder. Treat both files as stable, cacheable prompt context:
43
+
44
+ 1. read `harness/SKILL.developer.md` first
45
+ 2. read `harness/AUTO_CREATE_TEMPLATES.md` and the supporting harness prompt/schema files next
46
+ 3. only then load run-specific source media notes, analyzer outputs, DNA JSON, OCR, transcripts, and production graph artifacts
47
+
48
+ Keep that order in agent prompts and implementation passes. The developer skill and harness should form the stable prompt prefix so provider-side prompt caching can reuse them across repeated auto-create runs.
49
+
40
50
  ## Sample Read
41
51
 
42
52
  I sampled the local drafts across the spectrum:
@@ -196,6 +206,8 @@ The generated template must persist this decision in:
196
206
 
197
207
  - `about.viral_dna`
198
208
  - `about.visual_dna`
209
+ - `about.links_to_inspiration`
210
+ - `about.sound`
199
211
  - `about.proposal_generator`
200
212
  - `about.skeleton_prompt`
201
213
  - `sample_prompts`
@@ -299,6 +311,8 @@ Run [template-planner-prompt.md](/Users/localghost/Projects/OfficeX/OfficeX/Zoom
299
311
  - slug and title
300
312
  - `about.viral_dna`
301
313
  - `about.visual_dna`
314
+ - `about.links_to_inspiration`
315
+ - `about.sound`
302
316
  - `about.proposal_generator`
303
317
  - `about.skeleton_prompt`
304
318
  - `about.sample_prompts`
@@ -339,12 +353,60 @@ Then implement from the plan:
339
353
  - timing parameters are exposed when useful instead of being buried as constants; at minimum support `duration_ms` per scene/slide/media slot and sensible min/max clamping
340
354
  - caption/font parameters prefer TikTok-native defaults and can be configured when the format's recognizability depends on typography
341
355
  - generated media goes through `ctx.storage`
356
+ - `ctx.storage` keys are job-relative only, such as `backgrounds/slide-01.png`, `slides/slide-01.png`, `audio/narration.wav`, `renders/final.mp4`, or `manifests/run.json`
357
+ - do not generate absolute platform storage keys like `templates/${templateId}/users/${ctx.customer.id}/...`; hosted Vidfarm prefixes template job artifacts automatically
358
+ - do not import the AWS SDK, create S3 clients, mutate `process.env.AWS_*`, or read `REMOTION_AWS_*` in template code
342
359
  - video render props reference artifact URLs, not base64
343
360
  - Remotion is used only where it is the right tool: deterministic layout, captions, overlays, timing, simple motion, and final edit
344
361
  - if the format exceeds Remotion's practical complexity ceiling, preserve it as an AI-native prompt/reference template and use Remotion only for optional wrapping, captions, or stitching
345
362
  - image/video providers are used for assets that cannot be deterministically composed
363
+ - provider/model recommendations from `SKILL.developer.md` are persisted in the template-local `SKILL.md` and near the top of `src/template.ts` as a checked-in constant or clearly named comment block
364
+ - generated templates must not set a fixed `providerHint`, hidden provider fallback, or operation payload default that can strand jobs when the customer lacks that provider key. Operations should be provider-agnostic where possible and must call `ctx.providers.*` so platform provider resolution runs before AI generation.
365
+ - provider preferences are saved template config, not operation payload defaults. Keep operation provider fields optional explicit overrides, and express provider preference as payload override -> saved config -> platform-compatible fallback from available customer keys -> documented failure.
366
+ - do not generate schemas like `provider: z.enum(...).default("gemini")`, `tts_provider: z.enum(...).default("openai")`, or `transcription_provider: z.enum(...).default(...)` inside operation input schemas.
367
+ - do not generate parser helpers that silently return `"gemini"`, `"openai"`, or `"openrouter"` when config is missing unless the downstream `ctx.providers.*` call can still fall back to another compatible saved customer key.
368
+ - avoid generating `defaultProvider: z.enum(...).default("openai")` or similar fixed config defaults unless the job still falls back to another compatible saved provider key when that default is unavailable
369
+ - OpenAI image calls must use only supported `size` values: `1024x1024`, `1536x1024`, `1024x1536`, `2048x2048`, `2048x1152`, `3840x2160`, `2160x3840`, or `auto`
370
+ - Gemini image calls must use `aspectRatio` from `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `21:9`, or `9:21`, plus `imageSize` from `1K`, `2K`, or `4K`; do not pass arbitrary pixel sizes to Gemini
371
+ - translate requested framing into the selected provider's supported size fields at call time, especially when fallback can switch providers
346
372
  - template-local `SKILL.md` must describe operations, payloads, provider caveats, and examples
347
373
 
374
+ Recommended baseline models, unless the template has an explicit reason to differ:
375
+
376
+ ```ts
377
+ const TEMPLATE_PROVIDER_RECOMMENDATIONS = {
378
+ text: {
379
+ openai: "gpt-5.4",
380
+ gemini: "gemini-3.1-flash-lite",
381
+ openrouter: "qwen/qwen3.6-flash"
382
+ },
383
+ layout_analysis: {
384
+ openai: "gpt-5.4",
385
+ gemini: "gemini-3.1-flash-lite",
386
+ openrouter: "qwen/qwen3.6-flash"
387
+ },
388
+ image: {
389
+ openai: "gpt-image-2",
390
+ gemini: "gemini-3-pro-image-preview",
391
+ openrouter: "google/gemini-3.1-flash-image-preview"
392
+ },
393
+ video: {
394
+ openai: "sora-2",
395
+ gemini: "veo-3.0-generate-001"
396
+ },
397
+ tts: {
398
+ openai: "gpt-4o-mini-tts-2025-12-15",
399
+ gemini: "gemini-3.1-flash-tts-preview",
400
+ openrouter: "google/gemini-3.1-flash-tts-preview"
401
+ },
402
+ stt: {
403
+ openai: "gpt-4o-mini-transcribe-2025-12-15",
404
+ gemini: "gemini-3.1-flash-lite-preview",
405
+ openrouter: "openai/gpt-4o-mini-transcribe"
406
+ }
407
+ } as const;
408
+ ```
409
+
348
410
  Validate:
349
411
 
350
412
  ```bash
@@ -381,6 +443,55 @@ Every video-producing template should make timing explicit. The default input sh
381
443
 
382
444
  Every captioned template should strongly prefer TikTok-native typography. Use checked-in fonts when available, especially `TikTokSans-SemiBold.ttf` from the reference template assets, with practical fallbacks such as Montserrat or system sans. Expose caption styling in config only where it is useful; otherwise default to the closest source-matching TikTok style.
383
445
 
446
+ Caption fonts are an allowlist, not a vibe. New templates should default to these IDs:
447
+
448
+ - `tiktok_sans_semibold` for native TikTok captions, subtitles, and creator-authored overlays
449
+ - `montserrat_semibold` for clean bold social cards and modern overlays
450
+ - `source_code_pro_bold` for code, terminal, receipt, data, and intentionally monospaced formats
451
+ - `georgia_bold` for serif editorial formats
452
+ - `abel` for narrow/condensed UI-like captions
453
+
454
+ Legacy IDs `montserrat` and `source_code_pro` may be accepted for compatibility, but new configs should use the explicit weighted IDs. A `custom` font is an exception, not an option to expose casually. If a custom font is needed, the template plan and `SKILL.md` must name the font, asset path, fallback, role, and why an approved font would damage the source format.
455
+
456
+ Important readable text should normally be deterministic. Do not ask image or video models to render captions, subtitles, app UI labels, prices, claims, CTAs, or product offers when those can be composited after generation. Generate a clean background or scene first, then place text with Remotion, SVG/canvas, or Sharp. Allow AI-rendered text only when the whole format is poster/artifact-native and the validation harness includes OCR/readability checks.
457
+
458
+ Multiline caption renderer requirement:
459
+
460
+ - wrap each caption once, choose one font size and line height for the whole caption block, and render it as one multiline text block
461
+ - do not render each wrapped line as an independently trimmed image; that makes shorter lines look larger or heavier because trim bounds, line height, and shadow placement vary per line
462
+ - apply shadow/outline to the whole multiline block, then composite the block; line chips can be measured per line after the block layout is fixed
463
+ - tune TikTok Sans wrapping, size, and line spacing separately from Montserrat or generic sans defaults
464
+ - validate with mixed-length wrapped captions and confirm both lines retain the same apparent size, weight, baseline rhythm, and shadow strength
465
+
466
+ ## Output Quality Harness
467
+
468
+ Every video-producing or image-producing template should include a quality harness in its plan, manifest, and template-local `SKILL.md`. The point is to reject predictable low-quality outputs before the director burns three full generations.
469
+
470
+ Required report fields:
471
+
472
+ - `viralCompliance`: whether the first-frame hook, retention driver, and payoff still match the source format
473
+ - `visualPreservation`: which critical visual rules passed or failed
474
+ - `fontPolicy`: selected font IDs, custom font exceptions, and generated-vs-deterministic text decisions
475
+ - `captionReadability`: wrap, size, contrast, shadow/outline, and phone-size legibility
476
+ - `safeArea`: TikTok top/right/bottom collision checks for captions and important UI
477
+ - `assetIntegrity`: missing assets, malformed text in generated images, bad crops, or wrong aspect ratios
478
+ - `finalOutput`: artifact URLs, manifest URLs, duration clamps, ending/payoff, and storage boundary checks
479
+ - `retryPlan`: the smallest failed stage to rerun
480
+
481
+ The harness should run in four gates:
482
+
483
+ - Preflight: validate the structured plan before generating expensive assets. The plan must name exact hook text, media slots, caption surfaces, font IDs, timing clamps, and visual preservation rules.
484
+ - Asset check: inspect generated images, clips, audio, and uploaded media before final assembly. Reject bad crops, wrong aspect ratios, AI text artifacts, or missing references here.
485
+ - Composition check: validate deterministic layout. Caption safe area, font allowlist, multiline renderer, chip geometry, and shadow/outline failures are code/config failures, not creative prompt failures.
486
+ - Final check: validate the rendered image or MP4 against the viral DNA, visual preservation contract, duration, storage artifacts, and retry plan.
487
+
488
+ Retry rules:
489
+
490
+ - If font, safe-area, caption wrapping, chip geometry, storage, or Remotion layout fails, fix code/config and rerender. Do not regenerate the whole creative.
491
+ - If one generated asset fails, retry only that asset with stronger references or tighter prompt constraints.
492
+ - If the first-frame hook, story logic, or payoff fails, regenerate the script/plan before spending more image/video generations.
493
+ - If an AI-native style rule fails twice, switch to storyboard/keyframes, better references, or deterministic compositing for the failing surface.
494
+
384
495
  For simple image formats:
385
496
 
386
497
  - `create_image`: exact/director-controlled path
@@ -391,6 +502,12 @@ For slideshow formats:
391
502
  - `create_slides`: returns frames, manifest, and render input
392
503
  - `render_video`: turns frames or mixed media slots into MP4
393
504
 
505
+ For Remotion formats that include remote source footage:
506
+
507
+ - preserve director-supplied media URLs as direct render inputs
508
+ - prefer Remotion `Video` or `@remotion/media` `Video` for remote video playback
509
+ - do not choose `OffthreadVideo` for remote source footage
510
+
394
511
  For complex video formats:
395
512
 
396
513
  - `create_script`: hook, narration/dialogue, beat list
@@ -443,7 +560,14 @@ The graph should separate four layers:
443
560
  - Do not turn copyrighted movie/TV clips into a template dependency. Model those formats as user-supplied clip slots or generate parody-safe replacements.
444
561
  - Do not require AWS, S3, or cloud Remotion setup for local template creation.
445
562
  - Do not write binary media into JSON outputs. Store with `ctx.storage` and return URLs.
563
+ - Do not include hosted platform prefixes in template storage keys. The platform owns `templates/:template_id/users/:user_id/jobs/:job_id/`; templates provide only the artifact path inside the job.
564
+ - Do not use direct AWS/S3 or Remotion credential environment variables in template code. Use `ctx.storage` and `ctx.remotion`.
565
+ - Do not reconstruct hosted storage URLs. Preserve URLs returned by `ctx.storage`, provider uploads, or prior job results, and pass canonical `result.renderVideoInput` objects through to downstream `render_video` operations.
566
+ - Every `ctx.remotion.render(...)` call must include `preflightUrls` for remote media Remotion will load, with field labels such as `slides[2].imageUrl`, `scene_media_url`, or `demo_video_url`.
446
567
  - Do not invent REST endpoints. Use standard Vidfarm operations and jobs.
568
+ - Do not put provider defaults in operation payload schemas. That bypasses saved customer template config and can make the editor agent wait for the wrong provider key.
569
+ - Do not set fixed `providerHint` or hardcoded provider defaults that make an operation wait for OpenAI, Gemini, or another provider when the customer has a different compatible provider saved.
570
+ - Do not send unsupported image dimensions to provider APIs: OpenAI accepts only `1024x1024`, `1536x1024`, `1024x1536`, `2048x2048`, `2048x1152`, `3840x2160`, `2160x3840`, or `auto`; Gemini uses supported `aspectRatio` plus `imageSize` `1K`/`2K`/`4K`, not raw pixel sizes.
447
571
  - Do not treat DNA analysis as sufficient. It explains why and what; the production graph explains how.
448
572
  - Do not bury viral DNA as static `about` text only. It must steer prompts, plans, operation outputs, validation checks, and template usage docs.
449
573
  - Do not preserve visual traits blindly. First decide whether each trait materially supports the viral DNA; then preserve only the traits that matter.