@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
44 lines • 2.88 kB
TypeScript
import { type AccountSlot } from "./accounts.ts";
import { type AuthenticatedAttemptInput, type RetainableAttempt } from "./auth-attempt.ts";
import type { AnthropicSubscriptionAuthLane } from "./options.ts";
import type { Options, SDKMessage, SdkQuery } from "./sdk-boundary.ts";
import type { AnthropicSubscriptionProviderSettings, AnthropicSubscriptionTokenInjection } from "./settings.ts";
export { ANTHROPIC_SUBSCRIPTION_PROVIDER_ID } from "./account-management.ts";
export { overrideAuthLaneBoundary, resetAuthLaneBoundary } from "./auth-lane-boundary.ts";
export type { AuthenticatedAttemptInput } from "./auth-attempt.ts";
export type AuthenticatedQueryInput = {
prompt: Parameters<SdkQuery>[0]["prompt"];
query: SdkQuery;
buildOptions: (lane: AnthropicSubscriptionAuthLane) => Options;
providerSettings: AnthropicSubscriptionProviderSettings;
/** Effective request auth environment; overrides the host for account discovery and SDK spawn. */
env?: Record<string, string>;
signal?: AbortSignal;
sessionId?: string;
/** The requested model id: a usage limit on one model family blocks only that family (senpi#2555). */
model?: string;
/** Request-scoped CLI pin; takes precedence over persistent settings and account pins. */
pinnedAccount?: string;
/**
* A connection test of `pinnedAccount` alone (senpi#4436): no auth-block recovery across the pool, the account
* is tried even while blocked, and no block is stored or cleared. Requires `pinnedAccount`.
*/
probe?: boolean;
/** Accounts already attempted on this person's turn; absent on automated and auxiliary requests. */
recheckedAccounts?: Set<string>;
/** The account this session's SDK transcript lives under; preferred while it can serve (senpi#2891). */
preferredAccount?: string;
onQuery?: (query: ReturnType<SdkQuery>) => void;
/** Called once when a refused [1m] request is retried at the 200k window, so the turn can say so. */
onLongContextFallback?: () => void;
/** Full request context estimate, including a resident session's already billed prefix. */
contextTokens?: () => number;
/** Explicit response cap for the 200k retry; otherwise it uses the fallback default. */
outputReserveTokens?: number;
onAttemptStart?: () => void;
createAttempt?: (input: AuthenticatedAttemptInput) => RetainableAttempt<SDKMessage> | Promise<RetainableAttempt<SDKMessage>>;
};
export declare function resolveEffectiveLane(settings: AnthropicSubscriptionProviderSettings, accounts: readonly AccountSlot[]): AnthropicSubscriptionTokenInjection;
/** Resolves managed OAuth immediately before each subprocess spawn and retries only pre-delta failures. */
export declare function queryWithAuthLane(input: AuthenticatedQueryInput): AsyncGenerator<SDKMessage>;
//# sourceMappingURL=auth-lane.d.ts.map