/**
 * AgentWorker — 개별 워커 프로세스 관리
 *
 * 에이전트 YAML을 로드하고 프로세스를 스폰하여 작업을 실행합니다.
 */
import type { DagNode } from "../contracts/dag.js";
import type { WorkerLogHandle } from "./log-streamer.js";
import { type SkillAssignment } from "./skill-assigner.js";
import type { TaskRunContext } from "../contracts/worker-context.js";
export interface AgentWorkerOptions {
    node: DagNode;
    runId: string;
    agentYamlPath: string;
    logHandle: WorkerLogHandle;
    cwd?: string;
    env?: Record<string, string>;
    timeout?: number;
    runContext?: TaskRunContext;
}
export interface WorkerOutput {
    success: boolean;
    exitCode: number;
    stdout: string;
    stderr: string;
    metadata?: Record<string, unknown>;
}
export declare function buildAgentWorkerSpawnEnv(workerEnv: Record<string, string>, metadata: {
    readonly runId: string;
    readonly nodeId: string;
    readonly role: string;
}): Record<string, string>;
export declare class AgentWorker {
    private node;
    private runId;
    private agentYamlPath;
    private logHandle;
    private cwd;
    private env;
    private timeout;
    private runContext?;
    private process;
    private abortController;
    constructor(options: AgentWorkerOptions);
    /**
     * 워커 실행
     */
    execute(): Promise<WorkerOutput>;
    /**
     * 워커 중단
     */
    abort(): void;
    /**
     * 워커가 실행 중인지 확인
     */
    isRunning(): boolean;
    /**
     * 프로세스 ID 가져오기
     */
    getPid(): number | undefined;
    /**
     * 노드 정보 가져오기
     */
    getNode(): DagNode;
}
/**
 * 에이전트 YAML 파일 생성
 */
export declare function createAgentYaml(node: DagNode, runId: string, skills: SkillAssignment, outputDir: string): Promise<string>;
/**
 * 워커 생성 헬퍼
 */
export declare function createAgentWorker(node: DagNode, runId: string, logHandle: WorkerLogHandle, options?: Partial<AgentWorkerOptions>): Promise<AgentWorker>;
