import { ClientId } from "./mcp-config-writers.js"; export interface ParsedConnectArgs { mode?: "dev" | "prod" | "reauth" | "reconnect"; url?: string; client: string; clientExplicit: boolean; scope: string; name?: string; token?: string; serviceToken?: string; ttlDays?: number; all: boolean; apps?: string; gateway?: string; port?: number; ownerEmail?: string; fullCatalog?: boolean; } export declare function parseConnectArgs(argv: string[]): ParsedConnectArgs; export declare function normalizeUrl(raw: string): string; export declare function resolveClients(client: string): ClientId[]; export declare function connectPreferencesPath(): string; export declare function readConnectClientPreferences(file?: string): ClientId[] | null; export declare function writeConnectClientPreferences(clients: ClientId[], file?: string): void; export interface ConnectClientPromptContext { initialClients: ClientId[]; options: { value: ClientId; label: string; hint: string; }[]; preferencesFile: string; } export interface HostedApp { name: string; label: string; url: string; } export interface ConnectHostedAppsPromptContext { apps: HostedApp[]; initialApps: string[]; } export declare function supportsRemoteMcpOAuth(client: ClientId): boolean; export interface ConnectDeps { fetchImpl?: typeof fetch; sleep?: (ms: number) => Promise; openBrowser?: (url: string) => void | Promise; withBrowserOpenSpinner?: (message: string, openBrowser: () => void | Promise) => void | Promise; now?: () => number; isInteractive?: () => boolean; promptClients?: (context: ConnectClientPromptContext) => Promise; promptHostedApps?: (context: ConnectHostedAppsPromptContext) => Promise; preferencesFile?: string; profilesFile?: string; logOut?: (message: string) => void; logErr?: (message: string) => void; } export declare function runDeviceFlow(baseUrl: string, appSlug: string, clientArg: string, deps?: ConnectDeps, options?: { fullCatalog?: boolean; purpose?: "agent" | "credential"; }): Promise<{ token?: string; mcpUrl: string; serverName: string; headers?: Record; } | null>; export declare function writeConfigs(clients: ClientId[], serverName: string, mcpUrl: string, token: string | undefined, scope: string, baseDir?: string, headers?: Record): { client: ClientId; file: string; }[]; export declare function connectProfilesPath(): string; export declare function hostedApps(): HostedApp[]; /** * `agent-native connect --service-token ` — mint an ORG service * token for CI (e.g. the PLAN_RECAP_TOKEN GitHub secret). * * Flow: authenticate the human via the existing browser device flow, then use * that short-lived grant to call the app's `create-org-service-token` action * (org owner/admin gated server-side). The service token is printed exactly * once and never written to any local config file. */ export declare function runServiceTokenMint(parsed: ParsedConnectArgs, deps?: ConnectDeps): Promise; export declare function runConnect(args: string[], deps?: ConnectDeps): Promise;