import { ResolvedRef } from "../../validation/dolt-schemas.js"; import { ProjectScopeConfig } from "../../db/manage/scope-definitions.js"; import { ConversationHistoryConfig, ConversationMetadata, MessageContent, PaginationConfig } from "../../types/utility.js"; import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js"; import "../../types/index.js"; import { ConversationInsert, ConversationSelect, ConversationUpdate, MessageSelect } from "../../types/entities.js"; //#region src/data-access/runtime/conversations.d.ts declare const listConversations: (db: AgentsRunDatabaseClient) => (params: { scopes: ProjectScopeConfig; userId?: string; agentIds?: string[]; pagination?: PaginationConfig; }) => Promise<{ conversations: ConversationSelect[]; total: number; }>; declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{ id: string; createdAt: string; updatedAt: string; ref: { type: "commit" | "tag" | "branch"; name: string; hash: string; } | null; userId: string | null; metadata: ConversationMetadata | null; projectId: string; tenantId: string; properties: Record | null; title: string | null; agentId: string | null; userProperties: Record | null; activeSubAgentId: string; lastContextResolution: string | null; }>; declare const updateConversation: (db: AgentsRunDatabaseClient) => (params: { scopes: ProjectScopeConfig; conversationId: string; data: ConversationUpdate; }) => Promise<{ createdAt: string; updatedAt: string; userId: string | null; agentId: string | null; activeSubAgentId: string; ref: { type: "commit" | "tag" | "branch"; name: string; hash: string; } | null; title: string | null; lastContextResolution: string | null; metadata: ConversationMetadata | null; userProperties: Record | null; properties: Record | null; projectId: string; tenantId: string; id: string; }>; declare const deleteConversation: (db: AgentsRunDatabaseClient) => (params: { scopes: ProjectScopeConfig; conversationId: string; }) => Promise; declare const updateConversationActiveSubAgent: (db: AgentsRunDatabaseClient) => (params: { scopes: ProjectScopeConfig; conversationId: string; activeSubAgentId: string; }) => Promise<{ createdAt: string; updatedAt: string; userId: string | null; agentId: string | null; activeSubAgentId: string; ref: { type: "commit" | "tag" | "branch"; name: string; hash: string; } | null; title: string | null; lastContextResolution: string | null; metadata: ConversationMetadata | null; userProperties: Record | null; properties: Record | null; projectId: string; tenantId: string; id: string; }>; declare const getConversation: (db: AgentsRunDatabaseClient) => (params: { scopes: ProjectScopeConfig; conversationId: string; }) => Promise<{ id: string; createdAt: string; updatedAt: string; ref: { type: "commit" | "tag" | "branch"; name: string; hash: string; } | null; userId: string | null; metadata: ConversationMetadata | null; projectId: string; tenantId: string; properties: Record | null; title: string | null; agentId: string | null; userProperties: Record | null; activeSubAgentId: string; lastContextResolution: string | null; } | undefined>; /** * Batch-fetch conversations by id within a project scope. * * Set-based alternative to calling {@link getConversation} once per id, so callers * enriching many results (e.g. evaluation results) issue a single query instead of * fanning out one connection acquisition per conversation. */ declare const getConversationsByIds: (db: AgentsRunDatabaseClient) => (params: { scopes: ProjectScopeConfig; conversationIds: string[]; }) => Promise<{ id: string; agentId: string | null; createdAt: string; }[]>; declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input: ConversationInsert) => Promise<{ activeSubAgentId: string; projectId: string; tenantId: string; id: string; ref: { type: "commit" | "tag" | "branch"; name: string; hash: string; }; createdAt?: string | undefined; updatedAt?: string | undefined; userId?: string | null | undefined; agentId?: string | null | undefined; title?: string | null | undefined; lastContextResolution?: string | null | undefined; metadata?: ConversationMetadata | null | undefined; contextConfigId?: string | undefined; userProperties?: Record | null | undefined; properties?: Record | null | undefined; } | { id: string; createdAt: string; updatedAt: string; ref: { type: "commit" | "tag" | "branch"; name: string; hash: string; } | null; userId: string | null; metadata: ConversationMetadata | null; projectId: string; tenantId: string; properties: Record | null; title: string | null; agentId: string | null; userProperties: Record | null; activeSubAgentId: string; lastContextResolution: string | null; }>; /** * Extract text content from message content object */ declare function extractMessageText(content: MessageContent): string; /** * Get conversation history with filtering and context management */ declare const getConversationHistory: (db: AgentsRunDatabaseClient) => (params: { scopes: ProjectScopeConfig; conversationId: string; options?: ConversationHistoryConfig; }) => Promise; /** * Get active agent for a conversation */ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (params: { scopes: ProjectScopeConfig; conversationId: string; }) => Promise<{ id: string; createdAt: string; updatedAt: string; ref: { type: "commit" | "tag" | "branch"; name: string; hash: string; } | null; userId: string | null; metadata: ConversationMetadata | null; projectId: string; tenantId: string; properties: Record | null; title: string | null; agentId: string | null; userProperties: Record | null; activeSubAgentId: string; lastContextResolution: string | null; } | undefined>; /** * Set active agent for a conversation (upsert operation) */ declare const setActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (params: { scopes: ProjectScopeConfig; conversationId: string; subAgentId: string; agentId: string; ref: ResolvedRef; userId?: string; metadata?: ConversationMetadata; userProperties?: Record | null; properties?: Record | null; }) => Promise; declare const setActiveAgentForThread: (db: AgentsRunDatabaseClient) => ({ scopes, threadId, subAgentId, agentId, ref }: { scopes: ProjectScopeConfig; threadId: string; subAgentId: string; agentId: string; ref: ResolvedRef; }) => Promise; //#endregion export { createConversation, createOrGetConversation, deleteConversation, extractMessageText, getActiveAgentForConversation, getConversation, getConversationHistory, getConversationsByIds, listConversations, setActiveAgentForConversation, setActiveAgentForThread, updateConversation, updateConversationActiveSubAgent };