import type { ToolsManager } from '../tools/toolsManager.js'; import { AuthValidationResult } from '../types.js'; /** * Log an auth validation result to stderr at the severity its status carries. * Only the allow-listed fields are included, so credentials can never leak * through an auth result. */ export declare function logAuthValidationResult(result: AuthValidationResult): void; /** * Perform auto-authentication validation if environment is configured * * Environment variables: * - SN_INSTANCE_URL: ServiceNow instance URL (required for auto-auth) * - SN_AUTH_TYPE: Authentication type ('basic' or 'oauth', defaults to 'oauth'), * used in the command that adds a profile by hand * * Rules: * 1. If SN_INSTANCE_URL is not set -> return skipped status * 2. Read the stored auth profiles through the bundled SDK's credential API * (`AuthCommand`: structured JSON, never the human `auth --list` text). * The server only reads the profile store. * - If a profile's host matches SN_INSTANCE_URL and its alias has no control * characters -> store its alias in the session; every instance command * passes it per call (`--auth`), so the CLI's default profile is never switched * - If only control-character aliases match -> validation_error * 3. If no profile matches -> not_authenticated with the command that adds one * in a terminal. The server never adds a profile: `auth --add` makes it the * CLI default for every now-sdk run on the machine, and setting the previous * default back cannot be made safe. A failure after the write skips the * restore, and validations that overlap in separate server processes * restore the wrong default (W9 review). * * @returns AuthValidationResult with structured auth status, also stored in the session */ export declare function autoValidateAuthIfConfigured(toolsManager: ToolsManager): Promise; //# sourceMappingURL=fluentInstanceAuth.d.ts.map