cavi-ai/
GitHub ↗

@cavi-ai/api-client/core/teams

Package subpath: ./core/teams

createTeamDirectory#

Kind: function

ts
export declare function createTeamDirectory(teams: readonly Team[]): TeamDirectory;

getTeamLookupKeys#

Kind: function

ts
export declare function getTeamLookupKeys(team: Team): string[];

manifestTeamToTeam#

Kind: function

ts
/** Project a manifest team onto the provider-agnostic core `Team`. */
export declare function manifestTeamToTeam(team: ManifestTeam): Team;

matchesTeamIdentifier#

Kind: function

ts
export declare function matchesTeamIdentifier(team: Team, identifier: string | null | undefined): boolean;

normalizeTeamLookupValue#

Kind: function

ts
/** Canonical identifier normalization. Verbatim copy of the CAVI registry rule. */
export declare function normalizeTeamLookupValue(value: string): string;

resolveTeamFromCollection#

Kind: function

ts
export declare function resolveTeamFromCollection(teams: readonly Team[], identifier: string | null | undefined): Team | null;

Team#

Kind: type

ts
/**
 * Provider-agnostic team. A normalized projection of a manifest team that
 * excludes host/domain-specific fields (portal/sector/dispatch/library). Those
 * ride opaquely in `metadata`; core never reads them.
 */
export type Team = {
    id: string;
    identity: TeamIdentity;
    members: TeamMember[];
    capabilities: string[];
    metadata?: Record<string, unknown>;
};

TeamDirectory#

Kind: interface

ts
/** Provider-agnostic team directory. Pure resolution over a fixed team set. */
export interface TeamDirectory {
    listTeams(): Team[];
    listMembers(teamId: string): TeamMember[];
    resolveTeam(identifier: string | null | undefined): Team | null;
    requireTeam(identifier: string | null | undefined): Team;
    resolveMember(teamId: string, memberIdentifier: string | null | undefined): TeamMember | null;
    getLookupKeys(team: Team): string[];
}

teamDirectoryFromManifest#

Kind: function

ts
/** Build a resolution-only `TeamDirectory` from a resolved team manifest. */
export declare function teamDirectoryFromManifest(manifest: TeamManifest): TeamDirectory;

TeamIdentity#

Kind: type

ts
/** Provider-agnostic team identity — the native tokens, preserved verbatim. */
export type TeamIdentity = {
    name: string;
    displayName: string;
    slug: string;
    code: string;
    aliases: string[];
};

TeamMember#

Kind: type

ts
export type TeamMember = {
    id: string;
    identity: TeamIdentity;
    capabilities: string[];
};