@vanillaskyai/video 0.6.0 → 0.7.1

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 (130) hide show
  1. package/CHANGELOG.md +164 -0
  2. package/PUBLIC-API.md +123 -9
  3. package/README.md +69 -115
  4. package/dist/{bg-confetti-SHQI7ATB.js → bg-confetti-HITCGLGD.js} +1 -1
  5. package/dist/{bg-emoji-XYFRA63Q.js → bg-emoji-VU4UZYZN.js} +1 -1
  6. package/dist/{bg-media-G4XOQEAS.js → bg-media-L34PDQXJ.js} +2 -2
  7. package/dist/{brand-message-XHONEDNW.js → brand-message-FUJ4STFO.js} +1 -1
  8. package/dist/{builtin-server-YHEZ2JRF.js → builtin-server-KB7FKF6A.js} +2 -2
  9. package/dist/{chart-bar-HRHD57ML.js → chart-bar-EGPHJATL.js} +2 -2
  10. package/dist/{chart-counter-KFPV44RB.js → chart-counter-5FFWQNZO.js} +2 -2
  11. package/dist/{chart-progress-ring-OR2VOIHV.js → chart-progress-ring-JMXQLMLC.js} +2 -2
  12. package/dist/{chunk-66MNRUCR.js → chunk-2PYO6VAC.js} +51 -3
  13. package/dist/{chunk-ZQQQAAKP.js → chunk-2XT4MZ76.js} +33 -2
  14. package/dist/{chunk-PNS52FL4.js → chunk-5SLENAJW.js} +19 -6
  15. package/dist/{chunk-EFL34TXF.js → chunk-AITKH6QT.js} +24 -8
  16. package/dist/{chunk-FZHMQFG3.js → chunk-GAIOHGNR.js} +5 -21
  17. package/dist/{chunk-3RV4YKB3.js → chunk-JNN3EYVP.js} +51 -26
  18. package/dist/{chunk-HVCPEAQF.js → chunk-LKBZX7GV.js} +9 -6
  19. package/dist/{chunk-34O5BY6X.js → chunk-LLPMVDJZ.js} +21 -4
  20. package/dist/{chunk-G66Z5CWR.js → chunk-MMUXVA47.js} +27 -3
  21. package/dist/{chunk-7BGAU6C3.js → chunk-MXZSDGZQ.js} +2 -1
  22. package/dist/{chunk-3OU7HIEB.js → chunk-RE4IMWJR.js} +15 -31
  23. package/dist/{chunk-FVTMYS6U.js → chunk-RGF452LL.js} +1 -1
  24. package/dist/chunk-SKRGRKHY.js +142 -0
  25. package/dist/{chunk-TCEHK2BW.js → chunk-YJJC4N4D.js} +2 -1
  26. package/dist/cli.js +438 -30
  27. package/dist/{compose-video-JWIEDTEJ.js → compose-video-PD6LKKRK.js} +4 -4
  28. package/dist/{cta-logo-JJOGK4UC.js → cta-logo-YR7LYUR5.js} +1 -1
  29. package/dist/{cta-media-IQ3MAWEH.js → cta-media-DQJBKUO2.js} +2 -2
  30. package/dist/{events-BBP30j3c.d.ts → events-B6qS1Lsb.d.ts} +2 -2
  31. package/dist/{incoming-call-KXF67OT2.js → incoming-call-54KQ7O5A.js} +1 -1
  32. package/dist/index.d.ts +89 -3
  33. package/dist/index.js +12 -1
  34. package/dist/{infographic-before-after-2I7YZVDD.js → infographic-before-after-ROS52GOW.js} +1 -1
  35. package/dist/{infographic-feature-list-QDM4I7XE.js → infographic-feature-list-E7MGUDAN.js} +2 -2
  36. package/dist/{infographic-problem-solution-FMLJCPG6.js → infographic-problem-solution-3S6NGO5N.js} +2 -2
  37. package/dist/{infographic-stat-row-VFTIXS5F.js → infographic-stat-row-SYB7AB7H.js} +2 -2
  38. package/dist/{infographic-steps-L7W24Z35.js → infographic-steps-KCE6JWE2.js} +2 -2
  39. package/dist/{kit-DEG3fcaL.d.ts → kit-8g46H2RZ.d.ts} +1 -1
  40. package/dist/{prompt-input-F3CYU2XH.js → prompt-input-MHX4O42G.js} +1 -1
  41. package/dist/react.d.ts +194 -6
  42. package/dist/react.js +1849 -40
  43. package/dist/{reaction-2XCLOJOK.js → reaction-SLEGR3BE.js} +2 -2
  44. package/dist/server.d.ts +102 -4
  45. package/dist/server.js +972 -27
  46. package/dist/{showcase-code-KHSMIPG6.js → showcase-code-2HLAVKBM.js} +2 -2
  47. package/dist/{showcase-phone-M4CEANIW.js → showcase-phone-Q4HEO4LH.js} +2 -2
  48. package/dist/{showcase-terminal-26I3DYF7.js → showcase-terminal-DL45LUFG.js} +2 -2
  49. package/dist/{showcase-web-TY6CZV2Z.js → showcase-web-2QZO73FZ.js} +2 -2
  50. package/dist/{social-milestone-TF6MX7ET.js → social-milestone-GEFUQSBF.js} +1 -1
  51. package/dist/{social-notification-2RJDAZSF.js → social-notification-FJ5VHVLK.js} +1 -1
  52. package/dist/{social-review-stack-2ICKJQG7.js → social-review-stack-KXQCKFRP.js} +1 -1
  53. package/dist/{social-testimonial-X7OGADA3.js → social-testimonial-JZ7CHC7S.js} +1 -1
  54. package/dist/{social-tweet-TK7SH2F6.js → social-tweet-UCDXM25F.js} +1 -1
  55. package/dist/{system-prompt-4I6Z5HK3.js → system-prompt-RRXIWDDD.js} +5 -3
  56. package/dist/template-catalog.js +1 -1
  57. package/dist/templates.d.ts +3 -3
  58. package/dist/test.d.ts +2 -2
  59. package/dist/test.js +3 -3
  60. package/dist/{text-stream-J6EDDJP4.js → text-stream-ROTNGSD4.js} +2 -2
  61. package/dist/{types-BV9IqExh.d.ts → types-2wHBqtg8.d.ts} +29 -1
  62. package/dist/types-DrABlRa7.d.ts +46 -0
  63. package/docs/agent-integration.md +49 -25
  64. package/docs/architecture.md +37 -22
  65. package/docs/branding-and-personalization.md +1 -1
  66. package/docs/concepts.md +14 -0
  67. package/docs/custom-templates.md +9 -9
  68. package/docs/customization.md +41 -5
  69. package/docs/getting-started.md +81 -84
  70. package/docs/media-and-audio.md +103 -166
  71. package/docs/persistence.md +1 -1
  72. package/docs/production.md +81 -92
  73. package/docs/prompt-and-input.md +71 -161
  74. package/docs/provider-integration.md +91 -49
  75. package/docs/responsive-orientation.md +1 -1
  76. package/docs/security.md +6 -5
  77. package/docs/streaming-protocol.md +1 -1
  78. package/docs/testing.md +51 -43
  79. package/examples/custom-template/README.md +1 -1
  80. package/package.json +20 -22
  81. package/registry/items/barChart.json +6 -4
  82. package/registry/items/beforeAfter.json +1 -1
  83. package/registry/items/bigNumber.json +4 -3
  84. package/registry/items/brandMessage.json +3 -2
  85. package/registry/items/cardList.json +6 -4
  86. package/registry/items/codeEditor.json +4 -3
  87. package/registry/items/confetti.json +1 -1
  88. package/registry/items/ctaLogo.json +3 -2
  89. package/registry/items/ctaMedia.json +4 -3
  90. package/registry/items/emojiBurst.json +1 -1
  91. package/registry/items/incomingCall.json +3 -2
  92. package/registry/items/media.json +4 -3
  93. package/registry/items/milestone.json +3 -2
  94. package/registry/items/notification.json +3 -2
  95. package/registry/items/phoneMockup.json +4 -3
  96. package/registry/items/problemSolution.json +4 -3
  97. package/registry/items/progressRing.json +4 -3
  98. package/registry/items/promptInput.json +3 -2
  99. package/registry/items/reaction.json +2 -2
  100. package/registry/items/reviewStack.json +3 -2
  101. package/registry/items/steps.json +6 -4
  102. package/registry/items/terminal.json +5 -4
  103. package/registry/items/testimonial.json +3 -2
  104. package/registry/items/tripleStats.json +4 -3
  105. package/registry/items/tweet.json +3 -2
  106. package/registry/items/webMockup.json +4 -3
  107. package/starters/video-chat/.env.example +16 -0
  108. package/starters/video-chat/README.md +63 -0
  109. package/starters/video-chat/index.html +12 -0
  110. package/starters/video-chat/package.json +28 -0
  111. package/starters/video-chat/server.ts +152 -0
  112. package/starters/video-chat/src/main.tsx +8 -0
  113. package/starters/video-chat/stock.ts +139 -0
  114. package/starters/video-chat/tsconfig.json +20 -0
  115. package/starters/video-chat/vite.config.ts +81 -0
  116. package/styles/video-chat.css +713 -0
  117. package/docs/input-and-first-scene.md +0 -64
  118. package/docs/integrate-nextjs.md +0 -86
  119. package/docs/live-channels.md +0 -149
  120. package/docs/use-cases.md +0 -59
  121. package/examples/nextjs-quickstart/.env.example +0 -2
  122. package/examples/nextjs-quickstart/README.md +0 -27
  123. package/examples/nextjs-quickstart/next-env.d.ts +0 -4
  124. package/examples/nextjs-quickstart/package.json +0 -25
  125. package/examples/nextjs-quickstart/src/app/api/video/route.ts +0 -33
  126. package/examples/nextjs-quickstart/src/app/layout.tsx +0 -5
  127. package/examples/nextjs-quickstart/src/app/page.tsx +0 -31
  128. package/examples/nextjs-quickstart/tsconfig.json +0 -26
  129. package/examples/server-integrations/README.md +0 -20
  130. package/examples/server-integrations/src/ai-sdk-media.ts +0 -90
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  SceneBackground
3
- } from "./chunk-7BGAU6C3.js";
3
+ } from "./chunk-MXZSDGZQ.js";
4
4
  import {
5
5
  TemplateText
6
- } from "./chunk-TCEHK2BW.js";
6
+ } from "./chunk-YJJC4N4D.js";
7
7
  import "./chunk-L5BTTCZV.js";
8
8
  import "./chunk-FRN6WKHA.js";
9
9
  import "./chunk-W3VDIBGR.js";
package/dist/server.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import { n as VideoGenerationContext, o as VideoPlanner, p as VideoRequest, a as VideoCapabilities, j as VideoInput, d as VideoAudio, q as VideoSceneValidator, r as VideoTemplatePacing, s as VideoSnapshotRetention, t as VideoResumeCursor, u as VideoSceneValidationContext, e as VideoScene } from './types-BV9IqExh.js';
2
- import { a as VideoFinishReason, V as VideoWarning, b as VideoEvent } from './events-BBP30j3c.js';
3
- export { c as VideoWarningCategory } from './events-BBP30j3c.js';
1
+ import { o as VideoGenerationContext, p as VideoPlanner, q as VideoRequest, a as VideoCapabilities, g as VideoInput, d as VideoAudio, r as VideoSceneValidator, j as VideoTemplatePacing, s as VideoSnapshotRetention, t as VideoResumeCursor, u as VideoSceneValidationContext, e as VideoScene, b as VideoOrientation } from './types-2wHBqtg8.js';
2
+ import { a as VideoFinishReason, V as VideoWarning, b as VideoEvent } from './events-B6qS1Lsb.js';
3
+ export { c as VideoWarningCategory } from './events-B6qS1Lsb.js';
4
4
  import { S as SceneTemplateMetadata } from './catalog-types-BIhSpOWK.js';
5
+ import { V as VideoChatWelcomeOptions } from './types-DrABlRa7.js';
6
+ export { a as VideoChatCapabilities, b as VideoChatConversationTurn, c as VideoChatMode, d as VideoChatWelcomePrompt } from './types-DrABlRa7.js';
5
7
 
6
8
  interface VideoProviderUsage {
7
9
  inputTokens?: number;
@@ -133,6 +135,12 @@ interface MediaResolverContext {
133
135
  scene: Readonly<VideoScene>;
134
136
  templateId: string;
135
137
  preferredType: "image" | "video" | "any";
138
+ /**
139
+ * The visual language generated media must match, when the application set
140
+ * one. Append it to a provider prompt; a shot that ignores it is the
141
+ * mismatch this exists to prevent.
142
+ */
143
+ generatedLook?: string;
136
144
  signal: AbortSignal;
137
145
  }
138
146
  type MediaResolver = (query: string, context: MediaResolverContext) => ResolvedMedia | null | Promise<ResolvedMedia | null>;
@@ -150,6 +158,32 @@ interface VideoHandlerOptions extends Omit<VideoStreamHandlerOptions, "generate"
150
158
  allowMediaUrl?: Parameters<typeof createTemplateSceneValidator>[0]["allowMediaUrl"];
151
159
  /** Resolve bounded semantic media intent through an application-owned provider. */
152
160
  resolveMedia?: MediaResolver;
161
+ /**
162
+ * How many scenes may resolve media at once. Defaults to one.
163
+ *
164
+ * Raise it when resolution is slow enough to be felt - generated video rather
165
+ * than a stock search. Scenes are still emitted in the order they were
166
+ * planned; only the waiting overlaps.
167
+ */
168
+ mediaConcurrency?: number;
169
+ /**
170
+ * How many scenes in one request may resolve media at all.
171
+ *
172
+ * Unbounded by default, which is right when media is searched for and wrong
173
+ * when it is generated: the planner decides the scene count, and every scene
174
+ * is then a paid clip. Past the ceiling a scene keeps its copy on the brand
175
+ * gradient, and a `media_budget_reached` warning says it happened.
176
+ */
177
+ maxResolvedMedia?: number;
178
+ /**
179
+ * Ask the planner to write each scene's spoken line, on the scene itself.
180
+ *
181
+ * A narrated video otherwise costs a round trip per scene - handing a model
182
+ * the scene that was just planned and asking what to say over it - and those
183
+ * calls have to be chained, because a line is written knowing the ones
184
+ * before it. The planner already knows the scene and the ones around it.
185
+ */
186
+ narrate?: boolean;
153
187
  }
154
188
  /**
155
189
  * Build the secure route for a template kit while leaving provider, model,
@@ -157,4 +191,68 @@ interface VideoHandlerOptions extends Omit<VideoStreamHandlerOptions, "generate"
157
191
  */
158
192
  declare function createVideoHandler(options: VideoHandlerOptions): VideoStreamHandler;
159
193
 
160
- export { type MediaResolver, type MediaResolverContext, type ResolvedMedia, SceneTemplateMetadata as ServerTemplateMetadata, type ServerTemplateRegistry, VideoFinishReason, type VideoGenerationSummary, type VideoHandlerOptions, type VideoProviderUsage, VideoWarning, createServerTemplateRegistry, createVideoHandler };
194
+ type VideoChatTextTask = "narration" | "suggestions";
195
+ interface VideoChatTextContext {
196
+ task: VideoChatTextTask;
197
+ systemPrompt: string;
198
+ userPrompt: string;
199
+ maxOutputTokens: number;
200
+ signal: AbortSignal;
201
+ }
202
+ type VideoChatTextGenerator = (context: VideoChatTextContext) => string | Promise<string>;
203
+ interface VideoChatSpeechContext {
204
+ text: string;
205
+ signal: AbortSignal;
206
+ }
207
+ interface VideoChatSpeechResult {
208
+ audio: Uint8Array | ArrayBuffer;
209
+ mediaType?: string;
210
+ }
211
+ type VideoChatSpeechGenerator = (context: VideoChatSpeechContext) => VideoChatSpeechResult | Promise<VideoChatSpeechResult>;
212
+ interface VideoChatTranscriptionContext {
213
+ audio: Uint8Array;
214
+ mediaType: string;
215
+ signal: AbortSignal;
216
+ }
217
+ type VideoChatTranscriber = (context: VideoChatTranscriptionContext) => string | Promise<string>;
218
+ interface VideoChatMediaContext {
219
+ purpose: "response" | "welcome" | "suggestion";
220
+ orientation: VideoOrientation;
221
+ generatedLook?: string;
222
+ signal: AbortSignal;
223
+ requestId?: string;
224
+ scene?: Readonly<VideoScene>;
225
+ templateId?: string;
226
+ preferredType?: "image" | "video" | "any";
227
+ }
228
+ type VideoChatMediaResolver = (query: string, context: VideoChatMediaContext) => ResolvedMedia | null | Promise<ResolvedMedia | null>;
229
+ interface VideoChatHandlerOptions extends Omit<VideoHandlerOptions, "allowMediaUrl" | "basePrompt" | "maxResolvedMedia" | "narrate" | "resolveMedia"> {
230
+ /** Generate the small non-streaming text tasks around the visual plan. */
231
+ generateText: VideoChatTextGenerator;
232
+ /** Optional generated speech. Browsers can speak locally when absent. */
233
+ generateSpeech?: VideoChatSpeechGenerator;
234
+ /** Optional server transcription used when browser recognition is unavailable. */
235
+ transcribe?: VideoChatTranscriber;
236
+ /** Optional stock or application-owned media search. */
237
+ searchMedia?: VideoChatMediaResolver;
238
+ /** Optional generated-video provider. Its presence enables paid visual modes. */
239
+ generateVideo?: VideoChatMediaResolver;
240
+ /** Trusted application guidance appended to the general-purpose response brief. */
241
+ instructions?: string;
242
+ /** Application-owned prompts and visual searches shown before the first turn. */
243
+ welcome?: VideoChatWelcomeOptions;
244
+ /** Maximum accepted transcription body. Defaults to 8 MiB. */
245
+ maxAudioBytes?: number;
246
+ }
247
+ type VideoChatHandler = (request: Request) => Promise<Response>;
248
+ /**
249
+ * Create the complete provider-neutral server endpoint for a video chat.
250
+ *
251
+ * Mount the returned handler once and select operations with the `action`
252
+ * query parameter. Provider libraries and credentials stay in the application
253
+ * closures passed here; only bounded prompts, media, and capability booleans
254
+ * cross the browser boundary.
255
+ */
256
+ declare function createVideoChatHandler(options: VideoChatHandlerOptions): VideoChatHandler;
257
+
258
+ export { type MediaResolver, type MediaResolverContext, type ResolvedMedia, SceneTemplateMetadata as ServerTemplateMetadata, type ServerTemplateRegistry, type VideoChatHandlerOptions, VideoChatWelcomeOptions, VideoFinishReason, type VideoGenerationSummary, type VideoHandlerOptions, type VideoProviderUsage, VideoWarning, createServerTemplateRegistry, createVideoChatHandler, createVideoHandler };