/**
 * In-memory concurrency group tracker.
 *
 * Tracks active runs per concurrency group, scoped by routing key
 * to prevent cross-repo interference. Supports slot acquisition/release
 * and hydration from DB records on startup.
 */
/** Record used to hydrate tracker state from DB on startup. */
export interface HydrateRecord {
    groupKey: string;
    routingKey: string;
    runId: string;
}
export declare class ConcurrencyGroupTracker {
    /**
     * Scoped state: "routingKey::groupKey" -> ordered list of active run IDs.
     * Using an array (not Set) to preserve insertion order for getOldestRun().
     */
    private readonly groups;
    private scopeKey;
    private getOrCreateGroup;
    /**
     * Try to acquire a slot in the concurrency group.
     * Returns true if under max capacity and the run was added, false otherwise.
     * Idempotent: re-acquiring an already-active run returns true without double-adding.
     */
    acquireSlot(groupKey: string, routingKey: string, runId: string, opts: {
        max: number;
    }): boolean;
    /**
     * Release a slot in the concurrency group.
     * No-op if the run ID is not active.
     */
    releaseSlot(groupKey: string, routingKey: string, runId: string): void;
    /**
     * Get all active run IDs in a concurrency group.
     * Returns a copy of the array.
     */
    getActiveRuns(groupKey: string, routingKey: string): string[];
    /**
     * Get the oldest active run in a concurrency group.
     * Used by cancelInProgress mode to determine which run to cancel.
     */
    getOldestRun(groupKey: string, routingKey: string): string | null;
    /**
     * Hydrate tracker state from DB records.
     * Called on orchestrator startup to restore active concurrency groups.
     */
    hydrate(records: HydrateRecord[]): void;
}
//# sourceMappingURL=group-tracker.d.ts.map