@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
30 lines • 1.48 kB
TypeScript
import { type ClaudeCliRun } from "./claude-cli-process.ts";
/** The local-only profile a CLI-store account shows; never logged or sent to telemetry. */
export type ClaudeCliProfile = {
readonly email?: string;
readonly orgName?: string;
readonly subscriptionType?: string;
};
export type ClaudeCliAuthStatus = {
readonly state: "signed_in";
readonly profile: ClaudeCliProfile;
} | {
readonly state: "signed_out";
}
/** Logged in, but not as a first-party claude.ai subscription (an API key, Bedrock, Vertex...). */
| {
readonly state: "rejected";
readonly reason: "auth_method" | "api_provider";
} | {
readonly state: "unreadable";
};
/**
* Reads `claude auth status --json` (2.1.306: `{loggedIn, authMethod, apiProvider, email, orgName,
* subscriptionType, ...}`, exit 0 when logged in, 1 when not). Only a first-party claude.ai login with exit 0 is
* signed in; an exit code and a `loggedIn` that disagree are unreadable, never trusted.
*/
export declare function parseClaudeCliAuthStatus(stdout: string, exitCode: number | null): ClaudeCliAuthStatus;
export declare function readClaudeCliAuthStatus(run: ClaudeCliRun, timeoutMs?: number): Promise<ClaudeCliAuthStatus>;
/** `claude auth logout` for one account dir: deletes that dir's credential store entry. */
export declare function logoutClaudeCli(run: ClaudeCliRun, timeoutMs?: number, signal?: AbortSignal): Promise<boolean>;
//# sourceMappingURL=claude-cli-auth-status.d.ts.map