import type { Readable, Writable } from "node:stream"; import type { Credential } from "@earendil-works/pi-ai"; import type { ManagementClient } from "@nylorun/admin"; import { CliError } from "../../errors.js"; /** Exit 130 on SIGINT, 143 on SIGTERM. */ export declare class ConfigurationCancelled extends CliError { readonly signal: "SIGINT" | "SIGTERM"; constructor(signal: "SIGINT" | "SIGTERM"); } export type PromptedModel = { provider: string; model: string; baseUrl?: string; /** A custom endpoint's context window and output limit, when given. */ settings?: { contextWindow?: number; maxTokens?: number; }; auth: Credential; }; export type ModelCatalog = { providers: { id: string; name: string; models: { id: string; name: string; }[]; auth?: { apiKey?: unknown; oauth?: unknown; }; }[]; }; export type Selection = Readonly<{ provider: string; model: string; custom?: Readonly<{ baseUrl: string; }>; }>; /** The Tenant's model catalog (`GET /v1/tenant/models`, Management API). */ export declare function fetchModelCatalog(admin: ManagementClient): Promise; export declare function configureProvider(options?: { signal?: AbortSignal; root?: string; input?: Readable; output?: Writable; /** Management API catalog from GET /v1/tenant/models. */ catalog?: ModelCatalog; /** This installation's stable id, for OAuth flows that need one (OpenAI). */ deviceId?: () => string; }): Promise; /** * A stable id for this CLI installation, created on first use under the Host root. * OpenAI's "Sign in with ChatGPT" sends it as the agent host id. */ export declare function installationId(home?: string): string;