import type { ManagedOrganizationMembership, Workspace } from "../types.js"; export type ManagedSelfContextIdentity = { credentialGeneration: number; managedUserId: string; subjectId: string; }; export type ManagedSelfContext = { identity: ManagedSelfContextIdentity; memberships: ManagedOrganizationMembership[]; }; export declare function managedSelfContextIdentity(input: { credentialGeneration: number; managedUserId: string; }): ManagedSelfContextIdentity; export declare function sameManagedSelfContextIdentity(left: ManagedSelfContextIdentity | null, right: ManagedSelfContextIdentity): boolean; /** * Additional organization creation is available only after the exact current * managed identity is verified and its server-issued membership projection * proves that initial onboarding has completed. */ export declare function canCreateAdditionalOrganization(input: { managedUserId: string | null; emailVerified: boolean; selfContext: ManagedSelfContext | null; }): boolean; /** * Resolve managed-human membership facts only for the credential/principal * identity that started the request. A late response from a replaced cookie * session is discarded instead of becoming the next principal's UI truth. */ export declare function loadCurrentManagedSelfContext(input: { identity: ManagedSelfContextIdentity; currentIdentity: () => ManagedSelfContextIdentity | null; request: () => Promise<{ memberships: ManagedOrganizationMembership[]; }>; }): Promise; /** * Personal-workspace identity is a server-issued tuple. Never infer it from a * workspace name, default selection, permissions, creator, or account role. */ export declare function personalWorkspaceMembership(workspace: Pick | null, selfContext: ManagedSelfContext | null): ManagedOrganizationMembership | null; export declare function isPersonalWorkspace(workspace: Pick | null, _selfContext: ManagedSelfContext | null): boolean;