/** * `llm` setup wizard section (E-CONFIG-AUTH-UNIFY E3 / T9420). * * Mirrors Hermes Agent's `setup.py` LLM block: * 1. Display the current credential pool snapshot (provider/label/source). * 2. Prompt for a provider id (or accept `--provider` non-interactively). * 3. Accept an API key via `--api-key` *or* via interactive prompt. * 4. Write the result to the credential pool — never to config. * * V2 additions (T9610): * - `isConfigured()` — returns `true` when pool has at least one entry (LLM-7). * - Bracketed paste sanitization on API key input (LLM-4). * - Pool-seeding consent prompt after key entry (LLM-5). * - Section description printed before prompts (GEN-6). * * Non-interactive contract: * - `options.nonInteractive === true` + `options.provider` + `options.apiKey` * → write key to pool; no prompts. * - Missing `--provider` or `--api-key` under `--non-interactive` → * section short-circuits silently (`changed: false`). * * @task T9420 * @task T9610 * @epic T9402 * @epic T9591 * @see docs/plans/E-CLEO-SETUP-V2.md §4.3 */ import type { OnboardingResult } from '@cleocode/contracts'; import { type FrontDoorLoginOptions, type OAuthTokenAcquirer } from '../../llm/onboarding/front-door.js'; import type { WizardSectionRunner } from '../wizard.js'; /** * Injectable dependencies for the `llm` wizard section. * * The OAuth path runs the inline onboarding engine ({@link runFrontDoorLogin}), * but the interactive browser / device-code dance lives in the CLI (so core * stays headless). The CLI surface (`cleo setup`) supplies an * {@link OAuthTokenAcquirer}; when absent (programmatic / Studio callers that * have not wired a browser), the OAuth path short-circuits with a pointer to * `cleo login` rather than printing a dead "deferred" message. * * @task T11727 */ export interface LlmSectionDeps { /** * Interactive OAuth token acquirer wired by the CLI. When provided, the * wizard OAuth path runs the full inline onboarding engine. */ oauthAcquirer?: OAuthTokenAcquirer; /** * Override for the front-door orchestrator (tests inject a stub so the OAuth * path is exercised without the real engine). Defaults to * {@link runFrontDoorLogin}. */ runFrontDoorLogin?: (provider: string, opts?: FrontDoorLoginOptions, acquireOAuth?: OAuthTokenAcquirer) => Promise; } /** * Build the `llm` section runner. * * Constructed via a factory so unit tests can swap `getCredentialPool` * / `addCredential` references via module mocking without touching the * production singleton. * * @returns A {@link WizardSectionRunner} for the LLM section. * @task T9420 * @task T9610 */ export declare function createLlmSection(deps?: LlmSectionDeps): WizardSectionRunner; //# sourceMappingURL=llm.d.ts.map