import { PubSubEngine } from 'type-graphql';
import { AppContext } from '../types.js';
import { ResolverBase } from '../generic/ResolverBase.js';
export declare class AIAgentRunResult {
    success: boolean;
    errorMessage?: string;
    executionTimeMs?: number;
    result: string;
}
export declare class AgentExecutionProgress {
    currentStep: string;
    percentage?: number;
    message: string;
    agentName?: string;
    agentType?: string;
    stepCount?: number;
    hierarchicalStep?: string;
}
export declare class AgentStreamingContent {
    content: string;
    isPartial: boolean;
    stepName?: string;
    agentName?: string;
}
export declare class AgentExecutionStepSummary {
    stepId: string;
    stepName: string;
    agentName?: string;
    agentType?: string;
    startTime: Date;
    endTime?: Date;
    status: string;
    result?: string;
}
export declare class AgentPartialResult {
    currentStep: string;
    partialOutput?: string;
}
export declare class AgentExecutionStreamMessage {
    sessionId: string;
    agentRunId: string;
    type: 'progress' | 'streaming' | 'partial_result' | 'complete';
    progress?: AgentExecutionProgress;
    streaming?: AgentStreamingContent;
    partialResult?: AgentPartialResult;
    timestamp: Date;
    agentRun?: any;
    conversationDetailId?: string;
}
export declare class RunAIAgentResolver extends ResolverBase {
    /**
     * Sanitize ExecuteAgentResult for JSON serialization
     * Removes circular references and non-serializable objects
     */
    private sanitizeAgentResult;
    /**
     * Parse and validate JSON input
     */
    private parseJsonInput;
    /**
     * Extract the user message from the messages array
     * Looks for the last user message in the conversation
     */
    private extractUserMessage;
    /**
     * Validate the agent entity
     */
    private validateAgent;
    /**
     * Create streaming progress callback
     */
    private createProgressCallback;
    private PublishProgressUpdate;
    private PublishStreamingUpdate;
    /**
     * Create streaming content callback
     */
    private createStreamingCallback;
    /**
     * Internal method that handles the core AI agent execution logic.
     * This method is called by both the regular and system user resolvers.
     * @private
     */
    private executeAIAgent;
    /**
     * Publish final streaming events (partial result and completion)
     */
    private publishFinalEvents;
    /**
     * Public mutation for regular users to run AI agents with authentication.
     */
    RunAIAgent(agentId: string, { userPayload, providers, dataSource }: AppContext, messagesJson: string, sessionId: string, pubSub: PubSubEngine, data?: string, payload?: string, templateData?: string, lastRunId?: string, autoPopulateLastRunPayload?: boolean, configurationId?: string, conversationDetailId?: string, createArtifacts?: boolean, createNotification?: boolean, sourceArtifactId?: string, sourceArtifactVersionId?: string): Promise<AIAgentRunResult>;
    /**
     * System user query for running AI agents with elevated privileges.
     * Requires the @RequireSystemUser decorator to ensure only system users can access.
     */
    RunAIAgentSystemUser(agentId: string, { userPayload, providers, dataSource }: AppContext, messagesJson: string, sessionId: string, pubSub: PubSubEngine, data?: string, payload?: string, templateData?: string, lastRunId?: string, autoPopulateLastRunPayload?: boolean, configurationId?: string, conversationDetailId?: string, createArtifacts?: boolean, createNotification?: boolean, sourceArtifactId?: string, sourceArtifactVersionId?: string): Promise<AIAgentRunResult>;
    /**
     * Create a user notification for agent completion with artifact
     * Notification includes navigation link back to the conversation
     */
    private createCompletionNotification;
    /**
     * Optimized mutation that loads conversation history server-side.
     * This avoids sending large attachment data from client to server.
     *
     * @param conversationDetailId - The conversation detail ID (user's message already saved)
     * @param agentId - The agent to execute
     * @param maxHistoryMessages - Maximum number of history messages to include (default: 20)
     */
    RunAIAgentFromConversationDetail(conversationDetailId: string, agentId: string, { userPayload, providers, dataSource }: AppContext, sessionId: string, pubSub: PubSubEngine, maxHistoryMessages?: number, data?: string, payload?: string, lastRunId?: string, autoPopulateLastRunPayload?: boolean, configurationId?: string, createArtifacts?: boolean, createNotification?: boolean, sourceArtifactId?: string, sourceArtifactVersionId?: string): Promise<AIAgentRunResult>;
    /**
     * Load conversation history with attachments from database.
     * Builds ChatMessage[] with multimodal content blocks for attachments.
     */
    private loadConversationHistoryWithAttachments;
    /**
     * Map ConversationDetail Role to ChatMessage role
     */
    private mapDetailRoleToMessageRole;
}
//# sourceMappingURL=RunAIAgentResolver.d.ts.map