/** * Non-blocking credential state management for better-email-mcp. * * State machine: awaiting_setup -> setup_in_progress -> configured * Reset: configured -> awaiting_setup (via explicit reset) * * Setup flows: * - stdio mode (default): credentials come from env vars * (EMAIL_PROVIDER + EMAIL_USER + EMAIL_APP_PASSWORD), validated up-front in * `init-server.ts`. No relay form spawn. * - http mode (opt-in): credentials are entered into mcp-core's shared * card-group credential form served by `transports/http.ts`. The HTTP * transport runs `runLocalServer` directly — there is no separate * "trigger relay setup" path anymore (deleted 2026-05-01 per spec * 2026-05-01-stdio-pure-http-multiuser.md §5.2.1). * * Key constraint: MCP `initialize` must respond within 1 second. * `resolveCredentialState()` is synchronous-fast (<10ms) -- it only reads env * vars and the encrypted config file on disk. */ export type CredentialState = 'awaiting_setup' | 'setup_in_progress' | 'configured'; export declare function setMarkSetupComplete(fn: ((key?: string) => void) | null): void; export declare function getMarkSetupComplete(): ((key?: string) => void) | null; export declare function getState(): CredentialState; export declare function getSetupUrl(): string | null; export declare function setSetupUrl(url: string | null): void; /** * Fast credential check. Called during server startup. * * Resolution order: * 1. ENV VARS -- EMAIL_CREDENTIALS already set * 2. CONFIG FILE -- encrypted config from previous relay setup * 3. SAVED OAUTH TOKENS -- Outlook tokens from previous session * 4. NOTHING -- state = awaiting_setup (server starts; HTTP form serves /authorize) * * Returns new state. Takes <10ms (no network I/O). */ export declare function resolveCredentialState(): Promise; /** For testing and setup tool actions. */ export declare function setState(newState: CredentialState): void; /** Reset to awaiting_setup (used by setup reset action). */ export declare function resetState(): Promise; //# sourceMappingURL=credential-state.d.ts.map