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; /** * Personal workspaces the person's organization turned off. They still exist, * anchor the person's own machines, browsers and vaults, and keep their * existing chats reachable by link, but nobody browses to or lands in them. */ export declare function hiddenPersonalWorkspaceIds(selfContext: ManagedSelfContext | null): ReadonlySet; /** * The workspaces to offer in pickers and landing: every workspace except a * hidden Personal one, unless it is the workspace the person is already in. */ export declare function navigableWorkspaces>(workspaces: readonly T[], selfContext: ManagedSelfContext | null, currentWorkspaceId?: string | null): T[];