/**
 * Agent log forwarding: enriches agent log lines with metadata and writes
 * them to a writable stream (typically orchestrator stdout for ELK ingestion).
 *
 * Handles both JSON and non-JSON log lines:
 * - JSON lines are parsed, enriched with agent/context metadata, and re-serialized.
 * - Non-JSON lines are wrapped as info-level JSON objects.
 *
 * The `service` field identifies the originating tier for forwarded logs that flow
 * through orchestrator stdout (where `kici.service` from container name would say
 * `orchestrator`). This is NOT a rename of `app.source` -- it serves the different
 * purpose of identifying forwarded log origin for scaler-managed agents only.
 */
import type { LogCapture } from './types.js';
/** Context fields merged into each forwarded log line. */
interface ForwardContext {
    runId?: string;
    requestId?: string;
    jobId?: string;
}
/**
 * Enrich and forward a single log line to an output stream.
 *
 * Standalone function for use in the WS agent.log path (agent-handler).
 *
 * @param line - Raw log line from the agent
 * @param agentId - The agent that produced the line
 * @param output - Writable stream to write enriched JSON to
 * @param context - Optional trace context fields
 * @param logsSource - Optional log source identifier (e.g. 'docker', 'podman', 'bare-metal', 'firecracker-serial')
 */
export declare function forwardLine(line: string, agentId: string, output: NodeJS.WritableStream, context?: ForwardContext, logsSource?: string): void;
/**
 * Consumes a LogCapture stream and forwards enriched log lines to an output stream.
 *
 * Used by scaler backends (container, bare-metal, Firecracker) to forward
 * agent stdout/stderr to orchestrator stdout for ELK ingestion.
 */
export declare class AgentLogForwarder {
    private readonly agentId;
    private readonly output;
    constructor(agentId: string, output?: NodeJS.WritableStream);
    /**
     * Forward all lines from a LogCapture to the output stream.
     * Resolves when the capture's async iterable ends.
     *
     * @param capture - LogCapture to consume
     * @param context - Optional trace context fields
     * @param logsSource - Optional log source identifier (e.g. 'docker', 'podman', 'bare-metal')
     */
    forward(capture: LogCapture, context?: ForwardContext, logsSource?: string): Promise<void>;
}
export {};
//# sourceMappingURL=log-forwarder.d.ts.map