mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 00:19:26 +08:00
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>
17 lines
694 B
TypeScript
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();
|
|
}
|