@vanillaskyai/video 0.10.13 → 0.10.14

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 CHANGED
@@ -4,6 +4,10 @@ VanillaSky follows semantic versioning. This changelog begins with the 0.1 beta.
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.10.14
8
+
9
+ - Attach content-free record-shape diagnostics to rejected chat plans without accepting alternate formats or exposing model output.
10
+
7
11
  ## 0.10.13
8
12
 
9
13
  - Plan concise AI answers around the configured video-attempt budget, including the ending, while retaining complete authored narration and chapter recovery.
package/dist/server.js CHANGED
@@ -892,6 +892,24 @@ function continueAfterOpening(narration, earlier) {
892
892
 
893
893
  // src/server/chat-shot-planner.ts
894
894
  var object = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
895
+ function planShapeError(value) {
896
+ const part = object(value);
897
+ const has = (key) => Boolean(part && Object.hasOwn(part, key));
898
+ const shape = value === null ? "null" : Array.isArray(value) ? "array" : typeof value;
899
+ const discriminator = !has("type") ? "missing" : part.type === "answer" || part.type === "shot" ? part.type : typeof part.type === "string" ? "other-string" : "non-string";
900
+ return new Error("Chat plan requires an answer brief followed by shots", { cause: {
901
+ code: "chat_plan_shape",
902
+ shape,
903
+ discriminator,
904
+ fields: {
905
+ opening: has("opening"),
906
+ subject: has("subject"),
907
+ development: has("development"),
908
+ visualDirection: has("visualDirection"),
909
+ ending: has("ending")
910
+ }
911
+ } });
912
+ }
895
913
  function text(value, maximum) {
896
914
  return typeof value === "string" && value.trim().length <= maximum ? value.trim() : "";
897
915
  }
@@ -993,7 +1011,8 @@ function createChatShotPlanner(options) {
993
1011
  const line = (raw) => {
994
1012
  const trimmed = raw.trim();
995
1013
  if (!trimmed || /^```(?:json|ndjson)?$/i.test(trimmed)) return;
996
- const part = object(JSON.parse(trimmed));
1014
+ const value = JSON.parse(trimmed);
1015
+ const part = object(value);
997
1016
  if (part?.type === "answer") {
998
1017
  if (brief) throw new Error("Chat answer brief was emitted more than once");
999
1018
  brief = { opening: text(part.opening, 300), subject: text(part.subject, 80), visualDirection: text(part.visualDirection, 600), development: text(part.development, 2e3) };
@@ -1007,7 +1026,7 @@ function createChatShotPlanner(options) {
1007
1026
  options.publishOpening(brief.opening ? { line: brief.opening, keyword: brief.subject } : void 0);
1008
1027
  return;
1009
1028
  }
1010
- if (part?.type !== "shot") throw new Error("Chat plan requires an answer brief followed by shots");
1029
+ if (part?.type !== "shot") throw planShapeError(value);
1011
1030
  if (!brief) throw new Error("Chat shot arrived before its answer brief");
1012
1031
  const shot = readShot(part, clipDurationSec, brief.subject);
1013
1032
  if (shot.narration === brief.ending?.narration) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanillaskyai/video",
3
- "version": "0.10.13",
3
+ "version": "0.10.14",
4
4
  "description": "Open-source voice-and-video chat SDK for AI applications.",
5
5
  "keywords": [
6
6
  "video-chat",
@@ -9,7 +9,7 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "@vanillaskyai/video": "0.10.13",
12
+ "@vanillaskyai/video": "0.10.14",
13
13
  "react": "^19.2.8",
14
14
  "react-dom": "^19.2.8",
15
15
  "@ai-sdk/anthropic": "^3.0.0",