@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
30 lines • 1.62 kB
TypeScript
import type { CredentialStore } from "@earendil-works/pi-ai";
import type { AccountSlot, ClaudeCliAccountSlot } from "./accounts.ts";
import type { ClaudeCliAuthStatus } from "./claude-cli-auth-status.ts";
export type AuthBlockRecoveryInput = {
readonly store: CredentialStore;
readonly providerId: string;
readonly accounts: readonly AccountSlot[];
readonly signal: AbortSignal;
readonly reload: () => Promise<AccountSlot[]>;
/** Whether an account can serve this request now. */
readonly isUsable: (account: AccountSlot) => boolean;
readonly now: number;
/**
* The request error for a re-probe that could not finish (the CLI failed to answer, a busy store): the slot
* stays blocked and the next request tries it again.
*/
readonly transientError: (error: unknown) => Error;
/**
* What `claude auth status` reports for a `claude-cli` account (senpi#4436). Such an account holds no grant to
* redeem: at its re-probe time `signed_in` clears the block, only `signed_out` marks the login expired
* (senpi#5350), and anything else keeps the timed block.
*/
readonly claudeCliStatus?: (slot: ClaudeCliAccountSlot) => Promise<ClaudeCliAuthStatus["state"]>;
};
/**
* Re-probes before a turn: a claude CLI account whose auth block is due for its re-probe (senpi#3264) asks
* `claude auth status`; a login clears the block and a confirmed sign-out marks the login expired (senpi#5350).
*/
export declare function recoverAuthBlockedSlots(input: AuthBlockRecoveryInput): Promise<AccountSlot[]>;
//# sourceMappingURL=auth-block-recovery.d.ts.map