/** * LinkedIn Voyager-API egress for the @melaya/runner. * * The server (Alibaba) forwards LinkedIn API calls to the runner via * Socket.IO `linkedin:exec` events. This module: * * 1. Reads the operator's local cookies (li_at + JSESSIONID) from * ~/.melaya-runner/linkedin/cookies.json. The cookies were saved * via `npx @melaya/runner linkedin-setup`. They never leave this * machine. * * 2. Issues the actual HTTPS call to LinkedIn's Voyager API * (https://www.linkedin.com/voyager/api/...) using Node's native * fetch. The egress IP is the operator's residential IP — exactly * what they normally browse LinkedIn from, so no automation * flags. * * 3. For "write" actions (likes / replies / connection requests) * inserts a 3-9s human pause before the call, increments a daily * counter at ~/.melaya-runner/linkedin/usage-{YYYY-MM-DD}.json, * and refuses with `daily_cap_reached` past the configured cap. * * 4. Returns { status, body } back to the server so the caller (the * Python agent's social_linkedin tool) can parse the response. * * Caps (override via env on the runner): * LINKEDIN_DAILY_LIKES_CAP default 50 * LINKEDIN_DAILY_REPLIES_CAP default 20 * LINKEDIN_DAILY_CONNECTIONS_CAP default 15 */ interface LinkedInCookies { li_at: string; JSESSIONID: string; } export declare function readCookies(): LinkedInCookies | null; export declare function writeCookies(c: LinkedInCookies): string; export interface LinkedInExecRequest { correlation_id: string; method: string; path: string; params?: Record | null; body?: unknown; write?: boolean; } export interface LinkedInExecResult { status?: number; body?: unknown; error?: string; } export declare function handleLinkedInExec(req: LinkedInExecRequest, verbose?: boolean): Promise; export {};