UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

33 lines • 1.9 kB
import type { SDKMessage } from "./sdk-boundary.ts"; export type SdkErrorKind = "rate_limit" | "overloaded" | "auth_error" /** Claude Code found no login it could read in the account's dir (senpi#5630); says nothing about the account. */ | "login_unreadable" | "billing" | "org_not_allowed" | "entitlement" | "long_context_unavailable" | "other"; export type SdkErrorClassification = { kind: SdkErrorKind; retryable: boolean; /** Set on a rate limit that binds one model family ("Fable limit"), so only that family is blocked. */ modelFamily?: string; /** Set on an auth failure that proves the login itself is gone, so the account needs a new sign-in (senpi#5350). */ signInRequired?: "login_expired"; }; export declare function errorText(error: unknown): string; export declare function isExtraUsageExhausted(error: unknown): boolean; export type SdkResultUsage = Extract<SDKMessage, { type: "result"; }>["usage"]; /** A failed SDK result keeps the usage it billed so every lane can account for it. */ export declare class SdkResultFailure extends Error { readonly usage: SdkResultUsage | undefined; constructor(message: string, usage: SdkResultUsage | undefined); } /** The usage carried by a failed SDK result, looking through failover's classification wrapper. */ export declare function sdkResultFailureUsage(error: unknown): SdkResultUsage | undefined; export declare function sdkResultFailure(message: Extract<SDKMessage, { type: "result"; }>): SdkResultFailure | undefined; export declare function sdkAssistantFailure(message: Extract<SDKMessage, { type: "assistant"; }>): Error | undefined; /** Classifies Anthropic Subscription error codes and HTTP-shaped fallback text in one place. */ export declare function classifySdkError(error: unknown, askedLegacyLongContext?: boolean): SdkErrorClassification; //# sourceMappingURL=errors.d.ts.map