/** * DingTalk stream-mode channel adapter: bidirectional bot over the stream * gateway. Inbound messages arrive via STOMP push, replies are SENT back to * the triggering message's msgId. * * Capability notes (honest scope): * - Group replies require an @-mention (requireMention, default true) — the * gateway pushes every group message, so the adapter gates on isInAtList. * - Interactive menus render as a numbered text list: the user answers with a * number and the adapter resolves the choice. Real action-card buttons are * out of scope for this release. * - `streamText` accumulates the full reply and sends it once (the stream * gateway has no progressive card editing). * - Proactive pushes (reminders / broadcasts) still use the webhook service; * the stream adapter can only reply to inbound messages. * @module dsh-connect/channels/dingtalk/adapter */ import type { ChannelAdapter, ChoicePrompt, ChoiceResult, InboundMessage, OutboundTarget, SummaryCard } from "../../types.js"; import type { Language } from "../../i18n.js"; export interface DingtalkStreamAdapterConfig { clientId: string; clientSecret: string; /** Gateway URL override (default wss://api.dingtalk.com/connect). */ url?: string; /** Group messages must @-mention the bot (default true). */ requireMention?: boolean; language?: Language; } /** * Bidirectional DingTalk adapter (stream mode). Deliberately text-forward: * no card editing, no button callbacks — just normalized text both ways. */ export declare class DingtalkStreamAdapter implements ChannelAdapter { readonly id = "dingtalk"; private readonly client; private readonly t; private readonly requireMention; private handler?; private readonly pendingMenus; constructor(config: DingtalkStreamAdapterConfig, logger?: { warn?: (...args: unknown[]) => void; }); start(): Promise; stop(): Promise; onInbound(handler: (msg: InboundMessage) => void | Promise): void; /** Gate + normalize + menu-answer routing, then hand to the core. */ private dispatch; /** * A pending text menu is answered when the user replies with a number. * Returns true when the message was consumed as a menu answer. */ private tryResolveMenu; sendText(target: OutboundTarget, text: string): Promise; sendCard(target: OutboundTarget, card: SummaryCard): Promise; streamText(target: OutboundTarget, chunks: AsyncIterable): Promise; promptChoice(target: OutboundTarget, prompt: ChoicePrompt, _updateMessageId?: string, _signal?: AbortSignal, onPresented?: (messageId: string) => void): Promise; closeMenu(_messageId: string, _summary: string): Promise; } //# sourceMappingURL=adapter.d.ts.map