vidspotai-shared 1.0.92 → 1.0.94
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/lib/schemas/demoSpec.schema.d.ts +689 -0
- package/lib/schemas/demoSpec.schema.d.ts.map +1 -0
- package/lib/schemas/demoSpec.schema.js +276 -0
- package/lib/schemas/index.d.ts +1 -0
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +1 -0
- package/lib/schemas/project.schema.d.ts +78 -0
- package/lib/schemas/project.schema.d.ts.map +1 -1
- package/lib/schemas/project.schema.js +55 -1
- package/lib/schemas/videoPlan.schema.d.ts +69 -0
- package/lib/schemas/videoPlan.schema.d.ts.map +1 -1
- package/lib/schemas/videoPlan.schema.js +30 -1
- package/lib/services/agent/editClassifier.d.ts +16 -0
- package/lib/services/agent/editClassifier.d.ts.map +1 -1
- package/lib/services/agent/index.d.ts +1 -0
- package/lib/services/agent/index.d.ts.map +1 -1
- package/lib/services/agent/index.js +1 -0
- package/lib/services/agent/overlayRenderer.d.ts.map +1 -1
- package/lib/services/agent/overlayRenderer.js +8 -0
- package/lib/services/agent/planner/Planner.d.ts.map +1 -1
- package/lib/services/agent/planner/Planner.js +13 -2
- package/lib/services/agent/planner/structuralRules.d.ts.map +1 -1
- package/lib/services/agent/planner/structuralRules.js +6 -1
- package/lib/services/agent/textStylePacks.d.ts +35 -0
- package/lib/services/agent/textStylePacks.d.ts.map +1 -0
- package/lib/services/agent/textStylePacks.js +70 -0
- package/lib/services/agent/tools/composeScene.tool.d.ts +46 -0
- package/lib/services/agent/tools/composeScene.tool.d.ts.map +1 -1
- package/lib/services/agent/tools/estimateCost.tool.d.ts +16 -0
- package/lib/services/agent/tools/estimateCost.tool.d.ts.map +1 -1
- package/lib/services/agent/tools/planVideo.tool.d.ts +27 -0
- package/lib/services/agent/tools/planVideo.tool.d.ts.map +1 -1
- package/lib/services/agent/tools/render.tool.d.ts +16 -0
- package/lib/services/agent/tools/render.tool.d.ts.map +1 -1
- package/lib/services/aiGen/providers/bytedance/bytedance.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/bytedance/bytedance.service.js +8 -8
- package/lib/services/aiGen/providers/google/google.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/google/google.service.js +92 -8
- package/lib/services/asr/index.d.ts +1 -0
- package/lib/services/asr/index.d.ts.map +1 -1
- package/lib/services/asr/index.js +1 -0
- package/lib/services/asr/transcribeWithFallback.d.ts +54 -0
- package/lib/services/asr/transcribeWithFallback.d.ts.map +1 -0
- package/lib/services/asr/transcribeWithFallback.js +87 -0
- package/lib/services/editor/designToProject.d.ts +2 -0
- package/lib/services/editor/designToProject.d.ts.map +1 -1
- package/lib/services/editor/designToProject.js +10 -0
- package/lib/services/editor/planToProject.d.ts.map +1 -1
- package/lib/services/editor/planToProject.helpers.d.ts +9 -3
- package/lib/services/editor/planToProject.helpers.d.ts.map +1 -1
- package/lib/services/editor/planToProject.helpers.js +17 -2
- package/lib/services/editor/planToProject.js +21 -3
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ exports.sizeForAspect = sizeForAspect;
|
|
|
6
6
|
exports.provenanceForScene = provenanceForScene;
|
|
7
7
|
exports.buildOverlayClipsForScene = buildOverlayClipsForScene;
|
|
8
8
|
exports.makeTrack = makeTrack;
|
|
9
|
+
const textStylePacks_1 = require("../agent/textStylePacks");
|
|
9
10
|
/**
|
|
10
11
|
* Pure building blocks for planToProject: track ids, strategy/transition/size
|
|
11
12
|
* lookups, provenance + overlay styling, the per-scene overlay clip builder,
|
|
@@ -126,13 +127,21 @@ function fontWeightForOverlay(o) {
|
|
|
126
127
|
* of prior scene durations). `sceneDurationMs` clamps any overlay.endMs
|
|
127
128
|
* that overshoots the scene.
|
|
128
129
|
*/
|
|
129
|
-
function buildOverlayClipsForScene(sceneIndex, offsetMs, sceneDurationMs, overlays, frameHeight
|
|
130
|
+
function buildOverlayClipsForScene(sceneIndex, offsetMs, sceneDurationMs, overlays, frameHeight,
|
|
131
|
+
/**
|
|
132
|
+
* Per-video animation look. Resolves the preset for each overlay's role when
|
|
133
|
+
* the overlay didn't specify its own `preset`. Optional so regen callers that
|
|
134
|
+
* don't carry the plan still work (they fall through to "clean").
|
|
135
|
+
*/
|
|
136
|
+
stylePack) {
|
|
130
137
|
const clips = [];
|
|
131
138
|
for (const [oi, overlay] of overlays.entries()) {
|
|
132
139
|
const overlayFrom = offsetMs + Math.max(0, overlay.startMs ?? 0);
|
|
133
140
|
const overlayTo = offsetMs + Math.min(sceneDurationMs, overlay.endMs ?? sceneDurationMs);
|
|
134
141
|
if (overlayTo <= overlayFrom)
|
|
135
142
|
continue;
|
|
143
|
+
// Per-overlay preset wins; else resolve from the video's style pack + role.
|
|
144
|
+
const preset = overlay.preset ?? (0, textStylePacks_1.resolveTextPreset)(stylePack, overlay.role);
|
|
136
145
|
clips.push({
|
|
137
146
|
id: `scene-${sceneIndex}-overlay-${oi}`,
|
|
138
147
|
trackId: exports.TRACK_ID.text,
|
|
@@ -146,6 +155,8 @@ function buildOverlayClipsForScene(sceneIndex, offsetMs, sceneDurationMs, overla
|
|
|
146
155
|
color: overlay.color ?? "#ffffff",
|
|
147
156
|
align: "center",
|
|
148
157
|
backgroundColor: overlay.bgColor,
|
|
158
|
+
// First-class preset so the editor + round-trip carry it explicitly.
|
|
159
|
+
preset,
|
|
149
160
|
effects: [],
|
|
150
161
|
transform: { x: 0, y: 0, scaleX: 1, scaleY: 1, rotation: 0, opacity: 1 },
|
|
151
162
|
locked: false,
|
|
@@ -155,6 +166,9 @@ function buildOverlayClipsForScene(sceneIndex, offsetMs, sceneDurationMs, overla
|
|
|
155
166
|
position: overlay.position,
|
|
156
167
|
emphasis: overlay.emphasis,
|
|
157
168
|
animation: overlay.animation,
|
|
169
|
+
// Mirror preset into metadata too — readTextMetadata exposes it and
|
|
170
|
+
// some regen/diff paths only diff on metadata.
|
|
171
|
+
preset,
|
|
158
172
|
bgStyle: overlay.bgStyle,
|
|
159
173
|
sizePct: overlay.sizePct,
|
|
160
174
|
persistAcrossScenes: overlay.persistAcrossScenes ?? false,
|
|
@@ -163,7 +177,7 @@ function buildOverlayClipsForScene(sceneIndex, offsetMs, sceneDurationMs, overla
|
|
|
163
177
|
}
|
|
164
178
|
return clips;
|
|
165
179
|
}
|
|
166
|
-
function makeTrack(id, kind, index, name) {
|
|
180
|
+
function makeTrack(id, kind, index, name, sourceTrackId) {
|
|
167
181
|
return {
|
|
168
182
|
id,
|
|
169
183
|
kind,
|
|
@@ -173,5 +187,6 @@ function makeTrack(id, kind, index, name) {
|
|
|
173
187
|
hidden: false,
|
|
174
188
|
locked: false,
|
|
175
189
|
gainDb: 0,
|
|
190
|
+
...(sourceTrackId ? { sourceTrackId } : {}),
|
|
176
191
|
};
|
|
177
192
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.buildOverlayClipsForScene = exports.TRACK_ID = void 0;
|
|
4
4
|
exports.planToProject = planToProject;
|
|
5
5
|
const project_schema_1 = require("../../schemas/project.schema");
|
|
6
|
+
const textStylePacks_1 = require("../agent/textStylePacks");
|
|
6
7
|
const planToProject_helpers_1 = require("./planToProject.helpers");
|
|
7
8
|
// Re-export the public surface so `export * from "./editor/planToProject"`
|
|
8
9
|
// (services/index.ts) keeps surfacing these for existing importers.
|
|
@@ -221,7 +222,7 @@ function planToProject(input) {
|
|
|
221
222
|
clips.push(voClip);
|
|
222
223
|
}
|
|
223
224
|
// Overlay text clips.
|
|
224
|
-
const overlayClips = (0, planToProject_helpers_1.buildOverlayClipsForScene)(scene.sceneIndex, offsetMs, sceneDurationMs, scene.overlays ?? [], size.height);
|
|
225
|
+
const overlayClips = (0, planToProject_helpers_1.buildOverlayClipsForScene)(scene.sceneIndex, offsetMs, sceneDurationMs, scene.overlays ?? [], size.height, plan.textStylePack);
|
|
225
226
|
if (overlayClips.length > 0)
|
|
226
227
|
hasOverlays = true;
|
|
227
228
|
for (const clip of overlayClips)
|
|
@@ -234,6 +235,10 @@ function planToProject(input) {
|
|
|
234
235
|
// change_caption_style tool): per-scene override wins over the
|
|
235
236
|
// plan-level style, which wins over the renderer defaults, per field.
|
|
236
237
|
const cs = { ...plan.captionStyle, ...scene.captionStyle };
|
|
238
|
+
// Caption preset: explicit captionStyle.preset wins, else resolve from
|
|
239
|
+
// the video's style pack. Carried first-class so the editor + round-trip
|
|
240
|
+
// preserve it.
|
|
241
|
+
const captionPreset = cs?.preset ?? (0, textStylePacks_1.resolveCaptionPreset)(plan.textStylePack);
|
|
237
242
|
const captionClip = {
|
|
238
243
|
id: `scene-${scene.sceneIndex}-caption`,
|
|
239
244
|
trackId: planToProject_helpers_1.TRACK_ID.caption,
|
|
@@ -249,11 +254,19 @@ function planToProject(input) {
|
|
|
249
254
|
...(cs?.fontWeight !== undefined ? { fontWeight: cs.fontWeight } : {}),
|
|
250
255
|
color: cs?.color ?? "#ffffff",
|
|
251
256
|
...(cs?.highlightColor ? { highlightColor: cs.highlightColor } : {}),
|
|
257
|
+
...(captionPreset ? { preset: captionPreset } : {}),
|
|
252
258
|
language: "en",
|
|
253
259
|
effects: [],
|
|
254
260
|
transform: { x: 0, y: 0, scaleX: 1, scaleY: 1, rotation: 0, opacity: 1 },
|
|
255
261
|
locked: false,
|
|
256
|
-
|
|
262
|
+
// parentId / sourceUrl link the caption to its source VO clip — the same
|
|
263
|
+
// convention editor-made captions use, so the editor groups, regenerates
|
|
264
|
+
// (replace-in-place by parentId), and links them identically (1:1).
|
|
265
|
+
metadata: {
|
|
266
|
+
sceneIndex: scene.sceneIndex,
|
|
267
|
+
parentId: `scene-${scene.sceneIndex}-vo`,
|
|
268
|
+
...(outcome?.voiceoverUrl ? { sourceUrl: outcome.voiceoverUrl } : {}),
|
|
269
|
+
},
|
|
257
270
|
};
|
|
258
271
|
clips.push(captionClip);
|
|
259
272
|
}
|
|
@@ -382,8 +395,11 @@ function planToProject(input) {
|
|
|
382
395
|
tracks.push((0, planToProject_helpers_1.makeTrack)(planToProject_helpers_1.TRACK_ID.music, "audio", trackIndex++, "Music"));
|
|
383
396
|
if (hasOverlays)
|
|
384
397
|
tracks.push((0, planToProject_helpers_1.makeTrack)(planToProject_helpers_1.TRACK_ID.text, "text", trackIndex++, "Text"));
|
|
398
|
+
// Caption track is tagged with its SOURCE GROUP (the voiceover track) so the
|
|
399
|
+
// editor treats agent-made captions exactly like editor-made ones: one caption
|
|
400
|
+
// row per source group, and regen/new captions route back onto it.
|
|
385
401
|
if (hasCaptions)
|
|
386
|
-
tracks.push((0, planToProject_helpers_1.makeTrack)(planToProject_helpers_1.TRACK_ID.caption, "caption", trackIndex++, "Captions"));
|
|
402
|
+
tracks.push((0, planToProject_helpers_1.makeTrack)(planToProject_helpers_1.TRACK_ID.caption, "caption", trackIndex++, "Voiceover · Captions", planToProject_helpers_1.TRACK_ID.voiceover));
|
|
387
403
|
const durationMs = Math.max(1, offsetMs);
|
|
388
404
|
return {
|
|
389
405
|
schemaVersion: project_schema_1.PROJECT_SCHEMA_VERSION,
|
|
@@ -393,6 +409,8 @@ function planToProject(input) {
|
|
|
393
409
|
fps: 30,
|
|
394
410
|
size,
|
|
395
411
|
aspect: plan.aspect,
|
|
412
|
+
// Agent plans have no master-volume concept yet; 1 = unchanged.
|
|
413
|
+
masterVolume: 1,
|
|
396
414
|
background: { type: "color", value: "#000000" },
|
|
397
415
|
tracks,
|
|
398
416
|
clips,
|