UNPKG

@code-yeongyu/senpi

Version:

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

32 lines • 1.54 kB
import type { ThinkingLevel } from "@earendil-works/pi-agent-core"; import { type Api, type Model } from "@earendil-works/pi-ai"; import { type FallbackSelector } from "./chains.ts"; export interface CandidateRegistry { find(provider: string, id: string): Model<Api> | undefined; getAll(): Model<Api>[]; } export interface CandidateFilters { registry: CandidateRegistry; tried: ReadonlySet<string>; isSuppressed(base: string): boolean; isAuthAvailable(provider: string): boolean; isCircuitOpen(base: string): boolean; /** A model whose every rung is out for this walk (a network blip on it, senpi#3344). */ isModelSkipped?(base: string): boolean; /** Providers whose account-wide usage limit or billing failure this session saw: their entries are skipped. */ isProviderSpent?(provider: string): boolean; /** Provider-wide conservative skip after a request refusal; credentials are unavailable at this scan (senpi#2491). */ isProviderRefused?(provider: string): boolean; skip(candidate: string, skipReason: string): void; } export interface UsableCandidate { selector: FallbackSelector; model: Model<Api>; /** True only when every usable entry is circuit-open: the chain then probes instead of refusing. */ circuitOpen: boolean; } export declare function firstUsableCandidate(entries: readonly string[], current: { model: Model<Api>; thinkingLevel?: ThinkingLevel; }, filters: CandidateFilters): UsableCandidate | undefined; //# sourceMappingURL=candidates.d.ts.map