Recovered state: integrated TrendSurferAgent, restored frontend/backend files, and cleaned up recovery scripts

This commit is contained in:
ajaysi
2026-02-08 13:56:57 +05:30
parent 1db10ccd0f
commit e404a86502
333 changed files with 42223 additions and 10875 deletions

View File

@@ -1,6 +1,6 @@
import { apiClient, aiApiClient, pollingApiClient } from "../api/client";
// Import research types for use in this file
import type { ResearchMode, ResearchProvider, SourceType, DateRange, ResearchSource, ResearchConfig, ResearchResponse } from './researchApi';
import type { ResearchMode, ResearchSource, ResearchConfig, ResearchResponse } from './researchApi';
// Re-export research types for backward compatibility
// TODO: Update all blog writer code to import from researchApi.ts directly
export type { ResearchMode, ResearchProvider, SourceType, DateRange, ResearchSource, ResearchConfig, ResearchResponse } from './researchApi';
@@ -293,6 +293,77 @@ export const blogWriterApi = {
return data;
},
async sectionOriginalityTools(payload: {
section_id: string;
title?: string;
content: string;
}): Promise<{
success: boolean;
section_id: string;
cannibalization?: any;
matches?: Array<{ id?: string; score?: number; excerpt?: string }>;
error?: string;
}> {
const { data } = await apiClient.post('/api/blog/section/tools/originality', payload);
return data;
},
async sectionInternalLinkTools(payload: {
section_id: string;
title?: string;
content: string;
}): Promise<{
success: boolean;
section_id: string;
suggestions?: Array<{
url: string;
relevance?: number;
final_score?: number;
confidence?: number;
reason?: string;
}>;
}> {
const { data } = await apiClient.post('/api/blog/section/tools/internal-links', payload);
return data;
},
async sectionFactCheckTools(payload: {
section_id: string;
title?: string;
content: string;
}): Promise<{
success: boolean;
section_id: string;
verification?: any;
citations?: Array<{
source?: string;
title?: string;
relevance?: number;
citation_text?: string;
}>;
}> {
const { data } = await apiClient.post('/api/blog/section/tools/fact-check', payload);
return data;
},
async sectionOptimizeTools(payload: {
section_id: string;
title?: string;
content: string;
keywords?: string[];
goal?: string;
}): Promise<{
success: boolean;
section_id: string;
optimized_content?: string;
changes_made?: string[];
diff_summary?: string;
error?: string;
}> {
const { data } = await apiClient.post('/api/blog/section/tools/optimize', payload);
return data;
},
// Blog Rewrite API
async rewriteBlog(payload: {
title: string;

View File

@@ -5,20 +5,6 @@
* and avoid unnecessary API calls. Shared by both CopilotKit and manual flows.
*/
interface CachedOutlineEntry {
outline: any[];
title_options?: string[];
research_keywords: string[];
created_at: string;
}
interface CachedContentEntry {
sections: Record<string, string>;
outline_ids: string[];
research_keywords: string[];
created_at: string;
}
class BlogWriterCacheService {
private readonly OUTLINE_CACHE_KEY = 'blog_outline';
private readonly TITLE_OPTIONS_CACHE_KEY = 'blog_title_options';

View File

@@ -1,7 +1,6 @@
import { ResearchProvider, ResearchConfig } from "./blogWriterApi";
import {
storyWriterApi,
StoryScene,
StorySetupGenerationResponse,
} from "./storyWriterApi";
import { getResearchConfig, ResearchPersona } from "../api/researchConfig";