/** * Non-blocking credential state management for better-notion-mcp. * * State machine: awaiting_setup -> configured * Reset: configured -> awaiting_setup (via reset) * * Post stdio-pure + http-multi-user split (2026-05-01): the daemon-bridge * relay setup spawn is gone. In stdio mode the server fails fast with a * clear stderr message when NOTION_TOKEN is missing (see main.ts). In HTTP * mode the OAuth 2.1 AS in mcp-core serves the credential form directly at * /authorize on the same port as /mcp -- no separate spawn, no random port. * * This module is the single source of truth for "is the server configured?" * It supports two token resolution strategies: * - stdio / single-user: module-global ``_notionToken`` from env or * config.enc, set during ``resolveCredentialState``. * - HTTP / multi-user (remote-oauth): per-JWT-sub resolver injected by the * HTTP transport so ``config(action=status)`` reflects whether the * CURRENT caller has a Notion access token. */ export type CredentialState = 'awaiting_setup' | 'configured'; export declare function getState(): CredentialState; export declare function getNotionToken(): string | null; export declare function setSubjectTokenResolver(fn: () => string | null): void; export declare function getSubjectToken(): string | null; /** * Fast, synchronous-ish credential check. Called during startup. * * Checks (in order): * 1. ENV VARS -- NOTION_TOKEN present -> configured * 2. CONFIG FILE -- saved relay config has token -> configured * 3. NOTHING -- awaiting_setup * * Returns new state. Takes <50ms (single file read). */ export declare function resolveCredentialState(): Promise; export declare function setState(state: CredentialState): void; export declare function resetState(): void; //# sourceMappingURL=credential-state.d.ts.map