/** * Start, stop, and rotate the opt-in local coding-subscription API gateway. * @module dsh-coding-subscription-oauth/gateway */ import { type GatewayBackend } from "./gateway-backend.js"; import { type GatewayConfig } from "./gateway-config.js"; import { type GatewayGoRoute } from "./gateway-go-routing.js"; import type { OAuthProviderSession } from "./oauth-session.js"; import type { GrokBuildSession } from "./session.js"; export declare const GATEWAY_TOS_WARNING = "local API gateway is enabled; exposing a subscription as a local API can violate provider ToS and consumes your quota"; export interface StartGatewayOptions { getGoPreview?: () => GatewayGoRoute | null; resolveGoCredential?: (ref: string) => Promise; config?: Partial; dshHome?: string; backend?: GatewayBackend; grok?: GrokBuildSession; subscriptions?: readonly OAuthProviderSession[]; onError?: (error: unknown) => void; } export interface StartedGateway { close(): Promise; readonly bind: string; readonly port: number; } export interface GatewayPublicStatus { enabled: boolean; running: boolean; bind: string; port: number; model: string | null; keyConfigured: boolean; keyAvailable: boolean; keyHint: string; models: string[]; warning: string; opencodeGoEnabled: boolean; opencodeGoRoute?: GatewayGoRoute | null; opencodeGoPreview?: GatewayGoRoute | null; opencodeGoMigration?: "required" | "none"; } export interface GatewaySettingsPatch { enabled?: boolean; port?: number; opencodeGoEnabled?: boolean; opencodeGoRoute?: GatewayGoRoute | null; } export interface CodingOAuthGatewayController { applySettings(patch: GatewaySettingsPatch): Promise; status(): Promise; startIfEnabled(): Promise; setEnabled(enabled: boolean): Promise; setPort(port: number): Promise; setOpencodeGoEnabled(enabled: boolean): Promise; revealKey(): Promise<{ apiKey: string; keyHint: string; }>; rotateKey(): Promise<{ apiKey: string; keyHint: string; }>; stop(): Promise; } export declare function startCodingOAuthGateway(options: StartGatewayOptions): Promise; export declare function createCodingOAuthGatewayController(options: StartGatewayOptions): CodingOAuthGatewayController; //# sourceMappingURL=gateway.d.ts.map