feat: enhance discovery, vibe sessions, and library enrichment
Typecheck / typecheck (backend) (push) Has been cancelled
Typecheck / typecheck (workers) (push) Has been cancelled

This commit is contained in:
kami
2026-08-01 14:40:48 +04:00
parent a0c9f42a89
commit 4c48d11e9d
54 changed files with 4136 additions and 521 deletions
+5
View File
@@ -9,11 +9,14 @@ interface VibeState {
seedTrackId: string | null;
centerTrack: Track | null;
buffer: Track[]; // lookahead buffer of upcoming recommended tracks
/** Outcome of the first V2 batch, including sessions initiated from Discover. */
initialBatchStatus: 'idle' | 'loading' | 'exhausted' | 'failed';
setActiveSession: (session: VibeSession | null) => void;
setSeedTrackId: (seedTrackId: string | null) => void;
setCenterTrack: (track: Track | null) => void;
setBuffer: (buffer: Track[]) => void;
setInitialBatchStatus: (status: VibeState['initialBatchStatus']) => void;
appendBuffer: (tracks: Track[]) => void;
shiftBuffer: () => Track | undefined;
reset: () => void;
@@ -24,6 +27,7 @@ const initialState = {
seedTrackId: null as string | null,
centerTrack: null as Track | null,
buffer: [] as Track[],
initialBatchStatus: 'idle' as const,
};
export const useVibeStore = create<VibeState>((set, get) => ({
@@ -39,6 +43,7 @@ export const useVibeStore = create<VibeState>((set, get) => ({
setSeedTrackId: (seedTrackId) => set({ seedTrackId }),
setCenterTrack: (centerTrack) => set({ centerTrack }),
setBuffer: (buffer) => set({ buffer }),
setInitialBatchStatus: (initialBatchStatus) => set({ initialBatchStatus }),
appendBuffer: (tracks) => set((state) => ({ buffer: [...state.buffer, ...tracks] })),
shiftBuffer: () => {