@meetopenbot/slack 0.0.5 → 0.0.7
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 +1 -1
- package/dist/config.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/package.json +16 -10
- package/dist/logger.js +0 -17
- package/dist/slack-threads.js +0 -20
- package/dist/slack-verify.d.ts +0 -1
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ C01234567:engineering,C89ABCDEF:support,D0789ABC:slack-dms
|
|
|
43
43
|
- **Left side** — Slack channel id (`C…` for channels, `D…` for DMs). In Slack: right-click the channel → **View channel details** → copy the id at the bottom.
|
|
44
44
|
- **Right side** — OpenBot channel id to run in (must already exist).
|
|
45
45
|
|
|
46
|
-
Slack channels without a mapping route to **`
|
|
46
|
+
Slack channels without a mapping route to **`general`**.
|
|
47
47
|
|
|
48
48
|
This applies only to **webhook ingress delegation**, not Slack MCP tools.
|
|
49
49
|
|
package/dist/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveAuthMode } from "./cloud-mode.js";
|
|
2
2
|
import { shouldUseCreditsAuth } from "./credits-auth.js";
|
|
3
|
-
export const DEFAULT_OPENBOT_CHANNEL_ID = "
|
|
3
|
+
export const DEFAULT_OPENBOT_CHANNEL_ID = "general";
|
|
4
4
|
/** Parse `C0123:engineering,C0456:support` into a lookup index. */
|
|
5
5
|
export function buildSlackChannelMappingIndex(config) {
|
|
6
6
|
const index = new Map();
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -174,7 +174,7 @@ const slackPluginConfigSchema = {
|
|
|
174
174
|
},
|
|
175
175
|
channelMappings: {
|
|
176
176
|
type: "string",
|
|
177
|
-
description: "Inbound — webhook routing. Comma-separated slackChannelId:openbotChannelId pairs (e.g. C01234567:engineering,C89ABCDEF:support). Unmapped Slack channels use
|
|
177
|
+
description: "Inbound — webhook routing. Comma-separated slackChannelId:openbotChannelId pairs (e.g. C01234567:engineering,C89ABCDEF:support). Unmapped Slack channels use general.",
|
|
178
178
|
},
|
|
179
179
|
},
|
|
180
180
|
required: ["signingSecret"],
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meetopenbot/slack",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Slack Events API ingress, simple agent replies, and thread delivery for OpenBot",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
|
-
".":
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
10
14
|
},
|
|
11
15
|
"publishConfig": {
|
|
12
16
|
"access": "public"
|
|
@@ -14,17 +18,19 @@
|
|
|
14
18
|
"files": [
|
|
15
19
|
"dist"
|
|
16
20
|
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "tsc"
|
|
19
|
-
},
|
|
20
21
|
"dependencies": {
|
|
21
22
|
"@ai-sdk/mcp": "^2.0.14",
|
|
22
23
|
"@ai-sdk/openai": "^4.0.15",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
24
|
+
"ai": "^7.0.29",
|
|
25
|
+
"@meetopenbot/plugin-sdk": "^0.2.0"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"@types/node": "^20.10.1",
|
|
28
29
|
"typescript": "^5.9.3"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc && node ../../scripts/write-plugin-declaration.mjs",
|
|
33
|
+
"dev": "tsc --watch --preserveWatchOutput",
|
|
34
|
+
"typecheck": "tsc --noEmit"
|
|
29
35
|
}
|
|
30
|
-
}
|
|
36
|
+
}
|
package/dist/logger.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const PREFIX = "[slack]";
|
|
2
|
-
function formatMessage(message, details) {
|
|
3
|
-
if (!details || Object.keys(details).length === 0)
|
|
4
|
-
return message;
|
|
5
|
-
return `${message} ${JSON.stringify(details)}`;
|
|
6
|
-
}
|
|
7
|
-
export const log = {
|
|
8
|
-
info(message, details) {
|
|
9
|
-
console.log(`${PREFIX} ${formatMessage(message, details)}`);
|
|
10
|
-
},
|
|
11
|
-
warn(message, details) {
|
|
12
|
-
console.warn(`${PREFIX} ${formatMessage(message, details)}`);
|
|
13
|
-
},
|
|
14
|
-
debug(message, details) {
|
|
15
|
-
console.debug(`${PREFIX} ${formatMessage(message, details)}`);
|
|
16
|
-
},
|
|
17
|
-
};
|
package/dist/slack-threads.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
function slackThreadKey(channel, rootTs) {
|
|
2
|
-
return `${channel}:${rootTs}`;
|
|
3
|
-
}
|
|
4
|
-
const activeSlackThreads = new Set();
|
|
5
|
-
const threadHistories = new Map();
|
|
6
|
-
export function markSlackThreadActive(channel, rootTs) {
|
|
7
|
-
activeSlackThreads.add(slackThreadKey(channel, rootTs));
|
|
8
|
-
}
|
|
9
|
-
export function isSlackThreadActive(channel, rootTs) {
|
|
10
|
-
return activeSlackThreads.has(slackThreadKey(channel, rootTs));
|
|
11
|
-
}
|
|
12
|
-
export function getSlackThreadHistory(channel, rootTs) {
|
|
13
|
-
return threadHistories.get(slackThreadKey(channel, rootTs)) ?? [];
|
|
14
|
-
}
|
|
15
|
-
export function appendSlackThreadHistory(channel, rootTs, ...messages) {
|
|
16
|
-
const key = slackThreadKey(channel, rootTs);
|
|
17
|
-
const history = threadHistories.get(key) ?? [];
|
|
18
|
-
history.push(...messages);
|
|
19
|
-
threadHistories.set(key, history);
|
|
20
|
-
}
|
package/dist/slack-verify.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function verifySlackSignature(signingSecret: string, rawBody: Buffer, timestamp: string | undefined, signature: string | undefined): boolean;
|