@meetopenbot/slack 0.0.10 → 1.0.0
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/dist/index.js +24 -20
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6,28 +6,32 @@ export const plugin = definePlugin({
|
|
|
6
6
|
name: "Slack",
|
|
7
7
|
description: "Slack Events API ingress, local agent runtime, and system delegation for webhooks",
|
|
8
8
|
configSchema: pluginConfigSchema,
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
ctx,
|
|
16
|
-
config: slackConfig,
|
|
17
|
-
});
|
|
9
|
+
async *onWebhook({ event, state, context }) {
|
|
10
|
+
const slackConfig = readSlackConfig(context.config);
|
|
11
|
+
yield* handleSlackWebhook({
|
|
12
|
+
event: event,
|
|
13
|
+
ctx: { state },
|
|
14
|
+
config: slackConfig,
|
|
18
15
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
},
|
|
17
|
+
async *run({ event, handlerCtx, context }) {
|
|
18
|
+
const slackConfig = readSlackConfig(context.config);
|
|
19
|
+
yield* handleSlackInvoke({
|
|
20
|
+
event,
|
|
21
|
+
ctx: handlerCtx,
|
|
22
|
+
agentId: context.agentId,
|
|
23
|
+
config: slackConfig,
|
|
24
|
+
host: context.host,
|
|
25
|
+
publicBaseUrl: context.publicBaseUrl,
|
|
28
26
|
});
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
},
|
|
28
|
+
async *onEvent(event, context) {
|
|
29
|
+
if (event.type !== "agent:output")
|
|
30
|
+
return;
|
|
31
|
+
const slackConfig = readSlackConfig(context.config);
|
|
32
|
+
yield* handleSlackOutbound({
|
|
33
|
+
event: event,
|
|
34
|
+
config: slackConfig,
|
|
31
35
|
});
|
|
32
36
|
},
|
|
33
37
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meetopenbot/slack",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Slack Events API ingress, simple agent replies, and thread delivery for OpenBot",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@meetopenbot/plugin-sdk": "^0.
|
|
22
|
+
"@meetopenbot/plugin-sdk": "^1.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^20.10.1",
|