vidspotai-shared 1.0.84 → 1.0.86

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.
Files changed (54) hide show
  1. package/lib/globals/aiModels/providers/runway.d.ts.map +1 -1
  2. package/lib/globals/aiModels/providers/runway.js +12 -7
  3. package/lib/globals/types.d.ts +10 -0
  4. package/lib/globals/types.d.ts.map +1 -1
  5. package/lib/globals/types.js +11 -0
  6. package/lib/models/agent.model.d.ts +129 -1
  7. package/lib/models/agent.model.d.ts.map +1 -1
  8. package/lib/schemas/agentRunJob.schema.d.ts +21 -0
  9. package/lib/schemas/agentRunJob.schema.d.ts.map +1 -1
  10. package/lib/schemas/agentRunJob.schema.js +35 -3
  11. package/lib/services/agent/executor/core.d.ts.map +1 -1
  12. package/lib/services/agent/executor/core.js +21 -1
  13. package/lib/services/agent/executor/types.d.ts +10 -0
  14. package/lib/services/agent/executor/types.d.ts.map +1 -1
  15. package/lib/services/agent/index.d.ts +3 -0
  16. package/lib/services/agent/index.d.ts.map +1 -1
  17. package/lib/services/agent/index.js +3 -0
  18. package/lib/services/agent/providerFallback/chains.d.ts +2 -0
  19. package/lib/services/agent/providerFallback/chains.d.ts.map +1 -1
  20. package/lib/services/agent/providerFallback/chains.js +1 -0
  21. package/lib/services/agent/recovery/degradeLadder.d.ts +74 -0
  22. package/lib/services/agent/recovery/degradeLadder.d.ts.map +1 -0
  23. package/lib/services/agent/recovery/degradeLadder.js +133 -0
  24. package/lib/services/agent/repair/engine.d.ts +38 -0
  25. package/lib/services/agent/repair/engine.d.ts.map +1 -0
  26. package/lib/services/agent/repair/engine.js +175 -0
  27. package/lib/services/agent/repair/index.d.ts +20 -0
  28. package/lib/services/agent/repair/index.d.ts.map +1 -0
  29. package/lib/services/agent/repair/index.js +49 -0
  30. package/lib/services/agent/repair/strategies/llmRepair.strategy.d.ts +6 -0
  31. package/lib/services/agent/repair/strategies/llmRepair.strategy.d.ts.map +1 -0
  32. package/lib/services/agent/repair/strategies/llmRepair.strategy.js +210 -0
  33. package/lib/services/agent/repair/strategies/paramRepair.strategy.d.ts +3 -0
  34. package/lib/services/agent/repair/strategies/paramRepair.strategy.d.ts.map +1 -0
  35. package/lib/services/agent/repair/strategies/paramRepair.strategy.js +151 -0
  36. package/lib/services/agent/repair/types.d.ts +92 -0
  37. package/lib/services/agent/repair/types.d.ts.map +1 -0
  38. package/lib/services/agent/repair/types.js +2 -0
  39. package/lib/services/agent/runPlanning.d.ts +96 -0
  40. package/lib/services/agent/runPlanning.d.ts.map +1 -0
  41. package/lib/services/agent/runPlanning.js +233 -0
  42. package/lib/services/aiGen/providers/runway/types.d.ts +14 -0
  43. package/lib/services/aiGen/providers/runway/types.d.ts.map +1 -1
  44. package/lib/services/aiGen/providers/runway/types.js +22 -1
  45. package/lib/services/firestore.service.d.ts +7 -1
  46. package/lib/services/firestore.service.d.ts.map +1 -1
  47. package/lib/services/firestore.service.js +8 -0
  48. package/package.json +1 -1
  49. package/lib/services/agent/executor.d.ts +0 -141
  50. package/lib/services/agent/executor.d.ts.map +0 -1
  51. package/lib/services/agent/executor.js +0 -561
  52. package/lib/services/agent/llmCallerGateway.d.ts +0 -61
  53. package/lib/services/agent/llmCallerGateway.d.ts.map +0 -1
  54. package/lib/services/agent/llmCallerGateway.js +0 -368
@@ -0,0 +1,233 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.computeBibleCacheKey = computeBibleCacheKey;
4
+ exports.getBibleWithCache = getBibleWithCache;
5
+ exports.recordPlanTimings = recordPlanTimings;
6
+ exports.runPlanning = runPlanning;
7
+ const crypto_1 = require("crypto");
8
+ const logger_1 = require("../../utils/logger");
9
+ const firestore_service_1 = require("../firestore.service");
10
+ const brief_schema_1 = require("../../schemas/brief.schema");
11
+ const llmCallerRegistry_1 = require("./llmCallerRegistry");
12
+ const bibleBuilder_1 = require("./bibleBuilder");
13
+ const bibleImageVision_1 = require("./bibleImageVision");
14
+ const planner_1 = require("./planner");
15
+ const musicSelect_1 = require("./musicSelect");
16
+ const beatSnap_1 = require("./beatSnap");
17
+ /**
18
+ * plan-B — the single source of truth for "build a plan from a brief".
19
+ *
20
+ * Extracted out of the Cloud Function (plan.controller.ts) so BOTH the
21
+ * AGENT_PLAN_JOBS worker (the async primary path) and the blocking
22
+ * `planProject` Function call run the IDENTICAL bible→planner→music→snap
23
+ * pipeline + emit the IDENTICAL latency telemetry. Two callers, one routine,
24
+ * no drift.
25
+ *
26
+ * The caller owns persistence (writing `.plan` / `previewPlan` / `bibleCache`);
27
+ * this routine is pure compute + telemetry. Progress is surfaced through the
28
+ * optional `onStage` callback so the worker can mirror each sub-step onto
29
+ * `agentProjects.planRun.stage`.
30
+ */
31
+ const isoNow = () => new Date().toISOString();
32
+ /**
33
+ * Stable cache key for the Visual Bible. Bible content is a pure function of
34
+ * (brief, brandKit) — same inputs ⇒ same bible. We key on the brief object
35
+ * plus `brandKit.updatedAt` (cheap version proxy) so any brand-kit edit
36
+ * invalidates without re-hashing the kit body. C0 (no bible) returns "" so
37
+ * we never cache nothing as something.
38
+ */
39
+ function computeBibleCacheKey(brief, brandKit) {
40
+ if ((brief.consistencyTier ?? "C1") === "C0")
41
+ return "";
42
+ return (0, crypto_1.createHash)("sha256")
43
+ .update(JSON.stringify({
44
+ brief,
45
+ bku: brandKit?.updatedAt ?? null,
46
+ }))
47
+ .digest("hex");
48
+ }
49
+ /**
50
+ * AG-12 — soft-fail wrapper around BibleBuilder. A bible LLM failure must not
51
+ * block planning; the planner degrades to AG-11's per-scene re-state when no
52
+ * bible is passed. C0 briefs skip the builder entirely.
53
+ */
54
+ async function safeBuildBible(llm, args) {
55
+ const tier = args.brief.consistencyTier ?? "C1";
56
+ if (tier === "C0")
57
+ return undefined;
58
+ try {
59
+ const builder = new bibleBuilder_1.BibleBuilder({ llm });
60
+ return await builder.build({
61
+ brief: args.brief,
62
+ persona: args.persona,
63
+ brandKit: args.brandKit,
64
+ consistencyTier: tier === "C2" ? "C2" : "C1",
65
+ });
66
+ }
67
+ catch (err) {
68
+ logger_1.logger.warn("agent.bibleBuilder failed — degrading to AG-11", {
69
+ err: err.message,
70
+ });
71
+ return undefined;
72
+ }
73
+ }
74
+ /**
75
+ * OD-T6 — image-vision pass that rewrites bible.entity.description from the
76
+ * entity's referenceImageUrl. Runs between bible-build and planner so the
77
+ * planner composes scene prompts from what the IMAGE shows (color, material,
78
+ * finish, label text) rather than what the brief text invented. Skips
79
+ * entities without a referenceImageUrl. Per-entity soft-fail; vision outage
80
+ * leaves descriptions intact. Cost ~$0.0001/entity.
81
+ */
82
+ async function safeBibleImageVision(bible) {
83
+ if (!bible)
84
+ return bible;
85
+ const apiKey = process.env.GOOGLE_API_KEY;
86
+ if (!apiKey) {
87
+ logger_1.logger.warn("agent.bibleImageVision skipped — no GOOGLE_API_KEY");
88
+ return bible;
89
+ }
90
+ const haveRefs = bible.characters.some((e) => e.referenceImageUrl) ||
91
+ bible.objects.some((e) => e.referenceImageUrl) ||
92
+ bible.environments.some((e) => e.referenceImageUrl);
93
+ if (!haveRefs)
94
+ return bible;
95
+ try {
96
+ return await (0, bibleImageVision_1.runBibleImageVision)(bible, { apiKey });
97
+ }
98
+ catch (err) {
99
+ logger_1.logger.warn("agent.bibleImageVision failed — keeping text descriptions", {
100
+ err: err.message,
101
+ });
102
+ return bible;
103
+ }
104
+ }
105
+ /**
106
+ * Returns the bible to thread into the planner, using the project-level cache
107
+ * when the key matches. On miss runs the full BibleBuilder + image-vision
108
+ * pipeline (both soft-fail per their wrappers). Returns the bible and a
109
+ * `fresh` flag so the caller can decide to persist on cache miss only.
110
+ */
111
+ async function getBibleWithCache(args) {
112
+ const key = computeBibleCacheKey(args.brief, args.brandKit);
113
+ const cached = args.project.bibleCache;
114
+ if (key && cached?.key === key) {
115
+ args.onStage?.("bible_cached");
116
+ logger_1.logger.info("agent.bibleCache hit", {
117
+ projectId: args.project.id,
118
+ builtAt: cached.builtAt,
119
+ });
120
+ return { bible: cached.bible, fresh: false, key };
121
+ }
122
+ args.onStage?.("building_bible");
123
+ const built = await safeBuildBible(args.llm, {
124
+ brief: args.brief,
125
+ persona: args.persona,
126
+ brandKit: args.brandKit,
127
+ });
128
+ args.onStage?.("aligning_bible_with_images");
129
+ const bible = await safeBibleImageVision(built);
130
+ return { bible, fresh: true, key };
131
+ }
132
+ /**
133
+ * Latency telemetry — emits ONE structured record per planning run, two ways:
134
+ * 1) `logger.info("agent.planTimings", …)` → Console + Grafana Loki (the
135
+ * existing winston pipeline; no parallel reporter).
136
+ * 2) a durable doc in the `agentPlanTimings` Firestore collection → queryable
137
+ * for aggregate analysis (p50/p95 per stage, web-research/cache incidence)
138
+ * via scripts/analyze-plan-timings.mjs — no per-run guesswork.
139
+ *
140
+ * Fire-and-forget: never on the critical path, and a write failure is swallowed
141
+ * (warn only) so telemetry can't break planning.
142
+ */
143
+ function recordPlanTimings(args) {
144
+ const meta = (args.plan.meta ?? {});
145
+ const record = {
146
+ projectId: args.projectId,
147
+ userId: args.userId,
148
+ createdAt: isoNow(),
149
+ streaming: args.streaming,
150
+ dryRun: args.dryRun,
151
+ // shape signals — what makes a plan slow varies by these
152
+ durationSec: args.brief.durationSec ?? null,
153
+ lengthTier: args.brief.lengthTier ?? (0, brief_schema_1.deriveLengthTier)(args.brief.durationSec),
154
+ tierBudget: args.brief.tierBudget ?? null,
155
+ consistencyTier: args.brief.consistencyTier ?? null,
156
+ sceneCount: Array.isArray(args.plan.scenes) ? args.plan.scenes.length : null,
157
+ // cost-path flags (the prime suspects for short-form latency)
158
+ bibleCacheHit: args.bibleCacheHit,
159
+ bibleBuilt: meta.bibleBuilt ?? null,
160
+ usedWebResearch: meta.usedWebResearch ?? null,
161
+ usedThinking: meta.usedThinking ?? null,
162
+ // per-stage wall-clock
163
+ ...args.timings,
164
+ };
165
+ logger_1.logger.info("agent.planTimings", record);
166
+ // Durable, queryable copy. `.firestore` off any CollectionReference yields
167
+ // the admin Firestore instance, so we can write a new collection without a
168
+ // typed accessor in the shared package.
169
+ void firestore_service_1.FirestoreService.agentProjectsCol.firestore
170
+ .collection("agentPlanTimings")
171
+ .add(record)
172
+ .catch((err) => logger_1.logger.warn("agent.planTimings: firestore write failed", {
173
+ err: err.message,
174
+ }));
175
+ }
176
+ /**
177
+ * Run the full planning pipeline: bible (cache-or-build) → planner →
178
+ * music-select → beat-snap, stamping `plan.meta.bibleBuilt` and emitting
179
+ * latency telemetry. Pure compute — does NOT write the plan to Firestore;
180
+ * the caller decides where it lands (`.plan` for a live plan, `previewPlan`
181
+ * for a dry-run).
182
+ */
183
+ async function runPlanning(args) {
184
+ const llm = (0, llmCallerRegistry_1.getLlmCaller)();
185
+ const tStart = Date.now();
186
+ const { bible, fresh: bibleFresh, key: bibleKey } = await getBibleWithCache({
187
+ project: args.project,
188
+ brief: args.brief,
189
+ persona: args.persona,
190
+ brandKit: args.brandKit,
191
+ llm,
192
+ onStage: args.onStage,
193
+ });
194
+ const tBible = Date.now();
195
+ args.onStage?.("planning");
196
+ const planner = new planner_1.Planner({ llm });
197
+ const rawPlan = await planner.plan(args.brief, {
198
+ persona: args.persona,
199
+ brandKit: args.brandKit,
200
+ styleMemory: args.styleMemory,
201
+ bible,
202
+ useWebResearch: args.useWebResearch ?? "auto",
203
+ });
204
+ const tPlanner = Date.now();
205
+ // Stamp the bible-build flag onto plan.meta so /execute charges the bible
206
+ // overhead only when this run actually built one (cache hits cost nothing).
207
+ // Planner already stamped usedWebResearch / usedThinking.
208
+ rawPlan.meta = { ...(rawPlan.meta ?? {}), bibleBuilt: bibleFresh && !!bible };
209
+ const planWithMusic = await (0, musicSelect_1.selectMusicForPlan)(rawPlan);
210
+ const tMusic = Date.now();
211
+ const plan = (0, beatSnap_1.snapPlanToBeats)(planWithMusic);
212
+ const tSnap = Date.now();
213
+ recordPlanTimings({
214
+ projectId: args.project.id,
215
+ userId: args.project.userId,
216
+ brief: args.brief,
217
+ plan,
218
+ // The async worker path is non-streaming (progress comes from `onStage`,
219
+ // not token deltas), so `streaming: false` here. The kept legacy SSE
220
+ // endpoint still records `streaming: true` itself.
221
+ streaming: false,
222
+ dryRun: args.dryRun ?? false,
223
+ bibleCacheHit: !bibleFresh,
224
+ timings: {
225
+ bibleMs: tBible - tStart,
226
+ plannerMs: tPlanner - tBible,
227
+ musicMs: tMusic - tPlanner,
228
+ beatSnapMs: tSnap - tMusic,
229
+ totalMs: tSnap - tStart,
230
+ },
231
+ });
232
+ return { plan, bible, bibleFresh, bibleKey };
233
+ }
@@ -10,5 +10,19 @@ export declare const GEN4_ALEPH_RATIOS: string[];
10
10
  export declare const TGEN4_ALEPH_DURATIONS: readonly [5];
11
11
  export type Gen4AlephDuration = (typeof TGEN4_ALEPH_DURATIONS)[number];
12
12
  export declare const GEN4_ALEPH_DURATIONS: number[];
13
+ /**
14
+ * Canonical aspect ratios the Runway VIDEO models accept from the agent / UI
15
+ * layer. This is the CONTRACT `validateParams` checks the incoming canonical
16
+ * `aspectRatio` against — every other provider's config lists canonical ratios
17
+ * here too. The service then translates canonical → Runway pixel ratio at
18
+ * request time via `mapAspectToRunwayVideoRatio`. The pixel-ratio constants
19
+ * above (`GEN4_TURBO_RATIOS` / `GEN4_ALEPH_RATIOS`) describe the NATIVE values
20
+ * the Runway API accepts and back the `Gen4TurboRatio` / `Gen4AlephRatio` types
21
+ * used at that boundary — they are intentionally NOT the validation set.
22
+ *
23
+ * AG-16: keep this in lockstep with `mapAspectToRunwayVideoRatio`'s switch —
24
+ * every value listed here must map to a valid pixel ratio for all flavors.
25
+ */
26
+ export declare const RUNWAY_VIDEO_CANONICAL_RATIOS: string[];
13
27
  export {};
14
28
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/runway/types.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,kBAAkB,kFAOd,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC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,CAAC;AAClD,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AACvE,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAA+B,CAAC;AAEzE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,6BAA6B,EAAE,MAAM,EAOjD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GEN4_ALEPH_DURATIONS = exports.TGEN4_ALEPH_DURATIONS = exports.GEN4_ALEPH_RATIOS = exports.GEN4_TURBO_DURATIONS = exports.TGEN4_TURBO_DURATIONS = exports.GEN4_TURBO_RATIOS = void 0;
3
+ exports.RUNWAY_VIDEO_CANONICAL_RATIOS = exports.GEN4_ALEPH_DURATIONS = exports.TGEN4_ALEPH_DURATIONS = exports.GEN4_ALEPH_RATIOS = exports.GEN4_TURBO_DURATIONS = exports.TGEN4_TURBO_DURATIONS = exports.GEN4_TURBO_RATIOS = void 0;
4
4
  const TGEN4_TURBO_RATIOS = [
5
5
  "1280:720", // default
6
6
  "1584:672",
@@ -25,3 +25,24 @@ const TGEN4_ALEPH_RATIOS = [
25
25
  exports.GEN4_ALEPH_RATIOS = [...TGEN4_ALEPH_RATIOS];
26
26
  exports.TGEN4_ALEPH_DURATIONS = [5];
27
27
  exports.GEN4_ALEPH_DURATIONS = [...exports.TGEN4_ALEPH_DURATIONS];
28
+ /**
29
+ * Canonical aspect ratios the Runway VIDEO models accept from the agent / UI
30
+ * layer. This is the CONTRACT `validateParams` checks the incoming canonical
31
+ * `aspectRatio` against — every other provider's config lists canonical ratios
32
+ * here too. The service then translates canonical → Runway pixel ratio at
33
+ * request time via `mapAspectToRunwayVideoRatio`. The pixel-ratio constants
34
+ * above (`GEN4_TURBO_RATIOS` / `GEN4_ALEPH_RATIOS`) describe the NATIVE values
35
+ * the Runway API accepts and back the `Gen4TurboRatio` / `Gen4AlephRatio` types
36
+ * used at that boundary — they are intentionally NOT the validation set.
37
+ *
38
+ * AG-16: keep this in lockstep with `mapAspectToRunwayVideoRatio`'s switch —
39
+ * every value listed here must map to a valid pixel ratio for all flavors.
40
+ */
41
+ exports.RUNWAY_VIDEO_CANONICAL_RATIOS = [
42
+ "16:9",
43
+ "9:16",
44
+ "1:1",
45
+ "4:3",
46
+ "3:4",
47
+ "21:9",
48
+ ];
@@ -1,5 +1,5 @@
1
1
  import { DocumentData, OrderByDirection, WhereFilterOp } from "@google-cloud/firestore";
2
- import { CollectionReference, DocumentReference } from "firebase-admin/firestore";
2
+ import { CollectionReference, DocumentReference, FieldValue } from "firebase-admin/firestore";
3
3
  import { DeepPartial } from "../globals/types";
4
4
  import { IAgentProjectModel, IAgentRunModel, IBrandKitModel, IStyleMemoryModel } from "../models/agent.model";
5
5
  import { ICachedAssetModel } from "../models/cachedAsset.model";
@@ -55,6 +55,12 @@ export declare class FirestoreService {
55
55
  static socialPostsCol: CollectionReference<ISocialPostModel, DocumentData>;
56
56
  static socialAnalyticsCol: CollectionReference<ISocialAnalyticsModel, DocumentData>;
57
57
  static socialInboxCol: CollectionReference<ISocialInboxItemModel, DocumentData>;
58
+ /**
59
+ * Sentinel for `.update()` that removes a field from a doc (wraps
60
+ * `FieldValue.delete()`). Use to clear a transient field — e.g. plan-B's
61
+ * `planRun` once a live plan lands — without reading the doc first.
62
+ */
63
+ static deleteField(): FieldValue;
58
64
  /** Add new document with generated ID */
59
65
  static appendNewRecord<T>(collectionRef: CollectionReference<T>, data: T): Promise<DocumentReference<T>>;
60
66
  /** Add or overwrite a document with a specific ID */
@@ -1 +1 @@
1
- {"version":3,"file":"firestore.service.d.ts","sourceRoot":"","sources":["../../src/services/firestore.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,gBAAgB,EAEhB,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAGlB,MAAM,0BAA0B,CAAC;AAClC,O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R,YAAY,CAAC,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC;QAChC,cAAc,CAAC,EAAE,gBAAgB,CAAC;QAClC,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GACA,OAAO,CAAC,CAAC,CAAC,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAsBlC,8CAA8C;WACjC,UAAU,CAAC,CAAC,EACvB,aAAa,EAAE,mBAAmB,CAAC,CAAC,CAAC,EACrC,EAAE,EAAE,MAAM,EACV,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,EAC9B,OAAO,GAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAwB,GACrD,OAAO,CAAC,IAAI,CAAC;IAWhB,OAAO,CAAC,MAAM,CAAC,aAAa;IA2B5B,0CAA0C;WAC7B,cAAc,CACzB,EAAE,EAAE,MAAM,EACV,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,GAClC,OAAO,CAAC,IAAI,CAAC;IAIhB,sBAAsB;WACT,UAAU,CAAC,CAAC,EACvB,aAAa,EAAE,mBAAmB,CAAC,CAAC,CAAC,EACrC,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC;IAKhB,kCAAkC;WACrB,cAAc,CAAC,CAAC,EAC3B,OAAO,EAAE,CAAC,EAAE,EAAE,iBAAiB,CAAC,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,CAAC,CAAC;CAGd"}
@@ -22,6 +22,14 @@ function collectionConverter() {
22
22
  */
23
23
  class FirestoreService {
24
24
  // 🔹 CRUD / Utility methods
25
+ /**
26
+ * Sentinel for `.update()` that removes a field from a doc (wraps
27
+ * `FieldValue.delete()`). Use to clear a transient field — e.g. plan-B's
28
+ * `planRun` once a live plan lands — without reading the doc first.
29
+ */
30
+ static deleteField() {
31
+ return firestore_1.FieldValue.delete();
32
+ }
25
33
  /** Add new document with generated ID */
26
34
  static async appendNewRecord(collectionRef, data) {
27
35
  const docRef = collectionRef.doc();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vidspotai-shared",
3
- "version": "1.0.84",
3
+ "version": "1.0.86",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "exports": {
@@ -1,141 +0,0 @@
1
- import { PlannedScene, VideoPlan } from "../../schemas/videoPlan.schema";
2
- import { ToolContext, ToolOutcome } from "./toolRegistry";
3
- import { ProviderTaskCache, ProviderTaskCacheEntry } from "./providerTaskCache";
4
- export type RunToolFn = <O = unknown>(name: string, input: unknown, ctx: ToolContext) => Promise<ToolOutcome<O>>;
5
- /**
6
- * Executor — turns an approved VideoPlan into per-scene asset results.
7
- *
8
- * Plan-then-execute split (not free-form ReAct): the executor does NOT pick
9
- * tools. The plan dictates which tool runs per scene; the executor only does
10
- * the dispatch + per-scene parallelism + idempotency-key generation.
11
- *
12
- * Returns a SceneOutcome per scene, leaving composition (compose_scene),
13
- * critique (Critic.review), and render to the orchestrator above.
14
- */
15
- export interface SceneAssetResult {
16
- /** Concrete asset URL for the visual track (image or video). */
17
- visualUrl?: string;
18
- /** Voiceover audio (base64 or url depending on host policy). */
19
- voiceoverAudioBase64?: string;
20
- /**
21
- * Resolved voiceover URL once the host has uploaded the base64 buffer to
22
- * its asset store (GCS / Firebase Storage). The agent.controller flow
23
- * sets this in `onSceneComplete` so `planToProject` can render a real VO
24
- * clip on `track-vo`. When unset, planToProject skips the VO clip.
25
- */
26
- voiceoverUrl?: string;
27
- /** Provider task id for async generations the host still needs to poll. */
28
- pendingTaskId?: string;
29
- /** Model key the pending task was triggered on — the poller needs this to pick the provider. */
30
- pendingModelKey?: string;
31
- /** AG-22: provider chain the tool walked (in order, primary first). For trace + post-mortem. */
32
- attemptedProviders?: string[];
33
- /** Tool name used. */
34
- tool: string;
35
- /** Idempotency key the executor minted; useful for retries. */
36
- idempotencyKey: string;
37
- /**
38
- * AG-28: estimated VO duration (ms) from the wpm heuristic. Set when
39
- * voiceoverAudioBase64 is set. Used pre-upload for budget math; the
40
- * editor-side display window prefers voiceoverActualMs when available.
41
- */
42
- voiceoverEstimateMs?: number;
43
- /**
44
- * Probed actual mp3 duration (ms). Stamped by `resolveVoiceoverUrl` after
45
- * generation, before the buffer is discarded. Reflects real playback
46
- * length — required to size the editor VO clip's display window so
47
- * Remotion's `endAt` doesn't truncate emotive/punctuated deliveries that
48
- * the wpm estimate undershoots. Falls back to `voiceoverEstimateMs` when
49
- * ffprobe is unavailable.
50
- */
51
- voiceoverActualMs?: number;
52
- /**
53
- * AG-28: TTS over-budget signal. True when the line + style produces audio
54
- * longer than scene.durationMs * 1.05 even after the executor's atempo
55
- * adjustment. Stitcher should freeze-frame-pad rather than clip.
56
- */
57
- voiceoverOverBudget?: boolean;
58
- }
59
- export interface SceneOutcome {
60
- scene: PlannedScene;
61
- ok: boolean;
62
- result?: SceneAssetResult;
63
- error?: {
64
- code: string;
65
- message: string;
66
- /**
67
- * Set when the failure came from a provider-fallback-wrapped tool whose
68
- * entire chain exhausted (or terminated on auth/safety/input). Used by
69
- * the orchestrator to decide between agent re-plan / scene degrade /
70
- * hard fail.
71
- */
72
- classification?: "transient" | "rate_limit" | "capability" | "safety" | "auth" | "quota" | "input" | "unknown";
73
- needsReplan?: boolean;
74
- attemptedProviders?: string[];
75
- };
76
- durationMs: number;
77
- }
78
- /**
79
- * Inspect a failed scene to decide the next orchestration step.
80
- *
81
- * - "replan" : agent should re-plan the scene (safety / bad input)
82
- * - "degrade" : try a cheaper strategy (e.g. T2/T3 chain exhausted on quota)
83
- * - "fail" : terminal — surface to user (auth / chain-exhausted-unknown)
84
- * - "retry" : transient — caller may re-run the scene as-is later
85
- */
86
- export declare function classifySceneFailure(outcome: SceneOutcome): "replan" | "degrade" | "fail" | "retry" | null;
87
- export interface ExecutorOptions {
88
- /** Max scenes to run in parallel. Generation providers rate-limit themselves; this guards on top. */
89
- concurrency?: number;
90
- /** Inject a recording wrapper (e.g. runToolRecorded) for eval / replay. */
91
- runTool?: RunToolFn;
92
- /**
93
- * Stage 3 hook: invoked after each scene finishes (success OR failure).
94
- * Lets the orchestrator stream incremental Project updates into Firestore
95
- * so the editor + agent drawer surfaces light up as scenes complete,
96
- * rather than waiting for the whole executor to finish. Errors thrown
97
- * from the callback are swallowed (logged) so a Firestore blip can't
98
- * crash the executor.
99
- */
100
- onSceneComplete?: (sceneIndex: number, outcome: SceneOutcome) => Promise<void>;
101
- /**
102
- * Stage 7 slice 1: provider task-id cache (read side). When the upstream
103
- * inputs for animate_image / generate_video / generate_avatar_video hash
104
- * to the same value as a cached entry (and entry is within TTL), the
105
- * executor returns the cached taskId + modelKey and skips the tool call.
106
- * /execute passes the project's cache here so re-runs after downstream
107
- * (poll/stitch/critic) bugs reuse the prior $$ gens. /regenerate-scene
108
- * deliberately omits this (user wants a fresh gen) but still mints.
109
- */
110
- taskCache?: ProviderTaskCache;
111
- /**
112
- * Stage 7 slice 1: cache write side. Invoked after a successful tool call
113
- * that produced a pendingTaskId. Orchestrator persists the entry on the
114
- * AgentProject doc so the NEXT execute can replay. Errors swallowed —
115
- * cache is best-effort optimisation, not correctness.
116
- */
117
- onTaskMint?: (clipId: string, entry: ProviderTaskCacheEntry) => Promise<void>;
118
- }
119
- export declare class Executor {
120
- private readonly concurrency;
121
- private readonly runTool;
122
- private readonly onSceneComplete?;
123
- private readonly taskCache?;
124
- private readonly onTaskMint?;
125
- constructor(opts?: ExecutorOptions);
126
- /**
127
- * Stage 7 slice 1 helper. Returns cached pending-task output if the
128
- * upstream input hash matches and entry is within TTL; null otherwise.
129
- * Logs the hit so trace shows where $$ was saved.
130
- */
131
- private checkTaskCache;
132
- /**
133
- * Best-effort mint. Swallows callback errors — a Firestore blip must not
134
- * fail the scene (the tool already succeeded and produced a real taskId).
135
- */
136
- private mintTaskCache;
137
- run(plan: VideoPlan, ctx: ToolContext): Promise<SceneOutcome[]>;
138
- private runScene;
139
- private runVisual;
140
- }
141
- //# sourceMappingURL=executor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