import { A as AssignableWorkspaceRole } from './roles-BC1n4t37.js';

/**
 * Pure invitation helpers + email-template renderer for the teams capability.
 * Zero dependencies: no drizzle, no env, no react, no network. The lifecycle API
 * (`./invitations-api`) and an app's own mail transport build on these; this leaf
 * imports nothing back, so a consumer can pull just the token/expiry math or the
 * template renderer without dragging in drizzle or a mail client.
 *
 * `renderInvitationEmail` is deliberately transport-free: it returns the
 * `{ from, subject, html, text }` an app hands to its own Resend/SES/etc. The
 * secret (API key) and the network call stay in the app's seam — agent-app ships
 * only the deterministic template.
 */

/** The role an invitation grants — the assignable workspace ladder (never owner). */
type InvitationPermission = AssignableWorkspaceRole;
type InvitationStatus = 'pending' | 'accepted' | 'expired' | 'revoked';
type InvitationEmailStatus = 'not_sent' | 'sent' | 'failed';
declare const INVITATION_EXPIRY_DAYS = 7;
declare function normalizeInvitationEmail(email: string): string;
declare function parseInvitationPermission(value: string | undefined): InvitationPermission | null;
declare function getInvitationExpiresAt(now?: Date): Date;
/**
 * A cryptographically-random, URL-safe invitation token. `inv_`-prefixed so a
 * token is self-identifying and never collides with the workspaceMember invite
 * tokens minted by `members-api` (`generateInviteToken`).
 */
declare function generateInvitationToken(): string;
declare function inviteUrlForToken(origin: string, token: string): string;
interface RenderInvitationEmailInput {
    to: string;
    workspaceName: string;
    inviterEmail: string;
    permission: string;
    inviteUrl: string;
    expiresAt: Date;
}
interface InvitationEmailBrand {
    /** RFC-5322 From header, e.g. `GTM Agent <noreply@gtm.tangle.tools>`. */
    fromAddress: string;
}
interface RenderedInvitationEmail {
    from: string;
    subject: string;
    html: string;
    text: string;
}
/**
 * Render the invitation email body — pure, deterministic, transport-free. The
 * caller passes the result to its own mail client; this never reads a secret or
 * touches the network.
 */
declare function renderInvitationEmail(input: RenderInvitationEmailInput, brand: InvitationEmailBrand): RenderedInvitationEmail;

export { INVITATION_EXPIRY_DAYS as I, type RenderInvitationEmailInput as R, type InvitationEmailBrand as a, type InvitationEmailStatus as b, type InvitationPermission as c, type InvitationStatus as d, type RenderedInvitationEmail as e, getInvitationExpiresAt as f, generateInvitationToken as g, inviteUrlForToken as i, normalizeInvitationEmail as n, parseInvitationPermission as p, renderInvitationEmail as r };
