@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
25 lines • 1.94 kB
TypeScript
import type { Api, Model } from "@earendil-works/pi-ai";
import type { ActiveFallbackState, RetryFallbackControllerDeps } from "./controller-types.ts";
import type { UnusableEntries } from "./unusable.ts";
type RecoveryDeps = Pick<RetryFallbackControllerDeps, "recoveryRevision" | "cooldowns" | "circuits" | "logger">;
/**
* A billing pin assumes the original's account cannot recover by retrying it. A sign-in changes
* that account, so when the original provider's login id moved since the episode began, the
* billing pin and the original's cooldown, unusable mark and circuit are released and the
* existing revert path tries it once. A still-dead original falls back again and pins with the
* fresh id. This step reads the store at a turn boundary only while a billing pin holds; the
* other read is `applyCandidate` (controller.ts), once when an episode begins at its first
* fallback switch, to record the starting id. A token refresh keeps the id or drops it to "", and
* an id that is gone ("") is no sign-in, so neither releases. Refusal pins hold: a new credential
* does not change the context that was refused (senpi#4099).
*/
export declare function releaseOnCredentialChange(state: ActiveFallbackState, original: Model<Api>, deps: RecoveryDeps, unusable: UnusableEntries): Promise<void>;
/**
* A billing pin a usage limit caused holds only until the reset that limit stated: the account serves again
* then, so the pin and the original's cooldown, unusable mark and circuit are released and the existing
* revert path tries it once, with no re-login (senpi#4085). A pin with no stated reset (an empty credit
* balance) still holds until a sign-in. A still-spent original falls back and pins again.
*/
export declare function releaseOnLimitReset(state: ActiveFallbackState, original: Model<Api>, deps: RecoveryDeps, unusable: UnusableEntries): void;
export {};
//# sourceMappingURL=credential-recovery.d.ts.map