/**
 * Workspace entity and store for multi-tenant team-workspace support.
 *
 * Each Workspace maps to a billable tenant (design-partner, team, or
 * enterprise tier). WorkspaceMembers hold the per-user role assignment
 * inside a workspace.
 *
 * All mutations emit to the tamper-evident audit chain.
 * In-memory store -- Prisma migration flagged at bottom of file.
 *
 * @connexum/ai-governance tenant substrate
 */
export type BillingTier = 'design-partner' | 'team' | 'enterprise';
export type MemberInviteMode = 'email' | 'sso' | 'manual';
export interface WorkspaceSettings {
    /** Default reviewer tier used when creating review requests. */
    defaultReviewerTier: string;
    /** How new members may be invited. */
    memberInviteMode: MemberInviteMode;
    /** Whether MFA is required for all workspace members. */
    requireMfa: boolean;
    /** Session TTL in milliseconds (e.g. 3600000 = 1 hour). */
    sessionTtlMs: number;
    /**
     * COMP-R6 white-label branding reference.
     * The full TenantBranding record lives in TenantBrandingStore.
     * This field holds a reference (tenantId) so routes can look it up.
     */
    brandingTenantId?: string;
}
export interface Workspace {
    workspaceId: string;
    tenantId: string;
    name: string;
    createdBy: string;
    createdAt: string;
    billingTier: BillingTier;
    activePackIds: string[];
    ssoProviderId?: string;
    settings: WorkspaceSettings;
}
export type WorkspaceMemberStatus = 'active' | 'suspended' | 'pending';
export interface WorkspaceMember {
    workspaceId: string;
    userId: string;
    email: string;
    role: WorkspaceRole;
    joinedAt: string;
    invitedBy: string;
    status: WorkspaceMemberStatus;
}
/**
 * Workspace-scoped roles (distinct from the org-level Role enum in packages/auth).
 * These six roles are the canonical Team-tier RBAC surface.
 */
export type WorkspaceRole = 'owner' | 'compliance-officer' | 'security-admin' | 'reviewer' | 'developer' | 'billing-admin';
export interface AppendWorkspaceAuditFn {
    (workspaceId: string, entry: Record<string, unknown>): Promise<void>;
}
export declare class WorkspaceStore {
    private workspaces;
    private byTenant;
    private audit?;
    constructor(opts?: {
        appendAudit?: AppendWorkspaceAuditFn;
    });
    private emit;
    /** Create a new workspace. The caller automatically becomes owner. */
    create(params: Omit<Workspace, 'workspaceId' | 'createdAt'>): Promise<Workspace>;
    /** Retrieve a workspace by ID, or null if not found. */
    get(workspaceId: string): Workspace | null;
    /** Update mutable workspace fields. Emits audit event on any change. */
    update(workspaceId: string, updates: Partial<Pick<Workspace, 'name' | 'billingTier' | 'activePackIds' | 'ssoProviderId' | 'settings'>>, actor: string): Promise<Workspace>;
    /** Delete a workspace (owner only -- enforced at route layer). */
    delete(workspaceId: string, actor: string): Promise<void>;
    /** List all workspaces for a tenant. */
    listByTenant(tenantId: string): Workspace[];
    /** List all workspaces (for super-admin). */
    listAll(): Workspace[];
}
export declare class WorkspaceMemberStore {
    private members;
    private byWorkspace;
    private audit?;
    constructor(opts?: {
        appendAudit?: AppendWorkspaceAuditFn;
    });
    private key;
    private emit;
    /** Add or update a member record. */
    upsert(member: WorkspaceMember): Promise<WorkspaceMember>;
    /** Retrieve a single member. */
    get(workspaceId: string, userId: string): WorkspaceMember | null;
    /** List all members of a workspace. */
    listByWorkspace(workspaceId: string): WorkspaceMember[];
    /** Remove a member from a workspace. Emits audit event. */
    remove(workspaceId: string, userId: string, actor: string): Promise<void>;
    /** Update the role of an existing member. */
    setRole(workspaceId: string, userId: string, role: WorkspaceRole, actor: string): Promise<WorkspaceMember>;
    /** Suspend a member (status -> suspended). */
    suspend(workspaceId: string, userId: string, actor: string): Promise<WorkspaceMember>;
}
export declare function getWorkspaceStore(opts?: {
    appendAudit?: AppendWorkspaceAuditFn;
}): WorkspaceStore;
export declare function getWorkspaceMemberStore(opts?: {
    appendAudit?: AppendWorkspaceAuditFn;
}): WorkspaceMemberStore;
/** Test helper: reset both singletons. */
export declare function __resetWorkspaceStoresForTest(): void;
//# sourceMappingURL=workspace.d.ts.map