import { DataOperationEvent } from "@inkeep/agents-core";

//#region src/domains/run/utils/agent-operations.d.ts

/**
 * Agent initialization operation event
 */
interface AgentInitializingEvent {
  type: 'agent_initializing';
  details: {
    sessionId: string;
    agentId: string;
  };
}
/**
 * Completion operation event
 */
interface CompletionEvent {
  type: 'completion';
  details: {
    agent: string;
    iteration: number;
  };
}
/**
 * Unified error event structure
 * Can be used for both operational errors (with agent context) and general stream errors
 */
interface ErrorEvent {
  type: 'error';
  message: string;
  agent?: string;
  severity?: 'error' | 'warning' | 'info';
  code?: string;
  timestamp?: number;
}
/**
 * Discriminated union of all operation events
 */
type OperationEvent = AgentInitializingEvent | CompletionEvent | ErrorEvent | DataOperationEvent;
/**
 * Creates an agent initializing operation
 */
declare function agentInitializingOp(sessionId: string, agentId: string): AgentInitializingEvent;
/**
 * Creates a completion operation
 */
declare function completionOp(subAgentId: string, iterations: number): CompletionEvent;
/**
 * Creates a unified error event
 * @param message - Error message
 * @param subAgentId - Optional agent ID for context
 * @param severity - Error severity level
 * @param code - Optional error code
 */
declare function errorOp(message: string, subAgentId?: string, severity?: 'error' | 'warning' | 'info', code?: string): ErrorEvent;
/**
 * Generate a unique tool execution ID for lifecycle tracking
 */
declare function generateToolId(): string;
//#endregion
export { AgentInitializingEvent, CompletionEvent, ErrorEvent, OperationEvent, agentInitializingOp, completionOp, errorOp, generateToolId };