import type { ID } from '../common/types.js';
import type { ResourceLimits, ResourceUsage, ResourceStateProvider, TerminationReason } from './types.js';
/**
 * Resource tracker options
 */
export interface ResourceTrackerOptions {
    /** Polling interval in milliseconds (default: 100ms) */
    pollIntervalMs?: number;
    /** Resource state provider for distributed tracking */
    stateProvider?: ResourceStateProvider;
}
/**
 * Resource tracker for monitoring execution resource usage.
 *
 * Features:
 * - Polls memory via process.memoryUsage() at configurable intervals
 * - Tracks CPU via process.cpuUsage() deltas
 * - Uses AbortController for termination signaling
 * - Reports to optional distributed state provider
 */
export declare class ResourceTracker {
    private readonly executionId;
    private readonly limits;
    private readonly pollIntervalMs;
    private readonly stateProvider?;
    private readonly abortController;
    private pollTimer;
    private startTime;
    private lastCpuUsage;
    private totalCpuTimeMs;
    private peakMemoryMb;
    private terminated;
    private terminationReason?;
    constructor(executionId: ID, limits: ResourceLimits, options?: ResourceTrackerOptions);
    /**
     * Get the abort signal for termination
     */
    get signal(): AbortSignal;
    /**
     * Check if execution has been terminated
     */
    isTerminated(): boolean;
    /**
     * Get termination reason if terminated
     */
    getTerminationReason(): TerminationReason | undefined;
    /**
     * Start resource tracking
     */
    start(): Promise<void>;
    /**
     * Stop resource tracking
     */
    stop(): Promise<ResourceUsage>;
    /**
     * Terminate execution with reason
     */
    terminate(reason: string, violation?: string): void;
    /**
     * Poll current resource usage
     */
    private poll;
    /**
     * Check resource limits locally (when no distributed state provider)
     */
    private checkLocalLimits;
    /**
     * Get current resource usage snapshot
     */
    getCurrentUsage(): ResourceUsage;
}
/**
 * Create a resource tracker instance
 */
export declare function createResourceTracker(executionId: ID, limits: ResourceLimits, options?: ResourceTrackerOptions): ResourceTracker;
//# sourceMappingURL=resource-tracker.d.ts.map