Skip to content

Commit aef74c1

Browse files
committed
feat(slack): add Slack integration with @mention-based task submission
Adds full Slack integration enabling users to submit coding tasks by mentioning @shoof in any channel or DM, with real-time emoji reactions and threaded notifications showing task progress. Key features: - @mention task submission with natural language repo extraction - Emoji reaction progression: 👀 → ⌛ → ✅ - Threaded notifications (created, started, completed/failed) - Cancel button with instant feedback - DM support for private task submissions - OAuth multi-workspace install flow - `bgagent slack setup` CLI wizard for zero-friction onboarding - Account linking via /bgagent link New files: - CDK constructs: SlackIntegration, SlackInstallationTable, SlackUserMappingTable - Lambda handlers: events, commands, command-processor, interactions, oauth-callback, link, notify - Shared utilities: slack-verify, slack-blocks - CLI: slack.ts (setup, link commands) - Docs: SLACK_SETUP_GUIDE.md with screenshots
1 parent 396a245 commit aef74c1

38 files changed

+4112
-22
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/**
2+
* MIT No Attribution
3+
*
4+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
7+
* the Software without restriction, including without limitation the rights to
8+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
* the Software, and to permit persons to whom the Software is furnished to do so.
10+
*
11+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17+
* SOFTWARE.
18+
*/
19+
20+
import { RemovalPolicy } from 'aws-cdk-lib';
21+
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
22+
import { Construct } from 'constructs';
23+
24+
/**
25+
* Properties for SlackInstallationTable construct.
26+
*/
27+
export interface SlackInstallationTableProps {
28+
/**
29+
* Optional table name override.
30+
* @default - auto-generated by CloudFormation
31+
*/
32+
readonly tableName?: string;
33+
34+
/**
35+
* Removal policy for the table.
36+
* @default RemovalPolicy.DESTROY
37+
*/
38+
readonly removalPolicy?: RemovalPolicy;
39+
40+
/**
41+
* Whether to enable point-in-time recovery.
42+
* @default true
43+
*/
44+
readonly pointInTimeRecovery?: boolean;
45+
}
46+
47+
/**
48+
* DynamoDB table for Slack workspace installations.
49+
*
50+
* Schema: team_id (PK) — one record per installed Slack workspace.
51+
* Stores workspace metadata and a pointer to the bot token in Secrets Manager.
52+
* Bot tokens are stored in Secrets Manager at `bgagent/slack/{team_id}`.
53+
*/
54+
export class SlackInstallationTable extends Construct {
55+
/**
56+
* The underlying DynamoDB table.
57+
*/
58+
public readonly table: dynamodb.Table;
59+
60+
constructor(scope: Construct, id: string, props: SlackInstallationTableProps = {}) {
61+
super(scope, id);
62+
63+
this.table = new dynamodb.Table(this, 'Table', {
64+
tableName: props.tableName,
65+
partitionKey: {
66+
name: 'team_id',
67+
type: dynamodb.AttributeType.STRING,
68+
},
69+
billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
70+
timeToLiveAttribute: 'ttl',
71+
pointInTimeRecoverySpecification: {
72+
pointInTimeRecoveryEnabled: props.pointInTimeRecovery ?? true,
73+
},
74+
removalPolicy: props.removalPolicy ?? RemovalPolicy.DESTROY,
75+
});
76+
}
77+
}

0 commit comments

Comments
 (0)