@vanillaskyai/video 0.10.22 → 0.11.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 (128) hide show
  1. package/CHANGELOG.md +74 -1
  2. package/PUBLIC-API.md +45 -438
  3. package/README.md +57 -96
  4. package/dist/builtin-metadata-OT6V7TB4.js +8 -0
  5. package/dist/{chapter-title-2JVDU62E.js → chapter-title-2RCXX7SN.js} +1 -2
  6. package/dist/{chunk-PDQFQIQW.js → chunk-3EQ6PVWL.js} +1 -1
  7. package/dist/chunk-4G4JBMCM.js +37 -0
  8. package/dist/{chunk-7AA2JWHZ.js → chunk-5DOQTIMD.js} +6 -6
  9. package/dist/chunk-666HGTVZ.js +41 -0
  10. package/dist/{chunk-7M56IUUX.js → chunk-6Z3ID54H.js} +0 -18
  11. package/dist/{chunk-5BSJLT6H.js → chunk-E7FHBLAC.js} +16 -29
  12. package/dist/chunk-HIQM4J3U.js +30 -0
  13. package/dist/chunk-ISWQ6T5X.js +36 -0
  14. package/dist/{chunk-224QNWRA.js → chunk-K5J7ESRO.js} +1 -10
  15. package/dist/chunk-KMVRBUL5.js +50 -0
  16. package/dist/chunk-NM4CXXZY.js +25 -0
  17. package/dist/{chunk-44WND2VP.js → chunk-V2CP7PVY.js} +19 -63
  18. package/dist/{chunk-3O7OMMMF.js → chunk-WZESNEPT.js} +0 -1
  19. package/dist/{chunk-RXTN2CW6.js → chunk-Z3DLSLAJ.js} +1 -1
  20. package/dist/cinema-media-YZ2UANJG.js +365 -0
  21. package/dist/cli.js +154 -1753
  22. package/dist/{compose-video-BH5K6XWT.js → compose-video-H2YUQDUY.js} +4 -4
  23. package/dist/{events-B4YCc4vc.d.ts → events-BZAfl0Dm.d.ts} +1 -1
  24. package/dist/index.d.ts +2 -2
  25. package/dist/index.js +4 -6
  26. package/dist/preload-media-23JXUFCF.js +77 -0
  27. package/dist/react.d.ts +39 -15
  28. package/dist/react.js +1350 -739
  29. package/dist/scene-validation-SGLLLFY5.js +9 -0
  30. package/dist/server.d.ts +67 -117
  31. package/dist/server.js +262 -614
  32. package/dist/test.d.ts +2 -2
  33. package/dist/test.js +21 -21
  34. package/dist/{text-stream-LD364KBI.js → text-stream-SOVLYR2L.js} +2 -2
  35. package/dist/{types-BqB8zC9u.d.ts → types-CG-kPI81.d.ts} +3 -1
  36. package/dist/{types-DdZw4GRQ.d.ts → types-ht-Zw3Wv.d.ts} +1 -1
  37. package/docs/agent-integration.md +19 -64
  38. package/docs/architecture.md +82 -87
  39. package/docs/customization.md +49 -66
  40. package/docs/development.md +18 -17
  41. package/docs/errors.md +4 -4
  42. package/docs/getting-started.md +74 -93
  43. package/docs/media-and-audio.md +9 -7
  44. package/docs/performance.md +11 -6
  45. package/docs/persistence.md +3 -7
  46. package/docs/production.md +4 -15
  47. package/docs/prompt-and-input.md +1 -2
  48. package/docs/provider-integration.md +134 -181
  49. package/docs/reference/protocol.md +5 -14
  50. package/docs/reference/provider-adapters.md +21 -13
  51. package/docs/security.md +1 -14
  52. package/docs/testing.md +56 -123
  53. package/package.json +5 -27
  54. package/starters/video-chat/.env.example +12 -4
  55. package/starters/video-chat/.env.native.example +13 -0
  56. package/starters/video-chat/README.md +72 -11
  57. package/starters/video-chat/package.json +1 -1
  58. package/starters/video-chat/providers/text-native.ts +94 -0
  59. package/starters/video-chat/providers/text.ts +19 -0
  60. package/starters/video-chat/providers/transcription.ts +32 -0
  61. package/starters/video-chat/providers/video-custom.ts +45 -0
  62. package/starters/video-chat/providers/video-delivery.ts +57 -0
  63. package/starters/video-chat/providers/video-google.ts +48 -0
  64. package/starters/video-chat/providers/video-job.ts +103 -0
  65. package/starters/video-chat/providers/video-runway.ts +45 -0
  66. package/starters/video-chat/providers/video.ts +39 -63
  67. package/starters/video-chat/server.ts +3 -29
  68. package/starters/video-chat/vite.config.ts +2 -8
  69. package/styles/video-chat.css +8 -105
  70. package/dist/builtin-server-W4PLJUZ5.js +0 -8
  71. package/dist/catalog-types-WTbLP6Jh.d.ts +0 -78
  72. package/dist/check-runtime.d.ts +0 -15
  73. package/dist/check-runtime.js +0 -96
  74. package/dist/chunk-2E6T633S.js +0 -27
  75. package/dist/chunk-4YM2M62S.js +0 -13
  76. package/dist/chunk-4ZJLPHBV.js +0 -684
  77. package/dist/chunk-5JBMYQP6.js +0 -156
  78. package/dist/chunk-73NTSFFI.js +0 -81
  79. package/dist/chunk-EGVQODKU.js +0 -83
  80. package/dist/chunk-HFVNAPHZ.js +0 -35
  81. package/dist/chunk-IIN5M5HW.js +0 -697
  82. package/dist/chunk-IQMYK5DX.js +0 -133
  83. package/dist/chunk-IR44XKBI.js +0 -46
  84. package/dist/chunk-JKVOBTRO.js +0 -145
  85. package/dist/chunk-LVM5Q2DL.js +0 -68
  86. package/dist/chunk-M4QTEJTK.js +0 -709
  87. package/dist/chunk-QSBDB4J2.js +0 -16
  88. package/dist/chunk-R3XAOMKP.js +0 -29
  89. package/dist/chunk-SPVTJH3F.js +0 -24
  90. package/dist/chunk-YAHT3LST.js +0 -663
  91. package/dist/chunk-ZD2VTUYR.js +0 -28
  92. package/dist/cinema-media-HYCDG65Z.js +0 -11
  93. package/dist/comparison-XXAP4S4J.js +0 -36
  94. package/dist/editorial-timeline-VUQC6KPA.js +0 -42
  95. package/dist/key-figure-4TJK7HLT.js +0 -29
  96. package/dist/kit-DrRpdn0p.d.ts +0 -79
  97. package/dist/mobile-message-FIHAO6XC.js +0 -49
  98. package/dist/preload-media-LJXWKTWG.js +0 -57
  99. package/dist/quote-GRPIYKQJ.js +0 -32
  100. package/dist/system-prompt-AG26KJAA.js +0 -12
  101. package/dist/template-catalog.d.ts +0 -400
  102. package/dist/template-catalog.js +0 -6
  103. package/dist/templates.d.ts +0 -25
  104. package/dist/templates.js +0 -102
  105. package/dist/validate-4OUD2CLX.js +0 -10
  106. package/docs/concepts.md +0 -107
  107. package/docs/custom-templates.md +0 -346
  108. package/docs/immersive-interface.md +0 -86
  109. package/docs/maintainers/cinematic-migration.md +0 -38
  110. package/docs/motion-and-effects.md +0 -109
  111. package/docs/reference/design-system.html +0 -125
  112. package/docs/responsive-orientation.md +0 -37
  113. package/docs/streaming-protocol.md +0 -15
  114. package/examples/custom-template/README.md +0 -19
  115. package/examples/custom-template/minimal-text.tsx +0 -82
  116. package/examples/custom-template/structured-data.tsx +0 -104
  117. package/registry/items/backgrounds.json +0 -70
  118. package/registry/items/chapterTitle.json +0 -80
  119. package/registry/items/cinemaMedia.json +0 -136
  120. package/registry/items/comparison.json +0 -168
  121. package/registry/items/editorialTimeline.json +0 -172
  122. package/registry/items/keyFigure.json +0 -162
  123. package/registry/items/mobileMessage.json +0 -153
  124. package/registry/items/motion.json +0 -45
  125. package/registry/items/quote.json +0 -161
  126. package/registry/items/template-context.json +0 -31
  127. package/registry/items/theme.json +0 -47
  128. package/registry/items/typography.json +0 -47
@@ -1,400 +0,0 @@
1
- import { S as SceneTemplateMetadata, b as TemplateTimingMetadata } from './catalog-types-WTbLP6Jh.js';
2
-
3
- declare const BUILTIN_TEMPLATE_SCHEMAS: {
4
- readonly cinemaMedia: {
5
- readonly type: "object";
6
- readonly properties: {
7
- readonly mediaKeyword: {
8
- readonly type: "string";
9
- readonly format: "stock-media-keyword";
10
- readonly minLength: 1;
11
- readonly maxLength: 80;
12
- readonly description: "2–8 word literal subject/action search intent, maximum 80 characters. Host resolves URLs.";
13
- readonly examples: readonly ["Ocean waves breaking on a rocky shore"];
14
- };
15
- readonly mediaUrl: {
16
- readonly type: "string";
17
- readonly format: "uri";
18
- readonly description: "Host-only approved photo or video URL.";
19
- readonly default: "";
20
- };
21
- readonly mediaType: {
22
- readonly type: "string";
23
- readonly enum: readonly ["photo", "video"];
24
- readonly default: "video";
25
- readonly description: "Host-resolved asset kind.";
26
- };
27
- readonly mediaPoster: {
28
- readonly type: "string";
29
- readonly format: "uri";
30
- readonly description: "Host-only approved poster URL for video decoding.";
31
- readonly default: "";
32
- };
33
- readonly shotDirection: {
34
- readonly type: "string";
35
- readonly maxLength: 220;
36
- readonly description: "Optional action, framing and continuity for generation. Preserve the subject; do not request rendered text.";
37
- };
38
- readonly mediaSource: {
39
- readonly type: "string";
40
- readonly enum: readonly ["generate", "stock"];
41
- readonly description: "Generate distinctive illustrative shots; use approved stock for familiar observable subjects.";
42
- };
43
- readonly fallbackText: {
44
- readonly type: "string";
45
- readonly maxLength: 65;
46
- readonly description: "Optional grounded concise chapter text if this shot cannot be resolved; not visible over footage.";
47
- };
48
- };
49
- readonly required: readonly [];
50
- readonly additionalProperties: false;
51
- readonly "x-vanillasky": {
52
- readonly allowsStockMedia: true;
53
- readonly requiredAnyOf: readonly [readonly ["mediaKeyword", "mediaUrl"]];
54
- };
55
- };
56
- readonly chapterTitle: {
57
- readonly type: "object";
58
- readonly properties: {
59
- readonly title: {
60
- readonly type: "string";
61
- readonly maxLength: 65;
62
- readonly description: "Short title. Line breaks optional.";
63
- readonly default: "A different perspective";
64
- };
65
- };
66
- readonly required: readonly ["title"];
67
- readonly additionalProperties: false;
68
- };
69
- readonly editorialTimeline: {
70
- readonly type: "object";
71
- readonly properties: {
72
- readonly events: {
73
- readonly type: "array";
74
- readonly minItems: 3;
75
- readonly maxItems: 5;
76
- readonly items: {
77
- readonly type: "object";
78
- readonly properties: {
79
- readonly label: {
80
- readonly type: "string";
81
- readonly minLength: 1;
82
- readonly maxLength: 45;
83
- };
84
- };
85
- readonly required: readonly ["label"];
86
- readonly additionalProperties: false;
87
- };
88
- readonly default: readonly [{
89
- readonly label: "Observe";
90
- }, {
91
- readonly label: "Understand";
92
- }, {
93
- readonly label: "Act";
94
- }];
95
- readonly description: "3–5 ordered events or actions, each with one short label; no dates.";
96
- };
97
- readonly mediaKeyword: {
98
- readonly type: "string";
99
- readonly format: "stock-media-keyword";
100
- readonly minLength: 1;
101
- readonly maxLength: 80;
102
- readonly description: "2–8 word literal subject/action search intent, maximum 80 characters. Host resolves URLs.";
103
- readonly examples: readonly ["Ocean waves breaking on a rocky shore"];
104
- };
105
- readonly mediaUrl: {
106
- readonly type: "string";
107
- readonly format: "uri";
108
- readonly description: "Host-only approved photo or video URL.";
109
- readonly default: "";
110
- };
111
- readonly mediaType: {
112
- readonly type: "string";
113
- readonly enum: readonly ["photo", "video"];
114
- readonly default: "video";
115
- readonly description: "Host-resolved asset kind.";
116
- };
117
- readonly mediaPoster: {
118
- readonly type: "string";
119
- readonly format: "uri";
120
- readonly description: "Host-only approved poster URL for video decoding.";
121
- readonly default: "";
122
- };
123
- readonly shotDirection: {
124
- readonly type: "string";
125
- readonly maxLength: 220;
126
- readonly description: "Optional action, framing and continuity for generation. Preserve the subject; do not request rendered text.";
127
- };
128
- readonly mediaSource: {
129
- readonly type: "string";
130
- readonly enum: readonly ["generate", "stock"];
131
- readonly description: "Generate distinctive illustrative shots; use approved stock for familiar observable subjects.";
132
- };
133
- };
134
- readonly required: readonly ["events"];
135
- readonly additionalProperties: false;
136
- readonly "x-vanillasky": {
137
- readonly allowsStockMedia: true;
138
- };
139
- };
140
- readonly mobileMessage: {
141
- readonly type: "object";
142
- readonly properties: {
143
- readonly mediaKeyword: {
144
- readonly type: "string";
145
- readonly format: "stock-media-keyword";
146
- readonly minLength: 1;
147
- readonly maxLength: 80;
148
- readonly description: "2–8 word literal subject/action search intent, maximum 80 characters. Host resolves URLs.";
149
- readonly examples: readonly ["Ocean waves breaking on a rocky shore"];
150
- };
151
- readonly mediaUrl: {
152
- readonly type: "string";
153
- readonly format: "uri";
154
- readonly description: "Host-only approved photo or video URL.";
155
- readonly default: "";
156
- };
157
- readonly mediaType: {
158
- readonly type: "string";
159
- readonly enum: readonly ["photo", "video"];
160
- readonly default: "video";
161
- readonly description: "Host-resolved asset kind.";
162
- };
163
- readonly mediaPoster: {
164
- readonly type: "string";
165
- readonly format: "uri";
166
- readonly description: "Host-only approved poster URL for video decoding.";
167
- readonly default: "";
168
- };
169
- readonly message: {
170
- readonly type: "string";
171
- readonly maxLength: 120;
172
- readonly default: "Can we talk?";
173
- readonly description: "Exact supplied or explicitly illustrative message, preferably 6–16 words.";
174
- };
175
- readonly app: {
176
- readonly type: "string";
177
- readonly maxLength: 24;
178
- readonly default: "Messages";
179
- readonly description: "Optional app label; Messages is the visual default.";
180
- };
181
- readonly shotDirection: {
182
- readonly type: "string";
183
- readonly maxLength: 220;
184
- readonly description: "Optional action, framing and continuity for generation. Preserve the subject; do not request rendered text.";
185
- };
186
- readonly mediaSource: {
187
- readonly type: "string";
188
- readonly enum: readonly ["generate", "stock"];
189
- readonly description: "Generate distinctive illustrative shots; use approved stock for familiar observable subjects.";
190
- };
191
- };
192
- readonly required: readonly ["message"];
193
- readonly additionalProperties: false;
194
- readonly "x-vanillasky": {
195
- readonly allowsStockMedia: true;
196
- };
197
- };
198
- readonly comparison: {
199
- readonly type: "object";
200
- readonly properties: {
201
- readonly leftLabel: {
202
- readonly type: "string";
203
- readonly maxLength: 20;
204
- readonly description: "Optional short identifier for the first alternative.";
205
- };
206
- readonly rightLabel: {
207
- readonly type: "string";
208
- readonly maxLength: 20;
209
- readonly description: "Optional short identifier for the second alternative.";
210
- };
211
- readonly leftText: {
212
- readonly type: "string";
213
- readonly minLength: 1;
214
- readonly maxLength: 60;
215
- readonly default: "More distractions";
216
- readonly description: "First real alternative in one short phrase.";
217
- };
218
- readonly rightText: {
219
- readonly type: "string";
220
- readonly minLength: 1;
221
- readonly maxLength: 60;
222
- readonly default: "More room to think";
223
- readonly description: "Second real alternative, parallel to the first.";
224
- };
225
- readonly mediaKeyword: {
226
- readonly type: "string";
227
- readonly format: "stock-media-keyword";
228
- readonly minLength: 1;
229
- readonly maxLength: 80;
230
- readonly description: "2–8 word literal subject/action search intent, maximum 80 characters. Host resolves URLs.";
231
- readonly examples: readonly ["Ocean waves breaking on a rocky shore"];
232
- };
233
- readonly mediaUrl: {
234
- readonly type: "string";
235
- readonly format: "uri";
236
- readonly description: "Host-only approved photo or video URL.";
237
- readonly default: "";
238
- };
239
- readonly mediaType: {
240
- readonly type: "string";
241
- readonly enum: readonly ["photo", "video"];
242
- readonly default: "video";
243
- readonly description: "Host-resolved asset kind.";
244
- };
245
- readonly mediaPoster: {
246
- readonly type: "string";
247
- readonly format: "uri";
248
- readonly description: "Host-only approved poster URL for video decoding.";
249
- readonly default: "";
250
- };
251
- readonly shotDirection: {
252
- readonly type: "string";
253
- readonly maxLength: 220;
254
- readonly description: "Optional action, framing and continuity for generation. Preserve the subject; do not request rendered text.";
255
- };
256
- readonly mediaSource: {
257
- readonly type: "string";
258
- readonly enum: readonly ["generate", "stock"];
259
- readonly description: "Generate distinctive illustrative shots; use approved stock for familiar observable subjects.";
260
- };
261
- };
262
- readonly required: readonly ["leftText", "rightText"];
263
- readonly additionalProperties: false;
264
- readonly "x-vanillasky": {
265
- readonly allowsStockMedia: true;
266
- };
267
- };
268
- readonly quote: {
269
- readonly type: "object";
270
- readonly properties: {
271
- readonly quote: {
272
- readonly type: "string";
273
- readonly minLength: 1;
274
- readonly maxLength: 140;
275
- readonly format: "grounded-quote";
276
- readonly examples: readonly ["Look closely. There is always more to see."];
277
- readonly description: "Exact supplied quotation; do not paraphrase or invent.";
278
- };
279
- readonly attribution: {
280
- readonly type: "string";
281
- readonly minLength: 1;
282
- readonly maxLength: 60;
283
- readonly examples: readonly ["Illustrative example"];
284
- readonly description: "Grounded attribution belonging to these exact quoted words.";
285
- };
286
- readonly mediaKeyword: {
287
- readonly type: "string";
288
- readonly format: "stock-media-keyword";
289
- readonly minLength: 1;
290
- readonly maxLength: 80;
291
- readonly description: "2–8 word literal subject/action search intent, maximum 80 characters. Host resolves URLs.";
292
- readonly examples: readonly ["Ocean waves breaking on a rocky shore"];
293
- };
294
- readonly mediaUrl: {
295
- readonly type: "string";
296
- readonly format: "uri";
297
- readonly description: "Host-only approved photo or video URL.";
298
- readonly default: "";
299
- };
300
- readonly mediaType: {
301
- readonly type: "string";
302
- readonly enum: readonly ["photo", "video"];
303
- readonly default: "video";
304
- readonly description: "Host-resolved asset kind.";
305
- };
306
- readonly mediaPoster: {
307
- readonly type: "string";
308
- readonly format: "uri";
309
- readonly description: "Host-only approved poster URL for video decoding.";
310
- readonly default: "";
311
- };
312
- readonly shotDirection: {
313
- readonly type: "string";
314
- readonly maxLength: 220;
315
- readonly description: "Optional action, framing and continuity for generation. Preserve the subject; do not request rendered text.";
316
- };
317
- readonly mediaSource: {
318
- readonly type: "string";
319
- readonly enum: readonly ["generate", "stock"];
320
- readonly description: "Generate distinctive illustrative shots; use approved stock for familiar observable subjects.";
321
- };
322
- };
323
- readonly required: readonly ["quote", "attribution"];
324
- readonly additionalProperties: false;
325
- readonly "x-vanillasky": {
326
- readonly allowsStockMedia: true;
327
- };
328
- };
329
- readonly keyFigure: {
330
- readonly type: "object";
331
- readonly properties: {
332
- readonly value: {
333
- readonly type: "string";
334
- readonly minLength: 1;
335
- readonly maxLength: 14;
336
- readonly format: "grounded-stat";
337
- readonly examples: readonly ["42%"];
338
- readonly description: "One supplied supported quantity, preserving its unit.";
339
- };
340
- readonly label: {
341
- readonly type: "string";
342
- readonly minLength: 1;
343
- readonly maxLength: 50;
344
- readonly examples: readonly ["Illustrative example"];
345
- readonly description: "Exactly one short label identifying the quantity and its context.";
346
- };
347
- readonly mediaKeyword: {
348
- readonly type: "string";
349
- readonly format: "stock-media-keyword";
350
- readonly minLength: 1;
351
- readonly maxLength: 80;
352
- readonly description: "2–8 word literal subject/action search intent, maximum 80 characters. Host resolves URLs.";
353
- readonly examples: readonly ["Ocean waves breaking on a rocky shore"];
354
- };
355
- readonly mediaUrl: {
356
- readonly type: "string";
357
- readonly format: "uri";
358
- readonly description: "Host-only approved photo or video URL.";
359
- readonly default: "";
360
- };
361
- readonly mediaType: {
362
- readonly type: "string";
363
- readonly enum: readonly ["photo", "video"];
364
- readonly default: "video";
365
- readonly description: "Host-resolved asset kind.";
366
- };
367
- readonly mediaPoster: {
368
- readonly type: "string";
369
- readonly format: "uri";
370
- readonly description: "Host-only approved poster URL for video decoding.";
371
- readonly default: "";
372
- };
373
- readonly shotDirection: {
374
- readonly type: "string";
375
- readonly maxLength: 220;
376
- readonly description: "Optional action, framing and continuity for generation. Preserve the subject; do not request rendered text.";
377
- };
378
- readonly mediaSource: {
379
- readonly type: "string";
380
- readonly enum: readonly ["generate", "stock"];
381
- readonly description: "Generate distinctive illustrative shots; use approved stock for familiar observable subjects.";
382
- };
383
- };
384
- readonly required: readonly ["value", "label"];
385
- readonly additionalProperties: false;
386
- readonly "x-vanillasky": {
387
- readonly requiresStat: true;
388
- readonly allowsStockMedia: true;
389
- };
390
- };
391
- };
392
-
393
- type BuiltinTemplateId = keyof typeof BUILTIN_TEMPLATE_SCHEMAS;
394
- interface BuiltinTemplateManifestEntry extends SceneTemplateMetadata {
395
- id: BuiltinTemplateId;
396
- timing: TemplateTimingMetadata;
397
- }
398
- declare const BUILTIN_TEMPLATE_MANIFEST: readonly BuiltinTemplateManifestEntry[];
399
-
400
- export { type BuiltinTemplateId, type BuiltinTemplateManifestEntry as BuiltinTemplateMetadata, BUILTIN_TEMPLATE_MANIFEST as builtinTemplates };
@@ -1,6 +0,0 @@
1
- import {
2
- BUILTIN_TEMPLATE_MANIFEST
3
- } from "./chunk-4ZJLPHBV.js";
4
- export {
5
- BUILTIN_TEMPLATE_MANIFEST as builtinTemplates
6
- };
@@ -1,25 +0,0 @@
1
- import { I as InferTemplateJsonSchema, S as SceneTemplateProps, a as SceneTemplate } from './kit-DrRpdn0p.js';
2
- export { T as TemplateRegistry, c as createTemplateRegistry } from './kit-DrRpdn0p.js';
3
- import { ComponentType } from 'react';
4
- import { T as TemplateJsonSchema, S as SceneTemplateMetadata } from './catalog-types-WTbLP6Jh.js';
5
- export { a as TemplateFamily, b as TemplateTimingMetadata, c as TemplateTransitionTiming } from './catalog-types-WTbLP6Jh.js';
6
- import './types-DdZw4GRQ.js';
7
-
8
- interface TemplateExample<Variables extends Record<string, unknown> = Record<string, unknown>> {
9
- name: string;
10
- variables: Partial<Variables>;
11
- }
12
- type OptionalGlobalDefaults = Partial<Pick<SceneTemplateMetadata, "usesGlobalTextEffect" | "usesGlobalTransition" | "usesGlobalBackgroundEffect">>;
13
- type TemplateDefinitionMetadata = Omit<SceneTemplateMetadata, "id" | "useWhen" | "schema" | keyof OptionalGlobalDefaults> & OptionalGlobalDefaults;
14
- type TemplateDefinition<Schema extends TemplateJsonSchema = TemplateJsonSchema> = TemplateDefinitionMetadata & {
15
- id: string;
16
- useWhen: string;
17
- schema: Schema;
18
- examples?: readonly TemplateExample<InferTemplateJsonSchema<Schema>>[];
19
- component: ComponentType<SceneTemplateProps<InferTemplateJsonSchema<Schema>>>;
20
- };
21
- declare function defineTemplate<const Schema extends TemplateJsonSchema>(definition: TemplateDefinition<Schema>): SceneTemplate<InferTemplateJsonSchema<Schema>> & {
22
- examples?: readonly TemplateExample<InferTemplateJsonSchema<Schema>>[];
23
- };
24
-
25
- export { SceneTemplate, SceneTemplateMetadata, SceneTemplateProps, type TemplateDefinition, type TemplateExample, TemplateJsonSchema, defineTemplate };
package/dist/templates.js DELETED
@@ -1,102 +0,0 @@
1
- import {
2
- assertTemplateTransitionMetadata
3
- } from "./chunk-2E6T633S.js";
4
-
5
- // src/visual-system/catalog/kit.ts
6
- function toMetadata(template) {
7
- return {
8
- id: template.id,
9
- label: template.label,
10
- description: template.description,
11
- category: template.category,
12
- family: template.family,
13
- usesGlobalTextEffect: template.usesGlobalTextEffect,
14
- usesGlobalTransition: template.usesGlobalTransition,
15
- transitionTiming: template.transitionTiming,
16
- usesGlobalBackgroundEffect: template.usesGlobalBackgroundEffect,
17
- textCanvas: template.textCanvas,
18
- jobs: template.jobs,
19
- register: template.register,
20
- useWhen: template.useWhen,
21
- avoidWhen: template.avoidWhen,
22
- schema: template.schema,
23
- minDuration: template.minDuration,
24
- preferredDuration: template.preferredDuration,
25
- timing: template.timing
26
- };
27
- }
28
- function isTemplateJsonSchema(value) {
29
- if (typeof value !== "object" || value == null) return false;
30
- const schema = value;
31
- return schema.type === "object" && typeof schema.properties === "object" && schema.properties != null;
32
- }
33
- function defineTemplate(definition) {
34
- if (!/^[A-Za-z][A-Za-z0-9_-]*$/.test(definition.id)) {
35
- throw new Error(`Invalid template id: ${definition.id}`);
36
- }
37
- const suppliedSchema = "schema" in definition ? definition.schema : void 0;
38
- const standard = suppliedSchema && "~standard" in suppliedSchema ? suppliedSchema["~standard"] : void 0;
39
- const convertedSchema = standard?.jsonSchema ? standard.jsonSchema.input({ target: "draft-07" }) : suppliedSchema && !("~standard" in suppliedSchema) ? suppliedSchema : void 0;
40
- if (standard && !standard.jsonSchema) {
41
- throw new Error("Template schemas must expose Standard JSON Schema so the server registry can be generated safely");
42
- }
43
- if (!convertedSchema || !isTemplateJsonSchema(convertedSchema)) {
44
- throw new Error("Template schema must describe a JSON object");
45
- }
46
- const schema = { ...convertedSchema, additionalProperties: convertedSchema.additionalProperties ?? false };
47
- const transitionMetadata = {
48
- id: definition.id,
49
- usesGlobalTransition: definition.usesGlobalTransition ?? false,
50
- transitionTiming: definition.transitionTiming
51
- };
52
- assertTemplateTransitionMetadata(transitionMetadata);
53
- const { schema: _runtimeSchema, duration, ...definitionWithoutSchema } = definition;
54
- return Object.freeze({
55
- label: definition.id,
56
- description: "",
57
- usesGlobalTextEffect: false,
58
- usesGlobalTransition: false,
59
- usesGlobalBackgroundEffect: false,
60
- ...definitionWithoutSchema,
61
- schema,
62
- ...duration == null ? {} : { preferredDuration: duration }
63
- });
64
- }
65
- function createRenderTemplateRegistry(options) {
66
- const byId = /* @__PURE__ */ new Map();
67
- for (const template of options.templates) {
68
- assertTemplateTransitionMetadata(template);
69
- if (byId.has(template.id)) throw new Error(`Duplicate template id: ${template.id}`);
70
- byId.set(template.id, template);
71
- }
72
- const templates = Object.freeze([...options.templates]);
73
- if (options.metadata && options.metadata.map(({ id }) => id).join("\0") !== templates.map(({ id }) => id).join("\0")) {
74
- throw new Error("Template metadata does not match render templates");
75
- }
76
- const metadata = new Map((options.metadata ?? templates.map(toMetadata)).map((template) => [template.id, template]));
77
- const capabilities = { templates: templates.map(({ id }) => id) };
78
- return Object.freeze({
79
- templates,
80
- capabilities,
81
- getTemplate: (id) => byId.get(id),
82
- getTemplateMetadata: (id) => metadata.get(id),
83
- listTemplateMetadata: () => [...metadata.values()]
84
- });
85
- }
86
- function createTemplateRegistry(options) {
87
- return createRenderTemplateRegistry({ templates: options.definitions });
88
- }
89
-
90
- // src/templates.ts
91
- function defineTemplate2(definition) {
92
- if (Object.hasOwn(definition, "duration")) {
93
- throw new Error("Template duration is not supported; use preferredDuration");
94
- }
95
- return defineTemplate(
96
- definition
97
- );
98
- }
99
- export {
100
- createTemplateRegistry,
101
- defineTemplate2 as defineTemplate
102
- };
@@ -1,10 +0,0 @@
1
- import {
2
- createTemplateSceneValidator,
3
- validateTemplateSceneStructure
4
- } from "./chunk-IQMYK5DX.js";
5
- import "./chunk-EGVQODKU.js";
6
- import "./chunk-73NTSFFI.js";
7
- export {
8
- createTemplateSceneValidator,
9
- validateTemplateSceneStructure
10
- };
package/docs/concepts.md DELETED
@@ -1,107 +0,0 @@
1
- [← Documentation home](../README.md) · [Previous: Getting started](getting-started.md) · [Next: Streaming protocol →](streaming-protocol.md)
2
-
3
- # Core concepts
4
-
5
- ## Video chat
6
-
7
- The default product surface is a conversation whose answers are synchronized
8
- voice-and-video responses. `VideoChat` supplies the complete interface;
9
- `useVideoChat` supplies the same session, turn, suggestion, voice, and playback
10
- lifecycle for custom interfaces; `createVideoChatHandler` connects app-owned
11
- providers and reports their capabilities through one endpoint.
12
-
13
- Packaged templates and browser voice are the base mode. A text model makes that
14
- mode answer, while optional provider callbacks progressively add generated
15
- speech, stock media, transcription, and generated video without changing the
16
- client. Visual responses deliberately choose between templates and fully
17
- generated video; there is no mixed mode.
18
-
19
- ## Video response
20
-
21
- A video response is a short, responsive animated experience assembled from
22
- trusted templates. It begins before the full plan is available and ends as an
23
- editable deterministic configuration.
24
-
25
- It is not an encoded video stream. The browser renders normal React components
26
- from validated scene instructions. The SDK does not include MP4 or WebM
27
- encoding; pass the completed deterministic JSON to an application-owned render
28
- or export pipeline when an encoded file is required.
29
-
30
- ## Input
31
-
32
- The viewer sends a prompt with bounded completed conversation turns. The server
33
- adds trusted application `instructions`, template capabilities, and the selected
34
- AI video or Pexels mode. `VideoChat` options control style, orientation, and custom
35
- templates. Exact facts belong in the authorized prompt or conversation; secrets
36
- and provider configuration stay on the server.
37
-
38
- See [Prompt and conversation input](prompt-and-input.md) for the request contract.
39
-
40
- ## Template kit
41
-
42
- VanillaSky uses its trusted built-in kit by default. Applications only configure
43
- a kit when they need project-owned templates. Those templates replace matching
44
- built-in IDs and add new IDs while every untouched built-in remains available.
45
- A kit supplies three things together:
46
-
47
- 1. React components for the player;
48
- 2. advertised template capabilities for protocol negotiation;
49
- 3. an LLM catalog describing when and how each template may be used.
50
-
51
- The planner cannot legitimately select a template outside the active kit.
52
-
53
- ## Planner
54
-
55
- The server-side planner turns the input into complete `scene.add` parts followed
56
- by `plan.complete`. A planner may be
57
- recorded, deterministic, backed by OpenAI or Anthropic, or implemented with
58
- another streaming text model.
59
-
60
- The planner does not create public event IDs, checksums, or final
61
- snapshots. The runtime owns those guarantees.
62
-
63
- The internal composition pipeline can reserve a validated closing scene and
64
- append it after the body. Planner parts are internal data; applications connect
65
- text callbacks to `createVideoChatHandler` and let the SDK own event envelopes,
66
- sequence IDs, and final snapshots.
67
-
68
- ## Event stream
69
-
70
- The runtime emits ordered protocol events:
71
-
72
- ```text
73
- response.start
74
- data.video-chat-opening short spoken hook
75
- scene.add generated body
76
- scene.add generated body
77
- scene.add reserved closer
78
- response.complete exact terminal snapshot
79
- ```
80
-
81
- Network transport uses SSE. Test utilities can simulate protocol events in process.
82
-
83
- ## Playback and buffering
84
-
85
- The player renders the first committed scene and continues through the known
86
- timeline. The chat holds its current visual during a generation gap. A media-bearing scene should
87
- not be committed until its asset is ready; start generated content with a
88
- typography-led scene so useful playback does not wait on media lookup.
89
-
90
- Played scenes cannot be patched. This keeps playback deterministic and avoids a
91
- scene changing after the viewer already saw it.
92
-
93
- The same player accepts a completed value directly. After persisting the JSON,
94
- load it through `parseVideo(JSON.parse(storedJson))`, then render
95
- `<VideoPlayer video={savedVideo} />` to replay it without opening a stream or
96
- calling the model again. Supply `templates` only when that video uses
97
- customer-owned templates. See [Persistence and replay](persistence.md) for the
98
- complete storage contract.
99
-
100
- ## Completion snapshot
101
-
102
- `response.complete` contains the exact reduced `Video` plus a
103
- checksum. The chat retains the completed video on its turn for application-owned replay
104
- and storage. A partial playable answer may complete with non-fatal warnings.
105
-
106
- Read the complete [Protocol 0.5](reference/protocol.md) and the separate
107
- [persisted Video 0.1 contract](persistence.md).