@vanillaskyai/video 0.1.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 +45 -0
- package/LICENSE +201 -0
- package/PUBLIC-API.md +276 -0
- package/README.md +152 -0
- package/SECURITY.md +22 -0
- package/SUPPORT.md +28 -0
- package/bin/vanillasky.js +3 -0
- package/dist/bg-confetti-WNQXS7ZS.js +89 -0
- package/dist/bg-emoji-ETI47GLS.js +150 -0
- package/dist/bg-media-SVUZAMGX.js +99 -0
- package/dist/brand-message-F3RD4P3P.js +253 -0
- package/dist/builtin-server-F7YXRVCH.js +8 -0
- package/dist/catalog-types-BIhSpOWK.d.ts +74 -0
- package/dist/chart-bar-CNSC7BNK.js +304 -0
- package/dist/chart-counter-MCRHKN77.js +299 -0
- package/dist/chart-progress-ring-RMI4A7ZK.js +296 -0
- package/dist/check-runtime.d.ts +15 -0
- package/dist/check-runtime.js +102 -0
- package/dist/chunk-2E6T633S.js +27 -0
- package/dist/chunk-352ZZCET.js +83 -0
- package/dist/chunk-73NTSFFI.js +81 -0
- package/dist/chunk-A2X45FET.js +46 -0
- package/dist/chunk-ABPKM4GK.js +187 -0
- package/dist/chunk-ABZACD4G.js +216 -0
- package/dist/chunk-BCRUUJ6A.js +756 -0
- package/dist/chunk-CHLGW22F.js +3551 -0
- package/dist/chunk-CJ7F2CE6.js +104 -0
- package/dist/chunk-CR7FE7BW.js +109 -0
- package/dist/chunk-E7CL7UPB.js +109 -0
- package/dist/chunk-EE6PK6XC.js +18 -0
- package/dist/chunk-ERY4S6QV.js +385 -0
- package/dist/chunk-EVG2ZYIY.js +125 -0
- package/dist/chunk-FNAEQ7QO.js +155 -0
- package/dist/chunk-FQ47WXAJ.js +38 -0
- package/dist/chunk-FSG2PYWG.js +336 -0
- package/dist/chunk-GHJEAP4O.js +504 -0
- package/dist/chunk-GRMUV7QY.js +262 -0
- package/dist/chunk-IFOW65Z6.js +205 -0
- package/dist/chunk-IXCUY3B3.js +786 -0
- package/dist/chunk-L5BTTCZV.js +97 -0
- package/dist/chunk-LMG3GHLL.js +107 -0
- package/dist/chunk-OOPIETLW.js +101 -0
- package/dist/chunk-P22HHFDK.js +43 -0
- package/dist/chunk-QAAO7OAY.js +19 -0
- package/dist/chunk-S7HFLYNN.js +35 -0
- package/dist/chunk-SPVTJH3F.js +24 -0
- package/dist/chunk-W2XJKG6C.js +3177 -0
- package/dist/chunk-XB7LH4J2.js +301 -0
- package/dist/chunk-XGRA2MUV.js +242 -0
- package/dist/chunk-XTOXFMLM.js +105 -0
- package/dist/chunk-YC5MFXA5.js +132 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +1681 -0
- package/dist/compose-video-CN3VSWST.js +13 -0
- package/dist/cta-logo-SVA5GP2A.js +209 -0
- package/dist/cta-media-E7VLLK42.js +215 -0
- package/dist/events-_wfjbmEp.d.ts +81 -0
- package/dist/incoming-call-62MFZL3Z.js +320 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +14 -0
- package/dist/infographic-before-after-AXCDAWND.js +460 -0
- package/dist/infographic-feature-list-GW5GUE6O.js +266 -0
- package/dist/infographic-problem-solution-7NURJANA.js +340 -0
- package/dist/infographic-stat-row-J7IZR6ZN.js +241 -0
- package/dist/infographic-steps-VSZM6F5M.js +400 -0
- package/dist/kit-BMNcHqa9.d.ts +79 -0
- package/dist/prompt-input-LOUCRXCY.js +236 -0
- package/dist/react.d.ts +81 -0
- package/dist/react.js +835 -0
- package/dist/reaction-QG4CYZLQ.js +119 -0
- package/dist/server.d.ts +141 -0
- package/dist/server.js +498 -0
- package/dist/showcase-code-RUTFZR3H.js +351 -0
- package/dist/showcase-phone-6CP6XEU5.js +272 -0
- package/dist/showcase-terminal-MGAEQWPR.js +306 -0
- package/dist/showcase-web-Y4W2HVRJ.js +390 -0
- package/dist/social-conversation-75SD2637.js +695 -0
- package/dist/social-milestone-XI2QE5BO.js +292 -0
- package/dist/social-notification-2UOHQCUY.js +244 -0
- package/dist/social-review-stack-FDYZGZTJ.js +239 -0
- package/dist/social-testimonial-OQ7N52GJ.js +284 -0
- package/dist/social-tweet-5OLCNPPC.js +295 -0
- package/dist/state-DZcKuS32.d.ts +3 -0
- package/dist/system-prompt-A6UXNTPK.js +8 -0
- package/dist/template-catalog.d.ts +24 -0
- package/dist/template-catalog.js +6 -0
- package/dist/templates.d.ts +25 -0
- package/dist/templates.js +19 -0
- package/dist/test.d.ts +149 -0
- package/dist/test.js +272 -0
- package/dist/text-stream-6XHC7J47.js +10 -0
- package/dist/types-B-PZR6G_.d.ts +208 -0
- package/dist/validate-T7GBU2YF.js +8 -0
- package/docs/agent-integration.md +39 -0
- package/docs/architecture.md +84 -0
- package/docs/branding-and-personalization.md +87 -0
- package/docs/concepts.md +106 -0
- package/docs/custom-templates.md +329 -0
- package/docs/customization.md +141 -0
- package/docs/errors.md +70 -0
- package/docs/getting-started.md +111 -0
- package/docs/input-and-first-scene.md +41 -0
- package/docs/integrate-nextjs.md +79 -0
- package/docs/media-and-audio.md +69 -0
- package/docs/motion-and-effects.md +107 -0
- package/docs/persistence.md +95 -0
- package/docs/production.md +122 -0
- package/docs/prompt-and-input.md +185 -0
- package/docs/provider-integration.md +115 -0
- package/docs/reference/protocol.md +96 -0
- package/docs/reference/provider-adapters.md +158 -0
- package/docs/responsive-orientation.md +37 -0
- package/docs/security.md +38 -0
- package/docs/streaming-protocol.md +15 -0
- package/docs/testing.md +137 -0
- package/docs/use-cases.md +59 -0
- package/examples/custom-template/README.md +19 -0
- package/examples/custom-template/minimal-text.tsx +82 -0
- package/examples/custom-template/structured-data.tsx +104 -0
- package/examples/custom-template/supplied-media.tsx +92 -0
- package/examples/nextjs-quickstart/.env.example +2 -0
- package/examples/nextjs-quickstart/README.md +22 -0
- package/examples/nextjs-quickstart/next-env.d.ts +4 -0
- package/examples/nextjs-quickstart/package.json +24 -0
- package/examples/nextjs-quickstart/src/app/api/video/route.ts +22 -0
- package/examples/nextjs-quickstart/src/app/layout.tsx +5 -0
- package/examples/nextjs-quickstart/src/app/page.tsx +31 -0
- package/examples/nextjs-quickstart/tsconfig.json +26 -0
- package/package.json +167 -0
- package/registry/items/backgrounds.json +52 -0
- package/registry/items/barChart.json +237 -0
- package/registry/items/beforeAfter.json +180 -0
- package/registry/items/bigNumber.json +225 -0
- package/registry/items/brandMessage.json +158 -0
- package/registry/items/cardList.json +206 -0
- package/registry/items/chatMessenger.json +151 -0
- package/registry/items/chatWhatsapp.json +151 -0
- package/registry/items/codeEditor.json +184 -0
- package/registry/items/confetti.json +107 -0
- package/registry/items/ctaLogo.json +160 -0
- package/registry/items/ctaMedia.json +193 -0
- package/registry/items/emojiBurst.json +101 -0
- package/registry/items/incomingCall.json +170 -0
- package/registry/items/media.json +179 -0
- package/registry/items/milestone.json +205 -0
- package/registry/items/motion.json +45 -0
- package/registry/items/notification.json +182 -0
- package/registry/items/phoneMockup.json +254 -0
- package/registry/items/problemSolution.json +186 -0
- package/registry/items/progressRing.json +199 -0
- package/registry/items/promptInput.json +148 -0
- package/registry/items/reaction.json +170 -0
- package/registry/items/reviewStack.json +224 -0
- package/registry/items/steps.json +207 -0
- package/registry/items/template-context.json +31 -0
- package/registry/items/terminal.json +212 -0
- package/registry/items/testimonial.json +164 -0
- package/registry/items/theme.json +47 -0
- package/registry/items/tripleStats.json +228 -0
- package/registry/items/tweet.json +203 -0
- package/registry/items/typography.json +47 -0
- package/registry/items/webMockup.json +273 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
VanillaSky follows semantic versioning. This changelog begins with the 0.1 beta.
|
|
4
|
+
|
|
5
|
+
## 0.1.0
|
|
6
|
+
|
|
7
|
+
Initial beta release for `@vanillaskyai/video`.
|
|
8
|
+
|
|
9
|
+
- Generates validated, editable videos from grounded application input through
|
|
10
|
+
provider-neutral Vercel AI SDK streams.
|
|
11
|
+
- Supports OpenAI and Anthropic onboarding, with deterministic compatibility
|
|
12
|
+
coverage for Google Gemini and OpenRouter.
|
|
13
|
+
- Provides React playback and generation hooks with typed status, warnings,
|
|
14
|
+
errors, abort behavior, and public duration calculation.
|
|
15
|
+
- Enforces deterministic pacing, readable final calls to action, semantic brand
|
|
16
|
+
contrast, and browser/server dependency boundaries.
|
|
17
|
+
- Persists versioned video snapshots for safe local replay without another
|
|
18
|
+
model request.
|
|
19
|
+
- Includes deterministic test utilities and a source-owned template CLI for
|
|
20
|
+
adding, editing, synchronizing, and checking project templates.
|
|
21
|
+
- Requires every HTTP handler to declare an authorization policy explicitly;
|
|
22
|
+
the `"none"` escape hatch is reserved for intentionally private or in-process
|
|
23
|
+
use.
|
|
24
|
+
- Keeps private supplied-media URLs out of model prompts, treats supplied media
|
|
25
|
+
as an optional approved pool, and validates completed snapshots for replay.
|
|
26
|
+
- Reports proposed, accepted, and rejected scene counts alongside requested and
|
|
27
|
+
actual duration, and uses `gpt-4.1` as the documented OpenAI planning baseline.
|
|
28
|
+
- Preserves a readable declared poster at the completed-video boundary and can
|
|
29
|
+
reclaim unused closer reserve when a valid plan intentionally has no closer.
|
|
30
|
+
|
|
31
|
+
The API is beta. Review the frozen surface in `PUBLIC-API.md` before adopting
|
|
32
|
+
it in production.
|
|
33
|
+
|
|
34
|
+
### Compatibility
|
|
35
|
+
|
|
36
|
+
The `0.1.x` line preserves the documented public entry points and serialized
|
|
37
|
+
video round trips across patch releases. Pre-1.0 minor releases may change the
|
|
38
|
+
API with explicit release notes. The complete promise and intentional
|
|
39
|
+
exclusions are in [PUBLIC-API.md](PUBLIC-API.md).
|
|
40
|
+
|
|
41
|
+
### First release
|
|
42
|
+
|
|
43
|
+
This is the beginning of the fresh `@vanillaskyai/video` release line. Adopt
|
|
44
|
+
the package through the pinned quickstart and review
|
|
45
|
+
[PUBLIC-API.md](PUBLIC-API.md) before relying on the beta contract.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 VanillaSky
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/PUBLIC-API.md
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
# VanillaSky Video 0.1 public API
|
|
2
|
+
|
|
3
|
+
Status: frozen public beta contract for `0.1.0`.
|
|
4
|
+
|
|
5
|
+
This document defines the API that may enter the fresh
|
|
6
|
+
`@vanillaskyai/video` package. An export not listed here is internal. Tests and
|
|
7
|
+
the packed-package verifier must fail if the final package adds or removes an
|
|
8
|
+
export without changing this contract intentionally.
|
|
9
|
+
|
|
10
|
+
`tests/fixtures/public-api-signatures.json` is the reviewed normalized
|
|
11
|
+
declaration report for this surface. `npm run verify:api` checks the local build's
|
|
12
|
+
public names, complete reachable signatures, and runtime and declaration
|
|
13
|
+
dependency boundaries. `npm run verify:package` applies the same contract to the
|
|
14
|
+
exact packed artifact. Regenerate the report only as part of an intentional
|
|
15
|
+
public API review.
|
|
16
|
+
|
|
17
|
+
## Compatibility promise
|
|
18
|
+
|
|
19
|
+
- `0.1.x` patch releases do not make breaking changes to documented APIs or the
|
|
20
|
+
serialized `Video` schema.
|
|
21
|
+
- A later `0.x` minor may make a breaking change only with release notes and a
|
|
22
|
+
concrete adoption example.
|
|
23
|
+
- An API prefixed with `experimental_` may change in a patch. Canonical examples
|
|
24
|
+
must pin an exact package version when they use one.
|
|
25
|
+
- Deprecated APIs remain usable until the next minor release. The `0.1`
|
|
26
|
+
package starts without undocumented compatibility aliases.
|
|
27
|
+
- The package is ESM-only, targets ES2022, and supports Node.js 20 or newer.
|
|
28
|
+
- React is an optional peer dependency. Only `/react` and renderer definitions
|
|
29
|
+
under `/templates` may depend on React.
|
|
30
|
+
- Framework adapters are examples, not separate public APIs. The release suite
|
|
31
|
+
verifies current Next.js and Vite production builds.
|
|
32
|
+
|
|
33
|
+
## Environment boundaries
|
|
34
|
+
|
|
35
|
+
| Entry point | Environment | May import React | May import Node built-ins |
|
|
36
|
+
|---|---|---:|---:|
|
|
37
|
+
| `@vanillaskyai/video` | Universal | No | No |
|
|
38
|
+
| `@vanillaskyai/video/server` | Server | No | No required runtime built-ins |
|
|
39
|
+
| `@vanillaskyai/video/react` | Browser/React | Yes | No |
|
|
40
|
+
| `@vanillaskyai/video/templates` | Browser/React authoring | Yes | No |
|
|
41
|
+
| `@vanillaskyai/video/templates/catalog` | Universal JSON metadata | No | No |
|
|
42
|
+
| `@vanillaskyai/video/test` | Node test runners | No | Node test helpers allowed |
|
|
43
|
+
|
|
44
|
+
The CLI is exposed separately as the `vanillasky` binary.
|
|
45
|
+
|
|
46
|
+
## Root
|
|
47
|
+
|
|
48
|
+
The root contains serializable protocol types and pure helpers. It never starts
|
|
49
|
+
a request, renders React, imports a provider, or accesses browser globals.
|
|
50
|
+
|
|
51
|
+
### Values
|
|
52
|
+
|
|
53
|
+
- `getVideoDuration(video: Video): number`
|
|
54
|
+
- `parseVideo(value: unknown): Video`
|
|
55
|
+
- `VideoValidationError`
|
|
56
|
+
|
|
57
|
+
### Types
|
|
58
|
+
|
|
59
|
+
- `Video`
|
|
60
|
+
- `VideoAudio`
|
|
61
|
+
- `VideoBackground`
|
|
62
|
+
- `VideoBrand`
|
|
63
|
+
- `VideoInput`
|
|
64
|
+
- `VideoOrientation`
|
|
65
|
+
- `VideoScene`
|
|
66
|
+
- `VideoStyle`
|
|
67
|
+
- `VideoStyleOptions`
|
|
68
|
+
- `VideoSuppliedMedia`
|
|
69
|
+
- `VideoStatus`
|
|
70
|
+
- `VideoValidationErrorCode`
|
|
71
|
+
|
|
72
|
+
`VideoState` remains internal protocol reducer state. Browser consumers use the
|
|
73
|
+
normalized fields returned by `useVideo` instead.
|
|
74
|
+
|
|
75
|
+
## Server
|
|
76
|
+
|
|
77
|
+
The server entry point creates a customer-owned authenticated route. It accepts
|
|
78
|
+
the result of Vercel AI SDK `streamText()` directly while retaining a small
|
|
79
|
+
provider-neutral text-delta escape hatch.
|
|
80
|
+
|
|
81
|
+
### Values
|
|
82
|
+
|
|
83
|
+
- `createVideoHandler(options)`
|
|
84
|
+
- `createServerTemplateRegistry(options)`
|
|
85
|
+
|
|
86
|
+
### Types
|
|
87
|
+
|
|
88
|
+
- `VideoHandlerOptions`
|
|
89
|
+
- `ServerTemplateRegistry`
|
|
90
|
+
- `ServerTemplateMetadata`
|
|
91
|
+
- `VideoFinishReason`
|
|
92
|
+
- `VideoGenerationSummary`
|
|
93
|
+
- `VideoProviderUsage`
|
|
94
|
+
- `VideoWarning`
|
|
95
|
+
- `VideoWarningCategory`
|
|
96
|
+
|
|
97
|
+
### Handler contract
|
|
98
|
+
|
|
99
|
+
- `authorize` is required for HTTP handlers. Use `authorize: "none"` only for
|
|
100
|
+
an intentionally non-public in-process/test handler.
|
|
101
|
+
- `streamText` receives the generated system prompt, grounded user prompt, and
|
|
102
|
+
the request `AbortSignal`.
|
|
103
|
+
- `invalidPartBehavior` is `"drop" | "fail"`. A behavior selector is never
|
|
104
|
+
named like a callback.
|
|
105
|
+
- `onWarning` receives safe typed warnings.
|
|
106
|
+
- `onComplete` receives one server-only `VideoGenerationSummary` after an
|
|
107
|
+
actual `response.complete`; errors and aborts do not invoke it.
|
|
108
|
+
- `onError` receives the full internal server error. Client responses remain
|
|
109
|
+
redacted and typed separately.
|
|
110
|
+
- Provider usage, raw usage, provider metadata, and model identifiers remain
|
|
111
|
+
server-side unless the host deliberately persists them.
|
|
112
|
+
- Provider-native usage and metadata require the bounded
|
|
113
|
+
`includeRawProviderData` opt-in.
|
|
114
|
+
- `snapshotRetention` opts into individually bounded source, instructions, or
|
|
115
|
+
supplied-media URL metadata; all are omitted by default.
|
|
116
|
+
- Provider credentials, provider selection, authentication, rate limiting,
|
|
117
|
+
provider retries, logging, and tracing remain host-owned.
|
|
118
|
+
- Request cancellation always reaches the provider through `AbortSignal`.
|
|
119
|
+
- Callback failures are isolated and never alter the video response.
|
|
120
|
+
|
|
121
|
+
## React
|
|
122
|
+
|
|
123
|
+
### Values
|
|
124
|
+
|
|
125
|
+
- `useVideo(options?)`
|
|
126
|
+
- `VideoPlayer`
|
|
127
|
+
- `VideoError`
|
|
128
|
+
|
|
129
|
+
### Types
|
|
130
|
+
|
|
131
|
+
- `UseVideoOptions`
|
|
132
|
+
- `UseVideoResult`
|
|
133
|
+
- `VideoPlayerProps`
|
|
134
|
+
- `VideoErrorOptions`
|
|
135
|
+
|
|
136
|
+
`UseVideoResult` has this conceptual shape:
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
interface UseVideoResult {
|
|
140
|
+
generate(input: VideoInput): Promise<Video>;
|
|
141
|
+
abort(reason?: string): void;
|
|
142
|
+
video?: Video;
|
|
143
|
+
status: VideoStatus;
|
|
144
|
+
error?: VideoError;
|
|
145
|
+
warnings: readonly VideoWarning[];
|
|
146
|
+
playerProps: VideoPlayerProps;
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`VideoPlayer` accepts either streaming player props or a completed saved video:
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
<VideoPlayer {...video.playerProps} />
|
|
154
|
+
<VideoPlayer video={savedVideo} />
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Saved-video playback performs no generation request. `VideoPlayerBinding` and
|
|
158
|
+
the internal reducer state are not public types.
|
|
159
|
+
|
|
160
|
+
## Template authoring
|
|
161
|
+
|
|
162
|
+
The template entry point owns React render definitions only. React-free server
|
|
163
|
+
metadata registries are created through `/server`.
|
|
164
|
+
|
|
165
|
+
### Values
|
|
166
|
+
|
|
167
|
+
- `defineTemplate(definition)`
|
|
168
|
+
- `createTemplateRegistry(options)`
|
|
169
|
+
|
|
170
|
+
### Types
|
|
171
|
+
|
|
172
|
+
- `TemplateDefinition`
|
|
173
|
+
- `TemplateExample`
|
|
174
|
+
- `TemplateJsonSchema`
|
|
175
|
+
- `TemplateFamily`
|
|
176
|
+
- `TemplateTimingMetadata`
|
|
177
|
+
- `TemplateTransitionTiming`
|
|
178
|
+
- `TemplateRegistry`
|
|
179
|
+
- `SceneTemplate`
|
|
180
|
+
- `SceneTemplateMetadata`
|
|
181
|
+
- `SceneTemplateProps`
|
|
182
|
+
|
|
183
|
+
`SceneTemplateProps.progress` is always the raw `0 → 1` scene clock.
|
|
184
|
+
Transition-enabled templates may use the optional `motionProgress` clock for
|
|
185
|
+
presentation motion; the renderer-owned overlap never prevents that clock from
|
|
186
|
+
reaching `1` across the complete template lifecycle. Their metadata must provide
|
|
187
|
+
`transitionTiming.entryReadyProgress` and `transitionTiming.holdProgress`.
|
|
188
|
+
|
|
189
|
+
Template timing uses `preferredDuration`; `duration` is not part of the
|
|
190
|
+
package. `AuthoringTemplate` is inferred and internal.
|
|
191
|
+
|
|
192
|
+
## Built-in catalog
|
|
193
|
+
|
|
194
|
+
The catalog entry point is JSON-safe metadata. It does not contain renderers.
|
|
195
|
+
|
|
196
|
+
### Values
|
|
197
|
+
|
|
198
|
+
- `builtinTemplates`
|
|
199
|
+
|
|
200
|
+
### Types
|
|
201
|
+
|
|
202
|
+
- `BuiltinTemplateId`
|
|
203
|
+
- `BuiltinTemplateMetadata`
|
|
204
|
+
|
|
205
|
+
Template family and timing types have one canonical home under `/templates`.
|
|
206
|
+
|
|
207
|
+
## Test utilities
|
|
208
|
+
|
|
209
|
+
The test entry point allows deterministic consumer tests without provider
|
|
210
|
+
credentials or model spend.
|
|
211
|
+
|
|
212
|
+
### Values
|
|
213
|
+
|
|
214
|
+
- `createMockVideoPlanner(options?)`
|
|
215
|
+
- `simulateVideoStream(parts, options?)`
|
|
216
|
+
- `videoFixtures`
|
|
217
|
+
|
|
218
|
+
### Types
|
|
219
|
+
|
|
220
|
+
- `MockVideoPlannerOptions`
|
|
221
|
+
- `SimulatedVideoStreamOptions`
|
|
222
|
+
|
|
223
|
+
The fixtures cover successful generation, delayed streaming, truncation,
|
|
224
|
+
invalid scenes, provider failure, content filtering, abort, and timeout.
|
|
225
|
+
|
|
226
|
+
## CLI
|
|
227
|
+
|
|
228
|
+
The `vanillasky` binary supports:
|
|
229
|
+
|
|
230
|
+
- `list`
|
|
231
|
+
- `describe`
|
|
232
|
+
- `create`
|
|
233
|
+
- `add`
|
|
234
|
+
- `sync`
|
|
235
|
+
- `check`
|
|
236
|
+
- `add --dry-run`
|
|
237
|
+
- `add --diff`
|
|
238
|
+
|
|
239
|
+
Generated customer files import only the public entry points in this document.
|
|
240
|
+
Browser registries import `createTemplateRegistry` from `/templates`. Server
|
|
241
|
+
registries import `createServerTemplateRegistry` and `ServerTemplateMetadata`
|
|
242
|
+
from `/server` without crossing a React type boundary.
|
|
243
|
+
|
|
244
|
+
## Serialized video
|
|
245
|
+
|
|
246
|
+
- A completed `Video` is JSON-serializable and may be stored by the host.
|
|
247
|
+
- Every completed value carries the required storage field
|
|
248
|
+
`schemaVersion: "0.1"`; it is independent from streaming protocol `0.4`.
|
|
249
|
+
- `parseVideo(value: unknown)` is the strict universal storage boundary. It
|
|
250
|
+
validates the full document and returns a detached, deeply frozen `Video`.
|
|
251
|
+
- JSON serialization remains platform-native; the SDK has no redundant public
|
|
252
|
+
serializer.
|
|
253
|
+
- Patch releases preserve round-trip compatibility.
|
|
254
|
+
- The 0.1 contract supports the current schema only. It has no compatibility
|
|
255
|
+
aliases or implicit coercions.
|
|
256
|
+
- Invalid documents throw `VideoValidationError` with `invalid_video`.
|
|
257
|
+
Unsupported future or unknown versions use `unsupported_video_version` and
|
|
258
|
+
fail before any renderer runs; they are never rendered partially.
|
|
259
|
+
- Raw prompts, provider payloads, and credentials are never retained by
|
|
260
|
+
default.
|
|
261
|
+
- Raw source, instructions, and the supplied-media URL index are opt-in and
|
|
262
|
+
bounded. Hosts own the database, storage, tenant policy, deletion, and media
|
|
263
|
+
URL expiry.
|
|
264
|
+
- Replay through `<VideoPlayer video={savedVideo} />` never calls an LLM.
|
|
265
|
+
- Completion checksums detect accidental drift only; they do not provide
|
|
266
|
+
authenticity, authorization, or tenancy security.
|
|
267
|
+
|
|
268
|
+
## Intentionally excluded from 0.1
|
|
269
|
+
|
|
270
|
+
- Provider-specific OpenAI or Anthropic wrapper clients.
|
|
271
|
+
- Rendering/export infrastructure.
|
|
272
|
+
- Hosted persistence.
|
|
273
|
+
- OpenTelemetry integration.
|
|
274
|
+
- Automatic factual verification or scene repair.
|
|
275
|
+
- `useVideo(initialVideo)`.
|
|
276
|
+
- Undocumented API aliases.
|
package/README.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Give your AI a video output
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
**VanillaSky is the open-source video response layer.** Turn text, structured
|
|
6
|
+
data, and live application context into personalized video responses that start
|
|
7
|
+
playing while your LLM composes them.
|
|
8
|
+
|
|
9
|
+
> **Status: Beta.** VanillaSky is pre-1.0 and its public API may change as we
|
|
10
|
+
> test it in real applications. Pin an exact version before production use.
|
|
11
|
+
|
|
12
|
+
Your application owns the model, data, authentication, and UI. VanillaSky owns
|
|
13
|
+
the planning prompt, trusted templates, validation, streaming, and player.
|
|
14
|
+
|
|
15
|
+
## Start
|
|
16
|
+
|
|
17
|
+
For humans:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @vanillaskyai/video@0.1.0 ai @ai-sdk/openai
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For coding agents:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx skills add VanillaSkyAi/video@vanillasky
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Then prompt: `Use $vanillasky to turn this application's data into a personalized video response.`
|
|
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
|
+
## Connect your LLM
|
|
39
|
+
|
|
40
|
+
Create one authenticated server route:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
// app/api/video/route.ts
|
|
44
|
+
import { openai } from "@ai-sdk/openai";
|
|
45
|
+
import { streamText } from "ai";
|
|
46
|
+
import { createVideoHandler } from "@vanillaskyai/video/server";
|
|
47
|
+
|
|
48
|
+
const model = openai(process.env.OPENAI_MODEL ?? "gpt-4.1");
|
|
49
|
+
|
|
50
|
+
const handle = createVideoHandler({
|
|
51
|
+
// Local development only. Replace with your session check before deploying.
|
|
52
|
+
authorize: (request) => {
|
|
53
|
+
if (process.env.NODE_ENV !== "development") return false;
|
|
54
|
+
const hostname = new URL(request.url).hostname;
|
|
55
|
+
return hostname === "localhost" || hostname === "127.0.0.1";
|
|
56
|
+
},
|
|
57
|
+
streamText: ({ systemPrompt, userPrompt, signal }) => streamText({
|
|
58
|
+
model,
|
|
59
|
+
system: systemPrompt,
|
|
60
|
+
prompt: userPrompt,
|
|
61
|
+
abortSignal: signal,
|
|
62
|
+
}),
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export const POST = handle;
|
|
66
|
+
export const OPTIONS = handle;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The local authorization denies every production request. Replace it before
|
|
70
|
+
deploying. The model can come from OpenAI, Anthropic, an AI SDK registry or
|
|
71
|
+
gateway, or any compatible streaming adapter.
|
|
72
|
+
|
|
73
|
+
## Generate a video
|
|
74
|
+
|
|
75
|
+
Call the route from React and render the player:
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
"use client";
|
|
79
|
+
|
|
80
|
+
import { VideoPlayer, useVideo } from "@vanillaskyai/video/react";
|
|
81
|
+
|
|
82
|
+
export function VideoResponse() {
|
|
83
|
+
const video = useVideo();
|
|
84
|
+
|
|
85
|
+
return <>
|
|
86
|
+
<button onClick={() => { void video.generate({
|
|
87
|
+
input: "Activation increased from 41% to 58% after guided onboarding.",
|
|
88
|
+
personalization: { firstName: "Maya" },
|
|
89
|
+
}); }}>
|
|
90
|
+
Generate video
|
|
91
|
+
</button>
|
|
92
|
+
|
|
93
|
+
{video.error && <p role="alert">Video generation failed.</p>}
|
|
94
|
+
<VideoPlayer {...video.playerProps} />
|
|
95
|
+
</>;
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
That is the complete path. Built-in templates require no setup. VanillaSky
|
|
100
|
+
shows each complete, validated scene as soon as it is ready and returns a
|
|
101
|
+
deterministic `Video` object when generation finishes.
|
|
102
|
+
|
|
103
|
+
A copy-and-run app is in
|
|
104
|
+
[`examples/nextjs-quickstart`](https://github.com/VanillaSkyAi/video/tree/v0.1.0/examples/nextjs-quickstart).
|
|
105
|
+
|
|
106
|
+
## Shape the response
|
|
107
|
+
|
|
108
|
+
Start with `input`, the complete factual boundary for the video:
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
video.generate({
|
|
112
|
+
input: JSON.stringify({
|
|
113
|
+
period: "Q2",
|
|
114
|
+
activation: { previous: 41, current: 58 },
|
|
115
|
+
cause: "guided onboarding",
|
|
116
|
+
}),
|
|
117
|
+
instructions: "Lead with the improvement, then explain what changed.",
|
|
118
|
+
personalization: { firstName: "Maya", plan: "Pro" },
|
|
119
|
+
});
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
- Put claims, numbers, names, dates, and quotations in `input`.
|
|
123
|
+
- Put presentation direction in `instructions`.
|
|
124
|
+
- Put viewer or account context in `personalization`.
|
|
125
|
+
- Add brand, approved media, soundtrack audio, or a smaller template set only
|
|
126
|
+
when the experience needs them.
|
|
127
|
+
|
|
128
|
+
VanillaSky does not provide an LLM, hosted generation service, narration, TTS,
|
|
129
|
+
or speech synchronization. MP4/WebM encoding and export are application-owned.
|
|
130
|
+
Completed videos can be stored as JSON and replayed without calling the LLM.
|
|
131
|
+
|
|
132
|
+
Custom templates are optional. Only source-owned templates need the local TSX
|
|
133
|
+
compiler: `npm install --save-dev tsx`.
|
|
134
|
+
|
|
135
|
+
## Documentation
|
|
136
|
+
|
|
137
|
+
| Goal | Guide |
|
|
138
|
+
| --- | --- |
|
|
139
|
+
| Integrate with a coding agent | [Agent integration guide](docs/agent-integration.md) |
|
|
140
|
+
| Build the first response | [Getting started](docs/getting-started.md) |
|
|
141
|
+
| Copy the Next.js route and component | [Next.js integration](docs/integrate-nextjs.md) |
|
|
142
|
+
| Connect another model | [Provider integration](docs/provider-integration.md) |
|
|
143
|
+
| Understand grounding and prompts | [Prompt and input](docs/prompt-and-input.md) |
|
|
144
|
+
| Add brand or viewer context | [Branding and personalization](docs/branding-and-personalization.md) |
|
|
145
|
+
| Add media or soundtrack audio | [Media and soundtrack audio](docs/media-and-audio.md) |
|
|
146
|
+
| Persist and replay results | [Persistence and replay](docs/persistence.md) |
|
|
147
|
+
| Create source-owned templates | [Custom templates](docs/custom-templates.md) |
|
|
148
|
+
| Test routes and streams | [Test integrations](docs/testing.md) |
|
|
149
|
+
| Deploy securely | [Production](docs/production.md) · [Security](docs/security.md) |
|
|
150
|
+
| Inspect the API contract | [Public API](PUBLIC-API.md) · [Protocol](docs/reference/protocol.md) |
|
|
151
|
+
|
|
152
|
+
Apache-2.0
|