export type McpSignInEvidence = 'needs_auth_cache' | 'tools_removed' | 'auth_tool' | 'auth_error_result'; export interface McpSignInFields { mcpSignInNeeded?: true; mcpSignInEvidence?: McpSignInEvidence; } /** The cache holds a few entries; anything larger is not read. */ export declare const CACHE_MAX_BYTES: number; /** Claude Code 2.1.310 default for a non-plugin HTTP server (`an=900000`). */ export declare const CLAUDE_AUTH_TTL_MS: number; export declare function claudeConfigDir(env?: Record, home?: string): string; export interface NeedsAuthEntry { timestamp: number; ttlMs?: number; } /** The `mnemonik` entry of Claude Code's needs-auth cache, or null. Never throws. */ export declare function readNeedsAuthEntry(configDir: string): NeedsAuthEntry | null; /** * Is the entry Claude Code's current view? Inside its own window Claude Code * skips the server as needing a sign-in. After that it dials again at its next * start and either deletes the entry or rewrites it with a new timestamp, so * an entry written since this session started is still current (a running * session does not dial on its own), while an older one is left over from * before and says nothing about now. */ export declare function isNeedsAuthEntryCurrent(entry: NeedsAuthEntry, now: number, sessionStartedAt?: number): boolean; /** Did a Mnemonik tool call fail with Claude Code's sign-in error for the server? */ export declare function signInEvidenceFromFailure(toolName: unknown, error: unknown): boolean; /** Is this one of the sign-in stub tools Claude Code offers for `mnemonik`? */ export declare function isMnemonikAuthTool(toolName: unknown): boolean; /** A Mnemonik tool whose success shows the sign-in works (or was just completed). */ export declare function isMnemonikSuccessTool(toolName: unknown): boolean; /** Remember when this session started (the earliest SessionStart wins). */ export declare function noteSessionStart(stateFile: string, now?: number): void; export declare function recordPendingSignIn(stateFile: string, evidence: 'auth_tool' | 'auth_error_result', now?: number): void; /** A successful Mnemonik call: earlier sign-in evidence no longer holds. */ export declare function clearPendingSignIn(stateFile: string): void; export interface SignInFieldsResult { fields: McpSignInFields; /** Call once the server has answered: drops the pending evidence just sent. */ sent: () => void; } /** * The sign-in fields for this /hooks/injections request. Reads the needs-auth * cache only on SessionStart and UserPromptSubmit; pending evidence rides any * event. Never throws. */ export declare function mcpSignInFields(args: { event: string; configDir: string; stateFile: string | null; now?: number; sessionStartedAt?: number; }): SignInFieldsResult;