Files
suno-mcp-server/suno-server/dist/schemas.js
T

214 lines
11 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetCreditsSchema = exports.GetVideoDetailsSchema = exports.GetVocalSeparationDetailsSchema = exports.GetWavDetailsSchema = exports.GetLyricsDetailsSchema = exports.GetTimestampedLyricsSchema = exports.GetTaskStatusSchema = exports.GenerateMashupSchema = exports.GeneratePersonaSchema = exports.BoostStyleSchema = exports.ConvertToWavSchema = exports.CreateCoverSchema = exports.CreateVideoSchema = exports.SeparateStemsSchema = exports.SeparateVocalsSchema = exports.UploadAndExtendSchema = exports.UploadAndCoverSchema = exports.AddInstrumentalSchema = exports.AddVocalsSchema = exports.ReplaceSectionSchema = exports.ExtendMusicSchema = exports.GenerateSoundsSchema = exports.GenerateLyricsSchema = exports.GenerateMusicSchema = void 0;
const zod_1 = require("zod");
const MODELS = ['V4', 'V4_5', 'V4_5PLUS', 'V4_5ALL', 'V5', 'V5_5'];
const SOUND_MODELS = ['V5'];
const ModelEnum = zod_1.z.enum(MODELS).describe('Model version (V4, V4_5, V4_5PLUS, V4_5ALL, V5, V5_5)');
const SoundModelEnum = zod_1.z.enum(SOUND_MODELS).describe('Sounds model (V5 only)');
const PersonaModelEnum = zod_1.z.enum(['style_persona', 'voice_persona']).optional();
const CallbackUrl = zod_1.z.string().optional().describe('Optional webhook URL for async completion');
const CommonGenerateParams = {
model: ModelEnum,
negativeTags: zod_1.z.string().optional().describe('Styles to exclude'),
vocalGender: zod_1.z.enum(['m', 'f']).optional().describe('Preferred vocal gender'),
styleWeight: zod_1.z.number().min(0).max(1).optional().describe('Style weight 0.00-1.00'),
weirdnessConstraint: zod_1.z.number().min(0).max(1).optional().describe('Weirdness constraint 0.00-1.00'),
audioWeight: zod_1.z.number().min(0).max(1).optional().describe('Audio influence weight 0.00-1.00'),
personaId: zod_1.z.string().optional().describe('Persona or voice ID'),
personaModel: PersonaModelEnum.describe('Use style_persona or voice_persona'),
callBackUrl: CallbackUrl,
};
// 1. Generate Music (12 credits)
exports.GenerateMusicSchema = zod_1.z.object({
prompt: zod_1.z.string().optional().describe('Music description / lyrics (max 500 chars non-custom, 3000-5000 custom mode; required when customMode=false or customMode=true with instrumental=false)'),
customMode: zod_1.z.boolean().describe('Enable custom mode (requires style and title)'),
instrumental: zod_1.z.boolean().describe('Generate instrumental without vocals'),
style: zod_1.z.string().optional().describe('Music style/genre (required when customMode=true)'),
title: zod_1.z.string().optional().describe('Song title (required when customMode=true)'),
...CommonGenerateParams,
}).strict();
// 2. Generate Lyrics (0.4 credits)
exports.GenerateLyricsSchema = zod_1.z.object({
prompt: zod_1.z.string().describe('Topic or theme for lyrics'),
callBackUrl: CallbackUrl,
}).strict();
// 3. Generate Sounds (2.5 credits)
exports.GenerateSoundsSchema = zod_1.z.object({
prompt: zod_1.z.string().max(500).describe('Sound description (max 500 chars)'),
model: SoundModelEnum,
soundLoop: zod_1.z.boolean().optional().describe('Enable loop playback'),
soundTempo: zod_1.z.number().int().min(1).max(300).optional().describe('BPM'),
soundKey: zod_1.z.enum([
'Any', 'Cm', 'C#m', 'Dm', 'D#m', 'Em', 'Fm', 'F#m', 'Gm', 'G#m', 'Am', 'A#m', 'Bm',
'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B'
]).optional().describe('Pitch key'),
grabLyrics: zod_1.z.boolean().optional().describe('Fetch lyric subtitles'),
callBackUrl: CallbackUrl,
}).strict();
// 4. Extend Music (12 credits)
exports.ExtendMusicSchema = zod_1.z.object({
audioId: zod_1.z.string().describe('ID of the source track to extend'),
defaultParamFlag: zod_1.z.boolean().describe('Use custom params (true) or source params (false)'),
prompt: zod_1.z.string().optional().describe('Extension description (required with custom params)'),
style: zod_1.z.string().optional().describe('Style (required with custom params)'),
title: zod_1.z.string().optional().describe('Title (required with custom params)'),
continueAt: zod_1.z.number().positive().optional().describe('Start time in seconds (required with custom params)'),
model: ModelEnum,
negativeTags: zod_1.z.string().optional(),
vocalGender: zod_1.z.enum(['m', 'f']).optional(),
styleWeight: zod_1.z.number().min(0).max(1).optional(),
weirdnessConstraint: zod_1.z.number().min(0).max(1).optional(),
audioWeight: zod_1.z.number().min(0).max(1).optional(),
personaId: zod_1.z.string().optional(),
personaModel: PersonaModelEnum,
callBackUrl: CallbackUrl,
}).strict();
// 5. Replace Section (5 credits)
exports.ReplaceSectionSchema = zod_1.z.object({
audioId: zod_1.z.string().describe('ID of track to modify (or taskId if replacing within own generated track)'),
prompt: zod_1.z.string().describe('Description for replacement section'),
replaceAudioUrl: zod_1.z.string().optional().describe('Custom uploaded audio URL for replacement'),
start: zod_1.z.number().nonnegative().describe('Start time in seconds'),
end: zod_1.z.number().positive().describe('End time in seconds'),
customMode: zod_1.z.boolean().optional().describe('Enable custom mode'),
style: zod_1.z.string().optional().describe('Style (custom mode)'),
title: zod_1.z.string().optional().describe('Title (custom mode)'),
instrumental: zod_1.z.boolean().optional().describe('Instrumental (custom mode)'),
model: ModelEnum,
callBackUrl: CallbackUrl,
}).strict();
// 6. Add Vocals (12 credits)
exports.AddVocalsSchema = zod_1.z.object({
audioId: zod_1.z.string().describe('Instrumental track ID'),
prompt: zod_1.z.string().optional().describe('Vocal/lyrics concept'),
customMode: zod_1.z.boolean().optional(),
style: zod_1.z.string().optional(),
title: zod_1.z.string().optional(),
model: ModelEnum,
callBackUrl: CallbackUrl,
}).strict();
// 7. Add Instrumental (12 credits)
exports.AddInstrumentalSchema = zod_1.z.object({
audioId: zod_1.z.string().describe('Vocal or melody track ID'),
prompt: zod_1.z.string().optional().describe('Desired backing arrangement'),
customMode: zod_1.z.boolean().optional(),
style: zod_1.z.string().optional(),
title: zod_1.z.string().optional(),
model: ModelEnum,
callBackUrl: CallbackUrl,
}).strict();
// 8. Upload and Cover (12 credits)
exports.UploadAndCoverSchema = zod_1.z.object({
uploadUrl: zod_1.z.string().url().describe('Public URL of audio file to cover (max 8 minutes)'),
prompt: zod_1.z.string().optional(),
customMode: zod_1.z.boolean(),
instrumental: zod_1.z.boolean(),
style: zod_1.z.string().optional(),
title: zod_1.z.string().optional(),
model: ModelEnum,
negativeTags: zod_1.z.string().optional(),
vocalGender: zod_1.z.enum(['m', 'f']).optional(),
styleWeight: zod_1.z.number().min(0).max(1).optional(),
weirdnessConstraint: zod_1.z.number().min(0).max(1).optional(),
audioWeight: zod_1.z.number().min(0).max(1).optional(),
personaId: zod_1.z.string().optional(),
personaModel: PersonaModelEnum,
callBackUrl: CallbackUrl,
}).strict();
// 9. Upload and Extend (12 credits)
exports.UploadAndExtendSchema = zod_1.z.object({
uploadUrl: zod_1.z.string().url().describe('Public URL of audio file to extend'),
defaultParamFlag: zod_1.z.boolean(),
prompt: zod_1.z.string().optional(),
style: zod_1.z.string().optional(),
title: zod_1.z.string().optional(),
continueAt: zod_1.z.number().positive().optional(),
model: ModelEnum,
callBackUrl: CallbackUrl,
}).strict();
// 10. Separate Vocals (10 credits)
exports.SeparateVocalsSchema = zod_1.z.object({
taskId: zod_1.z.string().describe('Original generation task ID'),
audioId: zod_1.z.string().describe('Track ID to separate'),
callBackUrl: CallbackUrl,
}).strict();
// 11. Separate Stems / Advanced (20 credits)
exports.SeparateStemsSchema = zod_1.z.object({
taskId: zod_1.z.string().describe('Original generation task ID'),
audioId: zod_1.z.string().describe('Track ID to separate into stems'),
callBackUrl: CallbackUrl,
}).strict();
// 12. Create Music Video (2 credits)
exports.CreateVideoSchema = zod_1.z.object({
taskId: zod_1.z.string().describe('Music generation task ID'),
audioId: zod_1.z.string().describe('Track ID for the video'),
author: zod_1.z.string().optional().describe('Artist name'),
domainName: zod_1.z.string().optional().describe('Brand domain'),
callBackUrl: CallbackUrl,
}).strict();
// 13. Create Music Cover (0 credits)
exports.CreateCoverSchema = zod_1.z.object({
taskId: zod_1.z.string().describe('Music generation task ID'),
audioId: zod_1.z.string().describe('Track ID for cover image'),
callBackUrl: CallbackUrl,
}).strict();
// 14. Convert to WAV (0.4 credits)
exports.ConvertToWavSchema = zod_1.z.object({
taskId: zod_1.z.string().describe('Music generation task ID'),
audioId: zod_1.z.string().describe('Track ID to convert'),
callBackUrl: CallbackUrl,
}).strict();
// 15. Boost Style (0.4 credits)
exports.BoostStyleSchema = zod_1.z.object({
content: zod_1.z.string().describe('Short style description, e.g. "Pop, Mysterious"'),
}).strict();
// 16. Generate Persona (0 credits)
exports.GeneratePersonaSchema = zod_1.z.object({
taskId: zod_1.z.string().describe('Music generation task ID to derive persona from'),
audioId: zod_1.z.string().describe('Track ID to derive persona from'),
}).strict();
// 17. Generate Mashup (12 credits)
exports.GenerateMashupSchema = zod_1.z.object({
uploadUrlList: zod_1.z.array(zod_1.z.string().url()).length(2).describe('Exactly 2 audio URLs to mash up'),
customMode: zod_1.z.boolean(),
instrumental: zod_1.z.boolean().optional(),
prompt: zod_1.z.string().describe('Mashup concept / lyrics'),
style: zod_1.z.string().optional(),
title: zod_1.z.string().optional(),
model: zod_1.z.enum(['V4', 'V4_5', 'V4_5PLUS', 'V4_5ALL', 'V5']),
negativeTags: zod_1.z.string().optional(),
vocalGender: zod_1.z.enum(['m', 'f']).optional(),
styleWeight: zod_1.z.number().min(0).max(1).optional(),
weirdnessConstraint: zod_1.z.number().min(0).max(1).optional(),
audioWeight: zod_1.z.number().min(0).max(1).optional(),
callBackUrl: CallbackUrl,
}).strict();
// 18. Get Task Status (0 credits)
exports.GetTaskStatusSchema = zod_1.z.object({
taskId: zod_1.z.string().describe('Task ID to check'),
}).strict();
// 19. Get Timestamped Lyrics (0.5 credits)
exports.GetTimestampedLyricsSchema = zod_1.z.object({
taskId: zod_1.z.string().describe('Music generation task ID'),
audioId: zod_1.z.string().describe('Track ID'),
}).strict();
// 20. Get Lyrics Details (0 credits)
exports.GetLyricsDetailsSchema = zod_1.z.object({
taskId: zod_1.z.string().describe('Lyrics generation task ID'),
}).strict();
// 21. Get WAV Details (0 credits)
exports.GetWavDetailsSchema = zod_1.z.object({
taskId: zod_1.z.string().describe('WAV conversion task ID'),
}).strict();
// 22. Get Vocal Separation Details (0 credits)
exports.GetVocalSeparationDetailsSchema = zod_1.z.object({
taskId: zod_1.z.string().describe('Vocal separation task ID'),
}).strict();
// 23. Get Video Details (0 credits)
exports.GetVideoDetailsSchema = zod_1.z.object({
taskId: zod_1.z.string().describe('Music video task ID'),
}).strict();
// 24. Get Credits (0 credits)
exports.GetCreditsSchema = zod_1.z.object({}).strict();
//# sourceMappingURL=schemas.js.map