richtext replacement

This commit is contained in:
Stefan Hardegger
2025-09-21 10:10:04 +02:00
parent aae8f8926b
commit b1dbd85346
28 changed files with 3337 additions and 10558 deletions

View File

@@ -1,27 +1,9 @@
import { NextRequest } from 'next/server';
import { progressStore, type ProgressUpdate } from '../../../../lib/progress';
// Configure route timeout for long-running progress streams
export const maxDuration = 900; // 15 minutes (900 seconds)
interface ProgressUpdate {
type: 'progress' | 'completed' | 'error';
current: number;
total: number;
message: string;
url?: string;
title?: string;
author?: string;
wordCount?: number;
totalWordCount?: number;
error?: string;
combinedStory?: any;
results?: any[];
summary?: any;
}
// Global progress storage (in production, use Redis or database)
const progressStore = new Map<string, ProgressUpdate[]>();
export async function GET(request: NextRequest) {
const searchParams = request.nextUrl.searchParams;
const sessionId = searchParams.get('sessionId');
@@ -81,13 +63,3 @@ export async function GET(request: NextRequest) {
});
}
// Helper function for other routes to send progress updates
export function sendProgressUpdate(sessionId: string, update: ProgressUpdate) {
if (!progressStore.has(sessionId)) {
progressStore.set(sessionId, []);
}
progressStore.get(sessionId)!.push(update);
}
// Export the helper for other modules to use
export { progressStore };