@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
26 lines • 1.29 kB
TypeScript
import { type AssistantMessage } from "@earendil-works/pi-ai";
/** How long a served response vouches for its credential (senpi#2491). */
export declare const CREDENTIAL_SERVED_WINDOW_MS: number;
export interface RequestCredential {
readonly provider: string;
readonly baseUrl: string | undefined;
readonly apiKey: string | undefined;
}
/**
* When each credential last served a response, keyed by a one-way hash of provider, endpoint and key so no
* key material is held. An `auth` failure on a credential that served within the window is marked on its
* message: a gateway refused that request while the key kept working for others (senpi#2491).
* Without an apiKey (headers, ADC or SigV4), identity reduces to provider + baseUrl.
*/
export declare class ServedCredentials {
private readonly servedAt;
private readonly now;
constructor(now?: () => number);
/**
* Reads the request's final message before any consumer does: the result promise settles them in order.
* Resolves once the observation is recorded; callers on the request path do not wait for it.
*/
observe(result: Promise<AssistantMessage | undefined>, credential: RequestCredential): Promise<void>;
private settle;
}
//# sourceMappingURL=served-credentials.d.ts.map