/** * DiscordShuttle — the Discord channel via the gateway WebSocket (SH6). * * The agent is a bot member; DMs go straight to it, servers require @mention. * Inbound is the gateway WS (HELLO → IDENTIFY → heartbeat → MESSAGE_CREATE); * replies go out via REST. `processMessage` is public so mapping+dispatch is * testable without a live socket; `start()` runs the real gateway loop. * * NOTE: the WS loop uses the global `WebSocket` (Node ≥ 22) and needs the * privileged MESSAGE_CONTENT intent enabled in the Discord dev portal to read * message text. Exercised by a live pass, not unit tests. */ import type { ThreadMap, GroupPolicy, ShuttleMessage } from '../types.js'; import type { DeliveryPolicy } from '../delivery.js'; import type { LinePolicy, LlmGate } from '../gate.js'; import type { PairingStore } from '../pairing.js'; import type { GatewayClient } from '../gateway-client.js'; import { type DiscordMessageCreate } from './message.js'; export interface DiscordShuttleOptions { readonly token: string; readonly profileId: string; readonly gateway: GatewayClient; readonly threads?: ThreadMap; /** Default `typing+final`. */ readonly delivery?: DeliveryPolicy; readonly line?: LinePolicy; readonly groupPolicy?: GroupPolicy; readonly pairing?: PairingStore; readonly llmGate?: LlmGate; readonly isPaused?: (msg: ShuttleMessage) => boolean | Promise; readonly debounce?: { readonly ms: number; readonly maxWaitMs?: number; }; readonly fetch?: typeof fetch; readonly baseUrl?: string; /** Bot user id; resolved from the READY dispatch on start if omitted. */ readonly botUserId?: string; } export declare class DiscordShuttle { private readonly api; private readonly adapter; private readonly transport; private readonly token; private botUserId; private ws; private running; private seq; private hbTimer; constructor(opts: DiscordShuttleOptions); /** Outbound push (schedule delivery): send `text` to a channel id. */ sendText(target: string, text: string): Promise; /** Map + handle one MESSAGE_CREATE. Public for testing without a live socket. */ processMessage(d: DiscordMessageCreate): Promise; start(): Promise; private connect; private startHeartbeat; private stopHeartbeat; private reconnect; stop(): void; } //# sourceMappingURL=shuttle.d.ts.map