@@ -7,25 +7,6 @@ import { normalizeFileInput } from '@/blocks/utils'
77import type { SlackResponse } from '@/tools/slack/types'
88import { getTrigger } from '@/triggers'
99
10- /**
11- * Scopes added for the native Sim Slack app trigger (`slack_oauth`): the shared
12- * app's `app_mention`, assistant-thread, and DM events don't deliver without
13- * them. Advertised by `slack_v2` and the trigger only — the legacy block has no
14- * feature that needs them, and listing them there would flag every existing
15- * Slack credential as missing scopes and prompt a reconnect.
16- *
17- * This only controls what each picker *advertises* and treats as missing. The
18- * authorization request itself is provider-wide
19- * (`getCanonicalScopesForProvider('slack')`), so any reconnect grants the full
20- * set regardless of which block started it.
21- */
22- const SLACK_V2_ONLY_SCOPES = new Set ( [ 'app_mentions:read' , 'assistant:write' , 'im:history' ] )
23-
24- /** Slack scopes the legacy v1 block advertises — the set from before the trigger expansion. */
25- const SLACK_V1_ADVERTISED_SCOPES = getScopesForService ( 'slack' ) . filter (
26- ( scope ) => ! SLACK_V2_ONLY_SCOPES . has ( scope )
27- )
28-
2910export const SlackBlock : BlockConfig < SlackResponse > = {
3011 type : 'slack' ,
3112 name : 'Slack' ,
@@ -126,7 +107,7 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
126107 canonicalParamId : 'oauthCredential' ,
127108 mode : 'basic' ,
128109 serviceId : 'slack' ,
129- requiredScopes : SLACK_V1_ADVERTISED_SCOPES ,
110+ requiredScopes : getScopesForService ( 'slack' ) ,
130111 placeholder : 'Select Slack workspace' ,
131112 dependsOn : [ 'authMethod' ] ,
132113 condition : {
@@ -2661,9 +2642,6 @@ function adaptSubBlockForV2(sb: SubBlockConfig): SubBlockConfig {
26612642 ...rest ,
26622643 credentialKind : 'any' ,
26632644 placeholder : 'Select Slack account or bot' ,
2664- // Full set, unlike v1: v2 hosts the native Sim app trigger, whose events
2665- // need the mention/assistant/DM scopes.
2666- requiredScopes : getScopesForService ( 'slack' ) ,
26672645 credentialLabels : {
26682646 oauthGroup : 'Sim app' ,
26692647 oauthConnect : 'Connect the Sim app' ,
0 commit comments