import type { RevenueOrganizationTypes } from "@cargo-ai/types"; import { type Token } from "../core.js"; import { type ModelRef } from "../refs.js"; import type { ConnectorHandle } from "./connector.js"; import type { Filter } from "./filter.js"; import type { ModelHandle } from "./model.js"; export type CapacityColor = RevenueOrganizationTypes.CapacityColor; export type AllocationExpirationPolicy = RevenueOrganizationTypes.AllocationExpirationPolicy; export type CapacitySpec = { name?: string; /** Icon colour. Defaults to "grey". */ color?: CapacityColor; description?: string; /** The data model this capacity allocates over — a model handle or `modelRef`. */ model?: ModelHandle | ModelRef; /** Column identifying each record (its stable id). */ idColumnSlug?: string; /** Column the allocation is timed against. */ timeColumnSlug?: string; /** Max concurrent allocations per member. */ memberCapacity?: number; /** When an allocation expires and returns to the pool. */ allocationExpirationPolicy?: AllocationExpirationPolicy; /** Which records are eligible. */ filter?: Filter; }; export type CapacityHandle = { readonly slug: string; readonly uuid: Token; readonly resource: "capacity"; }; /** * The `{{member.ids.}}` expression for a capacity filter — * resolved by the backend at allocation time to the members' user ids in that * connector. Use it as the `values` of a `kind: "string"`, `operator: "is"` * condition on the column holding each record's owner id. Pass a connector * handle, or a raw workspace connector slug for a connector not defined in * code (e.g. an adopted OAuth connector whose actual slug differs from the * CDK slug). */ export declare function memberIds(connector: ConnectorHandle | string): string; export declare function defineCapacity(slug: string, spec: CapacitySpec): CapacityHandle; //# sourceMappingURL=capacity.d.ts.map