@meetopenbot/slack 0.0.2 → 0.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/dist/index.js +7 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { postSlackMessage } from "./slack-post.js";
|
|
|
8
8
|
import { runSlackAgent } from "./slack-agent.js";
|
|
9
9
|
import { verifySlackSignature } from "./slack-verify.js";
|
|
10
10
|
const ROUTING_AGENT_ID = "system";
|
|
11
|
+
const SLACK_USER_DISPLAY_NAME = "Slack user";
|
|
11
12
|
function isSlackWebhookIngress(meta) {
|
|
12
13
|
return meta?.source === "slack";
|
|
13
14
|
}
|
|
@@ -79,6 +80,10 @@ async function* bridgeSystemAgentRun(args) {
|
|
|
79
80
|
threadId: args.threadId,
|
|
80
81
|
source: "slack",
|
|
81
82
|
slack: slackMeta,
|
|
83
|
+
userName: SLACK_USER_DISPLAY_NAME,
|
|
84
|
+
...(typeof args.meta?.userId === "string"
|
|
85
|
+
? { userId: args.meta.userId }
|
|
86
|
+
: {}),
|
|
82
87
|
},
|
|
83
88
|
},
|
|
84
89
|
onEvent: async (outEvent) => {
|
|
@@ -267,6 +272,8 @@ export default definePlugin({
|
|
|
267
272
|
threadId,
|
|
268
273
|
source: "slack",
|
|
269
274
|
slack: slackMeta,
|
|
275
|
+
userName: SLACK_USER_DISPLAY_NAME,
|
|
276
|
+
...(slackEvent.user ? { userId: slackEvent.user } : {}),
|
|
270
277
|
},
|
|
271
278
|
};
|
|
272
279
|
});
|