feat(gtm): add session history, database loading, and markdown file import

This commit is contained in:
2026-01-04 17:29:20 +00:00
parent 9ac2b9c466
commit d43012eeb5
4 changed files with 292 additions and 98 deletions

View File

@@ -1,4 +1,4 @@
import { Phase1Data, Phase2Data, Phase3Data, Phase4Data, Phase6Data, Phase7Data, Phase8Data, Phase9Data, Language } from "./types";
import { Phase1Data, Phase2Data, Phase3Data, Phase4Data, Phase6Data, Phase7Data, Phase8Data, Phase9Data, Language, ProjectHistoryItem } from "./types";
const API_BASE_URL = './api'; // Relative path to respect Nginx /gtm/ routing
@@ -100,4 +100,16 @@ export const translateReportToEnglish = async (reportMarkdown: string): Promise<
export const generateConceptImage = async (prompt: string, referenceImagesBase64?: string[]): Promise<string> => {
const result = await callApi<{ imageBase64: string }>('run', 'image', { prompt, referenceImagesBase64 });
return result.imageBase64;
};
export const listSessions = async (): Promise<{ projects: ProjectHistoryItem[] }> => {
return callApi('run', 'list_history', {});
};
export const loadSession = async (projectId: string): Promise<any> => {
return callApi('run', 'load_history', { projectId });
};
export const deleteSession = async (projectId: string): Promise<any> => {
return callApi('run', 'delete_session', { projectId });
};