import type { PlatformAdapter, Conversation, Message, Participant } from "../index.js"; /** Instagram web app ID — hard-coded in their JS bundle */ export declare const IG_APP_ID = "936619743392459"; /** * ⚠️ VOLATILE — these doc_ids change when Instagram deploys new code. * Capture new IDs from Network tab on instagram.com/direct. * Filter by "graphql" and read `fb_api_req_friendly_name` + `doc_id` in the payload. * * ⚠️ THREAD-ID TRAP (the #1 cause of "GraphQL returns HTML / 0 messages"): * The REST inbox gives each thread a long `thread_id` * (e.g. "340282366841710301244259535260865788759"). GraphQL thread-fetch * and message-send do NOT accept that — they want the short `thread_fbid` / * `ig_thread_igid` (e.g. "1360243288701783"). The thread payload returns * BOTH (`thread_id` ↔ `thread_fbid`/`id`), so capture `thread_fbid` to drive * GraphQL. The REST per-thread endpoint, by contrast, takes the long * `thread_id` directly — which is why it's the reliable read path. */ export declare const DOC_IDS: { /** PolarisDirectInboxQuery — lists conversations */ readonly inboxQuery: "27228858046797698"; /** IGDSlideAsyncFetchAndInsertIGDViewerThreadQuery — fetches a thread's messages * (keyed by `thread_fbid`). Observed live 2026-06-21. */ readonly threadFetch: "27110549851904846"; /** IGDirectTextSendMutation — sends a text message (keyed by `ig_thread_igid`). * Observed live 2026-06-21. */ readonly textSend: "26911679871773184"; /** @deprecated IGDThreadDetailQuery — returned HTML as of 2026-06-21 (stale). * Kept for reference; use `threadFetch` or the REST per-thread endpoint. */ readonly threadDetail: "27530161873341603"; }; /** REST inbox response (/api/v1/direct_v2/inbox/) */ export interface InstagramInboxResponse { inbox: { threads: InstagramRawThread[]; has_older: boolean; unseen_count: number; }; pending_requests_total: number; } export interface InstagramRawThread { thread_id: string; thread_title: string; users: InstagramRawUser[]; items: InstagramRawItem[]; last_activity_at: string; read_state: number; is_group: boolean; named: boolean; } export interface InstagramRawUser { pk: number | string; username: string; full_name: string; profile_pic_url: string; is_verified: boolean; } export interface InstagramRawItem { item_id: string; user_id: number; timestamp: string; item_type: "text" | "media" | "reel_share" | "link" | "like" | "action_log" | string; text?: string; media?: { image_versions2?: { candidates: Array<{ url: string; width: number; }>; }; }; link?: { text: string; link_url: string; }; } /** GraphQL thread detail response */ export interface InstagramThreadDetailResponse { data: { get_slide_thread_nullable: { as_ig_direct_thread: { slide_messages: { edges: Array<{ node: InstagramRawGraphQLMessage; }>; }; }; }; }; } export interface InstagramRawGraphQLMessage { message_id?: string; /** the IGDSlideAsyncFetch query returns `id` rather than `message_id` */ id?: string; sender_fbid: string; sender?: { user_dict?: { username: string; full_name: string; }; name?: string; }; /** Present for TEXT + reactions ("🔥"). Empty for shares/stories. */ text_body: string; /** Human-readable summary of EVERY message, incl. non-text ones — * e.g. "You: 🔥", "You: replied to your story". The best fallback when * `text_body` is empty. Note the leading "You: " / ": " prefix. */ igd_snippet?: string; timestamp_ms: string; /** Observed: TEXT, MONTAGE_SHARE_XMA (story reply/reaction), and others. */ content_type: "TEXT" | "MEDIA" | "LINK" | "MONTAGE_SHARE_XMA" | string; content?: { __typename?: string; text_body?: string; }; } export declare function normalizeParticipant(user: InstagramRawUser): Participant; export declare function normalizeConversation(thread: InstagramRawThread): Conversation; export declare function normalizeMessage(msg: InstagramRawGraphQLMessage): Message; export declare const instagramAdapter: PlatformAdapter; //# sourceMappingURL=instagram.d.ts.map