import type { AgentIntegrationConfig, AgentVectorStoreProvider, ListAgentsQueryDto } from '@n8n/api-types'; import { BaseRepository, TransactionRunner, type OperationContext } from '@n8n/db'; import { DataSource } from '@n8n/typeorm'; import { Agent, type ProjectAgent, type ProjectScoped } from '../entities/agent.entity'; import type { AgentDefinitionMetadata } from '../utils/agent-definition'; export interface AgentListResult { count: number; data: ProjectAgent[]; } export type AgentSummary = ProjectScoped>; export interface PublishedAgentVectorStores { agentId: string; vectorStoreProviders: AgentVectorStoreProvider[]; } export declare function hasN8nChatChannel(integrations: Array<{ type: string; }> | undefined): boolean; export type AgentIntegrationState = Pick; export type AgentImportIdentity = Pick; export type AgentSummaryFilters = { query?: string; publishedOnly?: boolean; excludeAgentId?: string; limit?: number; }; export declare class AgentRepository extends BaseRepository { constructor(dataSource: DataSource, transactionRunner: TransactionRunner); insertNew(agent: Agent, ctx?: OperationContext): Promise; lockForVersionCapture(id: string, ctx: OperationContext): Promise; hasRevision(id: string, revision: number, ctx?: OperationContext): Promise; findByProjectId(projectId: string): Promise; findForExport(agentIds: string[], projectIds: string[] | null, options: { includeActiveVersion: boolean; }): Promise; findIdsInProjectsForExport(projectIds: string[]): Promise; findExistingIds(agentIds: string[]): Promise>; findImportCandidates(projectId: string, sourceAgentIds: string[]): Promise; findImportIdOwners(agentIds: string[]): Promise>>; findSummariesByProjectIds(projectIds: string[] | null, options?: AgentSummaryFilters): Promise; findByProjectIdsPaginated(projectIds: string[] | null, options: ListAgentsQueryDto, { withProject, usageCounts, }?: { withProject?: boolean; usageCounts?: Map; }): Promise; findN8nChatListPaginated(reachableProjectIds: string[] | null, ownedProjectIds: string[], options: ListAgentsQueryDto, usageCounts?: Map): Promise; private chatReachableQuery; findChatReachableIds(projectIds: string[] | null): Promise; findChatReachableById(id: string, projectIds: string[] | null): Promise; private applyFilters; private publishedN8nChatSql; private applySorting; private applyUsageSorting; findByIdAndProjectId(id: string, projectId: string): Promise; isN8nChatPublished(id: string, projectId: string): Promise; findById(id: string, ctx?: OperationContext): Promise; ensureInstanceAgent(id: string, name: string): Promise; findDependencyIndexAgentIdsBatch(afterId: string | null, batchSize: number): Promise>>; findSummariesByIds(ids: string[]): Promise>>>; findByIdInProjects(id: string, projectIds: string[]): Promise; existsByIdAndProjectId(id: string, projectId: string): Promise; getProjectIdById(id: string): Promise; findBudgetAlertTarget(id: string): Promise> | null>; findByIdsAndProjectId(ids: string[], projectId: string): Promise>>; findMcpAvailabilityCandidates(where: { ids: string[]; } | { projectIds: string[]; } | { all: true; }): Promise>>>; setAvailableInMCP(agentIds: string[], availableInMCP: boolean): Promise; claimSetupCompleted(id: string, completedAt: Date): Promise; findIntegrationState(id: string): Promise; updateIntegrations(id: string, integrations: AgentIntegrationConfig[], expected: Pick, versionId: string | null, ctx?: OperationContext): Promise; findPublished(): Promise; findPublishedAgentIds(): Promise; findActiveVersionId(agentId: string): Promise; findPublishedIds(agentIds: string[]): Promise>; findByIntegrationCredentialAnyProject(type: string, credentialId: string, excludeAgentId: string): Promise>>; findWithIntegrationType(type: string): Promise>>; findByIntegrationCredential(type: string, credentialId: string, projectId: string, excludeAgentId: string): Promise; setActiveVersionFenced(id: string, publicationRevision: number, activeVersionId: string | null, ctx?: OperationContext): Promise; saveDraftFenced(agent: Agent, ctx?: OperationContext, metadata?: AgentDefinitionMetadata): Promise; markFollowerDraftsChanged(agentIds: string[], ctx?: OperationContext): Promise; findProjectIdsByIds(ids: string[], ctx?: OperationContext): Promise>>>; updateDraftSchema(agent: Pick, ctx: OperationContext): Promise; findPublishedVectorStoreProvidersPage(afterId: string | null, limit: number): Promise; }