@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
29 lines • 1.44 kB
TypeScript
export type AuthStoreLoadErrorKind = "malformed_json" | "invalid_format" | "unreadable" | "write_back_failed";
/**
* Why an existing auth.json could not be loaded (senpi#4413). `reason` is safe to show and send to
* clients: it never carries the file's path or contents.
*/
export interface AuthStoreLoadError {
readonly kind: AuthStoreLoadErrorKind;
readonly reason: string;
}
export declare class AuthStoreUnreadableError extends Error {
readonly loadError: AuthStoreLoadError;
constructor(loadError: AuthStoreLoadError);
}
/** The top-level object of an auth.json document; anything else is refused rather than read as empty. */
export declare function parseAuthDocument(content: string): Record<string, unknown>;
/**
* The load error a failed store read stands for, or undefined when the failure says nothing about
* the file: a lock held by another writer, a read the caller aborted, or a lock lost after a clean read.
*/
export declare function describeAuthStoreLoadFailure(error: unknown): AuthStoreLoadError | undefined;
/**
* The error a store load surfaces: once auth.json parsed, a later failure (a write-back or a lost lock)
* becomes an AuthStoreAfterReadError so it is never reported as an unreadable file. Aborts pass through.
*/
export declare function failureAfterRead(error: unknown, load: {
parsed: boolean;
writeBack: boolean;
}): unknown;
//# sourceMappingURL=auth-store-load-error.d.ts.map