Build standalone MelodyMuse SPA
Drop the Supabase backend and call the AI provider directly from the
browser. The endpoint URL, API key, and model name are stored in
localStorage and used for direct /chat/completions requests.
- src/lib/llm.ts: config persistence, direct fetch, JSON extraction,
shape validation, connection test
- src/lib/prompts.ts: full + partial-regeneration system prompts and
user-message builder
- src/lib/{api,supabase}.ts removed
- supabase/ directory removed
- @supabase/supabase-js dropped from package.json
- README updated to describe the standalone architecture and CORS caveats
- .gitignore: drop Supabase entries, exclude *.tsbuildinfo
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
// Domain types shared across the app. These mirror the JSON shape produced by
|
||||
// the `generate-song` edge function.
|
||||
|
||||
export type Language =
|
||||
| 'English'
|
||||
| 'Deutsch'
|
||||
| 'Español'
|
||||
| 'Français'
|
||||
| 'Italiano'
|
||||
| 'Português'
|
||||
| 'Polski'
|
||||
| 'Other';
|
||||
|
||||
export type Vocals = 'vocals' | 'instrumental';
|
||||
|
||||
export type GenerationSection =
|
||||
| 'all'
|
||||
| 'lyrics'
|
||||
| 'style'
|
||||
| 'titles'
|
||||
| 'video_prompts'
|
||||
| 'youtube_description';
|
||||
|
||||
export type VideoPromptType = 'Abstract' | 'Cinematic' | 'Hybrid';
|
||||
|
||||
export interface VideoPrompt {
|
||||
type: VideoPromptType;
|
||||
prompt: string;
|
||||
tool_recommendation: string;
|
||||
}
|
||||
|
||||
export interface SongAssets {
|
||||
titles: string[];
|
||||
lyrics: string;
|
||||
style: string;
|
||||
negative_style: string;
|
||||
youtube_description: string;
|
||||
video_prompts: VideoPrompt[];
|
||||
}
|
||||
|
||||
export interface GenerateRequest {
|
||||
input: string;
|
||||
language: string; // 'English' or free-text from "Other"
|
||||
mood?: string;
|
||||
vocals: Vocals;
|
||||
section: GenerationSection;
|
||||
context?: Partial<SongAssets>;
|
||||
}
|
||||
|
||||
export interface ConfigDisplay {
|
||||
api_endpoint: string;
|
||||
model_name: string;
|
||||
api_key_set: boolean;
|
||||
}
|
||||
|
||||
export interface SaveConfigPayload {
|
||||
api_endpoint: string;
|
||||
api_key: string; // empty string => keep existing
|
||||
model_name: string;
|
||||
}
|
||||
|
||||
export interface TestConnectionResult {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export const NEGATIVE_VIDEO_PROMPT =
|
||||
'text, watermark, logo, flash, abrupt cuts, camera shake, faces, hands, distortion, blur';
|
||||
Reference in New Issue
Block a user