vidspotai-shared 1.0.133 → 1.0.135

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 (43) hide show
  1. package/lib/globals/aiModels/providers/falVideo.d.ts +34 -0
  2. package/lib/globals/aiModels/providers/falVideo.d.ts.map +1 -0
  3. package/lib/globals/aiModels/providers/falVideo.js +102 -0
  4. package/lib/globals/index.d.ts +1 -0
  5. package/lib/globals/index.d.ts.map +1 -1
  6. package/lib/globals/index.js +1 -0
  7. package/lib/globals/musicStudio.d.ts +90 -0
  8. package/lib/globals/musicStudio.d.ts.map +1 -0
  9. package/lib/globals/musicStudio.js +221 -0
  10. package/lib/globals/types.d.ts +10 -1
  11. package/lib/globals/types.d.ts.map +1 -1
  12. package/lib/globals/types.js +12 -0
  13. package/lib/models/index.d.ts +1 -0
  14. package/lib/models/index.d.ts.map +1 -1
  15. package/lib/models/index.js +1 -0
  16. package/lib/models/musicJob.model.d.ts +73 -0
  17. package/lib/models/musicJob.model.d.ts.map +1 -0
  18. package/lib/models/musicJob.model.js +2 -0
  19. package/lib/services/aiGen/providers/fal/falMusic.service.d.ts +63 -0
  20. package/lib/services/aiGen/providers/fal/falMusic.service.d.ts.map +1 -0
  21. package/lib/services/aiGen/providers/fal/falMusic.service.js +310 -0
  22. package/lib/services/aiGen/providers/fal/falVideo.service.d.ts +39 -0
  23. package/lib/services/aiGen/providers/fal/falVideo.service.d.ts.map +1 -0
  24. package/lib/services/aiGen/providers/fal/falVideo.service.js +266 -0
  25. package/lib/services/aiGen/providers/fal/index.d.ts +1 -0
  26. package/lib/services/aiGen/providers/fal/index.d.ts.map +1 -1
  27. package/lib/services/aiGen/providers/fal/index.js +1 -0
  28. package/lib/services/firestore.service.d.ts +2 -0
  29. package/lib/services/firestore.service.d.ts.map +1 -1
  30. package/lib/services/firestore.service.js +3 -0
  31. package/lib/services/index.d.ts +1 -0
  32. package/lib/services/index.d.ts.map +1 -1
  33. package/lib/services/index.js +1 -0
  34. package/lib/services/music/index.d.ts +3 -0
  35. package/lib/services/music/index.d.ts.map +1 -0
  36. package/lib/services/music/index.js +18 -0
  37. package/lib/services/music/musicLyricWriter.d.ts +25 -0
  38. package/lib/services/music/musicLyricWriter.d.ts.map +1 -0
  39. package/lib/services/music/musicLyricWriter.js +58 -0
  40. package/lib/services/music/musicLyrics.d.ts +66 -0
  41. package/lib/services/music/musicLyrics.d.ts.map +1 -0
  42. package/lib/services/music/musicLyrics.js +258 -0
  43. package/package.json +1 -1
@@ -0,0 +1,266 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FalVideoService = void 0;
4
+ exports.resolveFalKlingResolution = resolveFalKlingResolution;
5
+ const aiModels_1 = require("../../../../globals/aiModels");
6
+ const types_1 = require("../../../../globals/types");
7
+ const storage_1 = require("../../../../libs/storage");
8
+ const errors_1 = require("../../../../utils/errors");
9
+ const helpers_1 = require("../../../../utils/helpers");
10
+ const logger_1 = require("../../../../utils/logger");
11
+ const transientRetry_1 = require("../../transientRetry");
12
+ const types_2 = require("../../types");
13
+ const baseAiGenProvider_service_1 = require("../baseAiGenProvider.service");
14
+ const falUpscale_service_1 = require("./falUpscale.service");
15
+ const QUEUE_BASE_URL = "https://queue.fal.run";
16
+ /** Separator between the queue app path and the request id in the stored task. */
17
+ const TASK_SEP = "|";
18
+ /** fal v4 multi_prompt per-shot cap (KlingV4Shot.prompt maxLength). */
19
+ const SHOT_PROMPT_MAX = 512;
20
+ /** fal v4 `prompt` maxLength. */
21
+ const PROMPT_MAX = 26000;
22
+ const FLASH_KEYS = new Set([aiModels_1.EVideoGenModels.FAL_KLING_V4_0_FLASH]);
23
+ /**
24
+ * Output resolution actually sent to fal. An explicit, allowed `resolution`
25
+ * wins; otherwise mode maps std→720p, pro→1080p (Kling's own equivalence).
26
+ * Flash is 720p-only. Exported so billing prices the SAME resolution the
27
+ * request carried — fal's default is 1080p, so never leave it implicit.
28
+ */
29
+ function resolveFalKlingResolution(modelKey, resolution, mode) {
30
+ if (FLASH_KEYS.has(modelKey))
31
+ return "720p";
32
+ const r = resolution?.toLowerCase();
33
+ if (r === "720p" || r === "1080p")
34
+ return r;
35
+ return mode === types_2.EVideoMode.PROFESSIONAL ? "1080p" : "720p";
36
+ }
37
+ /**
38
+ * Canonical shots → fal `multi_prompt[]`. Missing per-shot durations split
39
+ * the requested total evenly (integers, ≥1s each); the clip length fal
40
+ * renders is the sum of the shot durations.
41
+ */
42
+ function toFalShots(shots, totalDuration) {
43
+ const missing = shots.filter((s) => !s.duration).length;
44
+ const declared = shots.reduce((sum, s) => sum + (s.duration ?? 0), 0);
45
+ const fill = missing > 0 ? Math.max(1, Math.floor((totalDuration - declared) / missing)) : 0;
46
+ return shots.map((s, i) => {
47
+ if (s.prompt.length > SHOT_PROMPT_MAX) {
48
+ throw new errors_1.UserFacingError(`Shot ${i + 1} prompt is ${s.prompt.length} characters; Kling 4.0 allows ${SHOT_PROMPT_MAX} per shot.`, errors_1.USER_FACING_ERROR_CODES.PROMPT_TOO_LONG);
49
+ }
50
+ return { prompt: s.prompt, duration: Math.max(1, Math.round(s.duration ?? fill)) };
51
+ });
52
+ }
53
+ /**
54
+ * Generic fal.ai video-generation provider. Today it serves Kling 4.0 and
55
+ * Kling 4.0 Flash (configs in globals/aiModels/providers/falVideo.ts), routing
56
+ * each request to the matching fal sub-endpoint:
57
+ * reference images/videos → v4/reference-to-video (not on Flash)
58
+ * a start frame → v4[/flash]/image-to-video
59
+ * otherwise → v4[/flash]/text-to-video
60
+ *
61
+ * The stored task is `<queue app path>|<request_id>`: fal's queue
62
+ * status/result URLs depend on the app path, which differs per sub-endpoint,
63
+ * so the poller needs it back. The path is taken from the submit response's
64
+ * `status_url` when present (fal's own canonical form), else the endpoint id.
65
+ */
66
+ class FalVideoService extends baseAiGenProvider_service_1.BaseAiGenProviderService {
67
+ constructor() {
68
+ super();
69
+ if (!process.env.FAL_KEY) {
70
+ throw new Error("Missing FAL_KEY in environment variables");
71
+ }
72
+ this.apiKey = process.env.FAL_KEY;
73
+ }
74
+ headers(json) {
75
+ const h = { Authorization: `Key ${this.apiKey}` };
76
+ if (json)
77
+ h["Content-Type"] = "application/json";
78
+ return h;
79
+ }
80
+ buildRequest(params) {
81
+ const modelKey = params.modelKey;
82
+ const config = aiModels_1.aiModelConfigs[modelKey];
83
+ if (!config?.modelId) {
84
+ throw new Error(`FalVideoService: no fal model config for "${modelKey}"`);
85
+ }
86
+ const isFlash = FLASH_KEYS.has(modelKey);
87
+ const refImages = params.referenceImageUrls?.filter(Boolean) ?? [];
88
+ const refVideos = params.referenceVideoUrls?.filter(Boolean) ?? [];
89
+ let endpoint;
90
+ if (refImages.length > 0 || refVideos.length > 0) {
91
+ if (isFlash) {
92
+ throw new errors_1.UserFacingError("Kling 4.0 Flash doesn't take reference images or videos — use Kling 4.0 for Omni reference.", errors_1.USER_FACING_ERROR_CODES.CAPABILITY_MISMATCH);
93
+ }
94
+ endpoint = "reference-to-video";
95
+ }
96
+ else if (params.inputImageUrl) {
97
+ endpoint = "image-to-video";
98
+ }
99
+ else {
100
+ endpoint = "text-to-video";
101
+ }
102
+ const duration = Math.round(params.duration ?? 5);
103
+ const body = {
104
+ resolution: resolveFalKlingResolution(modelKey, params.resolution, params.mode),
105
+ };
106
+ if (params.multiShot && params.multiShot.length > 0 && !isFlash) {
107
+ body.multi_prompt = toFalShots(params.multiShot, duration);
108
+ }
109
+ else {
110
+ const prompt = params.prompt ?? "";
111
+ if (prompt.length > PROMPT_MAX) {
112
+ throw new errors_1.UserFacingError(`Prompt is ${prompt.length} characters; Kling 4.0 allows ${PROMPT_MAX}.`, errors_1.USER_FACING_ERROR_CODES.PROMPT_TOO_LONG);
113
+ }
114
+ body.prompt = prompt;
115
+ body.duration = duration;
116
+ }
117
+ if (endpoint === "text-to-video") {
118
+ if (params.aspectRatio)
119
+ body.aspect_ratio = params.aspectRatio;
120
+ }
121
+ else if (endpoint === "image-to-video") {
122
+ // Output ratio follows the start frame — fal's i2v takes no aspect_ratio.
123
+ body.start_image_url = params.inputImageUrl;
124
+ if (params.lastFrameImageUrl && !isFlash)
125
+ body.end_image_url = params.lastFrameImageUrl;
126
+ }
127
+ else {
128
+ if (refImages.length > 0)
129
+ body.image_urls = refImages.slice(0, 10);
130
+ if (refVideos.length > 0)
131
+ body.video_urls = refVideos.slice(0, 5);
132
+ if (params.inputImageUrl)
133
+ body.start_image_url = params.inputImageUrl;
134
+ if (params.lastFrameImageUrl)
135
+ body.end_image_url = params.lastFrameImageUrl;
136
+ body.aspect_ratio = params.aspectRatio ?? "auto";
137
+ }
138
+ return { endpointId: `${config.modelId}/${endpoint}`, body };
139
+ }
140
+ async generateVideo(params) {
141
+ const { endpointId, body } = this.buildRequest(params);
142
+ return (0, transientRetry_1.withTransientRetry)("fal:generateVideo", async () => {
143
+ const resp = await fetch(`${QUEUE_BASE_URL}/${endpointId}`, {
144
+ method: "POST",
145
+ headers: this.headers(true),
146
+ body: JSON.stringify(body),
147
+ });
148
+ if (!resp.ok) {
149
+ throw (0, falUpscale_service_1.classifyFalHttpError)(resp.status, await resp.text(), "generateVideo");
150
+ }
151
+ const data = (await resp.json());
152
+ if (!data.request_id) {
153
+ throw new Error(`fal ${endpointId} did not return a request_id`);
154
+ }
155
+ const appPath = appPathFromStatusUrl(data.status_url) ?? endpointId;
156
+ logger_1.logger.info("fal video submitted", {
157
+ modelKey: params.modelKey,
158
+ endpointId,
159
+ appPath,
160
+ requestId: data.request_id,
161
+ });
162
+ return {
163
+ status: types_1.EVideoSceneStatus.TRIGGERED,
164
+ task: `${appPath}${TASK_SEP}${data.request_id}`,
165
+ };
166
+ }, {
167
+ onRetry: ({ attempt, maxAttempts, backoffMs, err }) => logger_1.logger.warn("fal generateVideo transient error — retrying", {
168
+ attempt,
169
+ maxAttempts,
170
+ backoffMs,
171
+ message: err.message,
172
+ }),
173
+ });
174
+ }
175
+ async checkVideoStatus({ task, outputFilename, outputFilePath = "videos", }) {
176
+ const sep = task.lastIndexOf(TASK_SEP);
177
+ if (sep <= 0) {
178
+ return { status: types_1.EVideoSceneStatus.FAILED, errorMessage: `Malformed fal video task "${task}"` };
179
+ }
180
+ const appPath = task.slice(0, sep);
181
+ const requestId = task.slice(sep + 1);
182
+ const statusResp = await fetch(`${QUEUE_BASE_URL}/${appPath}/requests/${requestId}/status`, {
183
+ headers: this.headers(false),
184
+ });
185
+ if (!statusResp.ok) {
186
+ throw (0, falUpscale_service_1.classifyFalHttpError)(statusResp.status, await statusResp.text(), "checkVideoStatus");
187
+ }
188
+ const statusData = (await statusResp.json());
189
+ const normalized = (statusData.status ?? "").toUpperCase();
190
+ // fal reports a failed job as COMPLETED + `error` — no separate FAILED state.
191
+ if (normalized === "COMPLETED" && statusData.error) {
192
+ return { status: types_1.EVideoSceneStatus.FAILED, errorMessage: statusData.error };
193
+ }
194
+ if (normalized !== "COMPLETED") {
195
+ return { status: types_1.EVideoSceneStatus.PENDING };
196
+ }
197
+ const resultResp = await fetch(`${QUEUE_BASE_URL}/${appPath}/requests/${requestId}`, {
198
+ headers: this.headers(false),
199
+ });
200
+ if (!resultResp.ok) {
201
+ const text = await resultResp.text();
202
+ // A 4xx on the result (e.g. 422 validation / content checker) is the
203
+ // job's terminal failure, not a transport problem — fail the scene.
204
+ if (resultResp.status >= 400 && resultResp.status < 500 && ![401, 403, 429].includes(resultResp.status)) {
205
+ return { status: types_1.EVideoSceneStatus.FAILED, errorMessage: `fal video failed (${resultResp.status}): ${text.slice(0, 500)}` };
206
+ }
207
+ throw (0, falUpscale_service_1.classifyFalHttpError)(resultResp.status, text, "checkVideoStatus:result");
208
+ }
209
+ const result = (await resultResp.json());
210
+ if (!result.video?.url) {
211
+ const detail = typeof result.detail === "string" ? result.detail : JSON.stringify(result.detail ?? "");
212
+ return { status: types_1.EVideoSceneStatus.FAILED, errorMessage: result.error ?? (detail || "fal video returned no output") };
213
+ }
214
+ const assetResp = await fetch(result.video.url);
215
+ if (!assetResp.ok) {
216
+ // Throw (not FAILED) so the outer poller retries — the video exists.
217
+ throw new Error(`Failed to download fal video: ${assetResp.status}`);
218
+ }
219
+ const buffer = Buffer.from(await assetResp.arrayBuffer());
220
+ // mediaStorage: GCS write + best-effort R2 mirror (zero-egress delivery).
221
+ const signedUrl = await storage_1.mediaStorage.put(`${outputFilePath}/${outputFilename}.mp4`, buffer, "video/mp4");
222
+ return { status: types_1.EVideoSceneStatus.COMPLETED, videoUrl: signedUrl };
223
+ }
224
+ /**
225
+ * Per second at the resolution the request sends. With a reference video
226
+ * fal/Kling bill a lower rate on (output × 2) when the input is no longer
227
+ * than the output, else (input + output) seconds. An unknown input length
228
+ * falls back to output × 2 (the input ≤ output case).
229
+ */
230
+ getCreditUsed({ modelKey, mode, resolution, duration = 5, multiClip = false, inputType, hasInputVideo, inputVideoDurationSec, creditFloor, }) {
231
+ const cost = aiModels_1.aiModelConfigs[modelKey]?.cost;
232
+ const res = resolveFalKlingResolution(modelKey, resolution, mode);
233
+ const applyFloor = !multiClip;
234
+ if (inputType === "video" || hasInputVideo) {
235
+ const rate = cost?.videoInputPerSecondByResolution?.[res];
236
+ if (rate !== undefined) {
237
+ const inputSec = inputVideoDurationSec ?? duration;
238
+ const billedSec = inputSec <= duration ? duration * 2 : inputSec + duration;
239
+ return (0, helpers_1.getCreditsFromCost)(rate * billedSec, applyFloor, creditFloor);
240
+ }
241
+ }
242
+ const perSecond = cost?.perSecondByResolution?.[res];
243
+ if (perSecond === undefined) {
244
+ logger_1.logger.warn(`fal video getCreditUsed: no cost for modelKey="${modelKey}" res="${res}" — returning fallback`, {
245
+ modelKey,
246
+ res,
247
+ });
248
+ return (0, helpers_1.getCreditsFromCost)(0.2355 * duration, applyFloor, creditFloor);
249
+ }
250
+ return (0, helpers_1.getCreditsFromCost)(perSecond * duration, applyFloor, creditFloor);
251
+ }
252
+ }
253
+ exports.FalVideoService = FalVideoService;
254
+ /** "https://queue.fal.run/fal-ai/kling-video/requests/<id>/status" → "fal-ai/kling-video". */
255
+ function appPathFromStatusUrl(statusUrl) {
256
+ if (!statusUrl)
257
+ return undefined;
258
+ try {
259
+ const path = new URL(statusUrl).pathname.replace(/^\/+/, "");
260
+ const idx = path.indexOf("/requests/");
261
+ return idx > 0 ? path.slice(0, idx) : undefined;
262
+ }
263
+ catch {
264
+ return undefined;
265
+ }
266
+ }
@@ -2,4 +2,5 @@ export * from "./falImage.service";
2
2
  export * from "./falUpscale.service";
3
3
  export * from "./falImageTools.service";
4
4
  export * from "./falVideoMatting.service";
5
+ export * from "./falMusic.service";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/fal/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/fal/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC"}
@@ -18,3 +18,4 @@ __exportStar(require("./falImage.service"), exports);
18
18
  __exportStar(require("./falUpscale.service"), exports);
19
19
  __exportStar(require("./falImageTools.service"), exports);
20
20
  __exportStar(require("./falVideoMatting.service"), exports);
21
+ __exportStar(require("./falMusic.service"), exports);
@@ -9,6 +9,7 @@ import { IAssetPoolModel } from "../models/assetPool.model";
9
9
  import { IImageJobModel } from "../models/image.model";
10
10
  import { IUpscaleJobModel } from "../models/upscale.model";
11
11
  import { IVideoToolJobModel } from "../models/videoTool.model";
12
+ import { IMusicJobModel } from "../models/musicJob.model";
12
13
  import { IPosterExportJobModel } from "../models/posterExport.model";
13
14
  import { INotificationModel } from "../models/notification.model";
14
15
  import { IRefModel } from "../models/ref.model";
@@ -36,6 +37,7 @@ export declare class FirestoreService {
36
37
  static imageJobsCol: CollectionReference<IImageJobModel, DocumentData>;
37
38
  static upscaleJobsCol: CollectionReference<IUpscaleJobModel, DocumentData>;
38
39
  static videoToolJobsCol: CollectionReference<IVideoToolJobModel, DocumentData>;
40
+ static musicJobsCol: CollectionReference<IMusicJobModel, DocumentData>;
39
41
  static communitySeedCol: CollectionReference<ICommunitySeedModel, DocumentData>;
40
42
  static assetPoolCol: CollectionReference<IAssetPoolModel, DocumentData>;
41
43
  static notificationsCol: CollectionReference<INotificationModel, DocumentData>;
@@ -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,EACjB,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CA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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"}
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,EACjB,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACL,kBAAkB,EAClB,cA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AAsB;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"}
@@ -134,6 +134,9 @@ FirestoreService.upscaleJobsCol = firebase_1.firestore
134
134
  FirestoreService.videoToolJobsCol = firebase_1.firestore
135
135
  .collection("videoToolJobs")
136
136
  .withConverter(collectionConverter());
137
+ FirestoreService.musicJobsCol = firebase_1.firestore
138
+ .collection("musicJobs")
139
+ .withConverter(collectionConverter());
137
140
  FirestoreService.communitySeedCol = firebase_1.firestore
138
141
  .collection("communitySeed")
139
142
  .withConverter(collectionConverter());
@@ -16,6 +16,7 @@ export * from "./tts";
16
16
  export * from "./translation";
17
17
  export * from "./moderation";
18
18
  export * from "./musicGen";
19
+ export * from "./music";
19
20
  export * from "./audioAnalysis";
20
21
  export * from "./asr";
21
22
  export * from "./agent";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qCAAqC,CAAC;AACpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;A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qB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,6CAA6C,CAAC"}
@@ -32,6 +32,7 @@ __exportStar(require("./tts"), exports);
32
32
  __exportStar(require("./translation"), exports);
33
33
  __exportStar(require("./moderation"), exports);
34
34
  __exportStar(require("./musicGen"), exports);
35
+ __exportStar(require("./music"), exports);
35
36
  __exportStar(require("./audioAnalysis"), exports);
36
37
  __exportStar(require("./asr"), exports);
37
38
  __exportStar(require("./agent"), exports);
@@ -0,0 +1,3 @@
1
+ export * from "./musicLyrics";
2
+ export * from "./musicLyricWriter";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/music/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./musicLyrics"), exports);
18
+ __exportStar(require("./musicLyricWriter"), exports);
@@ -0,0 +1,25 @@
1
+ import type { MusicVocalStyle } from "../../models/musicJob.model";
2
+ /**
3
+ * LLM songwriter for the Music Studio: the "Write lyrics" button, and the
4
+ * worker when the chosen model can only sing written lyrics. Returns
5
+ * `[Section]`-tagged lyrics (the shape every music model reads) plus a title.
6
+ */
7
+ export interface LyricWriterInput {
8
+ /** What the song is about — the user's description. */
9
+ idea: string;
10
+ genres?: string[];
11
+ moods?: string[];
12
+ vocalStyle?: MusicVocalStyle;
13
+ /** Language name to write in (e.g. "Spanish"). Defaults to English. */
14
+ language?: string;
15
+ /** Rough target length, used to size the structure. */
16
+ durationSec?: number;
17
+ /** Existing lyrics to revise instead of writing from scratch. */
18
+ draft?: string;
19
+ }
20
+ export interface LyricWriterResult {
21
+ title: string;
22
+ lyrics: string;
23
+ }
24
+ export declare function writeSongLyrics(input: LyricWriterInput): Promise<LyricWriterResult>;
25
+ //# sourceMappingURL=musicLyricWriter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"musicLyricWriter.d.ts","sourceRoot":"","sources":["../../../src/services/music/musicLyricWriter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE;;;;GAIG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAgBD,wBAAsB,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA0CzF"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.writeSongLyrics = writeSongLyrics;
4
+ const zod_1 = require("zod");
5
+ const aiModels_1 = require("../../globals/aiModels");
6
+ const musicStudio_1 = require("../../globals/musicStudio");
7
+ const textFallback_1 = require("../aiGen/textFallback");
8
+ const LyricWriterSchema = zod_1.z.object({
9
+ title: zod_1.z.string().min(1).max(80),
10
+ lyrics: zod_1.z.string().min(1),
11
+ });
12
+ /** Section plan sized to the length: short clips get a verse + chorus, full songs the classic arc. */
13
+ function structureFor(durationSec) {
14
+ const sec = durationSec ?? 150;
15
+ if (sec <= 40)
16
+ return "[Verse] (4 lines), [Chorus] (4 lines)";
17
+ if (sec <= 100)
18
+ return "[Verse] (4 lines), [Chorus] (4 lines), [Verse] (4 lines), [Chorus] (4 lines)";
19
+ if (sec <= 200)
20
+ return "[Intro], [Verse] (4–6 lines), [Pre-Chorus] (2 lines), [Chorus] (4 lines), [Verse] (4–6 lines), [Chorus] (4 lines), [Bridge] (2–4 lines), [Chorus] (4 lines), [Outro]";
21
+ return "[Intro], [Verse], [Pre-Chorus], [Chorus], [Verse], [Pre-Chorus], [Chorus], [Bridge], [Verse], [Chorus], [Chorus], [Outro] — 4–6 lines per sung section";
22
+ }
23
+ async function writeSongLyrics(input) {
24
+ const language = input.language?.trim() || "English";
25
+ const style = [input.genres?.join(", "), input.moods?.join(", "), input.vocalStyle ? `${input.vocalStyle} vocals` : ""]
26
+ .filter(Boolean)
27
+ .join("; ");
28
+ const system = [
29
+ "You are a professional songwriter. Write original, singable song lyrics.",
30
+ `Write every lyric line in ${language} (section tags stay in English).`,
31
+ "Tag sections on their own line in square brackets: [Intro], [Verse], [Pre-Chorus], [Chorus], [Bridge], [Outro]. Instrumental sections ([Intro], [Outro], [Instrumental]) have no lines under them.",
32
+ "Keep lines short (under 12 words) with natural rhythm and rhyme; the chorus is memorable and repeats exactly.",
33
+ "Never quote or imitate existing copyrighted lyrics, and never name real artists.",
34
+ `Stay under ${musicStudio_1.MUSIC_LIMITS.maxLyricsChars - 300} characters in total.`,
35
+ 'Respond with JSON: {"title": string, "lyrics": string} — lyrics uses \\n line breaks.',
36
+ ].join("\n");
37
+ const user = [
38
+ `Song idea: ${input.idea.trim() || "an uplifting song about chasing a dream"}`,
39
+ style ? `Style: ${style}` : "",
40
+ `Structure: ${structureFor(input.durationSec)}`,
41
+ input.draft ? `Revise and complete these draft lyrics, keeping their best lines:\n${input.draft.slice(0, musicStudio_1.MUSIC_LIMITS.maxLyricsChars)}` : "",
42
+ ]
43
+ .filter(Boolean)
44
+ .join("\n");
45
+ const { text } = await (0, textFallback_1.generateTextWithFallback)({
46
+ input: [
47
+ { role: "system", content: system },
48
+ { role: "user", content: user },
49
+ ],
50
+ modelKey: aiModels_1.ETextGenModels.OPENAI_GPT_4O_MINI,
51
+ options: { responseFormat: { type: "json_object" } },
52
+ }, "music-lyric-writer");
53
+ const parsed = LyricWriterSchema.parse(JSON.parse(text));
54
+ return {
55
+ title: parsed.title.replace(/^["']|["']$/g, "").trim(),
56
+ lyrics: parsed.lyrics.replace(/\r\n/g, "\n").trim().slice(0, musicStudio_1.MUSIC_LIMITS.maxLyricsChars),
57
+ };
58
+ }
@@ -0,0 +1,66 @@
1
+ import type { MusicTimedLine, MusicVocalStyle } from "../../models/musicJob.model";
2
+ /**
3
+ * Pure lyric / prompt helpers for the Music Studio worker. No I/O, so the
4
+ * provider-shape rules live somewhere testable.
5
+ */
6
+ export interface LyricSection {
7
+ /** Tag name without brackets, e.g. "Verse", "Chorus". "Verse" when the lyrics had none. */
8
+ name: string;
9
+ lines: string[];
10
+ }
11
+ /** Splits `[Verse]` / `[Chorus]`-tagged lyrics into sections. Untagged text is one Verse. */
12
+ export declare function parseLyricSections(lyrics: string): LyricSection[];
13
+ /** The sung lines only — section tags and blank lines dropped. */
14
+ export declare function lyricLines(lyrics: string): string[];
15
+ /**
16
+ * DiffRhythm wants LRC: every line stamped `[mm:ss.xx]`, at least two
17
+ * sections. Lines are paced evenly across the track with a breath between
18
+ * sections, starting after a short intro.
19
+ */
20
+ export declare function toLrc(lyrics: string, durationSec: number): string;
21
+ export interface ElevenLabsSection {
22
+ section_name: string;
23
+ duration_ms: number;
24
+ positive_local_styles: string[];
25
+ negative_local_styles: string[];
26
+ lines: string[];
27
+ }
28
+ /**
29
+ * ElevenLabs composition plan sections from tagged lyrics. Each section gets a
30
+ * share of `totalSec` proportional to its line count (instrumental tags get a
31
+ * fixed share), clamped to the provider's 3–120 s per section; lines are capped
32
+ * at 200 characters. Long untagged lyrics are chunked into 4-line sections so
33
+ * no section has to exceed 120 s.
34
+ */
35
+ export declare function toElevenLabsSections(lyrics: string, totalSec: number): ElevenLabsSection[];
36
+ export interface LyricWord {
37
+ text: string;
38
+ start: number;
39
+ end: number;
40
+ }
41
+ /**
42
+ * Times lyric lines against a word-level transcript of the track. With known
43
+ * lyrics, each line's words are matched in order against the transcript
44
+ * (fuzzy, with a lookahead so ad-libs and misheard words don't derail it);
45
+ * lines that matched nothing are interpolated between their neighbours.
46
+ * Without lyrics the transcript itself is split into lines at pauses.
47
+ */
48
+ export declare function alignLyrics(words: LyricWord[], lyrics: string | undefined, trackSec: number): MusicTimedLine[];
49
+ export interface StylePromptInput {
50
+ prompt: string;
51
+ genres?: string[];
52
+ moods?: string[];
53
+ bpm?: number;
54
+ instrumental: boolean;
55
+ vocalStyle?: MusicVocalStyle;
56
+ language?: string;
57
+ }
58
+ /**
59
+ * One natural-language style brief from the studio's controls. Every model
60
+ * reads genre / mood / tempo / vocal direction from text, so the controls
61
+ * become a leading descriptor line followed by the user's own description.
62
+ */
63
+ export declare function composeStylePrompt(input: StylePromptInput, maxChars: number): string;
64
+ /** Comma-separated tag string for ACE-Step (`tags`). */
65
+ export declare function composeStyleTags(input: StylePromptInput): string;
66
+ //# sourceMappingURL=musicLyrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"musicLyrics.d.ts","sourceRoot":"","sources":["../../../src/services/music/musicLyrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnF;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,2FAA2F;IAC3F,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAID,6FAA6F;AAC7F,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,EAAE,CAmBjE;AAED,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EA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