relaybot 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -10
- package/cli.js +7 -3
- package/manifest.json +37 -0
- package/package.json +2 -2
- package/src/slack-handlers.js +7 -0
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# RelayBot
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An AI assistant that lives in your Slack DMs — powered by Claude or Codex.
|
|
4
|
+
|
|
5
|
+
<img src="demo/demo.jpg" width="30%">
|
|
4
6
|
|
|
5
7
|
---
|
|
6
8
|
|
|
@@ -93,21 +95,37 @@ RelayBot acts as a bridge between Slack and AI coding agents, allowing you to in
|
|
|
93
95
|
|
|
94
96
|
## Installation
|
|
95
97
|
|
|
98
|
+
### Option 1: Install via npm (Recommended)
|
|
99
|
+
|
|
96
100
|
```bash
|
|
97
|
-
npm install -g
|
|
101
|
+
npm install -g relaybot
|
|
98
102
|
```
|
|
99
103
|
|
|
100
|
-
|
|
104
|
+
Then run:
|
|
101
105
|
|
|
102
106
|
```bash
|
|
103
|
-
#
|
|
104
|
-
relaybot
|
|
107
|
+
# Configure Slack credentials
|
|
108
|
+
relaybot setup
|
|
105
109
|
|
|
106
|
-
#
|
|
107
|
-
relaybot
|
|
110
|
+
# Start the bot
|
|
111
|
+
relaybot start
|
|
112
|
+
```
|
|
108
113
|
|
|
109
|
-
|
|
110
|
-
|
|
114
|
+
### Option 2: Run from Source
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Clone the repository
|
|
118
|
+
git clone https://github.com/dinhquan/relaybot.git
|
|
119
|
+
cd relaybot
|
|
120
|
+
|
|
121
|
+
# Install dependencies
|
|
122
|
+
npm install
|
|
123
|
+
|
|
124
|
+
# Configure Slack credentials
|
|
125
|
+
npm run setup
|
|
126
|
+
|
|
127
|
+
# Start the bot
|
|
128
|
+
npm start
|
|
111
129
|
```
|
|
112
130
|
|
|
113
131
|
---
|
|
@@ -121,7 +139,11 @@ Before running the bot, you need to configure your Slack credentials.
|
|
|
121
139
|
Run the setup command and follow the prompts:
|
|
122
140
|
|
|
123
141
|
```bash
|
|
124
|
-
|
|
142
|
+
# If installed globally
|
|
143
|
+
relaybot setup
|
|
144
|
+
|
|
145
|
+
# If running from source
|
|
146
|
+
npm run setup
|
|
125
147
|
```
|
|
126
148
|
|
|
127
149
|
You will be asked for:
|
|
@@ -155,6 +177,8 @@ If you don't have a Slack app yet, follow these steps:
|
|
|
155
177
|
|
|
156
178
|
1. Go to [api.slack.com/apps](https://api.slack.com/apps)
|
|
157
179
|
2. Click **Create New App**
|
|
180
|
+
3. Choose **From a manifest** (recommended) and paste the contents of `manifest.json` from this repo, then skip to step 5
|
|
181
|
+
4. Or choose **From scratch** to configure manually (continue with steps below)
|
|
158
182
|
3. Choose **From scratch**
|
|
159
183
|
4. Enter an app name (e.g., "RelayBot") and select your workspace
|
|
160
184
|
5. Click **Create App**
|
package/cli.js
CHANGED
|
@@ -7,15 +7,19 @@ function showHelp() {
|
|
|
7
7
|
console.log(`
|
|
8
8
|
🤖 RelayBot - Slack-to-AI gateway
|
|
9
9
|
|
|
10
|
-
Usage: relaybot <command>
|
|
10
|
+
Usage: relaybot <command> [options]
|
|
11
11
|
|
|
12
12
|
Commands:
|
|
13
13
|
setup Configure Slack credentials and working directory
|
|
14
14
|
start Start the RelayBot server
|
|
15
15
|
|
|
16
|
+
Options:
|
|
17
|
+
--codex Use Codex instead of Claude (for start command)
|
|
18
|
+
|
|
16
19
|
Examples:
|
|
17
|
-
relaybot setup
|
|
18
|
-
relaybot start
|
|
20
|
+
relaybot setup # Run interactive setup
|
|
21
|
+
relaybot start # Start with Claude (default)
|
|
22
|
+
relaybot start --codex # Start with Codex
|
|
19
23
|
`);
|
|
20
24
|
}
|
|
21
25
|
|
package/manifest.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"display_information": {
|
|
3
|
+
"name": "RelayBot",
|
|
4
|
+
"description": "An AI assistant that lives in your Slack DMs — powered by Claude or Codex",
|
|
5
|
+
"background_color": "#4A154B"
|
|
6
|
+
},
|
|
7
|
+
"features": {
|
|
8
|
+
"bot_user": {
|
|
9
|
+
"display_name": "RelayBot",
|
|
10
|
+
"always_online": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"oauth_config": {
|
|
14
|
+
"scopes": {
|
|
15
|
+
"bot": [
|
|
16
|
+
"chat:write",
|
|
17
|
+
"im:history",
|
|
18
|
+
"im:read",
|
|
19
|
+
"im:write",
|
|
20
|
+
"users:read"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"settings": {
|
|
25
|
+
"event_subscriptions": {
|
|
26
|
+
"bot_events": [
|
|
27
|
+
"message.im"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"interactivity": {
|
|
31
|
+
"is_enabled": false
|
|
32
|
+
},
|
|
33
|
+
"org_deploy_enabled": false,
|
|
34
|
+
"socket_mode_enabled": true,
|
|
35
|
+
"token_rotation_enabled": false
|
|
36
|
+
}
|
|
37
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "relaybot",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "An AI assistant that lives in your Slack DMs — powered by Claude or Codex",
|
|
5
5
|
"main": "main.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"relaybot": "./cli.js"
|
package/src/slack-handlers.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const agent = require('./agent');
|
|
3
|
+
const loadConfig = require('./load-config');
|
|
3
4
|
|
|
5
|
+
const config = loadConfig();
|
|
4
6
|
const isProduction = __dirname.includes('node_modules');
|
|
5
7
|
const skillPath = path.join(__dirname, '..', 'skills', 'relay-bot', 'SKILL.md');
|
|
6
8
|
|
|
@@ -13,6 +15,11 @@ function getPromptSuffix() {
|
|
|
13
15
|
|
|
14
16
|
function registerHandlers(app) {
|
|
15
17
|
app.message(async ({ message, say }) => {
|
|
18
|
+
// Only respond to messages from the configured user
|
|
19
|
+
if (message.user !== config.SLACK_USER_ID) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
16
23
|
console.log('New message:', message.text);
|
|
17
24
|
|
|
18
25
|
if (agent.isRunning()) {
|