diff --git a/frontend/src/api/frontApis.ts b/frontend/src/api/frontApis.ts index 1d53dc5..548957a 100644 --- a/frontend/src/api/frontApis.ts +++ b/frontend/src/api/frontApis.ts @@ -1,5 +1,7 @@ import type { AvailableGraphsResponse, + ConversationListItem, + ConversationMessageItem, GraphConfigListResponse, GraphConfigReadResponse, GraphConfigUpsertRequest, @@ -10,6 +12,8 @@ import type { McpToolConfigUpdateResponse, PipelineCreateRequest, PipelineCreateResponse, + PipelineConversationListResponse, + PipelineConversationMessagesResponse, PipelineListResponse, PipelineStopResponse, } from "../types"; @@ -138,3 +142,23 @@ export function stopPipeline(pipelineId: string): Promise }); } +export async function listPipelineConversations( + pipelineId: string, + limit = 100 +): Promise { + const response = await fetchJson( + `/v1/pipelines/${encodeURIComponent(pipelineId)}/conversations?limit=${limit}` + ); + return response.items || []; +} + +export async function getPipelineConversationMessages( + pipelineId: string, + conversationId: string +): Promise { + const response = await fetchJson( + `/v1/pipelines/${encodeURIComponent(pipelineId)}/conversations/${encodeURIComponent(conversationId)}/messages` + ); + return response.items || []; +} + diff --git a/frontend/src/types.ts b/frontend/src/types.ts index 8dda2e4..83b91b5 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -89,6 +89,33 @@ export type PipelineStopResponse = { reload_required: boolean; }; +export type ConversationListItem = { + conversation_id: string; + pipeline_id: string; + message_count: number; + last_updated?: string | null; +}; + +export type PipelineConversationListResponse = { + pipeline_id: string; + items: ConversationListItem[]; + count: number; +}; + +export type ConversationMessageItem = { + message_type: string; + content: string; + sequence_number: number; + created_at: string; +}; + +export type PipelineConversationMessagesResponse = { + pipeline_id: string; + conversation_id: string; + items: ConversationMessageItem[]; + count: number; +}; + export type McpToolConfigResponse = { path: string; raw_content: string;