@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
28 lines • 1.84 kB
TypeScript
import type { AuthStorage } from "./auth-storage.ts";
import { type CredentialAccountBlockedReason } from "./credential-accounts.ts";
import type { CredentialSlotRepository } from "./credential-pool/state-store.ts";
/** What the account looks like after the attempt, not what one source did. */
export type UnblockOutcome = {
/** A block was actually cleared in at least one health source. */
readonly lifted: boolean;
/** Whether the account is still blocked once both sources are merged. */
readonly blocked: boolean;
/** Why it is still blocked, when the stored block names a reason. */
readonly blockedReason?: CredentialAccountBlockedReason;
};
/**
* Lifts the account-level usage or rate-limit block the user knows is gone (senpi#4600).
*
* What it clears, in both health sources (the pool sidecar and a block a provider lane stored on
* the account itself): a live timed block whose reason is not `auth_error` or `account_disabled`,
* together with the failure counter behind it. Model-scoped limits (senpi#2555), the slot's lease
* and its success history are left untouched, and an expired block or one left by a previous login
* is not rewritten. Each decision is retaken inside that source's own locked write, so a block
* another session records between the listing and the write is never erased, and a source with
* nothing to lift is not written at all.
*
* The outcome is the MERGED state after the attempt: clearing a usage block in one source while
* the other still holds an auth block leaves the account blocked, and the caller must say so.
*/
export declare function unblockPooledAccount(storage: AuthStorage, provider: string, name: string, env?: NodeJS.ProcessEnv, repository?: CredentialSlotRepository): Promise<UnblockOutcome>;
//# sourceMappingURL=credential-account-unblock.d.ts.map