import type { SubAgentSource, SubAgentTaskDifficulty } from '@n8n/api-types'; import { Logger } from '@n8n/backend-common'; import { AgentBackgroundJobService, type BackgroundJobReceipt } from './agent-background-job.service'; import { SubAgentRunner, type SubAgentRunContext } from '../sub-agents/sub-agent-runner'; export interface BackgroundSpawnRequest { subAgentId: string; source: SubAgentSource; taskName: string; goal: string; context?: string; expectedOutput?: string; difficulty?: SubAgentTaskDifficulty; parentThreadId: string; parentResourceId: string; parentSandboxPrincipalHash: string; } export declare class SubAgentBackgroundRunner { private readonly runner; private readonly jobService; private readonly logger; private dispatchCounter; constructor(runner: SubAgentRunner, jobService: AgentBackgroundJobService, logger: Logger); spawn(request: BackgroundSpawnRequest, context: { projectId: string; parentAgentId: string; } & Pick): Promise; }