UNPKG

@code-yeongyu/senpi

Version:

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

27 lines • 1.85 kB
import { type AssistantMessage } from "@earendil-works/pi-ai"; import type { SessionEntry } from "../session-manager.ts"; /** * Who a usage limit binds. `model`: the provider refused THIS model only (a * Fable-only weekly cap, premium models on a Copilot plan, a model that needs * usage credits), so its siblings on the same account still serve. `account`: * the credential itself is spent (a session or weekly cap, a monthly quota, an * empty balance), so every other model on that provider fails the same way and * the chain moves to another provider instead. */ export type UsageLimitScope = "model" | "account"; export declare class AccountUsageLimitError extends Error { /** * `families`: a no-family weekly limit confirmed on these families before it held the provider (senpi#5596). * `accountsOut`: a pooled provider's accounts, each with why it cannot serve (senpi#5590). */ constructor(provider: string, raw?: string, resetsAt?: number, families?: readonly string[], accountsOut?: string); } export declare function formatResetTime(epochMs: number): string; export declare function usageLimitScope(failure: string | undefined | Pick<AssistantMessage, "errorMessage" | "errorCause">): UsageLimitScope | undefined; /** Project advice without mutating the diagnostic-bearing engine message. */ export declare function describeUsageLimitMessage(message: AssistantMessage): AssistantMessage; /** Project an assistant entry without mutating its persisted identity or payload. */ export declare function describeUsageLimitEntry(entry: SessionEntry): SessionEntry; /** The notice clause naming what hit the limit, or undefined when no usage limit caused the switch. */ export declare function usageLimitCause(from: string, limit: UsageLimitScope | undefined): string | undefined; //# sourceMappingURL=usage-limit.d.ts.map