@sedge-hq/slack
v0.4.0
Published
Slack for sedge: message your agent from Slack, and it answers there.
Readme
@sedge-hq/slack
Slack for sedge: message your agent in a DM, and it answers there, with buttons for its questions and approvals.
It uses Socket Mode, so nothing has to be reachable from the internet. Make an app at api.slack.com/apps:
- Socket Mode: turn it on; create the app-level token it offers (
xapp-…, withconnections:write). - Event Subscriptions: subscribe to the bot event
message.im. - Interactivity & Shortcuts: turn it on (needed for buttons).
- App Home: allow users to send messages from the Messages tab.
- OAuth & Permissions: add the bot scopes
chat:write,im:history,files:writeandfiles:read(for files you send it); install the app, and copy the bot token (xoxb-…).
Then in sedge, say "set up slack": it asks for both tokens in hidden fields, keeps them in your
keychain, and shows you a code. Send the bot pair <code> in a DM: that pairs your account, and
nobody else gets answers.
Files you send the bot (with files:read) are saved for the agent. It can also post in channels
the bot is in: the agent's act tool has a post action, behind your permissions.
As you, with an account
Instead of the bot token, account can name a Slack account you signed in to with sedge
(sign_in). Then sedge reads and posts as you, not as a bot. Slack lets an app that signs in
on a computer ask only for user scopes, so the token is yours:
- you talk to sedge in your DM with yourself (send
pair <code>there), and its answers show under your name; - it reads only that DM, and only what you write there; your other DMs are left alone;
- its
postaction posts as you, in channels you're in.
Socket Mode still needs the app-level token (appToken). For the sign-in, under OAuth &
Permissions add the redirect URL http://localhost:53682/, turn on PKCE, and add the user
token scopes chat:write, im:history, files:read and files:write; under Event
Subscriptions, subscribe to message.im on behalf of users. Give sedge the client ID and no
secret (Accounts). Give
botToken or account, not both.
Channels and signals · MIT
