import * as z from "zod/v3";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import { BudgetLimits } from "./budgetlimits.js";
import { BudgetMatch } from "./budgetmatch.js";
import { BudgetScope } from "./budgetscope.js";
import { BudgetUsage } from "./budgetusage.js";
import { RateLimit } from "./ratelimit.js";
/**
 * Budget is the canonical record stored in MongoDB `budgets.entities`.
 *
 * @remarks
 *  It replaces the embedded `constraints.budget` on api-keys and the
 *  legacy CONTACT-only `budgets.configs` collection (see ADR 0007).
 */
export type Budget = {
    budgetId?: string | undefined;
    /**
     * Denormalized metadata for UI rendering, list filters, and the
     *
     * @remarks
     *  resolver's prefilter index. Never consulted for matching — the
     *  `match` expression is the single source of matching semantics.
     *  Unset for budgets created from a raw CEL expression ("custom").
     */
    scope?: BudgetScope | undefined;
    /**
     * The matching semantics of the budget. The enforcement resolver
     *
     * @remarks
     *  evaluates `match.cel` against the request context; a budget
     *  applies to a request if and only if the expression evaluates to
     *  true. Scoped creates derive a canonical expression (e.g.
     *  `provider == "openai"`); an empty expression always matches
     *  (workspace-wide).
     */
    match?: BudgetMatch | undefined;
    /**
     * BudgetLimits is the per-period spend and token ceiling. At least one
     *
     * @remarks
     *  of `amount`, `token_limit`, or RateLimit.requests_per_minute MUST be
     *  set on a Budget; that invariant is enforced by the handler.
     */
    limits?: BudgetLimits | undefined;
    /**
     * RateLimit is the per-minute request ceiling. Enforced via atomic
     *
     * @remarks
     *  increment-first semantics in the enforcement middleware.
     */
    rateLimit?: RateLimit | undefined;
    isActive?: boolean | undefined;
    expiresAt?: Date | undefined;
    createdAt?: Date | undefined;
    updatedAt?: Date | undefined;
    /**
     * Live consumption for the current period, read from the Redis
     *
     * @remarks
     *  counters the enforcement gate maintains. Populated by read paths
     *  (Get / List); omitted on write responses (Create / Update / Reset)
     *  where it carries no signal. Absent or all-zero for a budget that
     *  has not been spent against in the current period.
     */
    usage?: BudgetUsage | undefined;
};
/** @internal */
export declare const Budget$inboundSchema: z.ZodType<Budget, z.ZodTypeDef, unknown>;
export declare function budgetFromJSON(jsonString: string): SafeParseResult<Budget, SDKValidationError>;
//# sourceMappingURL=budget.d.ts.map