import type { Principal } from '../types/principal.js'; /** * The tenant id rule every scope shares. An id is letters, digits, `_`, and `-`, so it can never hold * the `/` a scoped name or key is built with: no tenant's prefix is a prefix of another's. */ /** Refused when a tenant id is empty, too long, or holds a character a scoped key could be split on. */ export declare class TenantIdError extends RangeError { /** Always `TENANT_ID_INVALID`. */ readonly code = "TENANT_ID_INVALID"; constructor(tenantId: unknown); } /** Returns a tenant id unchanged, or throws `TenantIdError` when it is not one. */ export declare function assertTenantId(tenantId: string): string; /** @internal The prefix a tenant's names and keys carry in a shared store. */ export declare function tenantPrefix(tenantId: string): string; /** * Run options with the principal's tenant applied: the principal's `tenantId` becomes the run's when * it has none, a run whose two tenants differ is refused, and the principal's `userId` is recorded * in the run's metadata. */ export declare function withPrincipal; }>(runOptions: O): O;