relaybot 1.0.0 → 1.0.1
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/package.json +1 -1
- package/src/slack-handlers.js +12 -1
package/package.json
CHANGED
package/src/slack-handlers.js
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
|
+
const path = require('path');
|
|
1
2
|
const agent = require('./agent');
|
|
2
3
|
|
|
4
|
+
const isProduction = __dirname.includes('node_modules');
|
|
5
|
+
const skillPath = path.join(__dirname, '..', 'skills', 'relay-bot', 'SKILL.md');
|
|
6
|
+
|
|
7
|
+
function getPromptSuffix() {
|
|
8
|
+
if (isProduction) {
|
|
9
|
+
return `\nIMPORTANT: Read and follow the instructions in ${skillPath}`;
|
|
10
|
+
}
|
|
11
|
+
return '\nIMPORTANT: Use the relay-bot skill.';
|
|
12
|
+
}
|
|
13
|
+
|
|
3
14
|
function registerHandlers(app) {
|
|
4
15
|
app.message(async ({ message, say }) => {
|
|
5
16
|
console.log('New message:', message.text);
|
|
6
17
|
|
|
7
18
|
if (agent.isRunning()) {
|
|
8
|
-
const fullPrompt =
|
|
19
|
+
const fullPrompt = message.text + getPromptSuffix();
|
|
9
20
|
agent.sendCommand(fullPrompt);
|
|
10
21
|
} else {
|
|
11
22
|
await say('Agent process is not running.');
|