@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
28 lines • 1.75 kB
TypeScript
import { type AssistantMessageEvent } from "@earendil-works/pi-ai";
import type { SlotHasher } from "@earendil-works/pi-ai/auth/pool/select";
import { type RotationSlot, type RotationSources } from "./rotation-slots.ts";
export { listRotationSlots, type RotationLane, type RotationSlot, type RotationSources } from "./rotation-slots.ts";
/** The exact hash the claude-sdk-oauth affinity oracle uses, so pools never remap. */
export declare const sha256SlotHasher: SlotHasher;
export type CredentialRotationOptions = {
sources: RotationSources;
/** Stable session key keeps a session on its slot; absent, each request distributes. */
affinityKey?: string;
/** The requested model: a limit naming its family blocks only that family on the slot (senpi#2555). */
modelId?: string;
hasher?: SlotHasher;
runAttempt: (slot: RotationSlot) => AsyncIterable<AssistantMessageEvent> | Promise<AsyncIterable<AssistantMessageEvent>>;
};
/**
* In-lane credential rotation for one provider request. Selection follows the
* configured strategy for the affinity key. Rotation and same-slot retry stay transparent
* while only announcement frames have reached the caller; the first delta bars
* them, and a failure after it is forwarded as the provider's own terminal
* event for the session layer to recover from.
*
* Account listings read this health, so a block, or a success that lifts one,
* publishes an account change once its write has committed, whether or not
* another account takes over. A write the busy store skipped publishes nothing.
*/
export declare function streamWithCredentialRotation(options: CredentialRotationOptions): AsyncGenerator<AssistantMessageEvent>;
//# sourceMappingURL=rotation-stream.d.ts.map