export interface JailAgentInput {
  prompt: string;
  sessionId?: string;
  groupFolder: string;
  chatJid: string;
  isMain: boolean;
  isScheduledTask?: boolean;
  assistantName?: string;
  secrets?: Record<string, string>;
}

export interface JailAgentOutput {
  status: 'success' | 'error';
  result: string | null;
  newSessionId?: string;
  error?: string;
}

export interface EngineRunInput {
  prompt: string;
  sessionId?: string;
  resumeAt?: string;
  jailInput: JailAgentInput;
  sdkEnv: Record<string, string | undefined>;
  mcpServerPath: string;
  shouldClose: () => boolean;
  drainIpcInput: () => string[];
  emitOutput: (output: JailAgentOutput) => void;
  log: (message: string) => void;
}

export interface EngineRunResult {
  newSessionId?: string;
  lastAssistantUuid?: string;
  closedDuringTurn: boolean;
}

export interface AgentEngine {
  readonly name: string;
  runTurn(input: EngineRunInput): Promise<EngineRunResult>;
}
