diff --git a/.changeset/manifest-code-channels.md b/.changeset/manifest-code-channels.md new file mode 100644 index 000000000..a41243c96 --- /dev/null +++ b/.changeset/manifest-code-channels.md @@ -0,0 +1,5 @@ +--- +"@slack/web-api": minor +--- + +feat: add the `code_channels` app manifest feature and the `code_channels:manage` bot scope to manifest types diff --git a/packages/web-api/src/types/request/manifest.ts b/packages/web-api/src/types/request/manifest.ts index afe338dba..2efec77f5 100644 --- a/packages/web-api/src/types/request/manifest.ts +++ b/packages/web-api/src/types/request/manifest.ts @@ -65,6 +65,12 @@ interface ManifestFeatures { * @see {@link https://docs.slack.dev/legacy/legacy-bot-users Legacy bots}. */ bot_user?: ManifestBotUser; + /** + * @description A subgroup of settings that describe {@link https://docs.slack.dev/ai/slack-code code channels} + * configuration. + * @see {@link https://docs.slack.dev/ai/slack-code#enabling-code-channels Enabling code channels}. + */ + code_channels?: ManifestCodeChannels; /** * @description An array of settings groups that describe {@link https://docs.slack.dev/interactivity/implementing-shortcuts shortcuts} * configuration. A maximum of 10 shortcuts can be included in this array. @@ -153,6 +159,18 @@ interface ManifestBotUser { always_online?: boolean; } +interface ManifestCodeChannels { + /** @description A boolean that specifies whether or not code channels are enabled for the app. */ + enabled?: boolean; + /** + * @description A string containing the `https` URL where Slack delivers invocations of your agent's + * {@link https://docs.slack.dev/ai/slack-code/agent-slash-commands runtime-registered slash commands}. Not needed for + * Socket Mode or hosted apps. Maximum length is 3000 characters. + * @see {@link https://docs.slack.dev/ai/slack-code/agent-slash-commands Agent slash commands}. + */ + slash_command_url?: string; +} + interface ManifestShortcut { /** @description Specifies which {@link https://docs.slack.dev/interactivity/implementing-shortcuts type of shortcut} is being described. */ type: 'global' | 'message'; @@ -362,6 +380,7 @@ type BotScope = | 'chat:write' | 'chat:write.customize' | 'chat:write.public' + | 'code_channels:manage' | 'commands' | 'conversations.connect:manage' | 'conversations.connect:read' diff --git a/packages/web-api/test/types/methods/apps.test-d.ts b/packages/web-api/test/types/methods/apps.test-d.ts index b1c9b002f..077235290 100644 --- a/packages/web-api/test/types/methods/apps.test-d.ts +++ b/packages/web-api/test/types/methods/apps.test-d.ts @@ -37,6 +37,19 @@ expectError( }, }), ); +expectError( + web.apps.manifest.create({ + manifest: { + display_information: { name: 'Agent' }, + features: { + code_channels: { + // enabled is a boolean + enabled: 'true', + }, + }, + }, + }), +); // -- happy path expectAssignable>([ { @@ -75,6 +88,25 @@ expectAssignable>([ }, }, ]); +// -- happy path: code_channels +expectAssignable>([ + { + manifest: { + display_information: { name: 'Agent' }, + features: { + code_channels: { + enabled: true, + slash_command_url: 'https://example.com/slack/code-channel-commands', + }, + }, + oauth_config: { + scopes: { + bot: ['app_mentions:read', 'code_channels:manage'], + }, + }, + }, + }, +]); // apps.manifest.delete // -- sad path