export type PersonaType = 'software-engineer' | 'architect' | 'cto' | 'ceo' | 'cfo' | 'marketing' | 'sales' | 'product-manager' | 'designer' | 'custom';
export type TriggerType = 'manual' | 'schedule' | 'event' | 'webhook' | 'condition' | 'chain';
export type ActivityType = 'tool' | 'human' | 'agent' | 'conditional' | 'loop' | 'parallel' | 'external';
export interface ProcessTrigger {
    id: string;
    type: TriggerType;
    name: string;
    enabled: boolean;
    config: TriggerConfig;
    aiSuggested?: boolean;
    reasoning?: string;
}
export interface TriggerConfig {
    cron?: string;
    timezone?: string;
    event?: string;
    source?: string;
    filters?: Record<string, any>;
    endpoint?: string;
    secret?: string;
    condition?: string;
    checkInterval?: number;
    parentProcessId?: string;
    parentStatus?: 'success' | 'failure' | 'any';
    delay?: number;
    timeout?: number;
    retryPolicy?: RetryPolicy;
}
export interface RetryPolicy {
    maxAttempts: number;
    backoffStrategy: 'linear' | 'exponential';
    initialDelay: number;
    maxDelay: number;
}
export interface Activity {
    id: string;
    type: ActivityType;
    name: string;
    description?: string;
    config: ActivityConfig;
    inputs?: Record<string, any>;
    outputs?: string[];
    errorHandler?: ErrorHandler;
    condition?: string;
}
export interface ActivityConfig {
    toolName?: string;
    toolArgs?: Record<string, any>;
    assignTo?: string[];
    prompt?: string;
    formFields?: FormField[];
    approvalType?: 'any' | 'all' | 'specific';
    timeout?: number;
    agentType?: string;
    agentTask?: string;
    agentCapabilities?: string[];
    agentConfig?: Record<string, any>;
    priority?: 'low' | 'medium' | 'high' | 'critical';
    processContext?: Record<string, any>;
    conditions?: ConditionalBranch[];
    defaultBranch?: Activity[];
    collection?: string;
    itemVariable?: string;
    activities?: Activity[];
    maxIterations?: number;
    branches?: Activity[][];
    waitForAll?: boolean;
    url?: string;
    method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
    headers?: Record<string, string>;
    body?: any;
    authentication?: AuthConfig;
}
export interface FormField {
    name: string;
    type: 'text' | 'number' | 'boolean' | 'select' | 'multiselect' | 'date';
    label: string;
    required?: boolean;
    defaultValue?: any;
    options?: string[];
    validation?: string;
}
export interface AgentActivityConfig {
    agentType: string;
    agentTask: string;
    agentCapabilities?: string[];
    priority?: 'low' | 'medium' | 'high' | 'critical';
    processContext?: Record<string, any>;
    timeout?: number;
    retryOnFailure?: boolean;
    fallbackToSimulation?: boolean;
}
export interface ConditionalBranch {
    condition: string;
    activities: Activity[];
}
export interface ErrorHandler {
    type: 'retry' | 'skip' | 'fail' | 'alternate';
    retryPolicy?: RetryPolicy;
    alternateActivities?: Activity[];
    notifyOn?: 'always' | 'final-failure';
}
export interface AuthConfig {
    type: 'bearer' | 'basic' | 'oauth2' | 'api-key';
    credentials: Record<string, string>;
}
export interface ProcessDefinition {
    id: string;
    name: string;
    description?: string;
    version: string;
    persona?: PersonaType;
    category?: string;
    tags?: string[];
    triggers: ProcessTrigger[];
    activities: Activity[];
    variables?: Record<string, any>;
    onSuccess?: Activity[];
    onFailure?: Activity[];
    metadata: ProcessMetadata;
}
export interface ProcessMetadata {
    author?: string;
    createdAt: string;
    updatedAt: string;
    lastExecutedAt?: string;
    executionCount: number;
    averageDuration?: number;
    successRate?: number;
}
export interface ProcessExecution {
    id: string;
    processId: string;
    processVersion: string;
    status: ExecutionStatus;
    triggeredBy: string;
    startedAt: string;
    completedAt?: string;
    duration?: number;
    variables: Record<string, any>;
    activityResults: ActivityResult[];
    error?: ProcessError;
    logs: LogEntry[];
}
export type ExecutionStatus = 'pending' | 'running' | 'waiting' | 'paused' | 'completed' | 'failed' | 'cancelled';
export interface ActivityResult {
    activityId: string;
    status: 'success' | 'failed' | 'skipped';
    startedAt: string;
    completedAt: string;
    duration: number;
    outputs?: Record<string, any>;
    error?: string;
}
export interface ProcessError {
    activityId?: string;
    message: string;
    code?: string;
    stack?: string;
    retryable: boolean;
}
export interface LogEntry {
    timestamp: string;
    level: 'debug' | 'info' | 'warn' | 'error';
    activityId?: string;
    message: string;
    data?: any;
}
export interface TriggerSuggestion {
    trigger: ProcessTrigger;
    confidence: number;
    reasoning: string;
    alternatives: ProcessTrigger[];
    conflicts?: TriggerConflict[];
}
export interface TriggerConflict {
    processId: string;
    processName: string;
    triggerName: string;
    conflictType: 'time' | 'resource' | 'dependency';
    description: string;
    suggestion?: string;
}
export interface TriggerPattern {
    persona: PersonaType;
    activityTypes: string[];
    suggestedTriggers: TriggerTemplate[];
}
export interface TriggerTemplate {
    type: TriggerType;
    name: string;
    defaultConfig: Partial<TriggerConfig>;
    applicableWhen: string;
}
export interface ProcessTemplate {
    id: string;
    name: string;
    description: string;
    persona: PersonaType;
    category: string;
    variables: Array<{
        name: string;
        type: string;
        defaultValue?: any;
        required?: boolean;
        description?: string;
    }>;
    suggestedTriggers: TriggerTemplate[];
    activities: Activity[];
    estimatedDuration?: string;
    requiredIntegrations?: string[];
}
//# sourceMappingURL=types.d.ts.map