UNPKG

@phren/cli

Version:

Knowledge layer for AI agents - CLI, MCP server, and data layer

28 lines (27 loc) • 1.23 kB
import { type ClaudeHome } from "./claude-accounts.js"; import { type AccountRole } from "./account-pools.js"; export type LoginKind = "console" | "subscription"; export interface KnownLogin { kind: LoginKind; fingerprint: string; } export interface KnownSettings { pool?: string; role?: AccountRole; } export interface KnownPolicy { settings: Record<string, KnownSettings>; allowedPools?: string[]; } export interface LastKnown { logins?: Record<string, KnownLogin>; policy?: KnownPolicy; } /** The last-known logins and policy, or empty when there is no readable file. */ export declare function readLastKnown(): Promise<LastKnown>; /** A home's last-known login type: only when it belongs to the current login, or the config names none. */ export declare function knownLogin(last: LastKnown, home: ClaudeHome): LoginKind | undefined; /** Remembers a home's login type once Claude answered for the fingerprint seen before the probe. */ export declare function rememberLogin(home: ClaudeHome, seenFingerprint: string | undefined, kind: LoginKind): Promise<void>; /** Remembers the last accounts.yaml policy that parsed. */ export declare function rememberPolicy(policy: KnownPolicy): Promise<void>;