@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
@@ -5,10 +5,10 @@ import {
5
5
  import {
6
6
  SceneBackground,
7
7
  getMediaBackgroundProps
8
- } from "./chunk-7BGAU6C3.js";
8
+ } from "./chunk-MXZSDGZQ.js";
9
9
  import {
10
10
  TemplateText
11
- } from "./chunk-TCEHK2BW.js";
11
+ } from "./chunk-YJJC4N4D.js";
12
12
  import "./chunk-L5BTTCZV.js";
13
13
  import "./chunk-FRN6WKHA.js";
14
14
  import "./chunk-W3VDIBGR.js";
@@ -7,10 +7,10 @@ import "./chunk-S7HFLYNN.js";
7
7
  import {
8
8
  SceneBackground,
9
9
  getMediaBackgroundProps
10
- } from "./chunk-7BGAU6C3.js";
10
+ } from "./chunk-MXZSDGZQ.js";
11
11
  import {
12
12
  TemplateText
13
- } from "./chunk-TCEHK2BW.js";
13
+ } from "./chunk-YJJC4N4D.js";
14
14
  import "./chunk-L5BTTCZV.js";
15
15
  import "./chunk-FRN6WKHA.js";
16
16
  import "./chunk-W3VDIBGR.js";
@@ -7,10 +7,10 @@ import {
7
7
  import {
8
8
  SceneBackground,
9
9
  getMediaBackgroundProps
10
- } from "./chunk-7BGAU6C3.js";
10
+ } from "./chunk-MXZSDGZQ.js";
11
11
  import {
12
12
  TemplateText
13
- } from "./chunk-TCEHK2BW.js";
13
+ } from "./chunk-YJJC4N4D.js";
14
14
  import "./chunk-L5BTTCZV.js";
15
15
  import "./chunk-FRN6WKHA.js";
16
16
  import "./chunk-W3VDIBGR.js";
@@ -9,10 +9,10 @@ import {
9
9
  import {
10
10
  SceneBackground,
11
11
  getMediaBackgroundProps
12
- } from "./chunk-7BGAU6C3.js";
12
+ } from "./chunk-MXZSDGZQ.js";
13
13
  import {
14
14
  TemplateText
15
- } from "./chunk-TCEHK2BW.js";
15
+ } from "./chunk-YJJC4N4D.js";
16
16
  import "./chunk-L5BTTCZV.js";
17
17
  import "./chunk-FRN6WKHA.js";
18
18
  import "./chunk-W3VDIBGR.js";
@@ -8,7 +8,7 @@ import "./chunk-QAAO7OAY.js";
8
8
  import {
9
9
  SceneBackground,
10
10
  getMediaBackgroundProps
11
- } from "./chunk-7BGAU6C3.js";
11
+ } from "./chunk-MXZSDGZQ.js";
12
12
  import {
13
13
  Emoji,
14
14
  renderWithEmoji
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  SceneBackground,
6
6
  getMediaBackgroundProps
7
- } from "./chunk-7BGAU6C3.js";
7
+ } from "./chunk-MXZSDGZQ.js";
8
8
  import {
9
9
  Emoji,
10
10
  renderWithEmoji
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  SceneBackground,
6
6
  getMediaBackgroundProps
7
- } from "./chunk-7BGAU6C3.js";
7
+ } from "./chunk-MXZSDGZQ.js";
8
8
  import "./chunk-FRN6WKHA.js";
9
9
  import {
10
10
  accessibleTextColor,
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  SceneBackground,
6
6
  getMediaBackgroundProps
7
- } from "./chunk-7BGAU6C3.js";
7
+ } from "./chunk-MXZSDGZQ.js";
8
8
  import "./chunk-FRN6WKHA.js";
9
9
  import {
10
10
  accessibleTextColor,
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  SceneBackground,
6
6
  getMediaBackgroundProps
7
- } from "./chunk-7BGAU6C3.js";
7
+ } from "./chunk-MXZSDGZQ.js";
8
8
  import {
9
9
  renderWithEmoji
10
10
  } from "./chunk-L5BTTCZV.js";
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  DEFAULT_VIDEO_SYSTEM_PROMPT,
3
3
  VIDEO_PLAN_INSTRUCTION,
4
- createVideoSystemPrompt
5
- } from "./chunk-PNS52FL4.js";
4
+ createVideoSystemPrompt,
5
+ videoPlanInstruction
6
+ } from "./chunk-5SLENAJW.js";
6
7
  export {
7
8
  DEFAULT_VIDEO_SYSTEM_PROMPT,
8
9
  VIDEO_PLAN_INSTRUCTION,
9
- createVideoSystemPrompt
10
+ createVideoSystemPrompt,
11
+ videoPlanInstruction
10
12
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BUILTIN_TEMPLATE_MANIFEST
3
- } from "./chunk-HVCPEAQF.js";
3
+ } from "./chunk-LKBZX7GV.js";
4
4
  export {
5
5
  BUILTIN_TEMPLATE_MANIFEST as builtinTemplates
6
6
  };
@@ -1,9 +1,9 @@
1
- import { I as InferTemplateJsonSchema, S as SceneTemplateProps, a as SceneTemplate } from './kit-DEG3fcaL.js';
2
- export { T as TemplateRegistry, c as createTemplateRegistry } from './kit-DEG3fcaL.js';
1
+ import { I as InferTemplateJsonSchema, S as SceneTemplateProps, a as SceneTemplate } from './kit-8g46H2RZ.js';
2
+ export { T as TemplateRegistry, c as createTemplateRegistry } from './kit-8g46H2RZ.js';
3
3
  import { ComponentType } from 'react';
4
4
  import { d as TemplateJsonSchema, S as SceneTemplateMetadata } from './catalog-types-BIhSpOWK.js';
5
5
  export { T as TemplateFamily, c as TemplateTimingMetadata, e as TemplateTransitionTiming } from './catalog-types-BIhSpOWK.js';
6
- import './types-BV9IqExh.js';
6
+ import './types-2wHBqtg8.js';
7
7
 
8
8
  interface TemplateExample<Variables extends Record<string, unknown> = Record<string, unknown>> {
9
9
  name: string;
package/dist/test.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { e as VideoScene, b as VideoOrientation, V as VideoStyle, c as Video, d as VideoAudio, j as VideoInput } from './types-BV9IqExh.js';
2
- import { V as VideoWarning, a as VideoFinishReason } from './events-BBP30j3c.js';
1
+ import { e as VideoScene, b as VideoOrientation, V as VideoStyle, c as Video, d as VideoAudio, g as VideoInput } from './types-2wHBqtg8.js';
2
+ import { V as VideoWarning, a as VideoFinishReason } from './events-B6qS1Lsb.js';
3
3
 
4
4
  type MockVideoStreamPart = {
5
5
  type: "scene.add";
package/dist/test.js CHANGED
@@ -233,9 +233,9 @@ async function* simulateVideoStream(parts, options = {}) {
233
233
  if (timeoutMs != null && (!Number.isFinite(timeoutMs) || timeoutMs < 0)) {
234
234
  throw new Error("Simulation timeoutMs must be a non-negative finite number");
235
235
  }
236
- const { createVideo } = await import("./compose-video-JWIEDTEJ.js");
237
- const { createTextDeltaVideoPlanner } = await import("./text-stream-J6EDDJP4.js");
238
- const { BUILTIN_SERVER_TEMPLATE_KIT } = await import("./builtin-server-YHEZ2JRF.js");
236
+ const { createVideo } = await import("./compose-video-PD6LKKRK.js");
237
+ const { createTextDeltaVideoPlanner } = await import("./text-stream-ROTNGSD4.js");
238
+ const { BUILTIN_SERVER_TEMPLATE_KIT } = await import("./builtin-server-KB7FKF6A.js");
239
239
  const { createTemplateSceneValidator } = await import("./validate-T7GBU2YF.js");
240
240
  const controller = new AbortController();
241
241
  const forwardAbort = () => controller.abort(options.signal?.reason);
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createTextDeltaVideoPlanner
3
- } from "./chunk-34O5BY6X.js";
3
+ } from "./chunk-LLPMVDJZ.js";
4
4
  import "./chunk-E7CL7UPB.js";
5
- import "./chunk-G66Z5CWR.js";
5
+ import "./chunk-MMUXVA47.js";
6
6
  import "./chunk-AOWSXU2K.js";
7
7
  import "./chunk-XGRA2MUV.js";
8
8
  export {
@@ -47,8 +47,23 @@ interface VideoStyle {
47
47
  defaultTransition?: string;
48
48
  density?: string;
49
49
  motion?: string;
50
+ /**
51
+ * The visual language generated media is produced in.
52
+ *
53
+ * A style has two halves once media can be generated: the brand decides how
54
+ * captions are drawn, and this decides what the footage behind them looks
55
+ * like. They have to travel together - pale illustrated ground under dark
56
+ * documentary footage is unreadable - so this belongs on the style rather
57
+ * than being threaded into each provider call by hand.
58
+ *
59
+ * Nothing is rendered from it. It reaches `resolveMedia`, which is where a
60
+ * provider prompt is written.
61
+ */
62
+ generatedLook?: string;
50
63
  }
51
64
  interface VideoStyleOptions {
65
+ /** The visual language generated media is produced in. See `VideoStyle`. */
66
+ generatedLook?: string;
52
67
  density?: "airy" | "normal" | "packed";
53
68
  motion?: "calm" | "normal" | "punchy";
54
69
  textArchetype?: "subtle" | "typewriter" | "wordStagger" | "slam" | "cinematic" | "heroWord";
@@ -69,6 +84,19 @@ interface VideoScene {
69
84
  textArchetype?: string;
70
85
  backgroundEffect?: string;
71
86
  timing: VideoTiming;
87
+ /**
88
+ * What is said aloud while this scene is showing.
89
+ *
90
+ * A narrated video otherwise has to be carried as two things kept in step by
91
+ * index - the scenes, and a separate script - and they drift. Holding the
92
+ * line on the scene keeps them together through planning, playback, storage
93
+ * and replay, so a stored video can be spoken again without the model that
94
+ * wrote it.
95
+ *
96
+ * The renderer never draws this. It is the spoken half of the scene, not
97
+ * on-screen copy.
98
+ */
99
+ narration?: string;
72
100
  }
73
101
  interface VideoAudio {
74
102
  trackId: string;
@@ -194,4 +222,4 @@ interface VideoSnapshotRetention {
194
222
  suppliedMediaUrls?: boolean;
195
223
  }
196
224
 
197
- export { type VideoStyle as V, type VideoCapabilities as a, type VideoOrientation as b, type Video as c, type VideoAudio as d, type VideoScene as e, VIDEO_PROTOCOL_VERSION as f, type VideoBrandInput as g, type VideoBrand as h, type VideoBackground as i, type VideoInput as j, type VideoKnowledgeMode as k, type VideoStyleOptions as l, type VideoSuppliedMedia as m, type VideoGenerationContext as n, type VideoPlanner as o, type VideoRequest as p, type VideoSceneValidator as q, type VideoTemplatePacing as r, type VideoSnapshotRetention as s, type VideoResumeCursor as t, type VideoSceneValidationContext as u };
225
+ export { type VideoStyle as V, type VideoCapabilities as a, type VideoOrientation as b, type Video as c, type VideoAudio as d, type VideoScene as e, VIDEO_PROTOCOL_VERSION as f, type VideoInput as g, type VideoBrandInput as h, type VideoBrand as i, type VideoTemplatePacing as j, type VideoBackground as k, type VideoKnowledgeMode as l, type VideoStyleOptions as m, type VideoSuppliedMedia as n, type VideoGenerationContext as o, type VideoPlanner as p, type VideoRequest as q, type VideoSceneValidator as r, type VideoSnapshotRetention as s, type VideoResumeCursor as t, type VideoSceneValidationContext as u };
@@ -0,0 +1,46 @@
1
+ type VideoChatMode = "templates" | "full";
2
+ interface VideoChatConversationTurn {
3
+ prompt: string;
4
+ response?: string;
5
+ }
6
+ interface VideoChatCapabilities {
7
+ templates: true;
8
+ generatedSpeech: boolean;
9
+ generatedVideo: boolean;
10
+ stockMedia: boolean;
11
+ transcription: boolean;
12
+ modes: VideoChatMode[];
13
+ }
14
+ interface VideoChatMedia {
15
+ url: string;
16
+ type: "image" | "video";
17
+ posterUrl?: string;
18
+ }
19
+ interface VideoChatSuggestion {
20
+ prompt: string;
21
+ /** Optional short hook that can start speaking the moment this suggestion is selected. */
22
+ opening?: string;
23
+ media: VideoChatMedia | null;
24
+ }
25
+ interface VideoChatAskOptions {
26
+ /** Reuse already-loaded suggestion footage while the answer is prepared. */
27
+ openingMedia?: VideoChatMedia | null;
28
+ /** A prewritten 6-9 word hook that can start immediately while the response streams. */
29
+ opening?: string;
30
+ }
31
+ interface VideoChatWelcome {
32
+ hero: VideoChatMedia | null;
33
+ cards: VideoChatSuggestion[];
34
+ }
35
+ interface VideoChatWelcomePrompt {
36
+ prompt: string;
37
+ /** A prewritten 6-9 word hook for an instant suggested-prompt response. */
38
+ opening?: string;
39
+ mediaQuery?: string;
40
+ }
41
+ interface VideoChatWelcomeOptions {
42
+ heroQuery?: string;
43
+ prompts?: readonly VideoChatWelcomePrompt[];
44
+ }
45
+
46
+ export type { VideoChatWelcomeOptions as V, VideoChatCapabilities as a, VideoChatConversationTurn as b, VideoChatMode as c, VideoChatWelcomePrompt as d, VideoChatAskOptions as e, VideoChatMedia as f, VideoChatSuggestion as g, VideoChatWelcome as h };
@@ -2,39 +2,63 @@
2
2
 
3
3
  # Agent integration
4
4
 
5
- Use the same public path a human developer uses. The optional repository skill
6
- packages these instructions for coding agents:
5
+ Coding agents should build the same canonical video chat as a human developer.
6
+ Install the repository skill when the agent supports skills:
7
7
 
8
8
  ```bash
9
9
  npx skills add VanillaSkyAi/video@vanillasky
10
10
  ```
11
11
 
12
- ## Build the first response
12
+ Then prompt: `Use $vanillasky to set up and verify a general-purpose video chat in this project.`
13
13
 
14
- 1. Install `@vanillaskyai/video`.
15
- 2. Choose and configure a current model separately; put its provider key in an
16
- ignored `.env.local` file.
17
- 3. Connect that app-owned model with `createVideoHandler` in an authenticated
18
- server route.
19
- 4. Pass grounded text or structured data as `input`.
20
- 5. Call `useVideo()` and render `VideoPlayer` in React.
21
- 6. Verify one complete response in a browser before adding optional features.
14
+ ## Set up the canonical chat
22
15
 
23
- The root README and `examples/nextjs-quickstart` are the canonical working
24
- reference. Built-in templates require no registry setup.
16
+ The skill follows this public path in an empty npm project:
25
17
 
26
- ## Keep responsibilities clear
18
+ ```bash
19
+ npx @vanillaskyai/video init
20
+ npx vanillasky doctor
21
+ npm run dev
22
+ ```
23
+
24
+ Init generates the thin application-owned shell around the SDK's complete
25
+ `VideoChat` experience. The default uses packaged templates + browser voice.
26
+ One text-provider key makes it answer; optional keys enable generated speech,
27
+ stock media, transcription, and generated video without client changes.
28
+
29
+ If doctor reports a missing key, add the named key to the ignored `.env.local`
30
+ yourself. Never read or print a secret value, and never paste one into the chat.
31
+ Doctor is the safe capability interface: it reports names and readiness only.
32
+
33
+ ## Verify, do not merely scaffold
34
+
35
+ The agent should leave the dev server running and open its reported localhost
36
+ URL in a real browser. Browser automation should use normal motion
37
+ (`reducedMotion: "no-preference"`) so playback advances.
38
+
39
+ 1. Confirm the welcome screen, suggestions, composer, and voice control load
40
+ without console or page errors.
41
+ 2. Ask one explanatory question and confirm the answer streams, speaks, reaches
42
+ its final frame, and returns to a usable composer.
43
+ 3. Ask one unrelated creative question in the same conversation and confirm it
44
+ produces a distinct response.
45
+ 4. If doctor reports generated video ready, choose that mode and verify one
46
+ suitable prompt without editing client code.
47
+ 5. Check failed network responses before reporting success.
48
+
49
+ The handoff should name the localhost URL and ready capabilities. It should
50
+ never include credential values.
51
+
52
+ ## Keep ownership clear
27
53
 
28
- VanillaSky owns the planning prompt, trusted templates, validation, streaming
29
- protocol, and player. The application owns its LLM, credentials,
30
- authentication, source retrieval, media licensing, persistence, and product
31
- UI.
54
+ VanillaSky owns the chat flow, planning prompts, templates, validation,
55
+ streaming, voice timing, and player. The application owns provider choices,
56
+ keys, authentication, persistence, branding, copy, and policy.
32
57
 
33
- Use `input` for facts the video may claim, `instructions` for presentation
34
- direction, and `personalization` for viewer or account context. Treat all three
35
- as untrusted application data. Add brand, media, audio, persistence, or custom
36
- templates only when the requested experience needs them.
58
+ Customize generated application files only after the default chat passes in the
59
+ browser. Do not inspect SDK internals, copy its template tree, or invent a
60
+ parallel integration path. Source-own a template with
61
+ `npx vanillasky templates ...` only when the product actually needs to edit it.
37
62
 
38
- If a required credential is missing, ask the developer to add it to the ignored
39
- environment file. Never invent another provider or request secret values in
40
- chat.
63
+ The root README and [Getting started](getting-started.md) are the canonical
64
+ human references. Evaluation-only package checks remain in the maintainer docs.
@@ -7,35 +7,38 @@ embedded video that starts playing while it is still being composed.
7
7
  ## The shortest mental model
8
8
 
9
9
  ```text
10
- application context
10
+ user message + conversation context
11
11
  → app-owned model
12
12
  → trusted scene plan
13
13
  → validation and streaming protocol
14
- embedded React player
14
+ synchronized voice-and-video response
15
15
  ```
16
16
 
17
- VanillaSky does not choose your model, retrieve your application context, or
18
- generate executable UI code. It supplies the video-planning prompt, trusted
19
- visual vocabulary, validation, streaming lifecycle, and player.
17
+ VanillaSky does not choose your model, retrieve private application context, or
18
+ own your product policy. It supplies the complete default chat, video-planning
19
+ prompts, trusted visual vocabulary, conversation and narration lifecycle,
20
+ validation, streaming, and player.
20
21
 
21
22
  ## Repository map
22
23
 
23
24
  | Location | Purpose |
24
25
  | --- | --- |
25
- | `src/server/create-video-handler.ts` | Public server integration and provider adapter boundary |
26
+ | `src/server/create-video-chat-handler.ts` | Complete chat endpoint and capability boundary |
27
+ | `src/server/create-video-handler.ts` | Lower-level video composition and provider adapter boundary |
26
28
  | `src/server/prompts/` | System and user prompts sent to the app-owned model |
27
29
  | `src/server/model/` | Converts provider text deltas into typed video plan parts |
28
30
  | `src/protocol/` | Shared request, event, validation, checksum, and SSE contract |
29
31
  | `src/player/` | Browser stream client, `useVideo`, timeline, and React player |
32
+ | `src/video-chat/` | Default `VideoChat` interface and headless conversation/session engine |
30
33
  | `src/visual-system/catalog/` | Template metadata, schemas, loading, and planner catalog |
31
34
  | `src/visual-system/scene-templates/` | Complete scenes the model may select |
32
35
  | `src/visual-system/primitives/` | Reusable visual components used inside scenes |
33
36
  | `src/visual-system/backgrounds/` | Standalone background renderers |
34
37
  | `src/visual-system/motion/` | Animation functions and timing behavior |
35
38
  | `src/visual-system/theme/` | Color and design tokens |
36
- | `src/cli/` | `vanillasky create`, `add`, `sync`, `check`, `list`, and `describe` for customer-owned templates |
39
+ | `src/cli/` | `vanillasky init` and `doctor`, plus `vanillasky templates create`, `add`, `sync`, `check`, `list`, and `describe` |
37
40
  | `registry/items/` | Generated distributable copies installed into customer projects |
38
- | `src/index.ts`, `src/server.ts`, `src/react.ts`, `src/templates.ts`, `src/template-catalog.ts`, `src/test.ts` | The six small public package entry points |
41
+ | `src/index.ts`, `src/server.ts`, `src/react.ts`, `src/templates.ts`, `src/template-catalog.ts`, `src/test.ts`, `styles/video-chat.css` | The six small code entry points and one scoped stylesheet |
39
42
 
40
43
  The source of truth for built-in visuals is `src/visual-system`. The JSON files
41
44
  in `registry/items` are distribution artifacts, kept flat so the CLI can address
@@ -44,25 +47,36 @@ every installable item by a stable name. Their `meta.vanillasky.layer` and
44
47
  support code. Run `npm run registry:sync` after changing canonical visual source.
45
48
 
46
49
  Customer applications do not edit those internal locations. Their source of
47
- truth is one file per visual under `vanillasky/templates/`; `vanillasky sync`
50
+ truth is one file per visual under `vanillasky/templates/`; `vanillasky templates sync`
48
51
  derives a browser registry in `vanillasky/index.ts` and a React-free
49
52
  prompt/validation registry in `vanillasky/server.ts`.
50
53
 
51
54
  ## Request flow
52
55
 
53
- 1. `useVideo().generate(...)` sends grounded input and live application context
54
- to the authenticated application route.
55
- 2. `createVideoHandler(...)` builds the prompts and calls the application's
56
- `streamText` adapter. This is where OpenAI, Anthropic, or another model is
57
- connected.
58
- 3. The system prompt combines the composition rules with the trusted template
56
+ 1. `VideoChat` uses `useVideoChat` to send the user's message. A clicked
57
+ suggestion can start its prewritten hook and existing media immediately.
58
+ 2. For a typed prompt, the model emits a short hook first and then continues
59
+ planning scenes in the same response stream. Its stock-search keyword is
60
+ resolved separately while the hook is spoken.
61
+ 3. `createVideoChatHandler(...)` owns chat actions, suggestions, narration,
62
+ capability discovery, and generated-video budgets. The application supplies
63
+ provider callbacks and policy.
64
+ 4. Video answers flow into `createVideoHandler(...)`, which calls the
65
+ application's `streamText` adapter. This is where Anthropic, OpenAI, or
66
+ another text model is connected.
67
+ 5. The system prompt combines the opening and composition rules with the trusted template
59
68
  catalog, including generated metadata for customer-owned templates. The user
60
69
  prompt serializes the factual input, instructions,
61
70
  personalization, brand, and approved media.
62
- 4. The model streams NDJSON plan parts. The server parses and validates complete
63
- scenes before emitting versioned video events.
64
- 5. The browser reduces those events into a deterministic `Video`; `VideoPlayer`
65
- starts as soon as its first playable scene arrives.
71
+ 6. The model streams one host-consumed opening object followed by NDJSON plan
72
+ parts. The server emits the opening event, then parses and validates complete
73
+ scenes before emitting them.
74
+ 7. The browser reduces those events into a deterministic `Video`. The opening
75
+ loops or holds until its voice ends and the first playable scene is ready;
76
+ the planned playback and narration then take over in one cut.
77
+
78
+ The lower-level `useVideo` and `VideoPlayer` path skips chat actions and remains
79
+ available for explicit one-shot video response integrations.
66
80
 
67
81
  ## Where to change common behavior
68
82
 
@@ -79,6 +93,7 @@ prompt/validation registry in `vanillasky/server.ts`.
79
93
 
80
94
  ## Public vocabulary
81
95
 
82
- Use `Video`, `VideoInput`, `useVideo`, and `VideoPlayer` for the product API.
83
- Use “video response” when describing the lifecycle or output category. Use
84
- “motion” only for animation behavior inside the visual system.
96
+ Use `VideoChat`, `useVideoChat`, `createVideoChatHandler`, `Video`, `VideoInput`,
97
+ `useVideo`, and `VideoPlayer` for the product API. Use “video response” when
98
+ describing the lifecycle or output category. Use “motion” only for animation
99
+ behavior inside the visual system.
@@ -1,4 +1,4 @@
1
- [← Documentation home](../README.md) · [Previous: Input and first scene](input-and-first-scene.md) · [Next: Media and audio →](media-and-audio.md)
1
+ [← Documentation home](../README.md) · [Previous: Prompt and conversation input](prompt-and-input.md) · [Next: Media and audio →](media-and-audio.md)
2
2
 
3
3
  # Branding and personalization
4
4
 
package/docs/concepts.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  # Core concepts
4
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
+
5
19
  ## Video response
6
20
 
7
21
  A video response is a short, responsive animated experience assembled from
@@ -24,28 +24,28 @@ List the effective catalog, including project-owned templates, before choosing
24
24
  what to build or copy:
25
25
 
26
26
  ```bash
27
- npx vanillasky list
27
+ npx vanillasky templates list
28
28
  ```
29
29
 
30
30
  Create an original template:
31
31
 
32
32
  ```bash
33
- npx vanillasky create customer-health
34
- npx vanillasky describe customer-health
33
+ npx vanillasky templates create customer-health
34
+ npx vanillasky templates describe customer-health
35
35
  ```
36
36
 
37
37
  Or copy a built-in when its behavior is already close:
38
38
 
39
39
  ```bash
40
- npx vanillasky add bigNumber
40
+ npx vanillasky templates add bigNumber
41
41
  ```
42
42
 
43
43
  Then edit the owned `.tsx` file, regenerate the two small registries, and check
44
44
  the complete contract:
45
45
 
46
46
  ```bash
47
- npx vanillasky sync
48
- npx vanillasky check
47
+ npx vanillasky templates sync
48
+ npx vanillasky templates check
49
49
  ```
50
50
 
51
51
  For an original template, the source is
@@ -62,8 +62,8 @@ registry parity.
62
62
  Preview either operation without applying the proposed file writes:
63
63
 
64
64
  ```bash
65
- npx vanillasky add bigNumber --dry-run
66
- npx vanillasky add bigNumber --diff
65
+ npx vanillasky templates add bigNumber --dry-run
66
+ npx vanillasky templates add bigNumber --diff
67
67
  ```
68
68
 
69
69
  `--dry-run` lists every proposed file and `--diff` shows its content changes,
@@ -79,7 +79,7 @@ An edited file is never replaced unless you explicitly pass `--overwrite`.
79
79
 
80
80
  ## One file is the contract
81
81
 
82
- The file created by `vanillasky create` is a complete working template. Keep
82
+ The file created by `vanillasky templates create` is a complete working template. Keep
83
83
  these concerns together:
84
84
 
85
85
  - `useWhen` and `avoidWhen` tell the AI when the visual is appropriate;
@@ -2,6 +2,42 @@
2
2
 
3
3
  # Customization
4
4
 
5
+ ## Video chat interface
6
+
7
+ The default `VideoChat` interface is already responsive and accessible. Pass a
8
+ custom welcome heading and a root class when the application needs its own copy
9
+ or chrome colors:
10
+
11
+ ```tsx
12
+ <VideoChat
13
+ className="acme-chat"
14
+ welcomeTitle={<>Ask Acme<br />See the answer</>}
15
+ options={{ brand: acmeBrand }}
16
+ />
17
+ ```
18
+
19
+ Override the scoped custom properties after importing
20
+ `@vanillaskyai/video/video-chat.css`; the selectors and values stay local to
21
+ that instance:
22
+
23
+ ```css
24
+ .acme-chat {
25
+ --vs-accent: #0057ff;
26
+ --vs-accent-deep: #003fb8;
27
+ --vs-voice: #e11d74;
28
+ --vs-font: "Inter", sans-serif;
29
+ --vs-radius-lg: 1rem;
30
+ }
31
+ ```
32
+
33
+ Use `options` for the endpoint, templates, orientation, visual brand, request
34
+ headers, and an optional custom voice. Provider capabilities are discovered
35
+ from the server. Use `useVideoChat()` only when the application needs to own the
36
+ entire interface.
37
+
38
+ The sections below customize lower-level, one-shot video composition. They are
39
+ not required for the default chat.
40
+
5
41
  ## Background and semantic brand
6
42
 
7
43
  Omit brand configuration to use the standard `cosmic` background. Prefer a
@@ -125,16 +161,16 @@ Pass `audio: { src }` for a specific track, omit `audio` to let the server choos
125
161
  synchronously from a preloaded catalog, or pass `audio: false` for silence.
126
162
  VanillaSky infers deterministic duration, volume, beat, and fade-out metadata.
127
163
  The soundtrack should continue across visual generation gaps and finish with
128
- the final scene. Narration, TTS, and speech synchronization are not part of the
129
- 0.1 SDK contract.
164
+ the final scene. `VideoChat` separately owns narration, TTS integration, browser
165
+ voice fallback, and speech synchronization for conversational responses.
130
166
 
131
167
  ## Custom templates
132
168
 
133
169
  The built-in catalog needs no setup. Only source-owned templates need the
134
170
  optional local TSX compiler; install it once with `npm install --save-dev tsx`.
135
- Then use `npx vanillasky create <id>` for an original one-file template or
136
- `npx vanillasky add <builtin>` to copy a close built-in. Edit the owned file,
137
- run `npx vanillasky sync`, then run `npx vanillasky check` before committing.
171
+ Then use `npx vanillasky templates create <id>` for an original one-file template or
172
+ `npx vanillasky templates add <builtin>` to copy a close built-in. Edit the owned file,
173
+ run `npx vanillasky templates sync`, then run `npx vanillasky templates check` before committing.
138
174
  Pass the generated registry to the server and browser; project-owned IDs
139
175
  replace matching built-ins and new IDs extend the catalog.
140
176