Add brain and chat workspace views

Expand the frontend with brain, graph, and chat workspace updates so the
new backend orchestration and memory features have matching screens.
These changes also wire the new APIs into routing and add focused view
and routing tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-22 13:48:16 +08:00
parent d2447ee635
commit 7d80a6e2ec
21 changed files with 3095 additions and 658 deletions

View File

@@ -9,10 +9,26 @@ export interface Document {
summary?: string
chunk_count: number
is_indexed: boolean
ingestion_status?: 'uploaded' | 'parsing' | 'indexing' | 'ready' | 'warning' | 'failed'
ingestion_error?: string | null
indexed_at?: string | null
parser_version?: string | null
index_version?: string | null
folder_id?: string | null
created_at: string
}
export interface DocumentChunk {
id: string
chunk_index: number
content: string
metadata_?: string | null
}
export interface DocumentChunkUpdate {
content: string
}
export interface SearchResult {
chunk_id: string
document_id: string
@@ -29,6 +45,9 @@ export interface UploadResponse {
title: string
chunk_count: number
status: string
ingestion_status?: 'uploaded' | 'parsing' | 'indexing' | 'ready' | 'warning' | 'failed'
ingestion_error?: string | null
indexed_at?: string | null
}
export const documentApi = {
@@ -54,7 +73,11 @@ export const documentApi = {
},
getChunks(id: string) {
return api.get<any[]>(`/api/documents/${id}/chunks`)
return api.get<DocumentChunk[]>(`/api/documents/${id}/chunks`)
},
updateChunk(documentId: string, chunkId: string, payload: DocumentChunkUpdate) {
return api.put<DocumentChunk>(`/api/documents/${documentId}/chunks/${chunkId}`, payload)
},
delete(id: string) {