Files
DeepTutor/web/lib/learning-journal-api.ts
Bingxi Zhao (Frank) 64bc0d8e7c feat(learning): expose a durable workspace journal overview (#1407)
Adapt the journal foundation from PR #1226 and add a read-only mission, handoff and confirmed-record panel. Share its snapshot with turn injection, preserve corrupt files, and serialize worker writes.

Co-authored-by: ZQR1101 <278034003+ZQR1101@users.noreply.github.com>
2026-10-08 03:11:15 +08:00

17 lines
694 B
TypeScript

import { apiFetch } from "@/shared/api/client";
export interface LearningJournal {
version: number;
updated_at: string;
mission: { topic: string; why: string; level: string; updated_at: string };
last_session: { summary: string; next_focus: string; updated_at: string };
records: { id: string; title: string; insight: string; created_at: string }[];
injected_context: string;
}
export async function getLearningJournal(signal?: AbortSignal): Promise<LearningJournal> {
const response = await apiFetch("/api/learning-journal", { cache: "no-store", signal });
if (!response.ok) throw new Error(`Learning journal request failed: ${response.status}`);
return response.json();
}