- Multi-provider AI analysis (Anthropic, OpenAI, Ollama, Algorithmic) - server-only guards on all provider files; client bundle fix - /settings page with provider status, Ollama model picker, preferences - Song search box on /analyze replacing raw MBID input (debounced, keyboard nav) - Auto-register song via MusicBrainz on POST /api/tracks (no more 404) - Fix WAV duration bug: last section songEnd was double-counting elapsed time - Registry sync comment updated for self-hosted HTTPS git servers Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
906 B
TypeScript
30 lines
906 B
TypeScript
import type { CTPDocument } from '@/lib/ctp/schema';
|
|
|
|
export interface AnalysisInput {
|
|
bpm: number;
|
|
duration: number; // seconds
|
|
title?: string;
|
|
artist?: string;
|
|
mbid?: string | null;
|
|
contributed_by: string;
|
|
ollamaModel?: string; // required when provider id is "ollama"
|
|
}
|
|
|
|
export interface ProviderInfo {
|
|
id: string;
|
|
label: string;
|
|
type: 'cloud-ai' | 'local-ai' | 'algorithmic';
|
|
available: boolean;
|
|
unavailableReason?: string; // present only when available === false
|
|
ollamaBaseUrl?: string; // present only for the ollama provider
|
|
}
|
|
|
|
export interface AnalysisProvider {
|
|
id: string;
|
|
label: string;
|
|
type: 'cloud-ai' | 'local-ai' | 'algorithmic';
|
|
/** Returns true if this provider is configured and reachable. Must not throw. */
|
|
isAvailable(): Promise<{ available: boolean; reason?: string }>;
|
|
generateCTP(input: AnalysisInput): Promise<CTPDocument>;
|
|
}
|