@vanillaskyai/video 0.4.1 → 0.5.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 +83 -0
- package/PUBLIC-API.md +12 -5
- package/README.md +14 -17
- package/dist/{builtin-server-BRTZN4Q7.js → builtin-server-YHEZ2JRF.js} +2 -2
- package/dist/check-runtime.js +1 -1
- package/dist/{chunk-BKF3A357.js → chunk-34O5BY6X.js} +1 -1
- package/dist/{chunk-LHFADNWJ.js → chunk-3ROGEU5A.js} +179 -342
- package/dist/{chunk-XAMUOSX7.js → chunk-3RV4YKB3.js} +0 -1
- package/dist/{chunk-GHJEAP4O.js → chunk-66MNRUCR.js} +1 -1
- package/dist/{chunk-EE6PK6XC.js → chunk-AOWSXU2K.js} +1 -1
- package/dist/{chunk-GR4I3MN2.js → chunk-EFL34TXF.js} +3 -3
- package/dist/{chunk-I5YWVQ5R.js → chunk-FVTMYS6U.js} +1 -1
- package/dist/{chunk-STIFILQG.js → chunk-FZHMQFG3.js} +46 -38
- package/dist/{chunk-JW47XCRL.js → chunk-G66Z5CWR.js} +30 -72
- package/dist/{chunk-RBQN3VSY.js → chunk-HVCPEAQF.js} +83 -1265
- package/dist/{chunk-N3KUA7VP.js → chunk-K6YVQODK.js} +4 -1
- package/dist/{chunk-WHPZED7X.js → chunk-PNS52FL4.js} +2 -5
- package/dist/{chunk-S5ZU5WUU.js → chunk-ZQQQAAKP.js} +2 -2
- package/dist/cli.js +20 -14
- package/dist/compose-video-QJHKTOQ7.js +13 -0
- package/dist/{events-D_1F6gw5.d.ts → events-BBP30j3c.d.ts} +3 -14
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{kit-DLeCr3d0.d.ts → kit-DEG3fcaL.d.ts} +1 -1
- package/dist/react.d.ts +6 -5
- package/dist/react.js +999 -348
- package/dist/server.d.ts +3 -3
- package/dist/server.js +18 -79
- package/dist/{system-prompt-NMYHLAMJ.js → system-prompt-4I6Z5HK3.js} +1 -1
- package/dist/template-catalog.js +1 -1
- package/dist/templates.d.ts +3 -3
- package/dist/templates.js +87 -4
- package/dist/test.d.ts +3 -27
- package/dist/test.js +3 -3
- package/dist/{text-stream-UPGUD2TD.js → text-stream-J6EDDJP4.js} +3 -3
- package/dist/{types-Cg0Onj7l.d.ts → types-BV9IqExh.d.ts} +1 -16
- package/docs/agent-integration.md +4 -3
- package/docs/concepts.md +4 -4
- package/docs/custom-templates.md +2 -2
- package/docs/getting-started.md +13 -18
- package/docs/integrate-nextjs.md +12 -8
- package/docs/persistence.md +1 -1
- package/docs/prompt-and-input.md +2 -2
- package/docs/reference/protocol.md +9 -12
- package/docs/reference/provider-adapters.md +5 -5
- package/docs/testing.md +1 -1
- package/examples/nextjs-quickstart/.env.example +2 -2
- package/examples/nextjs-quickstart/README.md +4 -1
- package/examples/nextjs-quickstart/package.json +4 -4
- package/examples/nextjs-quickstart/src/app/api/video/route.ts +4 -2
- package/package.json +8 -8
- package/dist/chunk-CR7FE7BW.js +0 -109
- package/dist/compose-video-6UQ33DOO.js +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,89 @@ VanillaSky follows semantic versioning. This changelog begins with the 0.1 beta.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.5.0
|
|
8
|
+
|
|
9
|
+
### Breaking changes
|
|
10
|
+
|
|
11
|
+
- Simplifies streaming protocol `0.5` to complete immutable `scene.add` parts
|
|
12
|
+
followed by `plan.complete`. It removes `scene.patch`, `asset.patch`,
|
|
13
|
+
`plan.error`, and scene revision counters. Provider failures now use thrown
|
|
14
|
+
errors, while media resolution finishes before its scene is emitted.
|
|
15
|
+
- Raises the supported Node.js floor from 20 to 22. Node 20 reached end of life
|
|
16
|
+
and is no longer exercised by the SDK's tests, builds, or clean-room package
|
|
17
|
+
verification.
|
|
18
|
+
- Stops returning the merged built-in template catalog through
|
|
19
|
+
`useVideo().playerProps.templates`. `playerProps` now carries only the
|
|
20
|
+
customer registry passed to `useVideo`, while `VideoPlayer` supplies its
|
|
21
|
+
built-in renderers internally. Existing `<VideoPlayer {...playerProps} />`
|
|
22
|
+
usage is unchanged. This removes planner-only metadata from the initial
|
|
23
|
+
React graph, reducing it from 48,197 to 35,649 gzip bytes.
|
|
24
|
+
|
|
25
|
+
### Adoption
|
|
26
|
+
|
|
27
|
+
Custom planners that previously emitted a scene and patched it later:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
yield { type: "scene.add", scene: draftScene };
|
|
31
|
+
yield { type: "asset.patch", sceneId: draftScene.id, variables: resolvedMedia };
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
should emit one complete scene instead:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
yield {
|
|
38
|
+
type: "scene.add",
|
|
39
|
+
scene: { ...draftScene, variables: { ...draftScene.variables, ...resolvedMedia } },
|
|
40
|
+
};
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Throw planner failures instead of emitting `plan.error`. Protocol `0.4` replay
|
|
44
|
+
logs cannot be mixed into a `0.5` run; completed stored `Video` values remain on
|
|
45
|
+
the unchanged `0.1` storage schema.
|
|
46
|
+
|
|
47
|
+
Update applications that pin Node 20 before installing the next SDK release:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"engines": { "node": "20.x" }
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
becomes:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"engines": { "node": "22.x" }
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Code that used the player binding to inspect built-in metadata:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
const templates = video.playerProps.templates.listTemplateMetadata();
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
should import the explicit React-free catalog instead:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
import { builtinTemplates } from "@vanillaskyai/video/templates/catalog";
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Inspect a customer registry directly when the application created it; it is
|
|
76
|
+
still passed through `playerProps` unchanged.
|
|
77
|
+
|
|
78
|
+
### Maintenance
|
|
79
|
+
|
|
80
|
+
- Makes React 19 the primary development and example runtime. CI continues to
|
|
81
|
+
verify React 18 with its own runtime and type packages, including typecheck,
|
|
82
|
+
focused component tests, and a production build.
|
|
83
|
+
- Shares the replay buffer and identical JSON-validation primitives across
|
|
84
|
+
their call sites, removing duplicate implementations without changing the
|
|
85
|
+
public API.
|
|
86
|
+
- Keeps the first install provider-neutral, removes stale version and model
|
|
87
|
+
defaults from public guides, and moves the quality-oriented Anthropic/Sonnet
|
|
88
|
+
choice into the later provider setup step.
|
|
89
|
+
|
|
7
90
|
## 0.4.1
|
|
8
91
|
|
|
9
92
|
- Keeps soundtrack audio continuous when a saved `VideoPlayer` uses `loop`.
|
package/PUBLIC-API.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# VanillaSky Video
|
|
1
|
+
# VanillaSky Video public API
|
|
2
2
|
|
|
3
|
-
Status:
|
|
3
|
+
Status: current public beta contract.
|
|
4
4
|
|
|
5
5
|
This document defines the API that may enter the fresh
|
|
6
6
|
`@vanillaskyai/video` package. An export not listed here is internal. Tests and
|
|
@@ -16,7 +16,7 @@ public API review.
|
|
|
16
16
|
|
|
17
17
|
## Compatibility promise
|
|
18
18
|
|
|
19
|
-
-
|
|
19
|
+
- Patch releases do not make breaking changes to documented APIs or the
|
|
20
20
|
serialized `Video` schema.
|
|
21
21
|
- A compatible later `0.x` minor needs no migration ceremony. A breaking
|
|
22
22
|
pre-1.0 minor must document both `### Breaking changes` and `### Adoption` in
|
|
@@ -26,7 +26,7 @@ public API review.
|
|
|
26
26
|
must pin an exact package version when they use one.
|
|
27
27
|
- Deprecated APIs remain usable until the next minor release. The `0.1`
|
|
28
28
|
package starts without undocumented compatibility aliases.
|
|
29
|
-
- The package is ESM-only, targets ES2022, and supports Node.js
|
|
29
|
+
- The package is ESM-only, targets ES2022, and supports Node.js 22 or newer.
|
|
30
30
|
- React is an optional peer dependency. Only `/react` and renderer definitions
|
|
31
31
|
under `/templates` may depend on React.
|
|
32
32
|
- Framework adapters are examples, not separate public APIs. The release suite
|
|
@@ -178,6 +178,13 @@ interface UseVideoResult {
|
|
|
178
178
|
<VideoPlayer video={savedVideo} />
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
+
Built-in renderers are always available, so a streaming `VideoPlayer` does not
|
|
182
|
+
require a template registry. `playerProps` is a spread-ready player binding; it
|
|
183
|
+
contains the customer registry supplied to `useVideo` when one exists, but it
|
|
184
|
+
does not expose the built-in planning catalog. Import `builtinTemplates` from
|
|
185
|
+
`@vanillaskyai/video/templates/catalog` for labels, schemas, selection guidance,
|
|
186
|
+
and other React-free metadata.
|
|
187
|
+
|
|
181
188
|
Set `playbackMode="autoplay-after-interaction"` for chat feeds: the first
|
|
182
189
|
soundtrack waits on a visible scene-one poster, and later streams on the same
|
|
183
190
|
mounted player autoplay with sound after the first successful viewer start.
|
|
@@ -290,7 +297,7 @@ from `/server` without crossing a React type boundary.
|
|
|
290
297
|
|
|
291
298
|
- A completed `Video` is JSON-serializable and may be stored by the host.
|
|
292
299
|
- Every completed value carries the required storage field
|
|
293
|
-
`schemaVersion: "0.1"`; it is independent from streaming protocol `0.
|
|
300
|
+
`schemaVersion: "0.1"`; it is independent from streaming protocol `0.5`.
|
|
294
301
|
- `parseVideo(value: unknown)` is the strict universal storage boundary. It
|
|
295
302
|
validates the full document and returns a detached, deeply frozen `Video`.
|
|
296
303
|
- JSON serialization remains platform-native; the SDK has no redundant public
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Give your AI a video output
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|
|
|
5
5
|
**VanillaSky is the open-source video response layer.** Turn text, structured
|
|
6
6
|
data, and live application context into personalized video responses that start
|
|
@@ -17,7 +17,7 @@ the planning prompt, trusted templates, validation, streaming, and player.
|
|
|
17
17
|
For humans:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npm install @vanillaskyai/video
|
|
20
|
+
npm install @vanillaskyai/video
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
For coding agents:
|
|
@@ -28,24 +28,20 @@ npx skills add VanillaSkyAi/video@vanillasky
|
|
|
28
28
|
|
|
29
29
|
Then prompt: `Use $vanillasky to turn this application's data into a personalized video response.`
|
|
30
30
|
|
|
31
|
-
Add your model key to an ignored `.env.local`:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
OPENAI_API_KEY=your-key
|
|
35
|
-
OPENAI_MODEL=gpt-4.1
|
|
36
|
-
```
|
|
37
|
-
|
|
38
31
|
## Connect your LLM
|
|
39
32
|
|
|
33
|
+
VanillaSky never chooses a provider or model. Configure that separately on the
|
|
34
|
+
server, then connect the model your application already owns. The route below
|
|
35
|
+
assumes an AI SDK `LanguageModel` exported as `videoModel`; if you do not have
|
|
36
|
+
one yet, choose a provider and current model in [Provider integration](docs/provider-integration.md).
|
|
37
|
+
|
|
40
38
|
Create one authenticated server route:
|
|
41
39
|
|
|
42
40
|
```ts
|
|
43
41
|
// app/api/video/route.ts
|
|
44
|
-
import { openai } from "@ai-sdk/openai";
|
|
45
42
|
import { streamText } from "ai";
|
|
46
43
|
import { createVideoHandler } from "@vanillaskyai/video/server";
|
|
47
|
-
|
|
48
|
-
const model = openai(process.env.OPENAI_MODEL ?? "gpt-4.1");
|
|
44
|
+
import { videoModel } from "@/lib/video-model";
|
|
49
45
|
|
|
50
46
|
const handle = createVideoHandler({
|
|
51
47
|
// Local development only. Replace with your session check before deploying.
|
|
@@ -55,7 +51,7 @@ const handle = createVideoHandler({
|
|
|
55
51
|
return hostname === "localhost" || hostname === "127.0.0.1";
|
|
56
52
|
},
|
|
57
53
|
streamText: ({ systemPrompt, userPrompt, signal }) => streamText({
|
|
58
|
-
model,
|
|
54
|
+
model: videoModel,
|
|
59
55
|
system: systemPrompt,
|
|
60
56
|
prompt: userPrompt,
|
|
61
57
|
abortSignal: signal,
|
|
@@ -68,8 +64,10 @@ export const OPTIONS = handle;
|
|
|
68
64
|
|
|
69
65
|
The packaged development command supplies the local marker only to `next dev`,
|
|
70
66
|
so production builds and `next start` deny every request. Replace it before
|
|
71
|
-
deploying. The model can come from
|
|
72
|
-
gateway, or any compatible streaming adapter.
|
|
67
|
+
deploying. The model can come from Anthropic, OpenAI, an AI SDK registry or
|
|
68
|
+
gateway, or any compatible streaming adapter. The
|
|
69
|
+
[Next.js quickstart](examples/nextjs-quickstart) shows the later, explicit
|
|
70
|
+
provider-selection step with a quality-oriented Claude Sonnet model.
|
|
73
71
|
|
|
74
72
|
For planner-selected image and video backgrounds, configure the optional
|
|
75
73
|
server-only `resolveMedia` callback described in
|
|
@@ -105,8 +103,7 @@ That is the complete path. Built-in templates require no setup. VanillaSky
|
|
|
105
103
|
shows each complete, validated scene as soon as it is ready and returns a
|
|
106
104
|
deterministic `Video` object when generation finishes.
|
|
107
105
|
|
|
108
|
-
A copy-and-run app is in
|
|
109
|
-
[`examples/nextjs-quickstart`](https://github.com/VanillaSkyAi/video/tree/v0.4.1/examples/nextjs-quickstart).
|
|
106
|
+
A copy-and-run app is in [`examples/nextjs-quickstart`](examples/nextjs-quickstart).
|
|
110
107
|
|
|
111
108
|
## Shape the response
|
|
112
109
|
|
package/dist/check-runtime.js
CHANGED