import type { ControlPlaneStore, JsonValue } from '../control-plane';
import type { CapacityPool, CapacityVector, PlacementDecision, PlacementRequirements, RemoteBuild, WorkloadPlacement } from './types';
export declare const zeroCapacity: () => CapacityVector;
export declare const capacity: (value?: Partial<CapacityVector>) => CapacityVector;
export declare class PlacementStore {
    readonly control: ControlPlaneStore;
    private now;
    private id;
    constructor(control: ControlPlaneStore, now?: () => Date, id?: () => string);
    createPool(input: Omit<CapacityPool, 'id' | 'reserved' | 'version' | 'createdAt' | 'updatedAt'>): CapacityPool;
    getPool(id: string): CapacityPool | undefined;
    listPools(projectId: string): CapacityPool[];
    updatePool(id: string, patch: Partial<Pick<CapacityPool, 'status' | 'reserved' | 'capacity' | 'concurrency'>>): CapacityPool;
    addMember(poolId: string, serverId: string, override?: Partial<CapacityVector>): void;
    members(poolId: string): Array<{
        serverId: string;
        status: string;
        capacityOverride: Partial<CapacityVector>;
    }>;
    memberStatus(poolId: string, serverId: string, status: 'active' | 'draining' | 'offline'): void;
    listPlacements(projectId: string, statuses?: WorkloadPlacement['status'][]): WorkloadPlacement[];
    getPlacement(id: string): WorkloadPlacement | undefined;
    activeUsage(poolId: string, serverId?: string): {
        resources: CapacityVector;
        count: number;
    };
    expireLeases(): number;
    reserve(input: {
        projectId: string;
        environmentId?: string;
        resourceId: string;
        releaseId?: string;
        requirements: PlacementRequirements;
        decision: PlacementDecision;
    }): WorkloadPlacement;
    transitionPlacement(id: string, status: WorkloadPlacement['status']): WorkloadPlacement;
    createBuild(input: {
        projectId: string;
        resourceId?: string;
        poolId: string;
        placementId?: string;
        operationId?: string;
        sourceSha: string;
        buildSpec: JsonValue;
        tokenExpiresAt: string;
    }): RemoteBuild;
    getBuild(id: string): RemoteBuild | undefined;
    updateBuild(id: string, patch: Partial<Pick<RemoteBuild, 'status' | 'operationId' | 'workspace' | 'cacheKey' | 'artifactUri' | 'artifactDigest' | 'cleanupAt'>>): RemoteBuild;
}
