export interface EdenTokenPayload { sub: string; username: string; tenant_id?: string; workspace_id?: string; project_id?: string; role: 'admin' | 'user' | 'agent'; iat: number; exp: number; } export interface Tenant { id: string; name: string; slug: string; created_at: string; } export interface Workspace { id: string; tenant_id: string; name: string; slug: string; created_at: string; } /** * Create a JWT token with tenant/workspace context. */ export declare function createToken(userId: string, username: string, opts?: { tenantId?: string; workspaceId?: string; projectId?: string; role?: string; expiresIn?: string; }): Promise; /** * Verify a JWT token and return the payload. */ export declare function verifyToken(token: string): Promise; /** * Get or create default tenant/workspace for local CLI usage. */ export declare function getDefaultWorkspace(): Promise<{ tenantId: string; workspaceId: string; }>; /** * Resolve workspace from a project directory (reads .eden/config.json). */ export declare function resolveWorkspaceFromCwd(cwd: string): Promise<{ tenantId: string; workspaceId: string; projectId?: string; }>; /** scrypt hash: `salt:derivedHex` — legacy sha256 hex still accepted */ export declare function hashPassword(password: string): Promise; export declare function verifyPassword(password: string, stored: string): Promise; export declare class AuthManager { private invalidatedTokens; validateToken(token: string): Promise<{ valid: boolean; user?: any; }>; register(username: string, password: string): Promise<{ success: boolean; error?: string; }>; login(username: string, password: string): Promise<{ success: boolean; token?: string; error?: string; }>; logout(token: string): Promise; hasUsers(): Promise; } export declare const authManager: AuthManager; //# sourceMappingURL=auth-jwt.d.ts.map