import { ChannelID } from '../models/channel-id.js'; import { Account, ConversationAccount } from '../models/account.js'; import { ConversationReference } from '../models/conversation/conversation-reference.js'; import { Entity } from '../models/entity/index.js'; import { ChannelData } from '../models/channel-data/index.js'; import { MeetingInfo } from '../models/meeting/meeting-info.js'; import { ChannelInfo } from '../models/channel-data/channel-info.js'; import { TeamInfo } from '../models/channel-data/team-info.js'; import { NotificationInfo } from '../models/channel-data/notification-info.js'; import { CitationAppearance } from '../models/entity/citation-entity.js'; import { TenantInfo } from '../models/channel-data/tenant-info.js'; import '../models/membership-source.js'; import '../models/membership-source-types.js'; import '../models/membership-types.js'; import '../models/role.js'; import '../models/entity/ai-message-entity.js'; import '../models/entity/message-entity.js'; import '../models/entity/client-info-entity.js'; import '../models/entity/mention-entity.js'; import '../models/entity/product-info-entity.js'; import '../models/entity/quoted-reply-entity.js'; import '../models/entity/sensitive-usage-entity.js'; import '../models/entity/stream-info-entity.js'; import '../models/entity/targeted-message-info-entity.js'; import '../models/channel-data/app-info.js'; import '../models/channel-data/feedback-loop.js'; import '../models/channel-data/on-behalf-of.js'; import '../models/channel-data/settings.js'; import '../models/meeting/meeting-details.js'; interface IActivity { /** * Contains the type of the activity. */ readonly type: T; /** * Contains an ID that uniquely identifies the activity on the channel. */ id: string; /** * Contains the URL that specifies the channel's service endpoint. Set by the channel. */ serviceUrl?: string; /** * Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format. */ timestamp?: Date; /** * A locale name for the contents of the text field. * The locale name is a combination of an ISO 639 two- or three-letter culture code associated * with a language * and an ISO 3166 two-letter subculture code associated with a country or region. * The locale name can also correspond to a valid BCP-47 language tag. */ locale?: string; /** * Contains the local date and time of the message, expressed in ISO-8601 format. * * For example, 2016-09-23T13:07:49.4714686-07:00. */ localTimestamp?: Date; /** * Contains an ID that uniquely identifies the channel. Set by the channel. */ channelId: ChannelID; /** * Identifies the sender of the message. */ from: Account; /** * Identifies the conversation to which the activity belongs. */ conversation: ConversationAccount; /** * A reference to another conversation or activity. * @deprecated This will be removed by end of summer 2026. */ relatesTo?: ConversationReference; /** * Identifies the recipient of the message. */ recipient: Account; /** * Contains the ID of the message to which this message is a reply. */ replyToId?: string; /** * Represents the entities that were mentioned in the message. */ entities?: Entity[]; /** * Contains channel-specific content. */ channelData?: ChannelData; /** * Information about the channel in which the message was sent. */ get channel(): ChannelInfo | undefined; /** * Information about the team in which the message was sent. */ get team(): TeamInfo | undefined; /** * Information about the tenant in which the message was sent. */ get meeting(): MeetingInfo | undefined; /** * Notification settings for the message. */ get notification(): NotificationInfo | undefined; /** * is this a streaming activity */ isStreaming(): boolean; } /** * Base shape for an OUTBOUND activity the app constructs and sends. * * This is intentionally not derived from all of {@link IActivity}: inbound/server-filled * fields such as `from`, `conversation`, `channelId`, `serviceUrl`, and timestamps are * filled by the sender or service, not by callers constructing outbound input. */ interface IActivityInput { /** * Activity type discriminator. */ readonly type: T; /** * Optional activity ID used when updating an existing sent activity. */ id?: string; /** * Optional recipient account. Set `isTargeted` through {@link ActivityInput.withRecipient} * when sending a targeted message. */ recipient?: Account; /** * ID of the activity this outbound activity replies to. */ replyToId?: string; /** * Entities attached to the outbound activity. */ entities?: Entity[]; /** * Channel-specific metadata for the outbound activity. */ channelData?: ChannelData; } /** * Base builder for outbound activity inputs. */ declare class ActivityInput implements IActivityInput { /** * Activity type discriminator. */ readonly type: T; /** * Optional activity ID used when updating an existing sent activity. */ id?: string; /** * Optional recipient account. */ recipient?: Account; /** * ID of the activity this outbound activity replies to. */ replyToId?: string; /** * Entities attached to the outbound activity. */ entities?: Entity[]; /** * Channel-specific metadata for the outbound activity. */ channelData?: ChannelData; /** * Create an outbound activity input. * @param type - Activity type discriminator. * @param value - Initial outbound activity fields. */ constructor(type: T, value?: Omit>, 'type'>); /** * Set the activity ID for update scenarios. * @param value - Activity ID. */ withId(value: string): this; /** * Set the activity recipient. * @param value - Recipient account. * @param isTargeted - Whether the activity is targeted only to this recipient. */ withRecipient(value: Account, isTargeted?: boolean): this; /** * Set the activity ID this outbound activity replies to. * @param value - Activity ID being replied to. */ withReplyToId(value: string): this; /** * Merge channel-specific metadata into the outbound activity. * @param value - Channel metadata to merge. */ withChannelData(value: ChannelData): this; /** * Add an entity to the outbound activity. * @param value - Entity to add. */ addEntity(value: Entity): this; /** * Add multiple entities to the outbound activity. * @param value - Entities to add. */ addEntities(...value: Entity[]): this; /** * Add the `Generated By AI` label. */ addAiGenerated(): this; /** * Enable message feedback. * @param mode - `'default'` shows Teams' built-in thumbs up/down UI. * `'custom'` triggers a `message/fetchTask` invoke so the bot can return its own task module dialog. */ addFeedback(mode?: 'default' | 'custom'): this; /** * Add citations * @param position - Citation position in the message text. * @param appearance - Citation appearance metadata. */ addCitation(position: number, appearance: CitationAppearance): this; /** * Add a targeted message info entity for prompt preview. * Skips if already present. * * @param messageId the message ID of the targeted message * * @experimental This API is in preview and may change in the future. * Diagnostic: ExperimentalTeamsTargeted */ addTargetedMessageInfo(messageId: string): this; /** * Determine whether the activity contains stream metadata. */ isStreaming(): boolean; /** * Get or create the base message entity. * There should only be one root level message entity. */ private ensureSingleRootLevelMessageEntity; private isRootLevelMessageEntity; private mergeRootLevelMessageEntity; } declare class Activity implements IActivity { /** * Contains the type of the activity. */ readonly type: T; /** * Contains an ID that uniquely identifies the activity on the channel. */ id: string; /** * Contains the URL that specifies the channel's service endpoint. Set by the channel. */ serviceUrl?: string; /** * Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format. */ timestamp?: Date; /** * A locale name for the contents of the text field. * The locale name is a combination of an ISO 639 two- or three-letter culture code associated * with a language * and an ISO 3166 two-letter subculture code associated with a country or region. * The locale name can also correspond to a valid BCP-47 language tag. */ locale?: string; /** * Contains the local date and time of the message, expressed in ISO-8601 format. * * For example, 2016-09-23T13:07:49.4714686-07:00. */ localTimestamp?: Date; /** * Contains an ID that uniquely identifies the channel. Set by the channel. */ channelId: ChannelID; /** * Identifies the sender of the message. */ from: Account; /** * Identifies the conversation to which the activity belongs. */ conversation: ConversationAccount; /** * A reference to another conversation or activity. * @deprecated This will be removed by end of summer 2026. */ relatesTo?: ConversationReference; /** * Identifies the recipient of the message. */ recipient: Account; /** * Contains the ID of the message to which this message is a reply. */ replyToId?: string; /** * Represents the entities that were mentioned in the message. */ entities?: Entity[]; /** * Contains channel-specific content. */ channelData?: ChannelData; /** * Information about the tenant in which the message was sent. */ get tenant(): TenantInfo | undefined; /** * Information about the channel in which the message was sent. */ get channel(): ChannelInfo | undefined; /** * Information about the team in which the message was sent. */ get team(): TeamInfo | undefined; /** * Information about the tenant in which the message was sent. */ get meeting(): MeetingInfo | undefined; /** * Notification settings for the message. */ get notification(): NotificationInfo | undefined; constructor(value: Pick, 'type'> & Partial, 'type'>>); static from(activity: IActivity): Activity; toInterface(): IActivity; clone(options?: Omit, 'type'>): Activity; withId(value: string): this; withChannelId(value: ChannelID): this; withFrom(value: Account): this; withConversation(value: ConversationAccount): this; /** * @deprecated This will be removed by end of summer 2026. */ withRelatesTo(value: ConversationReference): this; /** * Set the recipient of this activity, optionally marking it as a targeted message. * Targeted messages are ephemeral to the specified recipient in a shared conversation. * @param value - The recipient account * @param isTargeted - If true, marks this as a targeted message visible only to the recipient (default: false) * @returns this instance for chaining * * @experimental This API is in preview and may change in the future. * Diagnostic: ExperimentalTeamsTargeted * * @deprecated Use ActivityInput/MessageActivityInput/TypingActivityInput when constructing outbound activities. */ withRecipient(value: Account, isTargeted?: boolean): this; withServiceUrl(value: string): this; withTimestamp(value: Date): this; withLocale(value: string): this; withLocalTimestamp(value: Date): this; /** * @deprecated Use ActivityInput/MessageActivityInput/TypingActivityInput when constructing outbound activities. */ withChannelData(value: ChannelData): this; /** * Add an entity. */ addEntity(value: Entity): this; /** * Add multiple entities */ addEntities(...value: Entity[]): this; /** * Add the `Generated By AI` label. * * @deprecated Use ActivityInput/MessageActivityInput/TypingActivityInput when constructing outbound activities. */ addAiGenerated(): this; /** * Enable message feedback. * @param mode - `'default'` shows Teams' built-in thumbs up/down UI. * `'custom'` triggers a `message/fetchTask` invoke so the bot can return its own task module dialog. * * @deprecated Use ActivityInput/MessageActivityInput/TypingActivityInput when constructing outbound activities. */ addFeedback(mode?: 'default' | 'custom'): this; /** * Add citations * * @deprecated Use ActivityInput/MessageActivityInput/TypingActivityInput when constructing outbound activities. */ addCitation(position: number, appearance: CitationAppearance): this; /** * Add a targeted message info entity for prompt preview. * Skips if already present. In reactive flows, `ctx.send()` and `ctx.reply()` * populate this automatically — use this helper for proactive or deferred sends. * An invalid or expired messageId causes APX to silently drop the preview * while still delivering the message. * * @param messageId the message ID of the targeted message (from the incoming activity's `id`) * * @experimental This API is in preview and may change in the future. * Diagnostic: ExperimentalTeamsTargeted * * @deprecated Use ActivityInput/MessageActivityInput/TypingActivityInput when constructing outbound activities. */ addTargetedMessageInfo(messageId: string): this; /** * is this a streaming activity */ isStreaming(): boolean; /** * Get or create the base message entity. * There should only be one root level message entity. */ private ensureSingleRootLevelMessageEntity; private isRootLevelMessageEntity; private mergeRootLevelMessageEntity; } export { Activity, ActivityInput, type IActivity, type IActivityInput };