Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(bots): ability to @ mention bots (#5316)
teoa92235d7c764
diff --git a/.sqlx/query-fc9677f507fc041fc15addd6de2bfc6e7d9ee74596ab88e2186b4e9fdd6a0146.json b/.sqlx/query-fc9677f507fc041fc15addd6de2bfc6e7d9ee74596ab88e2186b4e9fdd6a0146.jsonnew file mode 100644index 0000000000..97ba056f53--- /dev/null+++ b/.sqlx/query-fc9677f507fc041fc15addd6de2bfc6e7d9ee74596ab88e2186b4e9fdd6a0146.json@@ -0,0 +1,28 @@+{+ "db_name": "PostgreSQL",+ "query": "\n SELECT id, name\n FROM bots\n WHERE id = ANY($1) AND deleted_at IS NULL\n ",+ "describe": {+ "columns": [+ {+ "ordinal": 0,+ "name": "id",+ "type_info": "Uuid"+ },+ {+ "ordinal": 1,+ "name": "name",+ "type_info": "Text"+ }+ ],+ "parameters": {+ "Left": [+ "UuidArray"+ ]+ },+ "nullable": [+ false,+ false+ ]+ },+ "hash": "fc9677f507fc041fc15addd6de2bfc6e7d9ee74596ab88e2186b4e9fdd6a0146"+}diff --git a/Cargo.lock b/Cargo.lockindex d075fd7491..263a0e5416 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -16035,6 +16035,7 @@ dependencies = ["anyhow","axum","axum-extra",+ "bot_id","channel_sender","channels","chrono",diff --git a/apps/web/src/features/channel/Channel/Channel.tsx b/apps/web/src/features/channel/Channel/Channel.tsxindex 5162701034..68af338809 100644--- a/apps/web/src/features/channel/Channel/Channel.tsx+++ b/apps/web/src/features/channel/Channel/Channel.tsx@@ -12,6 +12,7 @@ import {SearchHighlightTermsProvider,} from '@channel/Message';import { MaybeMessageActionDrawerManager } from '@channel/Mobile/MessageActionDrawerManager';+import { useChannelBotMentionUsers } from '@channel/use-channel-bot-mention-users';import { useChannelParticipants } from '@channel/use-channel-participants';import { FloatRegionOrInline } from '@components/app/mobile/float-regions/FloatRegion';import { FloatRegions } from '@components/app/mobile/float-regions/float-region-state';@@ -233,6 +234,9 @@ export function Channel(props: ChannelProps) {});const participants = useChannelParticipants(() => props.channelId);+ const channelBotMentionUsers = useChannelBotMentionUsers(+ () => props.channelId+ );const activity = useChannelActivity(props.channelId);@@ -834,6 +838,7 @@ export function Channel(props: ChannelProps) {placeholder: 'Message channel',}}participants={participants.users}+ bots={channelBotMentionUsers}attachmentTracker={attachmentTracker}persistenceKey={makeInputValuePersistenceKey({channelId: props.channelId,diff --git a/apps/web/src/features/channel/Channel/InlineMessageEditor.tsx b/apps/web/src/features/channel/Channel/InlineMessageEditor.tsxindex 1c29a84167..3fe46a917a 100644--- a/apps/web/src/features/channel/Channel/InlineMessageEditor.tsx+++ b/apps/web/src/features/channel/Channel/InlineMessageEditor.tsx@@ -10,6 +10,7 @@ import {type InputHandle,} from '../Input';import type { MessageData } from '../Message';+import { useChannelBotMentionUsers } from '../use-channel-bot-mention-users';import type { MessageEditor } from './create-message-editor';type MessageEditorContentProps = {@@ -31,6 +32,9 @@ type MessageEditorContentProps = {*/export function MessageEditorContent(props: MessageEditorContentProps) {const snapshot = () => props.messageEditor.state()?.snapshot;+ const channelBotMentionUsers = useChannelBotMentionUsers(+ () => props.channelId+ );const attachmentTracker = createInputAttachmentTracker({initialAttachments: snapshot()?.attachments,});@@ -63,6 +67,7 @@ export function MessageEditorContent(props: MessageEditorContentProps) {autofocus={props.autofocus}attachmentTracker={attachmentTracker}participants={props.participants}+ bots={channelBotMentionUsers}markdownNamespace={`edit-message-${props.channelId}-${props.message.id}`}onReady={props.onReady}onChange={(nextSnapshot) =>diff --git a/apps/web/src/features/channel/Input/ChannelInput.tsx b/apps/web/src/features/channel/Input/ChannelInput.tsxindex bb6bbed85b..8672ee561f 100644--- a/apps/web/src/features/channel/Input/ChannelInput.tsx+++ b/apps/web/src/features/channel/Input/ChannelInput.tsx@@ -14,6 +14,7 @@ import {import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';import { isMobile } from '@core/mobile/isMobile';import type { IUser } from '@core/user/types';+import { uniqueByKey } from '@core/util/compareUtils';import { isPlatform } from '@core/util/platform';import {chatRuleset,@@ -65,6 +66,8 @@ export type ChannelInputProps = InputCallbacks & {persistenceKey?: InputPersistenceKey;attachmentTracker?: InputAttachmentTracker;participants?: Accessor<IUser[]>;+ /** Channel bots surfaced in the `@`-mention typeahead alongside users. */+ bots?: Accessor<IUser[]>;onReady?: (handle: InputHandle) => void;children?: JSX.Element;/** Whether to auto-focus the input on mount. Defaults to `!isMobile()`. */@@ -230,13 +233,16 @@ export function ChannelInput(props: ChannelInputProps) {queueMicrotask(() => focusEditorNow());};- // Macro AI is mentionable in every channel. It is surfaced through the same- // `@`-mention typeahead as participants and re-tagged as a bot at send time.+ // Macro AI is mentionable in every channel, and any bot added to the+ // channel is mentionable too. Both are surfaced through the same+ // `@`-mention typeahead as participants and re-tagged as bot mentions at+ // send time.const mentionUsers: Accessor<IUser[]> = () => {- const base = props.participants?.() ?? [];- return base.some((user) => isMacroAiId(user.id))- ? base- : [macroAiMentionUser(), ...base];+ const base = [...(props.participants?.() ?? []), ...(props.bots?.() ?? [])];+ if (!base.some((user) => isMacroAiId(user.id))) {+ base.unshift(macroAiMentionUser());+ }+ return uniqueByKey(base, (user) => user.id);};const markdownEditor = createConfiguredChannelMarkdownEditor({diff --git a/apps/web/src/features/channel/Input/message-payload.ts b/apps/web/src/features/channel/Input/message-payload.tsindex 5fe22a19b9..eee3a5fc8f 100644--- a/apps/web/src/features/channel/Input/message-payload.ts+++ b/apps/web/src/features/channel/Input/message-payload.ts@@ -1,10 +1,10 @@import type { ItemMention } from '@core/component/LexicalMarkdown/plugins';+import { isBotPrincipalId } from '@core/constant/macroAgent';import { STATIC_IMAGE, STATIC_VIDEO } from '@core/store/cacheChannelInput';import type { NewChannelAttachment as NewAttachment } from '@service-storage/generated/schemas/newChannelAttachment';import type { PostMessageRequest } from '@service-storage/generated/schemas/postMessageRequest';import type { SimpleMention } from '@service-storage/generated/schemas/simpleMention';import { match } from 'ts-pattern';-import { isMacroAiId } from '../macroAi';import type { InputAttachmentData, InputSnapshot } from './types';export function attachmentEntityType(@@ -59,10 +59,11 @@ export function expandMentions(} else if (mention.itemType === 'user') {if (seenUserIds.has(mention.itemId)) continue;seenUserIds.add(mention.itemId);- // Macro AI rides the user-mention machinery in the editor but is a bot;- // re-tag it so the backend dispatches a bot trigger.+ // Bots (Macro AI and channel bots) ride the user-mention machinery in+ // the editor; re-tag them so the backend dispatches bot triggers and+ // webhook events.result.push({- entity_type: isMacroAiId(mention.itemId) ? 'bot' : 'user',+ entity_type: isBotPrincipalId(mention.itemId) ? 'bot' : 'user',entity_id: mention.itemId,});} else {diff --git a/apps/web/src/features/channel/Input/tests/message-payload.test.ts b/apps/web/src/features/channel/Input/tests/message-payload.test.tsindex 0207865b1a..ec77f60030 100644--- a/apps/web/src/features/channel/Input/tests/message-payload.test.ts+++ b/apps/web/src/features/channel/Input/tests/message-payload.test.ts@@ -69,3 +69,52 @@ describe('buildPostMessageRequest — @here expansion', () => {expect(result.mentions).toEqual([]);});});++describe('buildPostMessageRequest — bot mentions', () => {+ const MACRO_AI_PRINCIPAL = 'bot|00000000-0000-0000-0000-00000000a1a1';+ const BOT_PRINCIPAL = 'bot|11111111-1111-1111-1111-111111111111';++ it('re-tags bot-principal user mentions as bot mentions', () => {+ const result = buildPostMessageRequest({+ snapshot: snap([+ { itemType: 'user', itemId: BOT_PRINCIPAL },+ { itemType: 'user', itemId: 'macro|[email protected]' },+ { itemType: 'user', itemId: MACRO_AI_PRINCIPAL },+ ]),+ participantIds: ['macro|[email protected]'],+ });++ expect(result.mentions).toEqual([+ { entity_type: 'bot', entity_id: BOT_PRINCIPAL },+ { entity_type: 'user', entity_id: 'macro|[email protected]' },+ { entity_type: 'bot', entity_id: MACRO_AI_PRINCIPAL },+ ]);+ });++ it('deduplicates repeated bot mentions', () => {+ const result = buildPostMessageRequest({+ snapshot: snap([+ { itemType: 'user', itemId: BOT_PRINCIPAL },+ { itemType: 'user', itemId: BOT_PRINCIPAL },+ ]),+ });++ expect(result.mentions).toEqual([+ { entity_type: 'bot', entity_id: BOT_PRINCIPAL },+ ]);+ });++ it('does not fan bots out through @here', () => {+ const result = buildPostMessageRequest({+ snapshot: snap([+ { itemType: 'group', itemId: 'here', groupAlias: 'here' },+ ]),+ // @here expands participant user ids only; bots are never participants.+ participantIds: ['macro|[email protected]'],+ });++ expect(result.mentions).toEqual([+ { entity_type: 'user', entity_id: 'macro|[email protected]' },+ ]);+ });+});diff --git a/apps/web/src/features/channel/Thread/ThreadReplyChannelInput.tsx b/apps/web/src/features/channel/Thread/ThreadReplyChannelInput.tsxindex 2bed8eb9fc..a084bb049e 100644--- a/apps/web/src/features/channel/Thread/ThreadReplyChannelInput.tsx+++ b/apps/web/src/features/channel/Thread/ThreadReplyChannelInput.tsx@@ -16,6 +16,7 @@ import {makeInputValuePersistenceKey,} from '../Input/utils/persistence';import { hasSendableInputContent } from '../Input/utils/sendable-content';+import { useChannelBotMentionUsers } from '../use-channel-bot-mention-users';import { useChannelParticipants } from '../use-channel-participants';import type { FocusRequest } from './focus-request';@@ -55,6 +56,9 @@ export function ThreadReplyChannelInput(props: ThreadReplyChannelInputProps) {const sendMessageMutation = useSendMessageMutation();const typingMutation = usePostTypingUpdateMutation();const participants = useChannelParticipants(() => props.channelId);+ const channelBotMentionUsers = useChannelBotMentionUsers(+ () => props.channelId+ );const tracker = createInputAttachmentTracker({persistenceKey: makeAttachmentTrackerPersistenceKey({@@ -105,6 +109,7 @@ export function ThreadReplyChannelInput(props: ThreadReplyChannelInputProps) {collapsible={props.collapsible}autofocus={false}participants={participants.users}+ bots={channelBotMentionUsers}attachmentTracker={tracker}persistenceKey={makeInputValuePersistenceKey({channelId: props.channelId,diff --git a/apps/web/src/features/channel/use-channel-bot-mention-users.ts b/apps/web/src/features/channel/use-channel-bot-mention-users.tsnew file mode 100644index 0000000000..f956671885--- /dev/null+++ b/apps/web/src/features/channel/use-channel-bot-mention-users.ts@@ -0,0 +1,24 @@+import type { IUser } from '@core/user/types';+import { useChannelBotsQuery } from '@queries/channel/channel-bots';+import { type Accessor, createMemo } from 'solid-js';++/**+ * The channel's bots as synthetic [`IUser`] entries for the `@`-mention+ * typeahead. Like `macroAiMentionUser()`, `email` is set to the bot's name so+ * persisted mentions render as "@BotName", and `id` uses the canonical+ * `bot|<uuid>` principal form so mentions are re-tagged as bot mentions at+ * send time (see `expandMentions`).+ */+export function useChannelBotMentionUsers(+ channelId: Accessor<string>+): Accessor<IUser[]> {+ const query = useChannelBotsQuery(channelId);++ return createMemo(() => {+ return (query.data ?? []).map((bot) => ({+ id: `bot|${bot.id}`,+ name: bot.name,+ email: bot.name,+ }));+ });+}diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/utils/botMention.ts b/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/utils/botMention.tsindex 026846a31f..7254111a60 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/utils/botMention.ts+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/utils/botMention.ts@@ -1,13 +1,9 @@-import { isMacroAgentId } from '@core/constant/macroAgent';+import { isBotPrincipalId } from '@core/constant/macroAgent';import type { UserItem } from '@core/context/quickAccess';import type { MentionItem } from '../../../../utils/mentionsUtils';-export function isBotMentionId(id: string | undefined): boolean {- return id?.startsWith('bot|') === true || isMacroAgentId(id);-}-export function isBotMentionUser(item: UserItem): boolean {- return isBotMentionId(item.id);+ return isBotPrincipalId(item.id);}export function isBotMentionItem(item: MentionItem): boolean {diff --git a/apps/web/src/lib/core/component/UserIcon.tsx b/apps/web/src/lib/core/component/UserIcon.tsxindex 01ec86a14a..cabd808981 100644--- a/apps/web/src/lib/core/component/UserIcon.tsx+++ b/apps/web/src/lib/core/component/UserIcon.tsx@@ -1,6 +1,6 @@import { useSplitLayout } from '@components/app/split-layout/layout';import { ENABLE_PROFILE_PICTURES } from '@core/constant/featureFlags';-import { isMacroAgentId } from '@core/constant/macroAgent';+import { isBotPrincipalId, isMacroAgentId } from '@core/constant/macroAgent';import { staticFileSizedUrl } from '@core/constant/servers';import { internalDrag } from '@core/directive/internalDragState';import { useProfilePictureUrl } from '@core/signal/profilePicture';@@ -13,6 +13,7 @@ import {useIsConnectedSecondaryInbox,} from '@core/user';import MacroLogo from '@icon/macro-logo.svg';+import RobotIcon from '@phosphor/robot.svg';import Trash from '@phosphor-icons/core/regular/trash.svg?component-solid';import { useGetOrCreateDirectMessageMutation } from '@queries/channel/get-or-create-dm';import { Avatar, type AvatarSize, cn } from '@ui';@@ -181,6 +182,17 @@ export function UserIcon(props: UserIconProps) {</Avatar></Match>+ <Match when={isBotPrincipalId(props.id)}>+ <Avatar+ size={size()}+ class={cn('bg-surface text-accent ring ring-edge-muted', props.class)}+ >+ <Avatar.Fallback>+ <RobotIcon class="size-[62%]" />+ </Avatar.Fallback>+ </Avatar>+ </Match>+<Match when={!showTooltip() || !hasTooltipContent()}><Avatarsize={size()}diff --git a/apps/web/src/lib/core/constant/macroAgent.ts b/apps/web/src/lib/core/constant/macroAgent.tsindex 927dbf9e4f..f5831df9e7 100644--- a/apps/web/src/lib/core/constant/macroAgent.ts+++ b/apps/web/src/lib/core/constant/macroAgent.ts@@ -27,3 +27,12 @@ export function isMacroAgentId(id: string | undefined): boolean {const bare = id.startsWith('bot|') ? id.slice('bot|'.length) : id;return bare === MACRO_AGENT_BOT_ID;}++/**+ * Whether an id is a bot principal: the canonical `bot|<uuid>` form used for+ * bot senders, participants, and mentions, or the Macro bot's bare UUID+ * (accepted for historical content only).+ */+export function isBotPrincipalId(id: string | undefined): boolean {+ return id?.startsWith('bot|') === true || isMacroAgentId(id);+}diff --git a/apps/web/src/lib/core/util/compareUtils.ts b/apps/web/src/lib/core/util/compareUtils.tsindex ff2874a777..887523a42f 100644--- a/apps/web/src/lib/core/util/compareUtils.ts+++ b/apps/web/src/lib/core/util/compareUtils.ts@@ -47,7 +47,11 @@ function _mapFromListsByKey<T extends Record<string, any>>(return map;}-function uniqueByKey<T>(items: readonly T[], keyOf: (item: T) => string): T[] {+/** First-occurrence-wins dedup by a string key, preserving input order. */+export function uniqueByKey<T>(+ items: readonly T[],+ keyOf: (item: T) => string+): T[] {const map = new Map<string, T>();for (const item of items) {const key = keyOf(item);diff --git a/apps/web/src/lib/service-clients/orval.config.ts b/apps/web/src/lib/service-clients/orval.config.tsindex c56a8682af..fb82e87306 100644--- a/apps/web/src/lib/service-clients/orval.config.ts+++ b/apps/web/src/lib/service-clients/orval.config.ts@@ -179,6 +179,7 @@ export default defineConfig({/^ChannelParticipant(Added|Removed)Metadata$/,/^ChannelMessage(Posted|Patched|Deleted)Metadata$/,/^ChannelMessageAttachment(Created|Removed)Metadata$/,+ /^ChannelMentionedMetadata$/,/^ChannelEventAttachment$/,/^ChannelSender$/,],diff --git a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts b/apps/web/src/lib/service-clients/service-storage/generated/zod.tsindex adc2c21073..a233509d85 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts@@ -822,6 +822,48 @@ export const createCommentResponse = zod}));+/**+ * @summary Handler for `GET /bots/me`.+ */+export const getSelfBotResponse = zod+ .object({+ avatar_url: zod.string().nullish().describe('Optional avatar URL.'),+ created_at: zod.iso.datetime({}).describe('Creation timestamp.'),+ created_by: zod.string().nullish().describe('User that created this bot.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Soft-delete timestamp.'),+ description: zod.string().nullish().describe('Optional description.'),+ handle: zod.string().describe('Stable handle.'),+ id: zod.string(),+ kind: zod.enum(['owned', 'system']).describe('Bot kind.'),+ name: zod.string().describe('Display name.'),+ owner: zod+ .union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ type: zod.enum(['user']),+ user_id: zod.string().describe('Owner user id.'),+ })+ .describe('User-owned bot.'),+ zod+ .object({+ team_id: zod.uuid().describe('Owner team id.'),+ type: zod.enum(['team']),+ })+ .describe('Team-owned bot.'),+ ])+ .describe('Bot owner.'),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}).describe('Update timestamp.'),+ })+ .describe('Bot row.');+/*** @summary Handler for `GET /bots/{bot_id}/channels`.*/diff --git a/apps/web/src/lib/service-clients/service-storage/openapi.json b/apps/web/src/lib/service-clients/service-storage/openapi.jsonindex 5858e9f80f..bc2e18819b 100644--- a/apps/web/src/lib/service-clients/service-storage/openapi.json+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json@@ -594,6 +594,65 @@}}},+ "/bots/me": {+ "get": {+ "tags": ["bots"],+ "summary": "Handler for `GET /bots/me`.",+ "operationId": "get_self_bot",+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/Bot"+ }+ }+ }+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "403": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "404": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "500": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ }+ },"/bots/{bot_id}/channels": {"get": {"tags": ["bots"],@@ -12695,6 +12754,57 @@}}},+ "ChannelMentionedMetadata": {+ "type": "object",+ "description": "Metadata for [`ChannelTopicEvent::Mentioned`].",+ "required": [+ "channel_id",+ "message_id",+ "sender",+ "channel_type",+ "content",+ "mentioned",+ "created_at"+ ],+ "properties": {+ "channel_id": {+ "type": "string",+ "format": "uuid",+ "description": "Channel containing the message."+ },+ "channel_type": {+ "$ref": "#/components/schemas/ChannelType",+ "description": "Type of channel containing the message."+ },+ "content": {+ "type": "string",+ "description": "Message body."+ },+ "created_at": {+ "type": "string",+ "format": "date-time",+ "description": "Creation timestamp reported by the repository."+ },+ "mentioned": {+ "$ref": "#/components/schemas/SimpleMention",+ "description": "The mentioned entity this event is about (`user`, `bot`, `document`, …).\n\nThe message's full mention list travels on `channel.message_posted`."+ },+ "message_id": {+ "type": "string",+ "format": "uuid",+ "description": "The id of the message carrying the mention."+ },+ "sender": {+ "$ref": "#/components/schemas/ChannelSender",+ "description": "Message author; may be a bot."+ },+ "thread_id": {+ "type": ["string", "null"],+ "format": "uuid",+ "description": "Thread parent id when the message is a thread reply."+ }+ }+ },"ChannelMessage": {"type": "object","description": "Lightweight channel message for soup payloads.",@@ -13275,6 +13385,21 @@}}},+ {+ "type": "object",+ "description": "An entity (user, bot, document, …) was mentioned in a message.",+ "required": ["metadata", "event_type"],+ "properties": {+ "event_type": {+ "type": "string",+ "enum": ["channel.mentioned"]+ },+ "metadata": {+ "$ref": "#/components/schemas/ChannelMentionedMetadata",+ "description": "An entity (user, bot, document, …) was mentioned in a message."+ }+ }+ },{"type": "object","description": "A message's content was patched.",diff --git a/crates/bots/src/domain/ports.rs b/crates/bots/src/domain/ports.rsindex dced2f2644..a58acccded 100644--- a/crates/bots/src/domain/ports.rs+++ b/crates/bots/src/domain/ports.rs@@ -168,6 +168,9 @@ pub trait BotService: Clone + Send + Sync + 'static {bot_id: BotId,) -> impl Future<Output = Result<Bot, BotError>> + Send;+ /// Get the authenticated bot's own record.+ fn get_self(&self, bot_id: BotId) -> impl Future<Output = Result<Bot, BotError>> + Send;+/// Patch a manageable bot.fn patch_bot(&self,diff --git a/crates/bots/src/domain/service.rs b/crates/bots/src/domain/service.rsindex 459d3862c9..350e0e1524 100644--- a/crates/bots/src/domain/service.rs+++ b/crates/bots/src/domain/service.rs@@ -238,6 +238,15 @@ whereself.ensure_manageable(caller, bot_id).await}+ async fn get_self(&self, bot_id: BotId) -> Result<Bot, BotError> {+ // A bot may always read itself; no manageability check.+ self.repo+ .get_bot(bot_id)+ .await+ .map_err(|err| BotError::Repo(err.into()))?+ .ok_or_else(|| BotError::NotFound("bot not found".to_string()))+ }+async fn patch_bot(&self,caller: MacroUserIdStr<'static>,diff --git a/crates/bots/src/inbound/axum_router.rs b/crates/bots/src/inbound/axum_router.rsindex 04f0226877..9ea384d3f7 100644--- a/crates/bots/src/inbound/axum_router.rs+++ b/crates/bots/src/inbound/axum_router.rs@@ -25,7 +25,8 @@ use entity_access::{inbound::axum_extractors::ChannelAccessLevelExtractor,};use macro_authorization::{- MacroAuthorizationExtractor, MacroAuthorizationService, MacroAuthorizationState, UserOrInternal,+ BotOnly, MacroAuthorizationExtractor, MacroAuthorizationService, MacroAuthorizationState,+ UserOrInternal,};use macro_user_id::user_id::MacroUserIdStr;use model_error_response::ErrorResponse;@@ -128,6 +129,7 @@ whereRouter::new().route("/bots", get(list_bots_handler::<S, Svc, Auth>)).route("/bots", post(create_bot_handler::<S, Svc, Auth>))+ .route("/bots/me", get(get_self_bot_handler::<S, Svc, Auth>)).route("/bots/{bot_id}", get(get_bot_handler::<S, Svc, Auth>)).route("/bots/{bot_id}", patch(patch_bot_handler::<S, Svc, Auth>)).route("/bots/{bot_id}", delete(delete_bot_handler::<S, Svc, Auth>))@@ -207,6 +209,36 @@ async fn list_bots_handler<))}+/// Handler for `GET /bots/me`.+#[utoipa::path(+ get,+ tag = "bots",+ operation_id = "get_self_bot",+ path = "/bots/me",+ responses(+ (status = 200, body = Bot),+ (status = 401, body = ErrorResponse),+ (status = 403, body = ErrorResponse),+ (status = 404, body = ErrorResponse),+ (status = 500, body = ErrorResponse),+ )+)]+pub async fn get_self_bot_handler<+ S: BotService,+ Svc: EntityAccessService,+ Auth: MacroAuthorizationService,+>(+ State(state): State<BotsRouterState<S, Svc, Auth>>,+ authorization: MacroAuthorizationExtractor<Auth, BotOnly>,+) -> Result<Json<Bot>, BotsHandlerErr> {+ Ok(Json(+ state+ .service+ .get_self(authorization.authorization.bot_id)+ .await?,+ ))+}+async fn get_bot_handler<S: BotService,Svc: EntityAccessService,diff --git a/crates/bots/src/inbound/axum_router/tests.rs b/crates/bots/src/inbound/axum_router/tests.rsindex 6a414ccd7d..740bed0ba5 100644--- a/crates/bots/src/inbound/axum_router/tests.rs+++ b/crates/bots/src/inbound/axum_router/tests.rs@@ -1,6 +1,6 @@use super::*;use crate::domain::models::{- AuthenticatedBot, BotChannel, BotChannelType, CreateChannelScopedBotRequest,+ AuthenticatedBot, BotChannel, BotChannelType, BotKind, BotOwner, CreateChannelScopedBotRequest,CreateChannelScopedBotResponse,};use crate::{domain::service::BotServiceImpl, outbound::pg_bots_repo::PgBotsRepo};@@ -18,8 +18,9 @@ use entity_access::domain::{};use entity_access::{domain::service::EntityAccessServiceImpl, outbound::PgAccessRepository};use macro_authorization::{- InternalAuthConfig, JwtValidator, MacroAuthorizationError, MacroAuthorizationServiceImpl,- MacroAuthorizationState, NoBotAuthorizer, ValidatedIdentity,+ BOT_SCOPE_HEADER, BOT_TOKEN_HEADER, BotActingUserClaims, BotAuthentication, BotAuthorizer,+ BotScope, InternalAuthConfig, JwtValidator, MacroAuthorizationError,+ MacroAuthorizationServiceImpl, MacroAuthorizationState, NoBotAuthorizer, ValidatedIdentity,};use macro_db_migrator::MACRO_DB_MIGRATIONS;use macro_event_broker::NoopMacroEventBroker;@@ -45,9 +46,12 @@ enum TestBotMode {struct TestBotService {mode: TestBotMode,bot_channels: Vec<BotChannel>,+ channel_bots: Vec<Bot>,+ self_bot: Option<Bot>,add_calls: Arc<AtomicUsize>,remove_calls: Arc<AtomicUsize>,list_bot_channels_calls: Arc<AtomicUsize>,+ list_channel_bots_calls: Arc<AtomicUsize>,}impl TestBotService {@@ -55,13 +59,30 @@ impl TestBotService {Self::with_bot_channels(mode, Vec::new())}+ fn with_self_bot(mode: TestBotMode, self_bot: Bot) -> Self {+ Self {+ self_bot: Some(self_bot),+ ..Self::new(mode)+ }+ }++ fn with_channel_bots(mode: TestBotMode, channel_bots: Vec<Bot>) -> Self {+ Self {+ channel_bots,+ ..Self::new(mode)+ }+ }+fn with_bot_channels(mode: TestBotMode, bot_channels: Vec<BotChannel>) -> Self {Self {mode,bot_channels,+ channel_bots: Vec::new(),+ self_bot: None,add_calls: Arc::new(AtomicUsize::new(0)),remove_calls: Arc::new(AtomicUsize::new(0)),list_bot_channels_calls: Arc::new(AtomicUsize::new(0)),+ list_channel_bots_calls: Arc::new(AtomicUsize::new(0)),}}@@ -103,6 +124,13 @@ impl BotService for TestBotService {unimplemented!()}+ async fn get_self(&self, _bot_id: BotId) -> Result<Bot, BotError> {+ self.result()?;+ self.self_bot+ .clone()+ .ok_or_else(|| BotError::NotFound("bot not found".to_string()))+ }+async fn patch_bot(&self,_caller: MacroUserIdStr<'static>,@@ -151,7 +179,9 @@ impl BotService for TestBotService {}async fn list_channel_bots(&self, _channel_id: Uuid) -> Result<Vec<Bot>, BotError> {- unimplemented!()+ self.list_channel_bots_calls.fetch_add(1, Ordering::SeqCst);+ self.result()?;+ Ok(self.channel_bots.clone())}async fn create_token(@@ -342,6 +372,48 @@ fn authorization_state() -> MacroAuthorizationState<TestAuthorizationService> {MacroAuthorizationState::new(Arc::new(service))}+const SELF_BOT_TOKEN: &str = "mbot_self_test";++/// Bot authorizer accepting exactly [`SELF_BOT_TOKEN`] for the given bot.+#[derive(Clone)]+struct SelfBotAuthorizer {+ bot_id: BotId,+}++impl BotAuthorizer for SelfBotAuthorizer {+ async fn authorize_bot(+ &self,+ bot_token: &str,+ bot_scope: BotScope,+ _acting_user: Option<BotActingUserClaims>,+ ) -> Result<BotAuthentication, rootcause::Report<MacroAuthorizationError>> {+ if bot_token != SELF_BOT_TOKEN {+ return Err(Report::new(MacroAuthorizationError::InvalidCredentials));+ }+ Ok(BotAuthentication {+ bot_id: self.bot_id,+ token_id: Uuid::new_v4(),+ bot_scope,+ team_id: None,+ acting_user: None,+ })+ }+}++fn authorization_state_with_bot(+ bot_id: BotId,+) -> MacroAuthorizationState<TestAuthorizationService> {+ let service = MacroAuthorizationServiceImpl::new(+ FakeJwtValidator,+ InternalAuthConfig {+ api_key: "test-internal-key".to_string(),+ default_user_id: None,+ },+ SelfBotAuthorizer { bot_id },+ );+ MacroAuthorizationState::new(Arc::new(service))+}+async fn attach_default_bearer(mut request: Request<Body>) -> Request<Body> {request.headers_mut().insert(header::AUTHORIZATION,@@ -472,6 +544,119 @@ async fn read_bot_channels(response: axum::response::Response) -> Vec<BotChannelserde_json::from_slice(&body).unwrap()}+fn sample_self_bot(bot_id: BotId) -> Bot {+ let now = chrono::Utc::now();+ Bot {+ id: bot_id,+ kind: BotKind::Owned,+ owner: Some(BotOwner::User {+ user_id: "macro|[email protected]".to_string(),+ }),+ name: "Datadog Alerts".to_string(),+ handle: "datadog-alerts".to_string(),+ description: None,+ avatar_url: None,+ created_by: Some("macro|[email protected]".to_string()),+ created_at: now,+ updated_at: now,+ deleted_at: None,+ }+}++/// Router whose bot authorizer accepts [`SELF_BOT_TOKEN`] for `bot_id`.+fn bot_router(service: TestBotService, bot_id: BotId) -> Router {+ bots_router(BotsRouterState::new(+ service,+ TestAccessService::new(EntityParticipantRole::Member),+ authorization_state_with_bot(bot_id),+ ))+}++#[tokio::test]+async fn bot_reads_itself_via_bots_me() {+ let bot_id = BotId::new_from_uuid(Uuid::new_v4());+ let service = TestBotService::with_self_bot(TestBotMode::Ok, sample_self_bot(bot_id));+ let request = Request::builder()+ .method("GET")+ .uri("/bots/me")+ .header(BOT_TOKEN_HEADER, SELF_BOT_TOKEN)+ .header(BOT_SCOPE_HEADER, "team")+ .body(Body::empty())+ .unwrap();++ let response = bot_router(service, bot_id).oneshot(request).await.unwrap();++ assert_eq!(response.status(), StatusCode::OK);+ let body = axum::body::to_bytes(response.into_body(), usize::MAX)+ .await+ .unwrap();+ let bot: Bot = serde_json::from_slice(&body).unwrap();+ assert_eq!(bot.id, bot_id);+ assert_eq!(bot.handle, "datadog-alerts");+}++#[tokio::test]+async fn bots_me_rejects_invalid_bot_token() {+ let bot_id = BotId::new_from_uuid(Uuid::new_v4());+ let service = TestBotService::with_self_bot(TestBotMode::Ok, sample_self_bot(bot_id));+ let request = Request::builder()+ .method("GET")+ .uri("/bots/me")+ .header(BOT_TOKEN_HEADER, "mbot_wrong")+ .header(BOT_SCOPE_HEADER, "team")+ .body(Body::empty())+ .unwrap();++ let response = bot_router(service, bot_id).oneshot(request).await.unwrap();++ assert_eq!(response.status(), StatusCode::UNAUTHORIZED);+}++#[tokio::test]+async fn bots_me_rejects_user_bearer_credentials() {+ let bot_id = BotId::new_from_uuid(Uuid::new_v4());+ let service = TestBotService::with_self_bot(TestBotMode::Ok, sample_self_bot(bot_id));+ let request = Request::builder()+ .method("GET")+ .uri("/bots/me")+ .body(Body::empty())+ .unwrap();++ // The `router` helper attaches a user Bearer token; BotOnly must reject it.+ let response = router(service, EntityParticipantRole::Member)+ .oneshot(request)+ .await+ .unwrap();++ assert_eq!(response.status(), StatusCode::FORBIDDEN);+}++#[tokio::test]+async fn channel_member_can_list_channel_bots() {+ let channel_id = Uuid::new_v4();+ let bot = sample_self_bot(BotId::new_from_uuid(Uuid::new_v4()));+ let service = TestBotService::with_channel_bots(TestBotMode::Ok, vec![bot.clone()]);+ let request = Request::builder()+ .method("GET")+ .uri(format!("/channels/{channel_id}/bots"))+ .body(Body::empty())+ .unwrap();++ let response = router(service.clone(), EntityParticipantRole::Member)+ .oneshot(request)+ .await+ .unwrap();++ assert_eq!(response.status(), StatusCode::OK);+ let body = axum::body::to_bytes(response.into_body(), usize::MAX)+ .await+ .unwrap();+ let bots: Vec<Bot> = serde_json::from_slice(&body).unwrap();+ assert_eq!(bots.len(), 1);+ assert_eq!(bots[0].id, bot.id);+ assert_eq!(service.list_channel_bots_calls.load(Ordering::SeqCst), 1);+}+#[tokio::test]async fn bot_owner_can_list_bot_channels_via_http() {let channel_id = Uuid::new_v4();diff --git a/crates/bots/src/inbound/channel_webhook_router/tests.rs b/crates/bots/src/inbound/channel_webhook_router/tests.rsindex bf407e54df..f687ba1e7c 100644--- a/crates/bots/src/inbound/channel_webhook_router/tests.rs+++ b/crates/bots/src/inbound/channel_webhook_router/tests.rs@@ -187,6 +187,10 @@ impl BotService for TestBotService {unimplemented!()}+ async fn get_self(&self, _bot_id: BotId) -> Result<Bot, BotError> {+ unimplemented!()+ }+async fn patch_bot(&self,_caller: MacroUserIdStr<'static>,diff --git a/crates/channel_bots/src/inbound/bot_trigger_router.rs b/crates/channel_bots/src/inbound/bot_trigger_router.rsindex f81af4e04a..f398ef4d66 100644--- a/crates/channel_bots/src/inbound/bot_trigger_router.rs+++ b/crates/channel_bots/src/inbound/bot_trigger_router.rs@@ -18,7 +18,9 @@ use crate::domain::{/// fire-and-forget: each trigger is handled on a spawned task.////// System bots are defined in code and require no database row. Unknown bot ids-/// are ignored for now; only Macro AI is handled by this branch.+/// are ignored here; only Macro AI is handled by this branch. Non-system bots+/// are notified of mentions out of process via the `channel.mentioned`+/// webhook event instead (see the `webhook` crate).pub struct BotTriggerRouter<C, R> {macro_ai: Arc<MacroAiHandler<C, R>>,}diff --git a/crates/channels/examples/channels_consumer.rs b/crates/channels/examples/channels_consumer.rsindex 54667b9633..3fcf0882ec 100644--- a/crates/channels/examples/channels_consumer.rs+++ b/crates/channels/examples/channels_consumer.rs@@ -75,6 +75,7 @@ fn event_type(event: &ChannelTopicEvent) -> &'static str {ChannelTopicEvent::MessageAttachmentRemoved(_) => "channel.message_attachment_removed",ChannelTopicEvent::ParticipantAdded(_) => "channel.participant_added",ChannelTopicEvent::ParticipantRemoved(_) => "channel.participant_removed",+ ChannelTopicEvent::Mentioned(_) => "channel.mentioned",}}diff --git a/crates/channels/src/domain/broker_events.rs b/crates/channels/src/domain/broker_events.rsindex fc6e3f65a9..24551ad93b 100644--- a/crates/channels/src/domain/broker_events.rs+++ b/crates/channels/src/domain/broker_events.rs@@ -108,6 +108,30 @@ pub struct ChannelMessagePostedMetadata {pub created_at: DateTime<Utc>,}+/// Metadata for [`ChannelTopicEvent::Mentioned`].+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]+pub struct ChannelMentionedMetadata {+ /// Channel containing the message.+ pub channel_id: Uuid,+ /// The id of the message carrying the mention.+ pub message_id: Uuid,+ /// Thread parent id when the message is a thread reply.+ pub thread_id: Option<Uuid>,+ /// Message author; may be a bot.+ pub sender: ChannelSender<'static>,+ /// Type of channel containing the message.+ pub channel_type: ChannelType,+ /// Message body.+ pub content: String,+ /// The mentioned entity this event is about (`user`, `bot`, `document`, …).+ ///+ /// The message's full mention list travels on `channel.message_posted`.+ pub mentioned: SimpleMention,+ /// Creation timestamp reported by the repository.+ pub created_at: DateTime<Utc>,+}+/// Metadata for [`ChannelTopicEvent::MessagePatched`].#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]@@ -219,6 +243,9 @@ pub enum ChannelTopicEvent {/// A message was posted.#[serde(rename = "channel.message_posted")]MessagePosted(ChannelMessagePostedMetadata),+ /// An entity (user, bot, document, …) was mentioned in a message.+ #[serde(rename = "channel.mentioned")]+ Mentioned(ChannelMentionedMetadata),/// A message's content was patched.#[serde(rename = "channel.message_patched")]MessagePatched(ChannelMessagePatchedMetadata),@@ -275,6 +302,11 @@ impl ChannelMacroEvent {)}+ /// Build a mentioned event keyed by the containing channel id.+ pub fn mentioned(metadata: ChannelMentionedMetadata) -> Self {+ Self::new(metadata.channel_id, ChannelTopicEvent::Mentioned(metadata))+ }+/// Build a message patched event keyed by the containing channel id.pub fn message_patched(metadata: ChannelMessagePatchedMetadata) -> Self {Self::new(diff --git a/crates/channels/src/domain/broker_events/test.rs b/crates/channels/src/domain/broker_events/test.rsindex c741b7a52f..23403e8bb6 100644--- a/crates/channels/src/domain/broker_events/test.rs+++ b/crates/channels/src/domain/broker_events/test.rs@@ -118,6 +118,51 @@ fn message_posted_wire_shape_with_bot_sender() {);}+#[test]+fn mentioned_wire_shape() {+ let bot_principal = "bot|00000000-0000-0000-0000-00000000a1a1";+ let event = Event::with_event_id(+ Uuid::nil(),+ ChannelTopicEvent::Mentioned(ChannelMentionedMetadata {+ channel_id: Uuid::nil(),+ message_id: Uuid::nil(),+ thread_id: None,+ sender: user("macro|[email protected]"),+ channel_type: ChannelType::Team,+ content: "hello bot".to_string(),+ mentioned: SimpleMention {+ entity_type: "bot".to_string(),+ entity_id: bot_principal.to_string(),+ },+ created_at: timestamp(),+ }),+ );++ let value = serde_json::to_value(&event).expect("serializable");+ assert_eq!(+ value,+ json!({+ "event_id": "00000000-0000-0000-0000-000000000000",+ "schema_version": 1,+ "event_type": "channel.mentioned",+ "metadata": {+ "channel_id": "00000000-0000-0000-0000-000000000000",+ "message_id": "00000000-0000-0000-0000-000000000000",+ "thread_id": null,+ "sender": "macro|[email protected]",+ "channel_type": "team",+ "content": "hello bot",+ "mentioned": { "entity_type": "bot", "entity_id": bot_principal },+ "created_at": "2026-01-02T03:04:05Z",+ },+ })+ );++ let decoded: Event<ChannelTopicEvent> =+ serde_json::from_value(value).expect("decodable payload");+ assert_eq!(&decoded, &event);+}+#[test]fn decode_round_trips() {let channel_id = Uuid::new_v4();diff --git a/crates/channels/src/domain/service.rs b/crates/channels/src/domain/service.rsindex 4e52703484..7635e55e7c 100644--- a/crates/channels/src/domain/service.rs+++ b/crates/channels/src/domain/service.rs@@ -1226,7 +1226,13 @@ where.get_participants(channel_id).await.map_err(|e| ChannelMutationErr::Repo(e.into()))?;- match (info.channel_type, participants.len()) {+ // Bots can be channel participants; only user participants count+ // toward the minimum-membership guard.+ let user_participant_count = participants+ .iter()+ .filter(|participant| MacroUserIdStr::try_from(participant.user_id.as_str()).is_ok())+ .count();+ match (info.channel_type, user_participant_count) {(ChannelType::Private, 2) | (ChannelType::DirectMessage, _) => {return Err(ChannelMutationErr::BadRequest("cannot leave channel with only 2 participants".to_string(),diff --git a/crates/channels/src/domain/side_effects.rs b/crates/channels/src/domain/side_effects.rsindex 28e428c4ee..fa67de9678 100644--- a/crates/channels/src/domain/side_effects.rs+++ b/crates/channels/src/domain/side_effects.rs@@ -3,8 +3,9 @@use crate::domain::{broker_events::{ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelEventAttachment, ChannelMacroEvent,- ChannelMessageAttachmentCreatedMetadata, ChannelMessageAttachmentRemovedMetadata,- ChannelMessageDeletedMetadata, ChannelMessagePatchedMetadata, ChannelMessagePostedMetadata,+ ChannelMentionedMetadata, ChannelMessageAttachmentCreatedMetadata,+ ChannelMessageAttachmentRemovedMetadata, ChannelMessageDeletedMetadata,+ ChannelMessagePatchedMetadata, ChannelMessagePostedMetadata,ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelUpdatedMetadata,},events::ChannelEvent,@@ -66,6 +67,33 @@ fn bot_mention_ids(mentions: &[SimpleMention]) -> Vec<BotId> {.collect()}+/// Collect mentioned bots that are active participants in the channel.+///+/// Mention payloads are client-controlled, so a syntactically valid bot id is+/// not sufficient to dispatch a trigger or publish a bot-mention event.+fn active_bot_mention_ids(+ mentions: &[SimpleMention],+ participants: &[ChannelParticipant],+) -> Vec<BotId> {+ let mut active_bot_ids: HashSet<_> = participants+ .iter()+ .filter(|participant| participant.left_at.is_none())+ .filter_map(|participant| {+ BotIdStr::parse_from_str(&participant.user_id)+ .ok()+ .map(|id| id.bot_id())+ })+ .collect();+ // Macro AI is a code-defined system bot available in every channel; it+ // has no participant row.+ active_bot_ids.insert(bot_id::MACRO_AI_BOT_ID);++ bot_mention_ids(mentions)+ .into_iter()+ .filter(|bot_id| active_bot_ids.contains(bot_id))+ .collect()+}+/// Parse a mention entity id in the canonical `bot|<uuid>` principal form.fn mention_bot_id(entity_id: &str) -> Option<BotId> {BotIdStr::parse_from_str(entity_id)@@ -370,13 +398,14 @@ impl<C, R, N, K, B> ChannelSideEffectService<C, R, N, K, B> {channel_id: Uuid,message: &MutatedMessage,mentions: &[SimpleMention],+ participants: &[ChannelParticipant],) {// Only user-authored messages can trigger bots; this prevents bots// (including Macro AI) from triggering each other in a loop.if message.sender_id.as_user().is_none() {return;}- let bot_ids = bot_mention_ids(mentions);+ let bot_ids = active_bot_mention_ids(mentions, participants);if bot_ids.is_empty() {return;}@@ -657,7 +686,7 @@ where.await;}- self.dispatch_bot_triggers(channel_id, &message, &mentions);+ self.dispatch_bot_triggers(channel_id, &message, &mentions, &participants);if notification_policy != PostMessageNotificationPolicy::Silent {self.send_message_posted_notifications(PostedMessageNotificationInputs {channel_id,@@ -1235,6 +1264,7 @@ fn broker_events_for_event(event: &ChannelEvent) -> Vec<ChannelMacroEvent> {ChannelEvent::MessagePosted {channel_id,metadata,+ participants,message,mentions,attachments,@@ -1270,6 +1300,39 @@ fn broker_events_for_event(event: &ChannelEvent) -> Vec<ChannelMacroEvent> {},));}+ // One mentioned event per distinct mentioned entity. Bot mentions+ // are invocations, so they only emit for bots that are active+ // channel participants (mention payloads are client-controlled).+ // Mentions of other entity kinds — including an author mentioning+ // themselves — pass through; delivery is already scoped to+ // channel access and consumers filter on the payload.+ let active_bots = active_bot_mention_ids(mentions, participants);+ let emits = |mention: &SimpleMention| match mention_bot_id(&mention.entity_id) {+ Some(bot_id) => active_bots.contains(&bot_id),+ // A bot-tagged mention that isn't a canonical bot principal+ // is malformed; other kinds pass through.+ None => mention.entity_type != BOT_MENTION_ENTITY_TYPE,+ };+ let mut seen_mentions = HashSet::new();+ for mention in mentions {+ if !emits(mention) {+ continue;+ }+ if !seen_mentions.insert((mention.entity_type.as_str(), mention.entity_id.as_str()))+ {+ continue;+ }+ events.push(ChannelMacroEvent::mentioned(ChannelMentionedMetadata {+ channel_id: *channel_id,+ message_id: message.id,+ thread_id: message.thread_id,+ sender: message.sender_id.clone(),+ channel_type: metadata.channel_type,+ content: message.content.clone(),+ mentioned: mention.clone(),+ created_at: message.created_at,+ }));+ }events}ChannelEvent::MessageChanged {diff --git a/crates/channels/src/domain/side_effects/test.rs b/crates/channels/src/domain/side_effects/test.rsindex 022319b366..e4781698ee 100644--- a/crates/channels/src/domain/side_effects/test.rs+++ b/crates/channels/src/domain/side_effects/test.rs@@ -785,6 +785,13 @@ async fn user_message_with_bot_mention_enqueues_bot_trigger() {joined_at: now,left_at: None,},+ ChannelParticipant {+ channel_id,+ user_id: bot_id::MACRO_AI_BOT_ID.into_storage_id().to_string(),+ role: ParticipantRole::Member,+ joined_at: now,+ left_at: None,+ },],message: MutatedMessage {id: message_id,@@ -818,6 +825,60 @@ async fn user_message_with_bot_mention_enqueues_bot_trigger() {assert!(bot_trigger_receiver.try_recv().is_err());}+#[tokio::test]+async fn user_message_with_uninstalled_bot_mention_does_not_enqueue_bot_trigger() {+ let channel_id = Uuid::new_v4();+ let bot_id = BotId::new_from_uuid(Uuid::new_v4());+ let (bot_trigger_sender, mut bot_trigger_receiver) = tokio::sync::mpsc::unbounded_channel();+ let service = ChannelSideEffectService::new(+ FakeContext::default(),+ FakeRealtime::default(),+ FakeNotifications::default(),+ FakeContacts::default(),+ )+ .with_bot_trigger_sender(bot_trigger_sender);+ let now = Utc::now();++ service+ .handle(ChannelEvent::MessagePosted {+ channel_id,+ metadata: ChannelMetadata {+ channel_type: ChannelType::Private,+ channel_name: "Project".to_string(),+ },+ participants: vec![ChannelParticipant {+ channel_id,+ user_id: "macro|[email protected]".to_string(),+ role: ParticipantRole::Member,+ joined_at: now,+ left_at: None,+ }],+ message: MutatedMessage {+ id: Uuid::new_v4(),+ channel_id,+ thread_id: None,+ sender_id: Sender::new_from_user(user("[email protected]")),+ triggered_by: None,+ content: "@bot help".to_string(),+ created_at: now,+ updated_at: now,+ edited_at: None,+ deleted_at: None,+ },+ mentions: vec![mention(+ BOT_MENTION_ENTITY_TYPE,+ &bot_id.into_storage_id().to_string(),+ )],+ has_attachments: false,+ attachments: Vec::new(),+ nonce: None,+ notification_policy: PostMessageNotificationPolicy::Default,+ })+ .await;++ assert!(bot_trigger_receiver.try_recv().is_err());+}+#[tokio::test]async fn document_mentions_notify_participants_except_sender() {let channel_id = Uuid::new_v4();@@ -1461,6 +1522,212 @@ fn broker_events_map_channel_updated() {assert_eq!(envelope["metadata"]["channel_name"], "new");}+/// Build a MessagePosted event from the given sender carrying the given+/// mentions.+fn message_posted_with_mentions(+ sender: Sender,+ channel_id: Uuid,+ message_id: Uuid,+ mentions: Vec<SimpleMention>,+ participant_principals: &[&str],+) -> ChannelEvent {+ let now = Utc::now();+ ChannelEvent::MessagePosted {+ channel_id,+ metadata: ChannelMetadata {+ channel_type: ChannelType::Team,+ channel_name: "Project".to_string(),+ },+ participants: participant_principals+ .iter()+ .map(|principal| ChannelParticipant {+ channel_id,+ user_id: principal.to_string(),+ role: ParticipantRole::Member,+ joined_at: now,+ left_at: None,+ })+ .collect(),+ message: MutatedMessage {+ id: message_id,+ channel_id,+ thread_id: None,+ sender_id: sender,+ triggered_by: None,+ content: "hello bots".to_string(),+ created_at: now,+ updated_at: now,+ edited_at: None,+ deleted_at: None,+ },+ mentions,+ has_attachments: false,+ attachments: Vec::new(),+ nonce: None,+ notification_policy: PostMessageNotificationPolicy::Default,+ }+}++#[test]+fn broker_events_map_message_posted_mentions_per_entity() {+ use macro_event_broker::MacroEvent as _;+ let channel_id = Uuid::new_v4();+ let message_id = Uuid::new_v4();+ let bot_principal = BotId::new_from_uuid(Uuid::new_v4())+ .into_storage_id()+ .to_string();+ let macro_ai_principal = bot_id::MACRO_AI_BOT_ID.into_storage_id().to_string();+ let uninstalled_bot_principal = BotId::new_from_uuid(Uuid::new_v4())+ .into_storage_id()+ .to_string();++ let events = broker_events_for_event(&message_posted_with_mentions(+ Sender::new_from_user(user("[email protected]")),+ channel_id,+ message_id,+ vec![+ mention(BOT_MENTION_ENTITY_TYPE, &bot_principal),+ // Duplicate mentions of one entity emit a single event.+ mention(BOT_MENTION_ENTITY_TYPE, &bot_principal),+ // Macro AI surfaced through the user-mention UI still counts.+ mention("user", ¯o_ai_principal),+ // A valid bot principal that is not installed emits nothing.+ mention(BOT_MENTION_ENTITY_TYPE, &uninstalled_bot_principal),+ // A bot-tagged mention with a malformed id emits nothing.+ mention(BOT_MENTION_ENTITY_TYPE, "not-a-bot-principal"),+ // The sender mentioning themselves emits like any other mention.+ mention("user", "macro|[email protected]"),+ // User and document mentions emit like any other entity.+ mention("user", "macro|[email protected]"),+ mention("document", "doc-1"),+ ],+ // Macro AI needs no participant row: it is a code-defined system bot+ // available in every channel.+ &[bot_principal.as_str()],+ ));++ let posted = serde_json::to_value(events[0].event()).unwrap();+ assert_eq!(posted["event_type"], "channel.message_posted");++ let mentioned: Vec<_> = events[1..]+ .iter()+ .map(|event| serde_json::to_value(event.event()).unwrap())+ .collect();+ for envelope in &mentioned {+ assert_eq!(envelope["event_type"], "channel.mentioned");+ assert_eq!(envelope["metadata"]["channel_id"], channel_id.to_string());+ assert_eq!(envelope["metadata"]["message_id"], message_id.to_string());+ assert_eq!(envelope["metadata"]["sender"], "macro|[email protected]");+ }+ let mentioned_entities: Vec<_> = mentioned+ .iter()+ .map(|envelope| {+ (+ envelope["metadata"]["mentioned"]["entity_type"]+ .as_str()+ .unwrap()+ .to_string(),+ envelope["metadata"]["mentioned"]["entity_id"]+ .as_str()+ .unwrap()+ .to_string(),+ )+ })+ .collect();+ assert_eq!(+ mentioned_entities,+ vec![+ ("bot".to_string(), bot_principal),+ ("user".to_string(), macro_ai_principal),+ ("user".to_string(), "macro|[email protected]".to_string()),+ ("user".to_string(), "macro|[email protected]".to_string()),+ ("document".to_string(), "doc-1".to_string()),+ ]+ );+ assert_eq!(events[1].key(), channel_id.to_string());+}++#[test]+fn broker_events_bot_authored_mentions_emit() {+ use macro_event_broker::MacroEvent as _;+ let sender_bot = BotId::new_from_uuid(Uuid::new_v4());+ let sender_principal = sender_bot.into_storage_id().to_string();+ let other_bot_principal = BotId::new_from_uuid(Uuid::new_v4())+ .into_storage_id()+ .to_string();++ let events = broker_events_for_event(&message_posted_with_mentions(+ Sender::new_from_bot(sender_bot),+ Uuid::new_v4(),+ Uuid::new_v4(),+ vec![+ // Bot-authored mentions emit like any other, including a bot+ // mentioning itself — the pipe reports facts, consumers filter.+ mention(BOT_MENTION_ENTITY_TYPE, &sender_principal),+ mention(BOT_MENTION_ENTITY_TYPE, &other_bot_principal),+ ],+ &[sender_principal.as_str(), other_bot_principal.as_str()],+ ));++ assert_eq!(events.len(), 3);+ let self_mention = serde_json::to_value(events[1].event()).unwrap();+ assert_eq!(self_mention["event_type"], "channel.mentioned");+ assert_eq!(+ self_mention["metadata"]["mentioned"]["entity_id"],+ sender_principal+ );+ let other = serde_json::to_value(events[2].event()).unwrap();+ assert_eq!(+ other["metadata"]["mentioned"]["entity_id"],+ other_bot_principal+ );+ assert_eq!(other["metadata"]["sender"], sender_principal);+}++#[test]+fn broker_events_skip_mentions_on_message_changed() {+ use macro_event_broker::MacroEvent as _;+ let channel_id = Uuid::new_v4();+ let now = Utc::now();++ let events = broker_events_for_event(&ChannelEvent::MessageChanged {+ channel_id,+ actor: Sender::new_from_user(user("[email protected]")),+ message: MutatedMessage {+ id: Uuid::new_v4(),+ channel_id,+ thread_id: None,+ sender_id: Sender::new_from_user(user("[email protected]")),+ triggered_by: None,+ content: "edited to mention a bot".to_string(),+ created_at: now,+ updated_at: now,+ edited_at: Some(now),+ deleted_at: None,+ },+ recipients: Vec::new(),+ nonce: None,+ posted_notification: Some(MessageChangedNotificationContext {+ metadata: ChannelMetadata {+ channel_type: ChannelType::Team,+ channel_name: "Project".to_string(),+ },+ participants: Vec::new(),+ mentions: vec![mention(+ BOT_MENTION_ENTITY_TYPE,+ &BotId::new_from_uuid(Uuid::new_v4())+ .into_storage_id()+ .to_string(),+ )],+ has_attachments: false,+ }),+ });++ assert_eq!(events.len(), 1);+ let envelope = serde_json::to_value(events[0].event()).unwrap();+ assert_eq!(envelope["event_type"], "channel.message_patched");+}+#[test]fn broker_events_skip_reaction_changes() {let events = broker_events_for_event(&ChannelEvent::ReactionChanged {diff --git a/crates/channels/src/outbound/pg_channels_repo.rs b/crates/channels/src/outbound/pg_channels_repo.rsindex 478ebd5d50..fe5ffee9e6 100644--- a/crates/channels/src/outbound/pg_channels_repo.rs+++ b/crates/channels/src/outbound/pg_channels_repo.rs@@ -553,38 +553,78 @@ async fn resolve_channel_display_name(Ok(info.name.clone().unwrap_or_default())}ChannelType::Private | ChannelType::DirectMessage => {- let participant_ids = load_active_participant_ids(pool, info.id).await?;- let name_lookup = load_user_display_names(pool, &participant_ids).await?;+ let principals = load_active_participant_principals(pool, info.id).await?;+ let user_ids: Vec<MacroUserIdStr<'static>> = principals+ .iter()+ .filter_map(|principal| MacroUserIdStr::try_from(principal.clone()).ok())+ .collect();+ let bot_ids: Vec<BotId> = principals+ .iter()+ .filter_map(|principal| {+ bot_id::BotIdStr::parse_from_str(principal)+ .ok()+ .map(|id| id.bot_id())+ })+ .collect();+ let name_lookup = load_user_display_names(pool, &user_ids).await?;+ let bot_name_lookup = load_bot_display_names(pool, &bot_ids).await?;+ let display_name = |principal: &String| {+ principal_display_name(principal, &name_lookup, &bot_name_lookup)+ };if matches!(info.channel_type, ChannelType::DirectMessage)- && participant_ids+ && principals.iter()- .any(|participant_id| participant_id.as_ref() == viewer_user_id.as_ref())+ .any(|principal| principal == viewer_user_id.as_ref()){- if let Some(other_participant_id) = participant_ids+ if let Some(name) = principals.iter()- .find(|participant_id| participant_id.as_ref() != viewer_user_id.as_ref())+ .filter(|principal| principal.as_str() != viewer_user_id.as_ref())+ .find_map(display_name){- return Ok(id_to_display_name(other_participant_id, &name_lookup));+ return Ok(name);}tracing::warn!(channel_id=%info.id, "direct message channel has no other participant");return Ok("Unknown".to_string());}- Ok(participant_ids+ Ok(principals.iter()- .map(|participant_id| id_to_display_name(participant_id, &name_lookup))+ .filter_map(display_name).collect::<Vec<_>>().join(", "))}}}-async fn load_active_participant_ids(+/// Display name for a participant principal: users resolve through the name+/// lookup, bots through the bot-name lookup (Macro AI is code-defined).+/// Unrecognized principals yield `None`.+fn principal_display_name(+ principal: &str,+ name_lookup: &NameLookup,+ bot_name_lookup: &HashMap<BotId, String>,+) -> Option<String> {+ if let Ok(user_id) = MacroUserIdStr::try_from(principal.to_string()) {+ return Some(id_to_display_name(&user_id, name_lookup));+ }+ let bot_id = bot_id::BotIdStr::parse_from_str(principal).ok()?.bot_id();+ if bot_id == bot_id::MACRO_AI_BOT_ID {+ return Some(bot_id::MACRO_AI_NAME.to_string());+ }+ Some(+ bot_name_lookup+ .get(&bot_id)+ .cloned()+ .unwrap_or_else(|| "Bot".to_string()),+ )+}++async fn load_active_participant_principals(pool: &PgPool,channel_id: Uuid,-) -> anyhow::Result<Vec<MacroUserIdStr<'static>>> {+) -> anyhow::Result<Vec<String>> {let rows = sqlx::query_as!(UserIdRow,r#"@@ -597,9 +637,31 @@ async fn load_active_participant_ids().fetch_all(pool).await?;- rows.into_iter()- .map(|row| MacroUserIdStr::try_from(row.user_id).map_err(Into::into))- .collect()+ Ok(rows.into_iter().map(|row| row.user_id).collect())+}++async fn load_bot_display_names(+ pool: &PgPool,+ bot_ids: &[BotId],+) -> anyhow::Result<HashMap<BotId, String>> {+ if bot_ids.is_empty() {+ return Ok(HashMap::new());+ }+ let uuids: Vec<Uuid> = bot_ids.iter().map(|bot_id| bot_id.as_uuid()).collect();+ let rows = sqlx::query!(+ r#"+ SELECT id, name+ FROM bots+ WHERE id = ANY($1) AND deleted_at IS NULL+ "#,+ &uuids,+ )+ .fetch_all(pool)+ .await?;+ Ok(rows+ .into_iter()+ .map(|row| (BotId::new_from_uuid(row.id), row.name))+ .collect())}async fn load_user_display_names(@@ -3556,15 +3618,12 @@ impl ChannelRepo for PgChannelsRepo {Ok(rows.into_iter()- .filter_map(|row| {- let user_id = MacroUserIdStr::try_from(row.user_id).ok()?;- Some(ChannelParticipant {- channel_id: row.channel_id,- user_id: user_id.as_ref().to_string(),- role: row.role,- joined_at: row.joined_at,- left_at: row.left_at,- })+ .map(|row| ChannelParticipant {+ channel_id: row.channel_id,+ user_id: row.user_id,+ role: row.role,+ joined_at: row.joined_at,+ left_at: row.left_at,}).collect())}diff --git a/crates/channels/src/outbound/pg_channels_repo/tests.rs b/crates/channels/src/outbound/pg_channels_repo/tests.rsindex c10d0374f9..8f04890cc8 100644--- a/crates/channels/src/outbound/pg_channels_repo/tests.rs+++ b/crates/channels/src/outbound/pg_channels_repo/tests.rs@@ -1870,6 +1870,78 @@ async fn participants_roles_parsed_correctly(pool: Pool<Postgres>) -> anyhow::ReOk(())}+#[sqlx::test(+ fixtures(path = "../../../fixtures", scripts("channels_repo")),+ migrator = "MACRO_DB_MIGRATIONS"+)]+async fn channel_participant_readers_handle_bot_principals(+ pool: Pool<Postgres>,+) -> anyhow::Result<()> {+ // An unnamed private channel resolves its display name from its+ // participants; bot participants contribute their bot name (never their+ // raw `bot|<uuid>` principal) and must not fail the call.+ let channel_id = Uuid::from_u128(0x00000000_0000_0000_0000_000000000c31);+ let bot_uuid = Uuid::from_u128(0x00000000_0000_0000_0000_0000_b0b0);+ sqlx::query(+ "INSERT INTO comms_channels (id, name, channel_type, owner_id, created_at, updated_at)+ VALUES ($1, NULL, 'private', $2, now(), now())",+ )+ .bind(channel_id)+ .bind(USER_A)+ .execute(&pool)+ .await?;+ sqlx::query(+ "INSERT INTO bots (id, kind, owner_user_id, name, handle, created_by)+ VALUES ($1, 'owned', $2, 'Deploy Bot', 'deploybot', $2)",+ )+ .bind(bot_uuid)+ .bind(USER_A)+ .execute(&pool)+ .await?;+ sqlx::query(+ "INSERT INTO comms_channel_participants (channel_id, user_id, role) VALUES+ ($1, $2, 'owner'),+ ($1, $3, 'member'),+ ($1, $4, 'member')",+ )+ .bind(channel_id)+ .bind(USER_A)+ .bind(USER_B)+ .bind(format!("bot|{bot_uuid}"))+ .execute(&pool)+ .await?;++ let repo = repo(pool);+ let metadata = repo+ .get_channel_metadata(channel_id, MacroUserIdStr::try_from(USER_A.to_string())?)+ .await?;+ let participants = repo.get_participants(channel_id).await?;++ assert_eq!(metadata.channel_type, ChannelType::Private);+ assert!(+ !metadata.channel_name.contains("bot|"),+ "raw bot principals must not appear in the channel display name: {}",+ metadata.channel_name+ );+ assert!(+ metadata.channel_name.contains("user-b"),+ "user participants should appear in the channel display name: {}",+ metadata.channel_name+ );+ assert!(+ metadata.channel_name.contains("Deploy Bot"),+ "bot participants should appear by bot name in the channel display name: {}",+ metadata.channel_name+ );+ assert!(+ participants+ .iter()+ .any(|participant| participant.user_id == format!("bot|{bot_uuid}")),+ "the mutation-time participant snapshot must retain installed bots"+ );+ Ok(())+}+#[sqlx::test(fixtures(path = "../../../fixtures", scripts("channels_repo")),migrator = "MACRO_DB_MIGRATIONS"diff --git a/crates/soup_realtime/src/inbound/kafka_consumer.rs b/crates/soup_realtime/src/inbound/kafka_consumer.rsindex 97254876e8..3624532e76 100644--- a/crates/soup_realtime/src/inbound/kafka_consumer.rs+++ b/crates/soup_realtime/src/inbound/kafka_consumer.rs@@ -316,6 +316,9 @@ fn patches_from_channel_event(event: &ChannelTopicEvent) -> Vec<SoupRealtimePatcChannelTopicEvent::Deleted(metadata) => {vec![delete(EntityType::Channel, metadata.channel_id)]}+ // Mentions carry no entity change beyond the message_posted event+ // emitted alongside them.+ ChannelTopicEvent::Mentioned(_) => Vec::new(),}}diff --git a/crates/webhook/Cargo.toml b/crates/webhook/Cargo.tomlindex 688a056664..26f4c82a91 100644--- a/crates/webhook/Cargo.toml+++ b/crates/webhook/Cargo.toml@@ -95,6 +95,7 @@ uuid = { workspace = true, optional = true }workspace-hack = { version = "0.1", path = "../workspace-hack" }[dev-dependencies]+bot_id = { path = "../bot_id" }channel_sender = { path = "../channel_sender" }macro_db_migrator = { path = "../macro_db_migrator" }rate_limit = { path = "../rate_limit", default-features = false, features = [diff --git a/crates/webhook/README.md b/crates/webhook/README.mdindex 250604fe81..da209badde 100644--- a/crates/webhook/README.md+++ b/crates/webhook/README.md@@ -83,8 +83,8 @@ The `webhook-event-ingestion` Kafka consumer reads `macro.documents`,- Channels: `channel.created`, `channel.updated`, `channel.deleted`,`channel.message_posted`, `channel.message_patched`,`channel.message_deleted`, `channel.message_attachment_created`,- `channel.message_attachment_removed`, `channel.participant_added`, and- `channel.participant_removed`.+ `channel.message_attachment_removed`, `channel.participant_added`,+ `channel.participant_removed`, and `channel.mentioned`.- Webhooks: `webhook.created`, `webhook.updated`, `webhook.deleted`, and`webhook.validated`.@@ -94,6 +94,15 @@ contains each person's Macro user ID, for personal webhooks, plus every team IDto which any of those people belongs. The set is deduplicated before matching,so one person or team is considered only once.+`channel.mentioned` is emitted once per distinct entity `@`-mentioned in a+channel message — users (`macro|<email>`), bots (`bot|<uuid>`), documents, and+any future mentionable kind. Bot mentions only emit when the bot is an active+channel participant; the author may itself be a bot. Like every channel+event, access and `ids` filtering are by channel: the entity is the channel+containing the message, and the mentioned entity travels in the payload's+`mentioned` field for consumers to filter on (e.g. the SDK's+`events.onSelfMention`).+Webhook events use `entity_type = "webhook"` and take the event metadata's`workspace_id` as the sole matching workspace. This is a strict owner-workspacerule: ingestion does not perform an entity-access lookup or personal/teamdiff --git a/crates/webhook/src/domain/ingestion.rs b/crates/webhook/src/domain/ingestion.rsindex 14999d96fe..4c1c1a9550 100644--- a/crates/webhook/src/domain/ingestion.rs+++ b/crates/webhook/src/domain/ingestion.rs@@ -264,6 +264,7 @@ fn normalized_channel_event(ChannelTopicEvent::MessagePosted(metadata) => {("channel.message_posted", metadata.channel_id)}+ ChannelTopicEvent::Mentioned(metadata) => ("channel.mentioned", metadata.channel_id),ChannelTopicEvent::MessagePatched(metadata) => {("channel.message_patched", metadata.channel_id)}diff --git a/crates/webhook/src/domain/ingestion/test.rs b/crates/webhook/src/domain/ingestion/test.rsindex 86bad88071..e81889d744 100644--- a/crates/webhook/src/domain/ingestion/test.rs+++ b/crates/webhook/src/domain/ingestion/test.rs@@ -12,12 +12,12 @@ use crate::domain::{use channel_sender::ChannelSender;use channels::domain::{broker_events::{- ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelMessageAttachmentCreatedMetadata,- ChannelMessageAttachmentRemovedMetadata, ChannelMessageDeletedMetadata,- ChannelMessagePatchedMetadata, ChannelMessagePostedMetadata,+ ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelMentionedMetadata,+ ChannelMessageAttachmentCreatedMetadata, ChannelMessageAttachmentRemovedMetadata,+ ChannelMessageDeletedMetadata, ChannelMessagePatchedMetadata, ChannelMessagePostedMetadata,ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelUpdatedMetadata,},- models::ChannelType,+ models::{ChannelType, SimpleMention},};use chrono::{DateTime, Utc};use documents::domain::events::{@@ -40,6 +40,7 @@ use std::{const DOCUMENT_ID: &str = "11111111-1111-1111-1111-111111111111";const COPIED_DOCUMENT_ID: &str = "22222222-2222-2222-2222-222222222222";const PERSONAL_WORKSPACE_ID: &str = "macro|[email protected]";+const BOT_PRINCIPAL_ID: &str = "bot|66666666-6666-6666-6666-666666666666";const TEAM_WORKSPACE_ID: &str = "33333333-3333-3333-3333-333333333333";fn lock<T>(mutex: &Mutex<T>) -> MutexGuard<'_, T> {@@ -419,10 +420,28 @@ struct EventCase {entity_id: String,}+impl EventCase {+ fn new(+ event: TestBrokerEvent,+ event_name: &'static str,+ entity_type: EntityType,+ normalized_entity_type: &'static str,+ entity_id: String,+ ) -> Self {+ Self {+ event,+ event_name,+ entity_type,+ normalized_entity_type,+ entity_id,+ }+ }+}+fn document_event_cases() -> Vec<EventCase> {vec![- EventCase {- event: TestBrokerEvent::Document(Event::with_schema_version(+ EventCase::new(+ TestBrokerEvent::Document(Event::with_schema_version(DocumentTopicEvent::Created(DocumentCreatedMetadata {document_id: DOCUMENT_ID.to_string(),owner: user_id("macro|[email protected]"),@@ -434,13 +453,13 @@ fn document_event_cases() -> Vec<EventCase> {}),2,)),- event_name: "document.created",- entity_type: EntityType::Document,- normalized_entity_type: DOCUMENT_ENTITY_TYPE,- entity_id: DOCUMENT_ID.to_string(),- },- EventCase {- event: TestBrokerEvent::Document(Event::with_schema_version(+ "document.created",+ EntityType::Document,+ DOCUMENT_ENTITY_TYPE,+ DOCUMENT_ID.to_string(),+ ),+ EventCase::new(+ TestBrokerEvent::Document(Event::with_schema_version(DocumentTopicEvent::Updated(DocumentUpdatedMetadata {document_id: DOCUMENT_ID.to_string(),owner: user_id("macro|[email protected]"),@@ -453,13 +472,13 @@ fn document_event_cases() -> Vec<EventCase> {}),2,)),- event_name: "document.updated",- entity_type: EntityType::Document,- normalized_entity_type: DOCUMENT_ENTITY_TYPE,- entity_id: DOCUMENT_ID.to_string(),- },- EventCase {- event: TestBrokerEvent::Document(Event::with_schema_version(+ "document.updated",+ EntityType::Document,+ DOCUMENT_ENTITY_TYPE,+ DOCUMENT_ID.to_string(),+ ),+ EventCase::new(+ TestBrokerEvent::Document(Event::with_schema_version(DocumentTopicEvent::Deleted(DocumentDeletedMetadata {document_id: DOCUMENT_ID.to_string(),actor_user_id: Some(user_id("macro|[email protected]")),@@ -467,13 +486,13 @@ fn document_event_cases() -> Vec<EventCase> {}),2,)),- event_name: "document.deleted",- entity_type: EntityType::Document,- normalized_entity_type: DOCUMENT_ENTITY_TYPE,- entity_id: DOCUMENT_ID.to_string(),- },- EventCase {- event: TestBrokerEvent::Document(Event::with_schema_version(+ "document.deleted",+ EntityType::Document,+ DOCUMENT_ENTITY_TYPE,+ DOCUMENT_ID.to_string(),+ ),+ EventCase::new(+ TestBrokerEvent::Document(Event::with_schema_version(DocumentTopicEvent::Copied(DocumentCopiedMetadata {document_id: COPIED_DOCUMENT_ID.to_string(),source_document_id: DOCUMENT_ID.to_string(),@@ -486,11 +505,11 @@ fn document_event_cases() -> Vec<EventCase> {}),2,)),- event_name: "document.copied",- entity_type: EntityType::Document,- normalized_entity_type: DOCUMENT_ENTITY_TYPE,- entity_id: COPIED_DOCUMENT_ID.to_string(),- },+ "document.copied",+ EntityType::Document,+ DOCUMENT_ENTITY_TYPE,+ COPIED_DOCUMENT_ID.to_string(),+ ),]}@@ -533,8 +552,8 @@ fn channel_event_cases() -> Vec<EventCase> {let member = "macro|[email protected]";vec![- EventCase {- event: TestBrokerEvent::Channel(Event::with_schema_version(+ EventCase::new(+ TestBrokerEvent::Channel(Event::with_schema_version(ChannelTopicEvent::Created(ChannelCreatedMetadata {channel_id,actor: sender(owner),@@ -544,13 +563,13 @@ fn channel_event_cases() -> Vec<EventCase> {}),3,)),- event_name: "channel.created",- entity_type: EntityType::Channel,- normalized_entity_type: CHANNEL_ENTITY_TYPE,- entity_id: channel_id.to_string(),- },- EventCase {- event: TestBrokerEvent::Channel(Event::with_schema_version(+ "channel.created",+ EntityType::Channel,+ CHANNEL_ENTITY_TYPE,+ channel_id.to_string(),+ ),+ EventCase::new(+ TestBrokerEvent::Channel(Event::with_schema_version(ChannelTopicEvent::Updated(ChannelUpdatedMetadata {channel_id,actor: user_id(owner),@@ -559,26 +578,26 @@ fn channel_event_cases() -> Vec<EventCase> {}),3,)),- event_name: "channel.updated",- entity_type: EntityType::Channel,- normalized_entity_type: CHANNEL_ENTITY_TYPE,- entity_id: channel_id.to_string(),- },- EventCase {- event: TestBrokerEvent::Channel(Event::with_schema_version(+ "channel.updated",+ EntityType::Channel,+ CHANNEL_ENTITY_TYPE,+ channel_id.to_string(),+ ),+ EventCase::new(+ TestBrokerEvent::Channel(Event::with_schema_version(ChannelTopicEvent::Deleted(ChannelDeletedMetadata {channel_id,actor: sender(owner),}),3,)),- event_name: "channel.deleted",- entity_type: EntityType::Channel,- normalized_entity_type: CHANNEL_ENTITY_TYPE,- entity_id: channel_id.to_string(),- },- EventCase {- event: TestBrokerEvent::Channel(Event::with_schema_version(+ "channel.deleted",+ EntityType::Channel,+ CHANNEL_ENTITY_TYPE,+ channel_id.to_string(),+ ),+ EventCase::new(+ TestBrokerEvent::Channel(Event::with_schema_version(ChannelTopicEvent::MessagePosted(ChannelMessagePostedMetadata {channel_id,message_id,@@ -593,13 +612,13 @@ fn channel_event_cases() -> Vec<EventCase> {}),3,)),- event_name: "channel.message_posted",- entity_type: EntityType::Channel,- normalized_entity_type: CHANNEL_ENTITY_TYPE,- entity_id: channel_id.to_string(),- },- EventCase {- event: TestBrokerEvent::Channel(Event::with_schema_version(+ "channel.message_posted",+ EntityType::Channel,+ CHANNEL_ENTITY_TYPE,+ channel_id.to_string(),+ ),+ EventCase::new(+ TestBrokerEvent::Channel(Event::with_schema_version(ChannelTopicEvent::MessagePatched(ChannelMessagePatchedMetadata {channel_id,message_id,@@ -611,13 +630,13 @@ fn channel_event_cases() -> Vec<EventCase> {}),3,)),- event_name: "channel.message_patched",- entity_type: EntityType::Channel,- normalized_entity_type: CHANNEL_ENTITY_TYPE,- entity_id: channel_id.to_string(),- },- EventCase {- event: TestBrokerEvent::Channel(Event::with_schema_version(+ "channel.message_patched",+ EntityType::Channel,+ CHANNEL_ENTITY_TYPE,+ channel_id.to_string(),+ ),+ EventCase::new(+ TestBrokerEvent::Channel(Event::with_schema_version(ChannelTopicEvent::MessageDeleted(ChannelMessageDeletedMetadata {channel_id,message_id,@@ -627,13 +646,13 @@ fn channel_event_cases() -> Vec<EventCase> {}),3,)),- event_name: "channel.message_deleted",- entity_type: EntityType::Channel,- normalized_entity_type: CHANNEL_ENTITY_TYPE,- entity_id: channel_id.to_string(),- },- EventCase {- event: TestBrokerEvent::Channel(Event::with_schema_version(+ "channel.message_deleted",+ EntityType::Channel,+ CHANNEL_ENTITY_TYPE,+ channel_id.to_string(),+ ),+ EventCase::new(+ TestBrokerEvent::Channel(Event::with_schema_version(ChannelTopicEvent::MessageAttachmentCreated(ChannelMessageAttachmentCreatedMetadata {channel_id,@@ -644,13 +663,13 @@ fn channel_event_cases() -> Vec<EventCase> {),3,)),- event_name: "channel.message_attachment_created",- entity_type: EntityType::Channel,- normalized_entity_type: CHANNEL_ENTITY_TYPE,- entity_id: channel_id.to_string(),- },- EventCase {- event: TestBrokerEvent::Channel(Event::with_schema_version(+ "channel.message_attachment_created",+ EntityType::Channel,+ CHANNEL_ENTITY_TYPE,+ channel_id.to_string(),+ ),+ EventCase::new(+ TestBrokerEvent::Channel(Event::with_schema_version(ChannelTopicEvent::MessageAttachmentRemoved(ChannelMessageAttachmentRemovedMetadata {channel_id,@@ -661,13 +680,13 @@ fn channel_event_cases() -> Vec<EventCase> {),3,)),- event_name: "channel.message_attachment_removed",- entity_type: EntityType::Channel,- normalized_entity_type: CHANNEL_ENTITY_TYPE,- entity_id: channel_id.to_string(),- },- EventCase {- event: TestBrokerEvent::Channel(Event::with_schema_version(+ "channel.message_attachment_removed",+ EntityType::Channel,+ CHANNEL_ENTITY_TYPE,+ channel_id.to_string(),+ ),+ EventCase::new(+ TestBrokerEvent::Channel(Event::with_schema_version(ChannelTopicEvent::ParticipantAdded(ChannelParticipantAddedMetadata {channel_id,channel_type: ChannelType::Team,@@ -676,13 +695,13 @@ fn channel_event_cases() -> Vec<EventCase> {}),3,)),- event_name: "channel.participant_added",- entity_type: EntityType::Channel,- normalized_entity_type: CHANNEL_ENTITY_TYPE,- entity_id: channel_id.to_string(),- },- EventCase {- event: TestBrokerEvent::Channel(Event::with_schema_version(+ "channel.participant_added",+ EntityType::Channel,+ CHANNEL_ENTITY_TYPE,+ channel_id.to_string(),+ ),+ EventCase::new(+ TestBrokerEvent::Channel(Event::with_schema_version(ChannelTopicEvent::ParticipantRemoved(ChannelParticipantRemovedMetadata {channel_id,channel_type: ChannelType::Team,@@ -691,11 +710,35 @@ fn channel_event_cases() -> Vec<EventCase> {}),3,)),- event_name: "channel.participant_removed",- entity_type: EntityType::Channel,- normalized_entity_type: CHANNEL_ENTITY_TYPE,- entity_id: channel_id.to_string(),- },+ "channel.participant_removed",+ EntityType::Channel,+ CHANNEL_ENTITY_TYPE,+ channel_id.to_string(),+ ),+ // Like every channel event, mentions match and resolve access on the+ // channel; the mentioned entity is payload for consumers to filter on.+ EventCase::new(+ TestBrokerEvent::Channel(Event::with_schema_version(+ ChannelTopicEvent::Mentioned(ChannelMentionedMetadata {+ channel_id,+ message_id,+ thread_id: None,+ sender: sender(member),+ channel_type: ChannelType::Team,+ content: "hello bot".to_string(),+ mentioned: SimpleMention {+ entity_type: "bot".to_string(),+ entity_id: BOT_PRINCIPAL_ID.to_string(),+ },+ created_at: timestamp(),+ }),+ 3,+ )),+ "channel.mentioned",+ EntityType::Channel,+ CHANNEL_ENTITY_TYPE,+ channel_id.to_string(),+ ),]}@@ -786,12 +829,12 @@ fn webhook_event_cases() -> Vec<WebhookEventCase> {}#[tokio::test]-async fn normalizes_and_matches_all_fourteen_event_variants() {+async fn normalizes_and_matches_all_fifteen_event_variants() {let event_cases = document_event_cases().into_iter().chain(channel_event_cases()).collect::<Vec<_>>();- assert_eq!(event_cases.len(), 14);+ assert_eq!(event_cases.len(), 15);for event_case in event_cases {let access = MockAccessService::with_users(vec![user_id(PERSONAL_WORKSPACE_ID)]);diff --git a/packages/sdk/generated/storage/index.ts b/packages/sdk/generated/storage/index.tsindex 97980716b0..b1d85a97b6 100644--- a/packages/sdk/generated/storage/index.ts+++ b/packages/sdk/generated/storage/index.ts@@ -1,4 +1,4 @@// This file is auto-generated by @hey-api/openapi-tsexport { type Options, Sdk } from './sdk.gen';-export type { AccessLevel, Activity, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Anchor, AnchorId, AnchorRequest, AnchorResponse, AnnotationIncrementalUpdate, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelContextMessage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelMessage, ApiChannelMessageKind, ApiChannelMessagesPage, ApiChannelParticipant, ApiChannelWithLatest, ApiCountedReaction, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiMessageAttachment, ApiMessageSender, ApiMessageSenderType, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, ApiResolvedChannelMessage, ApiThreadInfo, ApiThreadReply, BasicDocument, BasicDocumentSubType, BomPart, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CallActiveResponse, CallFilters, CallRecord, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelEventAttachment, ChannelFilters, ChannelJoinCodeResponse, ChannelMessage, ChannelMessageAttachmentCreatedMetadata, ChannelMessageAttachmentRemovedMetadata, ChannelMessageDeletedMetadata, ChannelMessageFilters, ChannelMessagePatchedMetadata, ChannelMessagePostedMetadata, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClientOptions, CloudStorageItemType, Comment, CommentThread, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCommentData, CreateCommentError, CreateCommentErrors, CreateCommentRequest, CreateCommentResponse, CreateCommentResponse2, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentError, CreateCrmCommentErrors, CreateCrmCommentRequest, CreateCrmCommentResponse, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmComment, CrmCommentEntityType, CrmCommentThread, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmTeamSettingsResponse, CrmThread, CustomSpeakerAssignment, DataType, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorInfo, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelResponse, DeleteChannelResponses, DeleteCommentData, DeleteCommentError, DeleteCommentErrors, DeleteCommentRequest, DeleteCommentResponse, DeleteCommentResponse2, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentError, DeleteCrmCommentErrors, DeleteCrmCommentResponse, DeleteCrmCommentResponses, DeleteCrmCommentResult, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageError, DeleteMessageErrors, DeleteMessageQuery, DeleteMessageResponse, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteThreadInfo, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentTeamShareResponse, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditCommentData, EditCommentError, EditCommentErrors, EditCommentRequest, EditCommentResponse, EditCommentResponse2, EditCommentResponses, EditCrmCommentData, EditCrmCommentError, EditCrmCommentErrors, EditCrmCommentRequest, EditCrmCommentResponse, EditCrmCommentResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmptyResponse, EntityFilters, EntityPermission, EntityPermissionResponse, EntityReference, EntityType, ErrorResponse, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileSystemNodeWithIds, FileType, FileTypeUpdate, FolderItem, ForeignEntity, ForeignEntityFilters, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActivitiesResponse, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesError, GetChannelMessagesErrors, GetChannelMessagesResponse, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsError, GetDocumentCommentsErrors, GetDocumentCommentsResponse, GetDocumentCommentsResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextError, GetMessageWithContextErrors, GetMessageWithContextResponse, GetMessageWithContextResponse2, GetMessageWithContextResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetRecentActivityHandlerData, GetRecentActivityHandlerError, GetRecentActivityHandlerErrors, GetRecentActivityHandlerResponse, GetRecentActivityHandlerResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetThreadRepliesData, GetThreadRepliesError, GetThreadRepliesErrors, GetThreadRepliesResponse, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubPullRequest, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestsResponse, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InstallSyncData, InteractionReason, Item, ItemWithUserAccessLevel, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, LatestMessage, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsError, ListCrmCommentsErrors, ListCrmCommentsResponse, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Mentions, NewChannelAttachment, NotificationFilters, Params, ParticipantRole, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageData, PatchMessageError, PatchMessageErrors, PatchMessageRequest, PatchMessageResponse, PatchMessageResponses, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfAnchorRequest, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PdfPlaceableCommentAnchorRequest, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesError, PostChannelMessagesErrors, PostChannelMessagesResponse, PostChannelMessagesResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessageData, PostMessageError, PostMessageErrors, PostMessageRequest, PostMessageResponse, PostMessageResponse2, PostMessageResponses, PostReactionData, PostReactionError, PostReactionErrors, PostReactionRequest, PostReactionResponse, PostReactionResponses, PostSoupAstRequest, PostSoupRequest, PostTypingData, PostTypingError, PostTypingErrors, PostTypingRequest, PostTypingResponse, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresignedUrl, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyFilter, PropertyInput, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, ReactionAction, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageError, ResolveChannelMessageErrors, ResolveChannelMessageResponse, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, S3ObjectInfo, SaveBomPart, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetPropertyValue, SharedEmailFilter, SharePermissionV2, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SoupApiItem, SoupApiSort, SoupAttachment, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmDomain, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupThreadInfo, SoupThreadReply, StarterDocumentsResponse, String, SuccessResponse, SyncServiceVersionId, TagFilterMode, TaskFilters, TeamRole, Thread, ThreadResponse, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TranscriptSegmentRequest, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingAction, UnthreadedPdfUuidRequest, UpdateChannelSharePermission, UpdateCrmTeamSettingsRequest, UpdateOperation, UpdateSharePermissionRequestV2, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserActivitiesResponse, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, View, ViewPatch, ViewsResponse, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';+export type { AccessLevel, Activity, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Anchor, AnchorId, AnchorRequest, AnchorResponse, AnnotationIncrementalUpdate, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelContextMessage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelMessage, ApiChannelMessageKind, ApiChannelMessagesPage, ApiChannelParticipant, ApiChannelWithLatest, ApiCountedReaction, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiMessageAttachment, ApiMessageSender, ApiMessageSenderType, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, ApiResolvedChannelMessage, ApiThreadInfo, ApiThreadReply, BasicDocument, BasicDocumentSubType, BomPart, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CallActiveResponse, CallFilters, CallRecord, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelEventAttachment, ChannelFilters, ChannelJoinCodeResponse, ChannelMentionedMetadata, ChannelMessage, ChannelMessageAttachmentCreatedMetadata, ChannelMessageAttachmentRemovedMetadata, ChannelMessageDeletedMetadata, ChannelMessageFilters, ChannelMessagePatchedMetadata, ChannelMessagePostedMetadata, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClientOptions, CloudStorageItemType, Comment, CommentThread, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCommentData, CreateCommentError, CreateCommentErrors, CreateCommentRequest, CreateCommentResponse, CreateCommentResponse2, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentError, CreateCrmCommentErrors, CreateCrmCommentRequest, CreateCrmCommentResponse, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmComment, CrmCommentEntityType, CrmCommentThread, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmTeamSettingsResponse, CrmThread, CustomSpeakerAssignment, DataType, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorInfo, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelResponse, DeleteChannelResponses, DeleteCommentData, DeleteCommentError, DeleteCommentErrors, DeleteCommentRequest, DeleteCommentResponse, DeleteCommentResponse2, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentError, DeleteCrmCommentErrors, DeleteCrmCommentResponse, DeleteCrmCommentResponses, DeleteCrmCommentResult, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageError, DeleteMessageErrors, DeleteMessageQuery, DeleteMessageResponse, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteThreadInfo, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentTeamShareResponse, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditCommentData, EditCommentError, EditCommentErrors, EditCommentRequest, EditCommentResponse, EditCommentResponse2, EditCommentResponses, EditCrmCommentData, EditCrmCommentError, EditCrmCommentErrors, EditCrmCommentRequest, EditCrmCommentResponse, EditCrmCommentResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmptyResponse, EntityFilters, EntityPermission, EntityPermissionResponse, EntityReference, EntityType, ErrorResponse, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileSystemNodeWithIds, FileType, FileTypeUpdate, FolderItem, ForeignEntity, ForeignEntityFilters, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActivitiesResponse, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesError, GetChannelMessagesErrors, GetChannelMessagesResponse, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsError, GetDocumentCommentsErrors, GetDocumentCommentsResponse, GetDocumentCommentsResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextError, GetMessageWithContextErrors, GetMessageWithContextResponse, GetMessageWithContextResponse2, GetMessageWithContextResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetRecentActivityHandlerData, GetRecentActivityHandlerError, GetRecentActivityHandlerErrors, GetRecentActivityHandlerResponse, GetRecentActivityHandlerResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetThreadRepliesData, GetThreadRepliesError, GetThreadRepliesErrors, GetThreadRepliesResponse, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubPullRequest, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestsResponse, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InstallSyncData, InteractionReason, Item, ItemWithUserAccessLevel, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, LatestMessage, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsError, ListCrmCommentsErrors, ListCrmCommentsResponse, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Mentions, NewChannelAttachment, NotificationFilters, Params, ParticipantRole, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageData, PatchMessageError, PatchMessageErrors, PatchMessageRequest, PatchMessageResponse, PatchMessageResponses, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfAnchorRequest, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PdfPlaceableCommentAnchorRequest, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesError, PostChannelMessagesErrors, PostChannelMessagesResponse, PostChannelMessagesResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessageData, PostMessageError, PostMessageErrors, PostMessageRequest, PostMessageResponse, PostMessageResponse2, PostMessageResponses, PostReactionData, PostReactionError, PostReactionErrors, PostReactionRequest, PostReactionResponse, PostReactionResponses, PostSoupAstRequest, PostSoupRequest, PostTypingData, PostTypingError, PostTypingErrors, PostTypingRequest, PostTypingResponse, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresignedUrl, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyFilter, PropertyInput, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, ReactionAction, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageError, ResolveChannelMessageErrors, ResolveChannelMessageResponse, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, S3ObjectInfo, SaveBomPart, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetPropertyValue, SharedEmailFilter, SharePermissionV2, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SoupApiItem, SoupApiSort, SoupAttachment, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmDomain, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupThreadInfo, SoupThreadReply, StarterDocumentsResponse, String, SuccessResponse, SyncServiceVersionId, TagFilterMode, TaskFilters, TeamRole, Thread, ThreadResponse, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TranscriptSegmentRequest, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingAction, UnthreadedPdfUuidRequest, UpdateChannelSharePermission, UpdateCrmTeamSettingsRequest, UpdateOperation, UpdateSharePermissionRequestV2, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserActivitiesResponse, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, View, ViewPatch, ViewsResponse, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';diff --git a/packages/sdk/generated/storage/sdk.gen.ts b/packages/sdk/generated/storage/sdk.gen.tsindex 69f51b92b8..0cfc84c078 100644--- a/packages/sdk/generated/storage/sdk.gen.ts+++ b/packages/sdk/generated/storage/sdk.gen.ts@@ -2,7 +2,7 @@import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';import { client } from './client.gen';-import type { AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCommentData, CreateCommentErrors, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentErrors, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentErrors, DeleteCrmCommentResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageErrors, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditCommentData, EditCommentErrors, EditCommentResponses, EditCrmCommentData, EditCrmCommentErrors, EditCrmCommentResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesErrors, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsErrors, GetDocumentCommentsResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextErrors, GetMessageWithContextResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetRecentActivityHandlerData, GetRecentActivityHandlerErrors, GetRecentActivityHandlerResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetThreadRepliesData, GetThreadRepliesErrors, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsErrors, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchMessageData, PatchMessageErrors, PatchMessageResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesErrors, PostChannelMessagesResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PostMessageData, PostMessageErrors, PostMessageResponses, PostReactionData, PostReactionErrors, PostReactionResponses, PostTypingData, PostTypingErrors, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageErrors, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';+import type { AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCommentData, CreateCommentErrors, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentErrors, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentErrors, DeleteCrmCommentResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageErrors, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditCommentData, EditCommentErrors, EditCommentResponses, EditCrmCommentData, EditCrmCommentErrors, EditCrmCommentResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesErrors, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsErrors, GetDocumentCommentsResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextErrors, GetMessageWithContextResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetRecentActivityHandlerData, GetRecentActivityHandlerErrors, GetRecentActivityHandlerResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetThreadRepliesData, GetThreadRepliesErrors, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsErrors, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchMessageData, PatchMessageErrors, PatchMessageResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesErrors, PostChannelMessagesResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PostMessageData, PostMessageErrors, PostMessageResponses, PostReactionData, PostReactionErrors, PostReactionResponses, PostTypingData, PostTypingErrors, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageErrors, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {/**@@ -167,6 +167,13 @@ export class Sdk extends HeyApiClient {});}+ /**+ * Handler for `GET /bots/me`.+ */+ public getSelfBot<ThrowOnError extends boolean = false>(options?: Options<GetSelfBotData, ThrowOnError>): RequestResult<GetSelfBotResponses, GetSelfBotErrors, ThrowOnError> {+ return (options?.client ?? this.client).get<GetSelfBotResponses, GetSelfBotErrors, ThrowOnError>({ url: '/bots/me', ...options });+ }+/*** Handler for `GET /bots/{bot_id}/channels`.*/diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.tsindex 005cf9663b..bf019de03e 100644--- a/packages/sdk/generated/storage/types.gen.ts+++ b/packages/sdk/generated/storage/types.gen.ts@@ -1572,6 +1572,46 @@ export type ChannelJoinCodeResponse = {join_code: string;};+/**+ * Metadata for [`ChannelTopicEvent::Mentioned`].+ */+export type ChannelMentionedMetadata = {+ /**+ * Channel containing the message.+ */+ channel_id: string;+ /**+ * Type of channel containing the message.+ */+ channel_type: ChannelType;+ /**+ * Message body.+ */+ content: string;+ /**+ * Creation timestamp reported by the repository.+ */+ created_at: string;+ /**+ * The mentioned entity this event is about (`user`, `bot`, `document`, …).+ *+ * The message's full mention list travels on `channel.message_posted`.+ */+ mentioned: SimpleMention;+ /**+ * The id of the message carrying the mention.+ */+ message_id: string;+ /**+ * Message author; may be a bot.+ */+ sender: ChannelSender;+ /**+ * Thread parent id when the message is a thread reply.+ */+ thread_id?: string | null;+};+/*** Lightweight channel message for soup payloads.*/@@ -1967,6 +2007,12 @@ export type ChannelTopicEvent = {* A message was posted.*/metadata: ChannelMessagePostedMetadata;+} | {+ event_type: 'channel.mentioned';+ /**+ * An entity (user, bot, document, …) was mentioned in a message.+ */+ metadata: ChannelMentionedMetadata;} | {event_type: 'channel.message_patched';/**@@ -7611,6 +7657,28 @@ export type CreateCommentResponses = {export type CreateCommentResponse2 = CreateCommentResponses[keyof CreateCommentResponses];+export type GetSelfBotData = {+ body?: never;+ path?: never;+ query?: never;+ url: '/bots/me';+};++export type GetSelfBotErrors = {+ 401: ErrorResponse;+ 403: ErrorResponse;+ 404: ErrorResponse;+ 500: ErrorResponse;+};++export type GetSelfBotError = GetSelfBotErrors[keyof GetSelfBotErrors];++export type GetSelfBotResponses = {+ 200: Bot;+};++export type GetSelfBotResponse = GetSelfBotResponses[keyof GetSelfBotResponses];+export type ListBotChannelsData = {body?: never;path: {diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.jsonindex 5858e9f80f..bc2e18819b 100644--- a/packages/sdk/specs/storage.json+++ b/packages/sdk/specs/storage.json@@ -594,6 +594,65 @@}}},+ "/bots/me": {+ "get": {+ "tags": ["bots"],+ "summary": "Handler for `GET /bots/me`.",+ "operationId": "get_self_bot",+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/Bot"+ }+ }+ }+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "403": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "404": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "500": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ }+ },"/bots/{bot_id}/channels": {"get": {"tags": ["bots"],@@ -12695,6 +12754,57 @@}}},+ "ChannelMentionedMetadata": {+ "type": "object",+ "description": "Metadata for [`ChannelTopicEvent::Mentioned`].",+ "required": [+ "channel_id",+ "message_id",+ "sender",+ "channel_type",+ "content",+ "mentioned",+ "created_at"+ ],+ "properties": {+ "channel_id": {+ "type": "string",+ "format": "uuid",+ "description": "Channel containing the message."+ },+ "channel_type": {+ "$ref": "#/components/schemas/ChannelType",+ "description": "Type of channel containing the message."+ },+ "content": {+ "type": "string",+ "description": "Message body."+ },+ "created_at": {+ "type": "string",+ "format": "date-time",+ "description": "Creation timestamp reported by the repository."+ },+ "mentioned": {+ "$ref": "#/components/schemas/SimpleMention",+ "description": "The mentioned entity this event is about (`user`, `bot`, `document`, …).\n\nThe message's full mention list travels on `channel.message_posted`."+ },+ "message_id": {+ "type": "string",+ "format": "uuid",+ "description": "The id of the message carrying the mention."+ },+ "sender": {+ "$ref": "#/components/schemas/ChannelSender",+ "description": "Message author; may be a bot."+ },+ "thread_id": {+ "type": ["string", "null"],+ "format": "uuid",+ "description": "Thread parent id when the message is a thread reply."+ }+ }+ },"ChannelMessage": {"type": "object","description": "Lightweight channel message for soup payloads.",@@ -13275,6 +13385,21 @@}}},+ {+ "type": "object",+ "description": "An entity (user, bot, document, …) was mentioned in a message.",+ "required": ["metadata", "event_type"],+ "properties": {+ "event_type": {+ "type": "string",+ "enum": ["channel.mentioned"]+ },+ "metadata": {+ "$ref": "#/components/schemas/ChannelMentionedMetadata",+ "description": "An entity (user, bot, document, …) was mentioned in a message."+ }+ }+ },{"type": "object","description": "A message's content was patched.",diff --git a/packages/sdk/src/entities/bots/namespace.ts b/packages/sdk/src/entities/bots/namespace.tsnew file mode 100644index 0000000000..1b103fb272--- /dev/null+++ b/packages/sdk/src/entities/bots/namespace.ts@@ -0,0 +1,42 @@+import type { Bot } from '../../../generated/storage/types.gen';+import { MacroError, unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';++/**+ * The authenticated bot's identity. Only meaningful with bot auth+ * (`auth: { type: 'bot', token }`).+ */+export class BotsNamespace {+ constructor(private readonly client: MacroClient) {}++ /**+ * The authenticated bot's own record. Requires bot auth; with a user API+ * key this throws (a user token has no bot identity).+ */+ async me(): Promise<Bot> {+ if (this.client.authConfig.type !== 'bot') {+ throw new MacroError(+ 'bots.me() requires bot auth — a user API key has no bot identity',+ );+ }+ return unwrap(+ await this.client.storage.getSelfBot({+ headers: { 'x-macro-bot-scope': 'user' },+ }),+ );+ }++ /**+ * The authenticated bot's canonical principal id (`bot|<uuid>`) — the form+ * used for bot mentions, senders, and webhook `ids` filters. Cached on the+ * client; see {@link MacroClient.myPrincipalId}.+ */+ async myPrincipalId(): Promise<string> {+ if (this.client.authConfig.type !== 'bot') {+ throw new MacroError(+ 'bots.myPrincipalId() requires bot auth — a user API key has no bot identity',+ );+ }+ return this.client.myPrincipalId();+ }+}diff --git a/packages/sdk/src/events/receiver.ts b/packages/sdk/src/events/receiver.tsindex 31e80937b7..91fcde7110 100644--- a/packages/sdk/src/events/receiver.ts+++ b/packages/sdk/src/events/receiver.ts@@ -56,6 +56,32 @@ export class MacroEvents {return () => set.delete(handler as AnyHandler);}+ /**+ * Subscribe to @-mentions of the authenticated caller: `channel.mentioned`+ * deliveries whose mentioned entity is this bot (bot auth) or this user+ * (user auth).+ *+ * `channel.mentioned` deliveries cover every mention in channels the+ * webhook's workspace can access (its `ids` filter, like all channel+ * events, holds channel ids); picking out "me" happens here, client-side.+ * The caller's identity is resolved lazily (once) on the first delivery.+ * The webhook itself is registered separately and once, e.g.+ * `macro.webhooks.create({ filters: [{ events: ['channel.mentioned'] }],+ * … })`.+ *+ * @returns An unsubscribe function.+ */+ onSelfMention(handler: EventHandler<'channel.mentioned'>): () => void {+ return this.on('channel.mentioned', async (event) => {+ // Principals embed emails for users; emails are case-insensitive.+ const mentioned = event.metadata.mentioned.entity_id.toLowerCase();+ if (mentioned !== (await this.client.myPrincipalId()).toLowerCase()) {+ return;+ }+ await handler(event);+ });+ }+/*** Feed a raw delivery in: verifies the signature, parses, and dispatches to* matching handlers.diff --git a/packages/sdk/src/macro.ts b/packages/sdk/src/macro.tsindex 3681f75470..8354ac2e17 100644--- a/packages/sdk/src/macro.ts+++ b/packages/sdk/src/macro.ts@@ -1,4 +1,5 @@import type { MacroOpts } from './config';+import { BotsNamespace } from './entities/bots/namespace';import { CallRecordNamespace } from './entities/calls/namespace';import { ChannelNamespace } from './entities/channels/namespace';import { ChatNamespace } from './entities/chats/namespace';@@ -32,6 +33,7 @@ export {} from './mentions';export class Macro<T extends MacroOpts = MacroOpts> {+ readonly bots: BotsNamespace;readonly calls: CallRecordNamespace;readonly channels: ChannelNamespace;readonly chats: ChatNamespace;@@ -61,6 +63,7 @@ export class Macro<T extends MacroOpts = MacroOpts> {this.opts = opts;const client = new MacroClient(opts);this._client = client;+ this.bots = new BotsNamespace(client);this.calls = new CallRecordNamespace(client);this.channels = new ChannelNamespace(client);this.chats = new ChatNamespace(client);@@ -81,6 +84,14 @@ export class Macro<T extends MacroOpts = MacroOpts> {this.webAppUrl = client.webAppUrl;}+ /**+ * The authenticated caller's mentionable principal — `bot|<uuid>` for bot+ * auth, `macro|<email>` for user auth — fetched once and cached.+ */+ myPrincipalId(): Promise<string> {+ return this._client.myPrincipalId();+ }+/** Clone of this SDK acting on behalf of `userId` (sent as* `x-macro-bot-for-macro-user-id`). Bot auth only — throws for user auth,* since a user token always acts as its own user. */diff --git a/packages/sdk/src/utils/client.ts b/packages/sdk/src/utils/client.tsindex 5183dcc767..7abb4caa75 100644--- a/packages/sdk/src/utils/client.ts+++ b/packages/sdk/src/utils/client.ts@@ -15,6 +15,8 @@ import {type ServiceName,WEB_APP_URLS,} from '../config';+import { BotsNamespace } from '../entities/bots/namespace';+import { User } from '../entities/users/user';import { MacroEvents } from '../events/receiver';import { resolveLocalPortmap } from '../local-portmap';@@ -33,6 +35,7 @@ export class MacroClient {/** Resolved authentication config (distinct from `auth`, the auth-service SDK). */readonly authConfig: MacroAuth;private readonly requestedAs?: string;+ private selfPrincipal?: Promise<string>;constructor(opts: MacroOpts) {const env: Env = opts.env ?? 'dev';@@ -82,6 +85,28 @@ export class MacroClient {}}+ /** Whether requests have a user identity accepted by acting-user endpoints. */+ hasActingUser(): boolean {+ return this.authConfig.type === 'user' || this.requestedAs !== undefined;+ }++ /**+ * The authenticated caller's mentionable principal — `bot|<uuid>` for bot+ * auth, `macro|<email>` for user auth — fetched once and cached. Failed+ * lookups are not cached, so a later call retries.+ */+ myPrincipalId(): Promise<string> {+ this.selfPrincipal ??= (+ this.authConfig.type === 'bot'+ ? new BotsNamespace(this).me().then((bot) => `bot|${bot.id}`)+ : User.me(this).then((user) => user.id)+ ).catch((error) => {+ this.selfPrincipal = undefined;+ throw error;+ });+ return this.selfPrincipal;+ }+private makeClient(baseUrl: string) {const c = createClient({ baseUrl });c.interceptors.request.use(async (request) => {@@ -89,10 +114,12 @@ export class MacroClient {const tok = typeof source === 'function' ? await source() : source;if (this.authConfig.type === 'bot') {request.headers.set('x-macro-bot-token', tok);- request.headers.set(- 'x-macro-bot-scope',- this.authConfig.scope ?? (this.requestedAs ? 'user' : 'team'),- );+ if (!request.headers.has('x-macro-bot-scope')) {+ request.headers.set(+ 'x-macro-bot-scope',+ this.authConfig.scope ?? (this.requestedAs ? 'user' : 'team'),+ );+ }if (this.requestedAs) {request.headers.set('x-macro-bot-for-macro-user-id',diff --git a/packages/sdk/tests/bots-namespace.test.ts b/packages/sdk/tests/bots-namespace.test.tsnew file mode 100644index 0000000000..fabc15b848--- /dev/null+++ b/packages/sdk/tests/bots-namespace.test.ts@@ -0,0 +1,45 @@+import { afterEach, describe, expect, test } from 'bun:test';+import type { Bot } from '../generated/storage/types.gen';+import { Macro } from '../src/macro';++const originalFetch = globalThis.fetch;++afterEach(() => {+ globalThis.fetch = originalFetch;+});++describe('BotsNamespace', () => {+ test('uses user scope for self lookup with default bot auth', async () => {+ const bot: Bot = {+ id: '0198a4cc-e138-7670-a308-a6b766602700',+ kind: 'owned',+ owner: { type: 'user', user_id: 'macro|[email protected]' },+ name: 'Mention Bot',+ handle: 'mention-bot',+ description: null,+ avatar_url: null,+ created_by: 'macro|[email protected]',+ created_at: '2026-07-31T12:00:00Z',+ updated_at: '2026-07-31T12:00:00Z',+ deleted_at: null,+ };+ let request: Request | undefined;+ globalThis.fetch = (async (input) => {+ request = input instanceof Request ? input : new Request(input);+ return new Response(JSON.stringify(bot), {+ status: 200,+ headers: { 'content-type': 'application/json' },+ });+ }) as typeof fetch;+ const macro = new Macro({+ auth: { type: 'bot', token: 'mbot_user_owned' },+ hosts: { storage: 'https://storage.example.test' },+ });++ await expect(macro.bots.me()).resolves.toEqual(bot);+ expect(request?.url).toBe('https://storage.example.test/bots/me');+ expect(request?.headers.get('x-macro-bot-token')).toBe('mbot_user_owned');+ expect(request?.headers.get('x-macro-bot-scope')).toBe('user');+ expect(request?.headers.has('x-macro-bot-for-macro-user-id')).toBe(false);+ });+});diff --git a/packages/sdk/tsconfig.json b/packages/sdk/tsconfig.jsonindex e58edce30e..9baf06fd7b 100644--- a/packages/sdk/tsconfig.json+++ b/packages/sdk/tsconfig.json@@ -12,6 +12,12 @@"noEmit": true,"forceConsistentCasingInFileNames": true},- "include": ["*.ts", "scripts/**/*.ts", "generated/**/*.ts", "src/**/*.ts"],+ "include": [+ "*.ts",+ "scripts/**/*.ts",+ "generated/**/*.ts",+ "src/**/*.ts",+ "tests/**/*.ts"+ ],"exclude": ["node_modules"]}diff --git a/services/document_storage_service/src/api/swagger.rs b/services/document_storage_service/src/api/swagger.rsindex 172aa790ea..95cd658250 100644--- a/services/document_storage_service/src/api/swagger.rs+++ b/services/document_storage_service/src/api/swagger.rs@@ -248,6 +248,7 @@ use utoipa::OpenApi;channels::inbound::axum_router::post_activity_handler,// bots+ bots::inbound::axum_router::get_self_bot_handler,bots::inbound::axum_router::list_bot_channels_handler,bots::inbound::axum_router::remove_bot_channel_handler,bots::inbound::channel_webhook_router::create_channel_scoped_bot_handler,diff --git a/services/search_processing_service/src/inbound/kafka_consumer/channel.rs b/services/search_processing_service/src/inbound/kafka_consumer/channel.rsindex e811a36e65..ac883e97e4 100644--- a/services/search_processing_service/src/inbound/kafka_consumer/channel.rs+++ b/services/search_processing_service/src/inbound/kafka_consumer/channel.rs@@ -51,6 +51,13 @@ pub(super) fn describe_channel_event(event: &ChannelTopicEvent) -> ChannelEventDchannel_id: metadata.channel_id,event_type: "channel.message_posted",},+ // Mentions carry no index change beyond the message_posted event+ // emitted alongside them.+ ChannelTopicEvent::Mentioned(metadata) => ChannelEventDescription {+ action: ChannelIndexAction::Ignore,+ channel_id: metadata.channel_id,+ event_type: "channel.mentioned",+ },ChannelTopicEvent::MessagePatched(metadata) => ChannelEventDescription {action: ChannelIndexAction::UpsertMessage {channel_id: metadata.channel_id,