/** * Minimal hand-rolled Bot Framework activity types and their normalization * into the channels core's {@link ChannelMessage} (spec §7.1.2). No botbuilder: * only the fields the adapter actually reads are typed. */ import type { IdentityPort } from "../../src/ports.js"; import type { ChannelActor, ChannelMessage, ConversationKey } from "../../src/types.js"; /** A Bot Framework activity, reduced to the fields the Teams adapter consumes. */ export type TeamsActivity = { /** "message", "messageReaction", "conversationUpdate", … */ type: string; id: string; timestamp?: string; serviceUrl: string; /** Always "msteams" for Teams traffic. */ channelId: string; from: { id: string; name?: string; aadObjectId?: string; }; conversation: { id: string; tenantId?: string; conversationType?: string; }; /** The bot the activity was addressed to. */ recipient: { id: string; name?: string; }; text?: string; entities?: Array<{ type: string; mentioned?: { id: string; name?: string; }; text?: string; }>; replyToId?: string; /** Action.Submit payload, e.g. `{ option }` from a question card. */ value?: unknown; channelData?: { tenant?: { id: string; }; }; }; /** * `"19:x@thread;messageid=123"` → key `msteams:19:x@thread/123`; no messageid → * channel-level key. */ export declare function conversationKeyFromActivity(a: TeamsActivity): ConversationKey; /** Teams tenant id — `conversation.tenantId` with the channelData fallback. */ export declare function tenantIdOfActivity(a: TeamsActivity): string | undefined; /** The sending user as a {@link ChannelActor} (AAD object id preferred as externalId). */ export declare function actorOfActivity(a: TeamsActivity): ChannelActor; /** * Normalizes a message activity into a ChannelMessage (spec §7.1.2): * payload { type:"prompt", prompt: textWithMentionTokensStripped }, * meta.channel { platform:"msteams", conversationKey, eventId: a.id, tenantId, * actor, messageRef }, meta.mentions via normalize (bot recipient id ⇒ isBot * entity). A text-less Action.Submit (question-card answer) uses its `option` * as the prompt. Returns null for non-message activities and for the bot's own * messages (a.from.id === a.recipient.id — the adapter-level loop filter, * spec §8). */ export declare function activityToChannelMessage(a: TeamsActivity, identity: IdentityPort): Promise; //# sourceMappingURL=activity.d.ts.map