import { Config } from '@backstage/config'; import { TeamInfo, TeamMemberUsage, UsageMetrics, VirtualKey } from './types'; /** `litellm.teamUsage.memberBreakdown`: who may see a team's per-member usage. */ export interface MemberBreakdownConfig { /** Off by default: the route returns 404 and the UI hides the table. */ enabled: boolean; /** LiteLLM team roles (e.g. "admin") whose holders may view their own team's breakdown. */ viewerRoles: string[]; /** Whether `litellm.team.usage.read` may grant access (needs `permission.enabled`). */ permissionEnabled: boolean; } export declare function readMemberBreakdownConfig(config: Config): MemberBreakdownConfig; /** Catalog profile of a member, keyed by lower-cased email. */ export type MemberProfiles = Map; /** * Emails worth looking up in the catalog for the members of a breakdown: * the team roster's emails and email-shaped user ids. */ export declare function memberEmails(team: TeamInfo, keys: VirtualKey[]): string[]; /** * Attributes a team's usage to its members. Each key in the team's daily * activity is credited to the key's owner (from `/key/list?team_id=`), so the * rows add up to the team total. Activity of keys with no known owner * (deleted keys, keys without a user) lands in one `user_id: null` row. * Team members without activity get zero rows. */ export declare function buildTeamMemberUsage(teamId: string, usage: UsageMetrics, keys: VirtualKey[], team: TeamInfo, profiles?: MemberProfiles): TeamMemberUsage; /** * Hides dollar amounts: spend becomes 0 and `spend_share_pct` remains the * way to compare members. Tokens and requests are kept. */ export declare function redactTeamMemberUsage(usage: TeamMemberUsage): TeamMemberUsage;