@vanillaskyai/video 0.9.0 → 0.10.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 (39) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{builtin-server-HW6HGXCZ.js → builtin-server-W4PLJUZ5.js} +2 -2
  3. package/dist/check-runtime.js +2 -2
  4. package/dist/{chunk-UDIODEDK.js → chunk-224QNWRA.js} +5 -1
  5. package/dist/{chunk-OR52UMSF.js → chunk-2HFO22K2.js} +2 -1
  6. package/dist/{chunk-MXEYPK7M.js → chunk-4ZJLPHBV.js} +194 -62
  7. package/dist/{chunk-3ZTEFJIR.js → chunk-ELVOT2FQ.js} +1 -1
  8. package/dist/{chunk-LH4BPALA.js → chunk-IIN5M5HW.js} +194 -61
  9. package/dist/{chunk-MQILEEXC.js → chunk-IR44XKBI.js} +1 -1
  10. package/dist/{chunk-G7IZBBWF.js → chunk-NMFDC2W2.js} +3 -10
  11. package/dist/chunk-XX4GXKTX.js +35 -0
  12. package/dist/chunk-Z67Q5KUW.js +16 -0
  13. package/dist/{cinema-media-YQHSIFDA.js → cinema-media-C7OUPNSH.js} +3 -2
  14. package/dist/cli.js +3 -3
  15. package/dist/{comparison-RZMMHZR2.js → comparison-GNZOR7MF.js} +14 -4
  16. package/dist/{editorial-timeline-OZX7OS6G.js → editorial-timeline-EMV5335S.js} +10 -3
  17. package/dist/key-figure-P37VK425.js +30 -0
  18. package/dist/{mobile-message-UZUPIKHD.js → mobile-message-OF7T62B7.js} +3 -2
  19. package/dist/{preload-media-CFTZIMZL.js → preload-media-LJXWKTWG.js} +1 -1
  20. package/dist/quote-T6WYLN7A.js +33 -0
  21. package/dist/react.js +29 -27
  22. package/dist/server.js +97 -19
  23. package/dist/template-catalog.d.ts +154 -19
  24. package/dist/template-catalog.js +1 -1
  25. package/dist/test.js +1 -1
  26. package/docs/customization.md +1 -1
  27. package/docs/maintainers/cinematic-migration.md +4 -0
  28. package/docs/media-and-audio.md +3 -3
  29. package/docs/provider-integration.md +1 -1
  30. package/package.json +1 -1
  31. package/registry/items/comparison.json +71 -4
  32. package/registry/items/editorialTimeline.json +71 -4
  33. package/registry/items/keyFigure.json +69 -4
  34. package/registry/items/quote.json +71 -4
  35. package/starters/video-chat/package.json +1 -1
  36. package/dist/focus-cards-TJ72BT7U.js +0 -20
  37. package/dist/key-figure-GYENXKH3.js +0 -20
  38. package/dist/quote-EW5HQA6H.js +0 -23
  39. package/registry/items/focusCards.json +0 -90
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ VanillaSky follows semantic versioning. This changelog begins with the 0.1 beta.
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.10.0
8
+
9
+ ### Breaking
10
+
11
+ - Remove `focusCards` from the built-in catalog and generated source templates, as requested. Existing callers must replace it with narration over `cinemaMedia`, or an appropriate comparison/timeline when supported by their content. Persisted videos using that ID must be regenerated before playback with the new catalog.
12
+
13
+ ### Changed
14
+
15
+ - Opening narration advances into the first shot and body. Exact repeated introductory sentences are removed without additional model calls or startup waits.
16
+ - Prefer relevant footage over repeated graphic scenes; use no more than one explanatory overlay in a typical thirty-second answer. Comparison, key figure, quote and timeline can now use optional host-resolved media with a contrast scrim and soft text shadows. Black remains the fallback; chapter titles stay black.
17
+
18
+
7
19
  ## 0.9.0
8
20
 
9
21
  - Continue video playback with subtitles when native browser speech cannot start, without weakening generated-audio readiness or counting paused time toward the fallback.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  BUILTIN_SERVER_TEMPLATE_KIT
3
- } from "./chunk-MQILEEXC.js";
4
- import "./chunk-LH4BPALA.js";
3
+ } from "./chunk-IR44XKBI.js";
4
+ import "./chunk-IIN5M5HW.js";
5
5
  import "./chunk-2E6T633S.js";
6
6
  export {
7
7
  BUILTIN_SERVER_TEMPLATE_KIT
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  VideoFrame
3
- } from "./chunk-3ZTEFJIR.js";
4
- import "./chunk-UDIODEDK.js";
3
+ } from "./chunk-ELVOT2FQ.js";
4
+ import "./chunk-224QNWRA.js";
5
5
  import "./chunk-TVIU23OM.js";
6
6
  import "./chunk-SPVTJH3F.js";
7
7
  import "./chunk-R3XAOMKP.js";
@@ -19,8 +19,12 @@ function resolveMediaType(mediaType, mediaUrl) {
19
19
  if (mediaType === "photo") return "photo";
20
20
  return mediaUrl && isVideoUrl(mediaUrl) ? "video" : "photo";
21
21
  }
22
+ function hasSceneMedia(variables) {
23
+ return String(variables.mediaUrl || "").trim() !== "" && String(variables.mediaType || "auto") !== "gradient";
24
+ }
22
25
 
23
26
  export {
24
27
  limitsConcurrentVideoDecoders,
25
- resolveMediaType
28
+ resolveMediaType,
29
+ hasSceneMedia
26
30
  };
@@ -118,7 +118,7 @@ ${options.basePrompt.trim()}` : void 0,
118
118
  "Variable notation is type[count]{characters}(options)! where count is list cardinality, characters is the inclusive character count for a string or each string-array item, and ! means required. Omitted ! means optional.",
119
119
  "Choose a template only when the permitted factual basis contains every fact it needs. Never invent peer values to complete a chart, comparison, stat set, timeline, or list.",
120
120
  ...PACING_PLANNER_RULES,
121
- "Do not compress a list, sequence, metric set, or comparison into a general-purpose prose field when a specific catalog template can show that structure.",
121
+ "Let narration carry ordinary lists. Use a structured overlay only when a comparison, sequence, exact quote or key figure adds understanding beyond the voice. Prefer relevant full-bleed footage for the rest of the explanation.",
122
122
  "If the catalog includes a suitable ask template and the input supplies a grounded CTA or URL, keep that concise action closer as its own final scene instead of folding it into preceding content.",
123
123
  "When a grounded CTA or URL is supplied and the catalog contains jobs:[ask], emit that final closer. A brand name may accompany the action but never qualifies as an ask by itself.",
124
124
  terminalPayoffs.length > 0 ? `When there is no grounded action, end with a concise supported payoff using a suitable template from ${terminalPayoffs.join(", ")}. Do not repeat the hook or invent a CTA.` : void 0,
@@ -127,6 +127,7 @@ ${options.basePrompt.trim()}` : void 0,
127
127
  mediaTemplates.length > 0 && options.mediaOnFirstScene !== true ? `The host owns immediate startup; reserve external media templates (${mediaTemplates.join(", ")}) for later beats when an asset-free opening is required.` : void 0,
128
128
  "For list and event variables emit actual JSON arrays. Follow each field's content budget; never use pipe-delimited strings or invent entries.",
129
129
  resolverMediaAvailable ? "Media-capable scenes may carry mediaKeyword: a literal 2\u20138 word shot description, at most 80 characters. Choose mediaSource=generate for distinctive illustrative shots and mediaSource=stock for common subjects a verified asset can depict. For generated footage, optional shotDirection gives action, framing and continuity separately from the stock query. Keep people, actions and essential details precise. Never broaden an exact identity or action into unrelated atmosphere. Supply a grounded fallbackText where declared. Only the host fills mediaUrl and mediaPoster; never invent them. If no media fits an abstract beat, choose an appropriate graphic template instead." : "Use media only when a supplied asset satisfies the scene. Never invent asset URLs. Otherwise choose a grounded graphic template.",
130
+ "When the catalog offers media, make relevant footage the default. For a typical 30-second answer use at most one structured explanatory overlay plus an optional brief chapter opening. Do not chain graphic-only beats when honest media is available. Reuse suitable supplied media behind overlays with optional media fields; retain black when no relevant asset exists. Never invent a stock match or spend beyond host generation limits.",
130
131
  "Catalog guidance describes composition; it is not a factual source and must never replace the permitted factual basis.",
131
132
  JSON.stringify(plannerCatalog(templates, resolverMediaAvailable)),
132
133
  // Last, because the catalogue is thousands of tokens of per-scene field
@@ -80,31 +80,6 @@ var BUILTIN_TEMPLATE_SCHEMAS = {
80
80
  ],
81
81
  "additionalProperties": false
82
82
  },
83
- "focusCards": {
84
- "type": "object",
85
- "properties": {
86
- "items": {
87
- "type": "array",
88
- "minItems": 2,
89
- "maxItems": 4,
90
- "items": {
91
- "type": "string",
92
- "minLength": 1,
93
- "maxLength": 55
94
- },
95
- "default": [
96
- "Listen closely",
97
- "Notice the pattern",
98
- "Make room for change"
99
- ],
100
- "description": "2\u20134 parallel phrases, about 2\u20136 words each; no heading or numbering."
101
- }
102
- },
103
- "required": [
104
- "items"
105
- ],
106
- "additionalProperties": false
107
- },
108
83
  "editorialTimeline": {
109
84
  "type": "object",
110
85
  "properties": {
@@ -138,12 +113,59 @@ var BUILTIN_TEMPLATE_SCHEMAS = {
138
113
  }
139
114
  ],
140
115
  "description": "3\u20135 ordered events or actions, each with one short label; no dates."
116
+ },
117
+ "mediaKeyword": {
118
+ "type": "string",
119
+ "format": "stock-media-keyword",
120
+ "minLength": 1,
121
+ "maxLength": 80,
122
+ "description": "2\u20138 word literal subject/action search intent, maximum 80 characters. Host resolves URLs.",
123
+ "examples": [
124
+ "Ocean waves breaking on a rocky shore"
125
+ ]
126
+ },
127
+ "mediaUrl": {
128
+ "type": "string",
129
+ "format": "uri",
130
+ "description": "Host-only approved photo or video URL.",
131
+ "default": ""
132
+ },
133
+ "mediaType": {
134
+ "type": "string",
135
+ "enum": [
136
+ "photo",
137
+ "video"
138
+ ],
139
+ "default": "video",
140
+ "description": "Host-resolved asset kind."
141
+ },
142
+ "mediaPoster": {
143
+ "type": "string",
144
+ "format": "uri",
145
+ "description": "Host-only approved poster URL for video decoding.",
146
+ "default": ""
147
+ },
148
+ "shotDirection": {
149
+ "type": "string",
150
+ "maxLength": 220,
151
+ "description": "Optional action, framing and continuity for generation. Preserve the subject; do not request rendered text."
152
+ },
153
+ "mediaSource": {
154
+ "type": "string",
155
+ "enum": [
156
+ "generate",
157
+ "stock"
158
+ ],
159
+ "description": "Generate distinctive illustrative shots; use approved stock for familiar observable subjects."
141
160
  }
142
161
  },
143
162
  "required": [
144
163
  "events"
145
164
  ],
146
- "additionalProperties": false
165
+ "additionalProperties": false,
166
+ "x-vanillasky": {
167
+ "allowsStockMedia": true
168
+ }
147
169
  },
148
170
  "mobileMessage": {
149
171
  "type": "object",
@@ -239,13 +261,60 @@ var BUILTIN_TEMPLATE_SCHEMAS = {
239
261
  "maxLength": 60,
240
262
  "default": "More room to think",
241
263
  "description": "Second real alternative, parallel to the first."
264
+ },
265
+ "mediaKeyword": {
266
+ "type": "string",
267
+ "format": "stock-media-keyword",
268
+ "minLength": 1,
269
+ "maxLength": 80,
270
+ "description": "2\u20138 word literal subject/action search intent, maximum 80 characters. Host resolves URLs.",
271
+ "examples": [
272
+ "Ocean waves breaking on a rocky shore"
273
+ ]
274
+ },
275
+ "mediaUrl": {
276
+ "type": "string",
277
+ "format": "uri",
278
+ "description": "Host-only approved photo or video URL.",
279
+ "default": ""
280
+ },
281
+ "mediaType": {
282
+ "type": "string",
283
+ "enum": [
284
+ "photo",
285
+ "video"
286
+ ],
287
+ "default": "video",
288
+ "description": "Host-resolved asset kind."
289
+ },
290
+ "mediaPoster": {
291
+ "type": "string",
292
+ "format": "uri",
293
+ "description": "Host-only approved poster URL for video decoding.",
294
+ "default": ""
295
+ },
296
+ "shotDirection": {
297
+ "type": "string",
298
+ "maxLength": 220,
299
+ "description": "Optional action, framing and continuity for generation. Preserve the subject; do not request rendered text."
300
+ },
301
+ "mediaSource": {
302
+ "type": "string",
303
+ "enum": [
304
+ "generate",
305
+ "stock"
306
+ ],
307
+ "description": "Generate distinctive illustrative shots; use approved stock for familiar observable subjects."
242
308
  }
243
309
  },
244
310
  "required": [
245
311
  "leftText",
246
312
  "rightText"
247
313
  ],
248
- "additionalProperties": false
314
+ "additionalProperties": false,
315
+ "x-vanillasky": {
316
+ "allowsStockMedia": true
317
+ }
249
318
  },
250
319
  "quote": {
251
320
  "type": "object",
@@ -268,13 +337,60 @@ var BUILTIN_TEMPLATE_SCHEMAS = {
268
337
  "Illustrative example"
269
338
  ],
270
339
  "description": "Grounded attribution belonging to these exact quoted words."
340
+ },
341
+ "mediaKeyword": {
342
+ "type": "string",
343
+ "format": "stock-media-keyword",
344
+ "minLength": 1,
345
+ "maxLength": 80,
346
+ "description": "2\u20138 word literal subject/action search intent, maximum 80 characters. Host resolves URLs.",
347
+ "examples": [
348
+ "Ocean waves breaking on a rocky shore"
349
+ ]
350
+ },
351
+ "mediaUrl": {
352
+ "type": "string",
353
+ "format": "uri",
354
+ "description": "Host-only approved photo or video URL.",
355
+ "default": ""
356
+ },
357
+ "mediaType": {
358
+ "type": "string",
359
+ "enum": [
360
+ "photo",
361
+ "video"
362
+ ],
363
+ "default": "video",
364
+ "description": "Host-resolved asset kind."
365
+ },
366
+ "mediaPoster": {
367
+ "type": "string",
368
+ "format": "uri",
369
+ "description": "Host-only approved poster URL for video decoding.",
370
+ "default": ""
371
+ },
372
+ "shotDirection": {
373
+ "type": "string",
374
+ "maxLength": 220,
375
+ "description": "Optional action, framing and continuity for generation. Preserve the subject; do not request rendered text."
376
+ },
377
+ "mediaSource": {
378
+ "type": "string",
379
+ "enum": [
380
+ "generate",
381
+ "stock"
382
+ ],
383
+ "description": "Generate distinctive illustrative shots; use approved stock for familiar observable subjects."
271
384
  }
272
385
  },
273
386
  "required": [
274
387
  "quote",
275
388
  "attribution"
276
389
  ],
277
- "additionalProperties": false
390
+ "additionalProperties": false,
391
+ "x-vanillasky": {
392
+ "allowsStockMedia": true
393
+ }
278
394
  },
279
395
  "keyFigure": {
280
396
  "type": "object",
@@ -297,6 +413,50 @@ var BUILTIN_TEMPLATE_SCHEMAS = {
297
413
  "Illustrative example"
298
414
  ],
299
415
  "description": "Exactly one short label identifying the quantity and its context."
416
+ },
417
+ "mediaKeyword": {
418
+ "type": "string",
419
+ "format": "stock-media-keyword",
420
+ "minLength": 1,
421
+ "maxLength": 80,
422
+ "description": "2\u20138 word literal subject/action search intent, maximum 80 characters. Host resolves URLs.",
423
+ "examples": [
424
+ "Ocean waves breaking on a rocky shore"
425
+ ]
426
+ },
427
+ "mediaUrl": {
428
+ "type": "string",
429
+ "format": "uri",
430
+ "description": "Host-only approved photo or video URL.",
431
+ "default": ""
432
+ },
433
+ "mediaType": {
434
+ "type": "string",
435
+ "enum": [
436
+ "photo",
437
+ "video"
438
+ ],
439
+ "default": "video",
440
+ "description": "Host-resolved asset kind."
441
+ },
442
+ "mediaPoster": {
443
+ "type": "string",
444
+ "format": "uri",
445
+ "description": "Host-only approved poster URL for video decoding.",
446
+ "default": ""
447
+ },
448
+ "shotDirection": {
449
+ "type": "string",
450
+ "maxLength": 220,
451
+ "description": "Optional action, framing and continuity for generation. Preserve the subject; do not request rendered text."
452
+ },
453
+ "mediaSource": {
454
+ "type": "string",
455
+ "enum": [
456
+ "generate",
457
+ "stock"
458
+ ],
459
+ "description": "Generate distinctive illustrative shots; use approved stock for familiar observable subjects."
300
460
  }
301
461
  },
302
462
  "required": [
@@ -305,7 +465,8 @@ var BUILTIN_TEMPLATE_SCHEMAS = {
305
465
  ],
306
466
  "additionalProperties": false,
307
467
  "x-vanillasky": {
308
- "requiresStat": true
468
+ "requiresStat": true,
469
+ "allowsStockMedia": true
309
470
  }
310
471
  }
311
472
  };
@@ -369,38 +530,9 @@ var BUILTIN_TEMPLATE_MANIFEST = [
369
530
  },
370
531
  schema: BUILTIN_TEMPLATE_SCHEMAS.chapterTitle
371
532
  },
372
- {
373
- "label": "Focus cards",
374
- "description": "Two to four short phrases fade in sequentially on black; no boxes or heading.",
375
- "usesGlobalTextEffect": false,
376
- "usesGlobalTransition": false,
377
- "usesGlobalBackgroundEffect": false,
378
- "textCanvas": "tight",
379
- "id": "focusCards",
380
- "family": "Explainers",
381
- "jobs": [
382
- "setup",
383
- "proof"
384
- ],
385
- "register": "card-led",
386
- "useWhen": "Two to four short parallel points support an explanation. ",
387
- "avoidWhen": "The points require an order, long paragraphs, numerical data or additional images to make sense.",
388
- "minDuration": 4,
389
- "preferredDuration": 5,
390
- "timing": {
391
- "contentFields": [
392
- "items"
393
- ],
394
- "contentUnit": "items",
395
- "revealSeconds": 2.4,
396
- "holdSeconds": 1.8,
397
- "exitSeconds": 0
398
- },
399
- schema: BUILTIN_TEMPLATE_SCHEMAS.focusCards
400
- },
401
533
  {
402
534
  "label": "Timeline",
403
- "description": "Three to five events on a fine continuous line on black; without dates.",
535
+ "description": "Three to five events on a fine continuous line over relevant media or black; without dates.",
404
536
  "usesGlobalTextEffect": false,
405
537
  "usesGlobalTransition": false,
406
538
  "usesGlobalBackgroundEffect": false,
@@ -458,7 +590,7 @@ var BUILTIN_TEMPLATE_MANIFEST = [
458
590
  },
459
591
  {
460
592
  "label": "Comparison",
461
- "description": "Two short statements with equal weight on black, side by side or stacked in portrait.",
593
+ "description": "Two short statements with equal weight over relevant media or black, side by side or stacked in portrait.",
462
594
  "usesGlobalTextEffect": false,
463
595
  "usesGlobalTransition": false,
464
596
  "usesGlobalBackgroundEffect": false,
@@ -489,7 +621,7 @@ var BUILTIN_TEMPLATE_MANIFEST = [
489
621
  },
490
622
  {
491
623
  "label": "Quote",
492
- "description": "A short exact quotation with a legible attribution on black.",
624
+ "description": "A short exact quotation with a legible attribution over relevant media or black.",
493
625
  "usesGlobalTextEffect": false,
494
626
  "usesGlobalTransition": false,
495
627
  "usesGlobalBackgroundEffect": false,
@@ -518,7 +650,7 @@ var BUILTIN_TEMPLATE_MANIFEST = [
518
650
  },
519
651
  {
520
652
  "label": "Key figure",
521
- "description": "One supplied figure with one short label on black.",
653
+ "description": "One supplied figure with one short label over relevant media or black.",
522
654
  "usesGlobalTextEffect": false,
523
655
  "usesGlobalTransition": false,
524
656
  "usesGlobalBackgroundEffect": false,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  limitsConcurrentVideoDecoders,
3
3
  resolveMediaType
4
- } from "./chunk-UDIODEDK.js";
4
+ } from "./chunk-224QNWRA.js";
5
5
  import {
6
6
  ExternalVideoBackdropProvider,
7
7
  resolveDensity