@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.
- package/CHANGELOG.md +74 -1
- package/PUBLIC-API.md +45 -438
- package/README.md +57 -96
- package/dist/builtin-metadata-OT6V7TB4.js +8 -0
- package/dist/{chapter-title-2JVDU62E.js → chapter-title-2RCXX7SN.js} +1 -2
- package/dist/{chunk-PDQFQIQW.js → chunk-3EQ6PVWL.js} +1 -1
- package/dist/chunk-4G4JBMCM.js +37 -0
- package/dist/{chunk-7AA2JWHZ.js → chunk-5DOQTIMD.js} +6 -6
- package/dist/chunk-666HGTVZ.js +41 -0
- package/dist/{chunk-7M56IUUX.js → chunk-6Z3ID54H.js} +0 -18
- package/dist/{chunk-5BSJLT6H.js → chunk-E7FHBLAC.js} +16 -29
- package/dist/chunk-HIQM4J3U.js +30 -0
- package/dist/chunk-ISWQ6T5X.js +36 -0
- package/dist/{chunk-224QNWRA.js → chunk-K5J7ESRO.js} +1 -10
- package/dist/chunk-KMVRBUL5.js +50 -0
- package/dist/chunk-NM4CXXZY.js +25 -0
- package/dist/{chunk-44WND2VP.js → chunk-V2CP7PVY.js} +19 -63
- package/dist/{chunk-3O7OMMMF.js → chunk-WZESNEPT.js} +0 -1
- package/dist/{chunk-RXTN2CW6.js → chunk-Z3DLSLAJ.js} +1 -1
- package/dist/cinema-media-YZ2UANJG.js +365 -0
- package/dist/cli.js +154 -1753
- package/dist/{compose-video-BH5K6XWT.js → compose-video-H2YUQDUY.js} +4 -4
- package/dist/{events-B4YCc4vc.d.ts → events-BZAfl0Dm.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -6
- package/dist/preload-media-23JXUFCF.js +77 -0
- package/dist/react.d.ts +39 -15
- package/dist/react.js +1350 -739
- package/dist/scene-validation-SGLLLFY5.js +9 -0
- package/dist/server.d.ts +67 -117
- package/dist/server.js +262 -614
- package/dist/test.d.ts +2 -2
- package/dist/test.js +21 -21
- package/dist/{text-stream-LD364KBI.js → text-stream-SOVLYR2L.js} +2 -2
- package/dist/{types-BqB8zC9u.d.ts → types-CG-kPI81.d.ts} +3 -1
- package/dist/{types-DdZw4GRQ.d.ts → types-ht-Zw3Wv.d.ts} +1 -1
- package/docs/agent-integration.md +19 -64
- package/docs/architecture.md +82 -87
- package/docs/customization.md +49 -66
- package/docs/development.md +18 -17
- package/docs/errors.md +4 -4
- package/docs/getting-started.md +74 -93
- package/docs/media-and-audio.md +9 -7
- package/docs/performance.md +11 -6
- package/docs/persistence.md +3 -7
- package/docs/production.md +4 -15
- package/docs/prompt-and-input.md +1 -2
- package/docs/provider-integration.md +134 -181
- package/docs/reference/protocol.md +5 -14
- package/docs/reference/provider-adapters.md +21 -13
- package/docs/security.md +1 -14
- package/docs/testing.md +56 -123
- package/package.json +5 -27
- package/starters/video-chat/.env.example +12 -4
- package/starters/video-chat/.env.native.example +13 -0
- package/starters/video-chat/README.md +72 -11
- package/starters/video-chat/package.json +1 -1
- package/starters/video-chat/providers/text-native.ts +94 -0
- package/starters/video-chat/providers/text.ts +19 -0
- package/starters/video-chat/providers/transcription.ts +32 -0
- package/starters/video-chat/providers/video-custom.ts +45 -0
- package/starters/video-chat/providers/video-delivery.ts +57 -0
- package/starters/video-chat/providers/video-google.ts +48 -0
- package/starters/video-chat/providers/video-job.ts +103 -0
- package/starters/video-chat/providers/video-runway.ts +45 -0
- package/starters/video-chat/providers/video.ts +39 -63
- package/starters/video-chat/server.ts +3 -29
- package/starters/video-chat/vite.config.ts +2 -8
- package/styles/video-chat.css +8 -105
- package/dist/builtin-server-W4PLJUZ5.js +0 -8
- package/dist/catalog-types-WTbLP6Jh.d.ts +0 -78
- package/dist/check-runtime.d.ts +0 -15
- package/dist/check-runtime.js +0 -96
- package/dist/chunk-2E6T633S.js +0 -27
- package/dist/chunk-4YM2M62S.js +0 -13
- package/dist/chunk-4ZJLPHBV.js +0 -684
- package/dist/chunk-5JBMYQP6.js +0 -156
- package/dist/chunk-73NTSFFI.js +0 -81
- package/dist/chunk-EGVQODKU.js +0 -83
- package/dist/chunk-HFVNAPHZ.js +0 -35
- package/dist/chunk-IIN5M5HW.js +0 -697
- package/dist/chunk-IQMYK5DX.js +0 -133
- package/dist/chunk-IR44XKBI.js +0 -46
- package/dist/chunk-JKVOBTRO.js +0 -145
- package/dist/chunk-LVM5Q2DL.js +0 -68
- package/dist/chunk-M4QTEJTK.js +0 -709
- package/dist/chunk-QSBDB4J2.js +0 -16
- package/dist/chunk-R3XAOMKP.js +0 -29
- package/dist/chunk-SPVTJH3F.js +0 -24
- package/dist/chunk-YAHT3LST.js +0 -663
- package/dist/chunk-ZD2VTUYR.js +0 -28
- package/dist/cinema-media-HYCDG65Z.js +0 -11
- package/dist/comparison-XXAP4S4J.js +0 -36
- package/dist/editorial-timeline-VUQC6KPA.js +0 -42
- package/dist/key-figure-4TJK7HLT.js +0 -29
- package/dist/kit-DrRpdn0p.d.ts +0 -79
- package/dist/mobile-message-FIHAO6XC.js +0 -49
- package/dist/preload-media-LJXWKTWG.js +0 -57
- package/dist/quote-GRPIYKQJ.js +0 -32
- package/dist/system-prompt-AG26KJAA.js +0 -12
- package/dist/template-catalog.d.ts +0 -400
- package/dist/template-catalog.js +0 -6
- package/dist/templates.d.ts +0 -25
- package/dist/templates.js +0 -102
- package/dist/validate-4OUD2CLX.js +0 -10
- package/docs/concepts.md +0 -107
- package/docs/custom-templates.md +0 -346
- package/docs/immersive-interface.md +0 -86
- package/docs/maintainers/cinematic-migration.md +0 -38
- package/docs/motion-and-effects.md +0 -109
- package/docs/reference/design-system.html +0 -125
- package/docs/responsive-orientation.md +0 -37
- package/docs/streaming-protocol.md +0 -15
- package/examples/custom-template/README.md +0 -19
- package/examples/custom-template/minimal-text.tsx +0 -82
- package/examples/custom-template/structured-data.tsx +0 -104
- package/registry/items/backgrounds.json +0 -70
- package/registry/items/chapterTitle.json +0 -80
- package/registry/items/cinemaMedia.json +0 -136
- package/registry/items/comparison.json +0 -168
- package/registry/items/editorialTimeline.json +0 -172
- package/registry/items/keyFigure.json +0 -162
- package/registry/items/mobileMessage.json +0 -153
- package/registry/items/motion.json +0 -45
- package/registry/items/quote.json +0 -161
- package/registry/items/template-context.json +0 -31
- package/registry/items/theme.json +0 -47
- package/registry/items/typography.json +0 -47
package/docs/development.md
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Development
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use Node 22+ and the locked npm version. Run `npm ci` once in your worktree.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```bash
|
|
6
|
+
npm run dev:chat
|
|
7
|
+
```
|
|
6
8
|
|
|
7
|
-
The
|
|
9
|
+
The local chat harness imports source directly for HMR. Keep media fixtures:
|
|
10
|
+
they exercise real decoder, readiness, audio-clock, and replay boundaries.
|
|
11
|
+
There is no catalog generation or registry synchronization step.
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
For an ordinary edit, run the affected test files, lint, and typecheck. Add a
|
|
14
|
+
focused regression for a behavior change. Run browser tests when playback or UI
|
|
15
|
+
behavior changes; use the packed-consumer gates when exports, starter code, or
|
|
16
|
+
public examples change. Do not run the complete release matrix repeatedly during
|
|
17
|
+
the edit loop.
|
|
10
18
|
|
|
11
|
-
|
|
19
|
+
`npm run verify:release` is the final candidate gate: it builds one artifact and
|
|
20
|
+
reuses it for clean-room consumers. `verify:package` already verifies public API
|
|
21
|
+
declarations/runtime boundaries; `verify:api` is a targeted shortcut, not an
|
|
22
|
+
additional full-release pass.
|
|
12
23
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
`npm run check:chat` runs the harness/unit recovery cases, checks harness TypeScript and runs one Chromium recording with short footage looping under actual audio. Install Chromium once with `npx playwright install chromium`. The harness smoke additionally records submit-to-visible-chapter paint opportunity with a 200 ms warm-UI target. This is a browser animation-frame opportunity, not a physical display measurement. The target for the complete command is under a minute on a warm machine; the command reports its measured duration. It does not replace release checks or claim browser-wide/live-provider coverage.
|
|
16
|
-
|
|
17
|
-
## One candidate for release verification
|
|
18
|
-
|
|
19
|
-
`npm run verify:release` runs registry, lint, type, unit, acceptance, size, production dependency audit, API, packed-consumer, onboarding, provider and all existing browser checks. It builds and packs once into ignored `artifacts/chat-candidate/`, then sends the exact tarball and integrity to every consumer verifier. Each verifier still uses its independent clean install. Browser and provider compatibility remain independent gates; no paid API calls are enabled by this command.
|
|
20
|
-
|
|
21
|
-
`candidate.json` records version, source commit, dirty-tree status, SHA-256 and npm integrity. A local candidate may include uncommitted work; it is never called a published artifact. `VANILLASKY_CANDIDATE_DIR` selects a different output directory. The command verifies but never publishes, merges or deploys. CI additionally retains the existing Node and React version checks.
|
|
22
|
-
|
|
23
|
-
For one targeted consumer check, run `node scripts/chat-candidate.mjs`, then provide `VANILLASKY_PACKED_TARBALL`, `VANILLASKY_EXPECTED_INTEGRITY` and `VANILLASKY_EXPECTED_SHA256` from that manifest to an existing verifier. Do not repack between checks of the same candidate.
|
|
24
|
+
[Architecture](architecture.md) · [Contributing](https://github.com/VanillaSkyAi/video/blob/main/CONTRIBUTING.md)
|
package/docs/errors.md
CHANGED
|
@@ -11,9 +11,9 @@ be produced. Never put provider details or stack traces in the interface.
|
|
|
11
11
|
| Failure | Result |
|
|
12
12
|
| --- | --- |
|
|
13
13
|
| Invalid planner scene | Skip the part and accept later valid scenes |
|
|
14
|
-
| Generated footage |
|
|
15
|
-
| Stock lookup or candidate | Continue with another candidate or
|
|
16
|
-
|
|
|
14
|
+
| Generated footage | Use a narrated chapter; never silently switch to stock |
|
|
15
|
+
| Stock lookup or candidate | Continue with another stock candidate or narrated chapter |
|
|
16
|
+
| Scene renderer | Isolate the failed scene with a safe visual |
|
|
17
17
|
| Missing narration | Continue with scene text |
|
|
18
18
|
| Generated speech | Use browser voice |
|
|
19
19
|
| Late stream failure | Keep playable opening and completed scenes |
|
|
@@ -50,7 +50,7 @@ Automated regression and acceptance tests use mocked providers. See
|
|
|
50
50
|
|
|
51
51
|
## Slow optional providers
|
|
52
52
|
|
|
53
|
-
Generated video
|
|
53
|
+
Generated video starts with a 15-second preparation budget; later deadlines account for the scene's position. Stock media, generated
|
|
54
54
|
speech preparation, and fallback scene narration have 3-second deadlines.
|
|
55
55
|
A deadline uses the same safe fallback as a failed provider; completed scenes
|
|
56
56
|
and scene order are preserved. Providers receive cancellation, and late results
|
package/docs/getting-started.md
CHANGED
|
@@ -1,115 +1,96 @@
|
|
|
1
|
-
[← Documentation home](../README.md) · [Next: Provider integration →](provider-integration.md)
|
|
2
|
-
|
|
3
1
|
# Getting started
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
It starts with a template introduction and browser voice. Add the video adapter
|
|
7
|
-
and its server key for generated footage, or choose Pexels for stock footage.
|
|
8
|
-
Without a media provider, the answer retains narration and subtitles with an
|
|
9
|
-
chapter template. Generated speech is optional.
|
|
10
|
-
|
|
11
|
-
## Create the app
|
|
12
|
-
|
|
13
|
-
Start in an empty folder:
|
|
3
|
+
This is the canonical quickstart. Create the default chat in an empty directory:
|
|
14
4
|
|
|
15
5
|
```bash
|
|
16
6
|
npx @vanillaskyai/video init
|
|
17
7
|
```
|
|
18
8
|
|
|
19
|
-
Init
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
rerun the same init command to finish setup.
|
|
23
|
-
It does not copy VanillaSky's template tree. The important generated files are:
|
|
24
|
-
|
|
25
|
-
| File | Your application owns |
|
|
26
|
-
| --- | --- |
|
|
27
|
-
| `src/main.tsx` | The mount point for the SDK-owned chat |
|
|
28
|
-
| `server.ts` | Provider choices and callbacks |
|
|
29
|
-
| `stock.ts` | Optional stock search policy |
|
|
30
|
-
| `vite.config.ts` | Local UI and `/api/video-chat` endpoint |
|
|
31
|
-
| `.env.local` | Ignored server-only credentials |
|
|
32
|
-
|
|
33
|
-
The generated browser entry is intentionally tiny:
|
|
34
|
-
|
|
35
|
-
```tsx
|
|
36
|
-
import { StrictMode } from "react";
|
|
37
|
-
import { createRoot } from "react-dom/client";
|
|
38
|
-
import { VideoChat } from "@vanillaskyai/video/react";
|
|
39
|
-
import "@vanillaskyai/video/video-chat.css";
|
|
40
|
-
|
|
41
|
-
createRoot(document.getElementById("root")!).render(
|
|
42
|
-
<StrictMode><VideoChat /></StrictMode>,
|
|
43
|
-
);
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
The SDK owns the responsive interface, conversation state, suggestions, voice
|
|
47
|
-
input, narration pacing, streaming player, and packaged templates. Your shell
|
|
48
|
-
stays responsible for providers, keys, authorization, limits, storage,
|
|
49
|
-
branding, and product copy.
|
|
50
|
-
|
|
51
|
-
## Add the one required key
|
|
52
|
-
|
|
53
|
-
Add the text-provider key to the generated, ignored `.env.local`:
|
|
54
|
-
|
|
55
|
-
```dotenv
|
|
56
|
-
ANTHROPIC_API_KEY=
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Fill the value locally; do not expose it through a client-prefixed environment
|
|
60
|
-
variable. Then inspect the setup without calling any provider:
|
|
9
|
+
Init creates an editable Vite app, installs its dependencies, and runs doctor.
|
|
10
|
+
The default text adapter uses the optional Vercel AI SDK. Add `ANTHROPIC_API_KEY`
|
|
11
|
+
to the generated, ignored `.env.local`, then:
|
|
61
12
|
|
|
62
13
|
```bash
|
|
63
14
|
npx vanillasky doctor
|
|
15
|
+
npm run dev
|
|
64
16
|
```
|
|
65
17
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
18
|
+
Open the reported localhost URL. Ask a question, let its spoken answer finish,
|
|
19
|
+
then ask a follow-up. Doctor reports key names and readiness, never key values.
|
|
20
|
+
Rerun init if installation was interrupted. It preserves keys and installed
|
|
21
|
+
provider adapters, and refuses conflicting scaffold files rather than replacing
|
|
22
|
+
your code.
|
|
69
23
|
|
|
70
|
-
|
|
24
|
+
For the native alternative, start a new directory with
|
|
25
|
+
`npx @vanillaskyai/video init --native` and set `GEMINI_API_KEY` instead.
|
|
26
|
+
Its editable Gemini REST callbacks need no `ai`, `@ai-sdk/anthropic`, or other
|
|
27
|
+
model SDK. You can replace either text adapter with your own implementation.
|
|
28
|
+
Rerunning ordinary init keeps the selected adapter.
|
|
71
29
|
|
|
72
|
-
|
|
30
|
+
## Application files
|
|
73
31
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
32
|
+
- `src/main.tsx` mounts `<VideoChat />` and imports the scoped stylesheet.
|
|
33
|
+
- `server.ts` connects one `createVideoChatHandler` to app-owned providers.
|
|
34
|
+
- `providers.ts` holds optional provider wiring.
|
|
35
|
+
- `providers/text.ts` supplies streaming planning and small text tasks.
|
|
36
|
+
- `vite.config.ts` serves the client and `/api/video-chat`.
|
|
37
|
+
- `.env.local` holds server-only keys; never commit it.
|
|
77
38
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
```
|
|
39
|
+
The SDK owns the interface, shot planning, streaming, subtitles, voice timing,
|
|
40
|
+
and footage/chapter renderers. It does not copy a template tree into your app.
|
|
81
41
|
|
|
82
|
-
Add
|
|
83
|
-
`.env.local`, then restart the dev server. Stock media needs only
|
|
84
|
-
`PEXELS_API_KEY`; no extra package or command is needed. The client stays the
|
|
85
|
-
same. Rerun an interrupted provider command to finish its installation, then
|
|
86
|
-
check readiness with `npx vanillasky doctor`.
|
|
42
|
+
## Add footage and voice
|
|
87
43
|
|
|
88
|
-
|
|
44
|
+
Add `PEXELS_API_KEY` for stock video without another package. For optional
|
|
45
|
+
generated video or speech, run the corresponding setup command:
|
|
89
46
|
|
|
90
47
|
```bash
|
|
91
|
-
|
|
48
|
+
npx vanillasky providers add video fal
|
|
49
|
+
npx vanillasky providers add speech
|
|
50
|
+
npx vanillasky providers add transcription
|
|
51
|
+
npx vanillasky doctor
|
|
92
52
|
```
|
|
93
53
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
|
|
54
|
+
Choose `fal`, `google`, `runway`, or `custom` after `video`; omitting the name
|
|
55
|
+
selects fal. These install app-owned source, not core vendor dependencies.
|
|
56
|
+
The fal and Runway references use `FAL_KEY` and `RUNWAY_API_KEY`; Google uses
|
|
57
|
+
`GEMINI_API_KEY`. `custom` leaves a callback skeleton for any vendor.
|
|
58
|
+
|
|
59
|
+
Before enabling generated video, configure `providers/video-delivery.ts` with
|
|
60
|
+
your storage. Its example accepts your `VIDEO_UPLOAD_URL` and
|
|
61
|
+
`VIDEO_STORAGE_TOKEN`; that upload service is not supplied by VanillaSky.
|
|
62
|
+
See [provider integration](provider-integration.md#video-delivery-and-cancellation)
|
|
63
|
+
for the callback contract. Provider credentials alone do not enable the
|
|
64
|
+
starter's generated-video capability.
|
|
65
|
+
|
|
66
|
+
Speech and transcription are independent upgrades. Speech installs the optional
|
|
67
|
+
xAI/AI SDK adapter and uses `XAI_API_KEY`; Whisper transcription uses `FAL_KEY`
|
|
68
|
+
without selecting fal for video. Doctor inspects the selected configuration
|
|
69
|
+
locally; it never tests a paid generation.
|
|
70
|
+
|
|
71
|
+
Configure keys locally and restart the server. Generated speech is
|
|
72
|
+
optional; browser speech remains the default. Without usable footage, chapter
|
|
73
|
+
scenes retain the narration and subtitles. See [provider integration](provider-integration.md)
|
|
74
|
+
and [media and voice](media-and-audio.md) for callback and storage responsibilities.
|
|
75
|
+
|
|
76
|
+
To use an existing assistant rather than ask the planner to answer directly,
|
|
77
|
+
add [`resolveAnswer`](provider-integration.md#use-an-existing-assistant) to
|
|
78
|
+
`server.ts`. The UI does not change.
|
|
79
|
+
|
|
80
|
+
## Verify the result
|
|
81
|
+
|
|
82
|
+
Use the real browser with normal motion enabled. Check one complete response
|
|
83
|
+
and a follow-up, pause/mute, visible error recovery, and the console.
|
|
84
|
+
If generated video is ready, verify that the footage actually moves and that
|
|
85
|
+
the final spoken sentence completes. A passing mocked test does not prove
|
|
86
|
+
provider latency or video quality.
|
|
87
|
+
Google/Runway job APIs can take minutes; the SDK cannot turn that wait into
|
|
88
|
+
real-time footage. Narration aims to finish 0.8 seconds before each clip ends;
|
|
89
|
+
if a bounded rewrite cannot fit it, chapter recovery preserves the full speech.
|
|
90
|
+
|
|
91
|
+
Before exposing the endpoint publicly, add application authentication, request
|
|
92
|
+
limits, media policy, and spending controls. The local starter is not a
|
|
93
|
+
production authorization policy. See [production](production.md) and
|
|
94
|
+
[security](security.md).
|
|
95
|
+
|
|
96
|
+
[Documentation home](../README.md)
|
package/docs/media-and-audio.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[← Documentation home](../README.md) · [Previous: Customization](customization.md) · [Next:
|
|
1
|
+
[← Documentation home](../README.md) · [Previous: Customization](customization.md) · [Next: Customization →](customization.md)
|
|
2
2
|
|
|
3
3
|
# Media, voice, and audio
|
|
4
4
|
|
|
@@ -46,8 +46,7 @@ createVideoChatHandler({
|
|
|
46
46
|
The planner emits a short semantic keyword, not a URL. The callback returns an
|
|
47
47
|
application-approved image or video URL, and the SDK validates it before it
|
|
48
48
|
reaches a scene. Return `null` when no licensed, safe, relevant asset exists;
|
|
49
|
-
default chat displays an authored chapter while retaining the spoken answer.
|
|
50
|
-
validation, and fallback contracts.
|
|
49
|
+
default chat displays an authored chapter while retaining the spoken answer.
|
|
51
50
|
|
|
52
51
|
For Pexels, keep `PEXELS_API_KEY` on the server, enforce a deadline, filter for
|
|
53
52
|
suitable renditions, and return only validated Pexels asset domains. Licensing,
|
|
@@ -85,7 +84,7 @@ Pexels retains literal footage queries; these instructions cannot restyle stock
|
|
|
85
84
|
assets. The opening chapter keeps its existing appearance. Automatic direction
|
|
86
85
|
is generation-time guidance, not a new persisted style field; saved media keeps
|
|
87
86
|
its rendered appearance and existing caller-supplied style persistence is
|
|
88
|
-
unchanged.
|
|
87
|
+
unchanged.
|
|
89
88
|
|
|
90
89
|
## Generated shots
|
|
91
90
|
|
|
@@ -135,8 +134,11 @@ owns the provider key, model, spend, generated bytes, retention, and delivery.
|
|
|
135
134
|
Set `generatedClipDurationSec` to the duration your video adapter actually
|
|
136
135
|
requests (default 5, supported range 2–20 seconds). Keep it aligned with provider
|
|
137
136
|
settings and host spending limits. The planner fits natural spoken beats to that
|
|
138
|
-
budget
|
|
139
|
-
|
|
137
|
+
budget with a 0.8-second tail. One bounded rewrite may shorten an oversized
|
|
138
|
+
beat before generation; otherwise its complete narration stays on a chapter.
|
|
139
|
+
Measured audio and actual decoded footage are checked before playback. Normal
|
|
140
|
+
footage plays once at native speed; overruns recover to a chapter without
|
|
141
|
+
cutting off narration or buying another clip.
|
|
140
142
|
|
|
141
143
|
`generateVideoTimeoutMs` sets the first-shot preparation budget (default 15 seconds).
|
|
142
144
|
Later deadlines account for their position in the answer rather than restarting
|
|
@@ -185,4 +187,4 @@ interaction before audible playback on many devices.
|
|
|
185
187
|
while narration continues.
|
|
186
188
|
- Return a safe fallback instead of leaving the response waiting forever.
|
|
187
189
|
|
|
188
|
-
[← Documentation home](../README.md) · [Previous: Customization](customization.md) · [Next:
|
|
190
|
+
[← Documentation home](../README.md) · [Previous: Customization](customization.md) · [Next: Customization →](customization.md)
|
package/docs/performance.md
CHANGED
|
@@ -39,10 +39,15 @@ playback. It is not the time a speech request finishes. Custom voices must call
|
|
|
39
39
|
`onStart()` when sound begins; otherwise this measurement remains unavailable.
|
|
40
40
|
Muted responses do not produce a speech-start event.
|
|
41
41
|
|
|
42
|
-
`stall` measures a wait
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
`stall` measures a completed wait interval with `durationMs` and a fixed reason:
|
|
43
|
+
`scene-generation`, `speech`, or `media-decoding`. Deliberate pauses are excluded.
|
|
44
|
+
Custom player owners must not pause voice for a `speech` wait.
|
|
45
|
+
|
|
46
|
+
`scene-duration` compares prepared speech and clip seconds and records chapter
|
|
47
|
+
recovery. `media-playback` reports the actual decoded clip duration, scene duration
|
|
48
|
+
and observed repeat count. `buffer` samples ready buffered seconds across the
|
|
49
|
+
active and next mounted media elements, not total downloaded bytes. The local
|
|
50
|
+
development chat displays these measurements without retaining response content.
|
|
46
51
|
|
|
47
52
|
Elapsed times start at prompt submission and can include user pauses. Compare
|
|
48
53
|
unpaused runs with the same mode and voice configuration. Treat missing speech
|
|
@@ -75,6 +80,6 @@ chapter scenes. Neither callback measures the immediate opening template;
|
|
|
75
80
|
measure that surface separately when checking submit-to-template latency.
|
|
76
81
|
|
|
77
82
|
AI and Pexels modes remain separate. Missing, late, or unplayable footage uses
|
|
78
|
-
the authored chapter and complete narration.
|
|
79
|
-
|
|
83
|
+
the authored chapter and complete narration. Normal clips play once at native
|
|
84
|
+
speed; overlong narration recovers to a chapter. See [the local chat harness](development.md) for fixture timing
|
|
80
85
|
and explicit live-provider checks.
|
package/docs/persistence.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[← Documentation home](../README.md) · [Previous: Core concepts](
|
|
1
|
+
[← Documentation home](../README.md) · [Previous: Core concepts](architecture.md) · [Next: Streaming protocol →](reference/protocol.md)
|
|
2
2
|
|
|
3
3
|
# Persistence and replay
|
|
4
4
|
|
|
@@ -11,7 +11,7 @@ completed conversation history. The default `VideoChat` keeps history in memory;
|
|
|
11
11
|
use the headless hook when the application needs durable storage.
|
|
12
12
|
|
|
13
13
|
Every stored video has `schemaVersion: "0.2"`. This storage version is separate
|
|
14
|
-
from streaming protocol `0.
|
|
14
|
+
from streaming protocol `0.6`. The SDK supports the current storage
|
|
15
15
|
schema only: there are no compatibility aliases or implicit coercions.
|
|
16
16
|
|
|
17
17
|
## Load at the storage boundary
|
|
@@ -73,8 +73,4 @@ normal authenticated storage and a cryptographic integrity mechanism when
|
|
|
73
73
|
those properties are required.
|
|
74
74
|
|
|
75
75
|
Saved replay makes zero generation endpoint or model-provider requests. It is
|
|
76
|
-
not necessarily zero network traffic: audio, images, videos, fonts
|
|
77
|
-
customer-owned renderers may make separate media network requests.
|
|
78
|
-
|
|
79
|
-
When a saved video uses project-owned templates, provide the matching browser
|
|
80
|
-
registry: `<VideoPlayer video={savedVideo} templates={templates} />`.
|
|
76
|
+
not necessarily zero network traffic: audio, images, videos, and fonts may make separate media network requests.
|
package/docs/production.md
CHANGED
|
@@ -17,7 +17,7 @@ Mount `<VideoChat />` or `useVideoChat` against that boundary.
|
|
|
17
17
|
- Forward cancellation to every text, speech, media, transcription, and video provider.
|
|
18
18
|
|
|
19
19
|
The handler rejects unknown templates and fields, invalid variables, unsafe
|
|
20
|
-
media
|
|
20
|
+
media before a scene reaches the
|
|
21
21
|
player. Read the [security guide](security.md) for the complete controls.
|
|
22
22
|
|
|
23
23
|
## Cinematic direction and providers
|
|
@@ -25,9 +25,7 @@ player. Read the [security guide](security.md) for the complete controls.
|
|
|
25
25
|
Default chat shows an immediate chapter while speech and selected footage prepare.
|
|
26
26
|
Configure `generateVideo` for AI mode and `searchMedia` for Pexels mode. Neither
|
|
27
27
|
mode calls the other footage source. Missing or late footage uses the authored
|
|
28
|
-
chapter with complete narration.
|
|
29
|
-
existing composition and fallback contracts.
|
|
30
|
-
A stock candidate must match the subject, action and permitted crop. Return
|
|
28
|
+
chapter with complete narration. A stock candidate must match the subject, action and permitted crop. Return
|
|
31
29
|
`null` for uncertainty rather than broadening an essential detail.
|
|
32
30
|
|
|
33
31
|
Use explicit provider deadlines. Generated video should use idempotency keys
|
|
@@ -45,8 +43,7 @@ cards may carry a prepared opening so its speech starts without a model round tr
|
|
|
45
43
|
|
|
46
44
|
Do not wait for the complete plan before showing the first validated scene.
|
|
47
45
|
Preload upcoming assets and keep the current visual if the next one is late.
|
|
48
|
-
|
|
49
|
-
can begin while the planner streams later scenes.
|
|
46
|
+
The answer brief reserves the ending while body shots stream; do not wait for every clip before sending ready scenes.
|
|
50
47
|
|
|
51
48
|
## Data and privacy
|
|
52
49
|
|
|
@@ -90,15 +87,7 @@ small, explicitly gated real-provider smoke test before a release.
|
|
|
90
87
|
|
|
91
88
|
In CI, build one clean consumer from the packed SDK artifact. This catches
|
|
92
89
|
missing exports, server/browser boundary leaks, code-generation drift, and
|
|
93
|
-
dependency-resolution problems that workspace tests miss.
|
|
94
|
-
owns copied templates, also run:
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
npx vanillasky templates sync --check
|
|
98
|
-
npm run build
|
|
99
|
-
npm test
|
|
100
|
-
```
|
|
101
|
-
|
|
90
|
+
dependency-resolution problems that workspace tests miss.
|
|
102
91
|
## Deployment checklist
|
|
103
92
|
|
|
104
93
|
- [ ] Keys exist only in the server secret store.
|
package/docs/prompt-and-input.md
CHANGED
|
@@ -98,8 +98,7 @@ produces safe diagnostics. A media failure does not delete valid narration.
|
|
|
98
98
|
|
|
99
99
|
AI mode generates footage within the host allowance. Pexels mode searches
|
|
100
100
|
stock without calling the video generator. Each authored beat includes a short
|
|
101
|
-
chapter title; missing footage becomes that chapter with its complete narration.
|
|
102
|
-
support the trusted catalog and its existing structured planner contract.
|
|
101
|
+
chapter title; missing footage becomes that chapter with its complete narration.
|
|
103
102
|
|
|
104
103
|
## Grounding
|
|
105
104
|
|