/** * Resolving credentials, and the multi-publication model. * * Three sources, in priority order: * 1. SUBSTACK_PUBLICATIONS a JSON array, for several publications at once * 2. SUBSTACK_* the single-publication environment variables * 3. ~/.substack-mcp/session.json whatever `substack-mcp login` captured * * One Substack login often owns more than one publication. Every tool that * touches a specific publication takes an optional `publication` argument * matched loosely against the hostname, defaulting to the first configured one. */ export type Credentials = { publicationUrl: string; sessionToken: string; userId?: string; }; export type Config = { publications: Credentials[]; readOnly: boolean; allowDestructive: boolean; requestTimeoutMs: number; userAgent: string; minRequestIntervalMs: number; maxRetries: number; auditPath?: string; }; export declare const DEFAULT_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"; /** Strip scheme, path and trailing slashes down to a bare hostname. */ export declare function normalizeHost(raw: string): string; export declare function loadConfig(): Config; /** * Pick which publication a call targets. * * `hint` is matched loosely against the hostname so "example" finds * "example.substack.com". With no hint, the first configured publication wins. */ export declare function selectPublication(config: Config, hint?: string): Credentials;