import { type RuntimeManagementCaller, type RuntimeManagementError, type RuntimeManagementGate } from "./runtimeManagementPlane.js";
export type RuntimeResourceKind = "cpu" | "memory" | "token" | "concurrency" | "tool-call" | "network" | "storage" | (string & {});
export type RuntimeResourceDemand = {
    resource?: RuntimeResourceKind;
    amount?: number;
    unit?: string;
    reason?: string;
    requestedScopes?: readonly string[];
};
export type RuntimeResourceBudget = {
    resource?: RuntimeResourceKind;
    limit?: number;
    used?: number;
    unit?: string;
    window?: string;
    hard?: boolean;
};
export type RuntimeResourceDecision = {
    resource: RuntimeResourceKind;
    requestedAmount: number;
    grantedAmount: number;
    remainingAfterGrant?: number;
    unit?: string;
    window?: string;
    status: "granted" | "capped";
    hardLimit: boolean;
    reason?: string;
};
export type RuntimeResourceGovernorSnapshot = {
    runtimeId: string;
    caller: RuntimeManagementCaller;
    route: "runtime.managementPlane.resourceGovernor";
    phase: "evaluated";
    decisions: readonly RuntimeResourceDecision[];
    requestedScopes: readonly string[];
    grantedScopes: readonly string[];
    governanceChecked: true;
    contractChecked: true;
    auditRequired: true;
    dryRun: true;
    unsafeSideEffects: false;
};
export type RuntimeResourceGovernorErrorCode = "MISSING_RUNTIME_ID" | "MISSING_CALLER" | "MISSING_RESOURCE_DEMANDS" | "MISSING_RESOURCE_KIND" | "INVALID_RESOURCE_AMOUNT" | "RUNTIME_NOT_READY" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "SCOPE_DENIED" | "RESOURCE_LIMIT_EXCEEDED";
export type RuntimeResourceGovernorError = Omit<RuntimeManagementError, "code"> & {
    code: RuntimeResourceGovernorErrorCode;
};
export type RuntimeResourceGovernorRequest = {
    runtimeId?: string;
    caller?: RuntimeManagementCaller;
    demands?: readonly RuntimeResourceDemand[];
    budgets?: readonly RuntimeResourceBudget[];
    runtimeReady?: boolean;
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    contract?: RuntimeManagementGate;
    governance?: RuntimeManagementGate;
};
export type RuntimeResourceGovernorResult = {
    ok: true;
    governor: RuntimeResourceGovernorSnapshot;
    events: readonly string[];
} | {
    ok: false;
    error: RuntimeResourceGovernorError;
    events: readonly string[];
};
export declare function governRuntimeResources(request?: RuntimeResourceGovernorRequest): RuntimeResourceGovernorResult;
