@cuylabs/channel-slack 0.5.0 → 0.6.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/README.md +25 -136
- package/dist/app-home.d.ts +23 -0
- package/dist/app-home.js +35 -0
- package/dist/artifacts/index.d.ts +135 -0
- package/dist/artifacts/index.js +299 -0
- package/dist/{assistant.d.ts → assistant/index.d.ts} +1 -1
- package/dist/{assistant.js → assistant/index.js} +2 -2
- package/dist/auth/index.d.ts +56 -0
- package/dist/auth/index.js +168 -0
- package/dist/{chunk-IDVDMJ5U.js → chunk-6JSGIVQH.js} +110 -3
- package/dist/chunk-6WHFQUYQ.js +54 -0
- package/dist/{bolt.js → chunk-73QXT7MA.js} +29 -322
- package/dist/{chunk-CMR6B76C.js → chunk-DNVSH7H5.js} +407 -1
- package/dist/chunk-QJYCHWN6.js +76 -0
- package/dist/chunk-S3SWPYXJ.js +81 -0
- package/dist/{chunk-JZG4IETE.js → chunk-X4WBBBYM.js} +0 -52
- package/dist/core.js +5 -3
- package/dist/diagnostics/index.d.ts +71 -0
- package/dist/{diagnostics.js → diagnostics/index.js} +5 -1
- package/dist/entrypoints/index.d.ts +120 -0
- package/dist/entrypoints/index.js +132 -0
- package/dist/{history.d.ts → history/index.d.ts} +2 -2
- package/dist/{history.js → history/index.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +28 -15
- package/dist/{policy.d.ts → policy/index.d.ts} +103 -2
- package/dist/{policy.js → policy/index.js} +13 -1
- package/dist/runtime-BNBHOZSQ.d.ts +53 -0
- package/dist/{setup.d.ts → setup/index.d.ts} +30 -3
- package/dist/{setup.js → setup/index.js} +134 -3
- package/dist/transports/http/index.d.ts +68 -0
- package/dist/transports/http/index.js +8 -0
- package/dist/transports/index.d.ts +8 -0
- package/dist/transports/index.js +24 -0
- package/dist/transports/socket/index.d.ts +94 -0
- package/dist/transports/socket/index.js +19 -0
- package/dist/types-B9NfCVrk.d.ts +141 -0
- package/docs/README.md +31 -0
- package/docs/concepts/activity.md +3 -3
- package/docs/concepts/artifacts.md +56 -0
- package/docs/concepts/entrypoints.md +73 -0
- package/docs/concepts/message-policy.md +13 -0
- package/docs/concepts/setup-requirements.md +23 -0
- package/docs/concepts/{bolt-runtime.md → transport-runtime.md} +14 -4
- package/docs/recipes/app-mention-handler.md +5 -0
- package/docs/recipes/generate-slack-manifest.md +16 -0
- package/docs/recipes/publish-artifact.md +45 -0
- package/docs/recipes/slash-command-and-shortcut.md +51 -0
- package/docs/recipes/socket-mode-app.md +1 -1
- package/docs/reference/channel-slack-boundary.md +10 -6
- package/docs/reference/exports.md +7 -2
- package/docs/reference/source-layout.md +35 -0
- package/package.json +63 -39
- package/dist/bolt.d.ts +0 -364
- package/dist/chunk-NE57BLLU.js +0 -0
- package/dist/diagnostics.d.ts +0 -22
- package/dist/shared.d.ts +0 -2
- package/dist/shared.js +0 -43
- /package/dist/{feedback.d.ts → feedback/index.d.ts} +0 -0
- /package/dist/{feedback.js → feedback/index.js} +0 -0
- /package/dist/{targets.d.ts → targets/index.d.ts} +0 -0
- /package/dist/{targets.js → targets/index.js} +0 -0
- /package/dist/{users.d.ts → users/index.d.ts} +0 -0
- /package/dist/{users.js → users/index.js} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuylabs/channel-slack",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Agent-runtime-agnostic Slack channel primitives for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -12,14 +12,24 @@
|
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
14
|
"./assistant": {
|
|
15
|
-
"types": "./dist/assistant.d.ts",
|
|
16
|
-
"import": "./dist/assistant.js",
|
|
17
|
-
"default": "./dist/assistant.js"
|
|
15
|
+
"types": "./dist/assistant/index.d.ts",
|
|
16
|
+
"import": "./dist/assistant/index.js",
|
|
17
|
+
"default": "./dist/assistant/index.js"
|
|
18
18
|
},
|
|
19
|
-
"./
|
|
20
|
-
"types": "./dist/
|
|
21
|
-
"import": "./dist/
|
|
22
|
-
"default": "./dist/
|
|
19
|
+
"./app-home": {
|
|
20
|
+
"types": "./dist/app-home.d.ts",
|
|
21
|
+
"import": "./dist/app-home.js",
|
|
22
|
+
"default": "./dist/app-home.js"
|
|
23
|
+
},
|
|
24
|
+
"./artifacts": {
|
|
25
|
+
"types": "./dist/artifacts/index.d.ts",
|
|
26
|
+
"import": "./dist/artifacts/index.js",
|
|
27
|
+
"default": "./dist/artifacts/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./auth": {
|
|
30
|
+
"types": "./dist/auth/index.d.ts",
|
|
31
|
+
"import": "./dist/auth/index.js",
|
|
32
|
+
"default": "./dist/auth/index.js"
|
|
23
33
|
},
|
|
24
34
|
"./core": {
|
|
25
35
|
"types": "./dist/core.d.ts",
|
|
@@ -27,44 +37,59 @@
|
|
|
27
37
|
"default": "./dist/core.js"
|
|
28
38
|
},
|
|
29
39
|
"./diagnostics": {
|
|
30
|
-
"types": "./dist/diagnostics.d.ts",
|
|
31
|
-
"import": "./dist/diagnostics.js",
|
|
32
|
-
"default": "./dist/diagnostics.js"
|
|
40
|
+
"types": "./dist/diagnostics/index.d.ts",
|
|
41
|
+
"import": "./dist/diagnostics/index.js",
|
|
42
|
+
"default": "./dist/diagnostics/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./entrypoints": {
|
|
45
|
+
"types": "./dist/entrypoints/index.d.ts",
|
|
46
|
+
"import": "./dist/entrypoints/index.js",
|
|
47
|
+
"default": "./dist/entrypoints/index.js"
|
|
33
48
|
},
|
|
34
49
|
"./feedback": {
|
|
35
|
-
"types": "./dist/feedback.d.ts",
|
|
36
|
-
"import": "./dist/feedback.js",
|
|
37
|
-
"default": "./dist/feedback.js"
|
|
50
|
+
"types": "./dist/feedback/index.d.ts",
|
|
51
|
+
"import": "./dist/feedback/index.js",
|
|
52
|
+
"default": "./dist/feedback/index.js"
|
|
38
53
|
},
|
|
39
54
|
"./history": {
|
|
40
|
-
"types": "./dist/history.d.ts",
|
|
41
|
-
"import": "./dist/history.js",
|
|
42
|
-
"default": "./dist/history.js"
|
|
55
|
+
"types": "./dist/history/index.d.ts",
|
|
56
|
+
"import": "./dist/history/index.js",
|
|
57
|
+
"default": "./dist/history/index.js"
|
|
43
58
|
},
|
|
44
59
|
"./policy": {
|
|
45
|
-
"types": "./dist/policy.d.ts",
|
|
46
|
-
"import": "./dist/policy.js",
|
|
47
|
-
"default": "./dist/policy.js"
|
|
60
|
+
"types": "./dist/policy/index.d.ts",
|
|
61
|
+
"import": "./dist/policy/index.js",
|
|
62
|
+
"default": "./dist/policy/index.js"
|
|
48
63
|
},
|
|
49
64
|
"./setup": {
|
|
50
|
-
"types": "./dist/setup.d.ts",
|
|
51
|
-
"import": "./dist/setup.js",
|
|
52
|
-
"default": "./dist/setup.js"
|
|
53
|
-
},
|
|
54
|
-
"./shared": {
|
|
55
|
-
"types": "./dist/shared.d.ts",
|
|
56
|
-
"import": "./dist/shared.js",
|
|
57
|
-
"default": "./dist/shared.js"
|
|
65
|
+
"types": "./dist/setup/index.d.ts",
|
|
66
|
+
"import": "./dist/setup/index.js",
|
|
67
|
+
"default": "./dist/setup/index.js"
|
|
58
68
|
},
|
|
59
69
|
"./targets": {
|
|
60
|
-
"types": "./dist/targets.d.ts",
|
|
61
|
-
"import": "./dist/targets.js",
|
|
62
|
-
"default": "./dist/targets.js"
|
|
70
|
+
"types": "./dist/targets/index.d.ts",
|
|
71
|
+
"import": "./dist/targets/index.js",
|
|
72
|
+
"default": "./dist/targets/index.js"
|
|
73
|
+
},
|
|
74
|
+
"./transports": {
|
|
75
|
+
"types": "./dist/transports/index.d.ts",
|
|
76
|
+
"import": "./dist/transports/index.js",
|
|
77
|
+
"default": "./dist/transports/index.js"
|
|
78
|
+
},
|
|
79
|
+
"./transports/http": {
|
|
80
|
+
"types": "./dist/transports/http/index.d.ts",
|
|
81
|
+
"import": "./dist/transports/http/index.js",
|
|
82
|
+
"default": "./dist/transports/http/index.js"
|
|
83
|
+
},
|
|
84
|
+
"./transports/socket": {
|
|
85
|
+
"types": "./dist/transports/socket/index.d.ts",
|
|
86
|
+
"import": "./dist/transports/socket/index.js",
|
|
87
|
+
"default": "./dist/transports/socket/index.js"
|
|
63
88
|
},
|
|
64
89
|
"./users": {
|
|
65
|
-
"types": "./dist/users.d.ts",
|
|
66
|
-
"import": "./dist/users.js",
|
|
67
|
-
"default": "./dist/users.js"
|
|
90
|
+
"types": "./dist/users/index.d.ts",
|
|
91
|
+
"import": "./dist/users/index.js",
|
|
92
|
+
"default": "./dist/users/index.js"
|
|
68
93
|
}
|
|
69
94
|
},
|
|
70
95
|
"files": [
|
|
@@ -108,8 +133,7 @@
|
|
|
108
133
|
"agent",
|
|
109
134
|
"slack",
|
|
110
135
|
"channel",
|
|
111
|
-
"adapter"
|
|
112
|
-
"bolt"
|
|
136
|
+
"adapter"
|
|
113
137
|
],
|
|
114
138
|
"license": "Apache-2.0",
|
|
115
139
|
"publishConfig": {
|
|
@@ -119,9 +143,9 @@
|
|
|
119
143
|
"node": ">=20"
|
|
120
144
|
},
|
|
121
145
|
"scripts": {
|
|
122
|
-
"build": "tsup src/index.ts src/
|
|
146
|
+
"build": "tsup src/index.ts src/app-home.ts src/artifacts/index.ts src/core.ts src/assistant/index.ts src/auth/index.ts src/diagnostics/index.ts src/entrypoints/index.ts src/feedback/index.ts src/history/index.ts src/policy/index.ts src/setup/index.ts src/targets/index.ts src/transports/index.ts src/transports/http/index.ts src/transports/socket/index.ts src/users/index.ts --format esm --dts --clean",
|
|
123
147
|
"clean": "rm -rf dist",
|
|
124
|
-
"dev": "tsup src/index.ts src/
|
|
148
|
+
"dev": "tsup src/index.ts src/app-home.ts src/artifacts/index.ts src/core.ts src/assistant/index.ts src/auth/index.ts src/diagnostics/index.ts src/entrypoints/index.ts src/feedback/index.ts src/history/index.ts src/policy/index.ts src/setup/index.ts src/targets/index.ts src/transports/index.ts src/transports/http/index.ts src/transports/socket/index.ts src/users/index.ts --format esm --dts --watch",
|
|
125
149
|
"lint": "eslint \"src/**/*.{ts,tsx}\" \"tests/**/*.{ts,tsx}\" --max-warnings=0",
|
|
126
150
|
"test": "vitest run",
|
|
127
151
|
"test:watch": "vitest",
|
package/dist/bolt.d.ts
DELETED
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
import { Application } from 'express';
|
|
2
|
-
import { AppOptions, ExpressReceiverOptions, App, ExpressReceiver, SocketModeReceiverOptions, Logger as Logger$1 } from '@slack/bolt';
|
|
3
|
-
export { LogLevel as SlackSdkLogLevel, Logger as SlackSdkLogger } from '@slack/bolt';
|
|
4
|
-
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
5
|
-
import { L as Logger } from './logging-Bl3HfcC8.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* OAuth and installation type declarations for the direct Slack adapter.
|
|
9
|
-
*
|
|
10
|
-
* Pure types — no runtime imports beyond `node:http` request/response.
|
|
11
|
-
* Mirrors the public surface of `@slack/oauth` enough that callers can
|
|
12
|
-
* implement custom installation/state stores without depending on Bolt's
|
|
13
|
-
* internal types.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
type SlackDirectAuthMode = "single-workspace" | "oauth" | "authorize";
|
|
17
|
-
interface SlackOAuthError extends Error {
|
|
18
|
-
code: string;
|
|
19
|
-
}
|
|
20
|
-
interface SlackInstallURLOptions {
|
|
21
|
-
scopes?: string[];
|
|
22
|
-
userScopes?: string[];
|
|
23
|
-
redirectUri?: string;
|
|
24
|
-
metadata?: string;
|
|
25
|
-
teamId?: string;
|
|
26
|
-
}
|
|
27
|
-
interface SlackInstallationQuery {
|
|
28
|
-
teamId: string | undefined;
|
|
29
|
-
enterpriseId: string | undefined;
|
|
30
|
-
userId?: string;
|
|
31
|
-
conversationId?: string;
|
|
32
|
-
isEnterpriseInstall: boolean;
|
|
33
|
-
}
|
|
34
|
-
interface SlackInstallation {
|
|
35
|
-
team?: {
|
|
36
|
-
id: string;
|
|
37
|
-
name?: string;
|
|
38
|
-
} | undefined;
|
|
39
|
-
enterprise?: {
|
|
40
|
-
id: string;
|
|
41
|
-
name?: string;
|
|
42
|
-
} | undefined;
|
|
43
|
-
user: {
|
|
44
|
-
id: string;
|
|
45
|
-
token?: string;
|
|
46
|
-
refreshToken?: string;
|
|
47
|
-
expiresAt?: number;
|
|
48
|
-
scopes?: string[];
|
|
49
|
-
};
|
|
50
|
-
bot?: {
|
|
51
|
-
token: string;
|
|
52
|
-
refreshToken?: string;
|
|
53
|
-
expiresAt?: number;
|
|
54
|
-
scopes: string[];
|
|
55
|
-
id?: string;
|
|
56
|
-
userId?: string;
|
|
57
|
-
};
|
|
58
|
-
incomingWebhook?: {
|
|
59
|
-
url: string;
|
|
60
|
-
channel?: string;
|
|
61
|
-
channelId?: string;
|
|
62
|
-
configurationUrl?: string;
|
|
63
|
-
};
|
|
64
|
-
appId?: string;
|
|
65
|
-
tokenType?: "bot";
|
|
66
|
-
enterpriseUrl?: string;
|
|
67
|
-
isEnterpriseInstall?: boolean;
|
|
68
|
-
authVersion?: "v1" | "v2";
|
|
69
|
-
metadata?: string;
|
|
70
|
-
}
|
|
71
|
-
interface SlackInstallationStore {
|
|
72
|
-
storeInstallation(installation: SlackInstallation, logger?: unknown): Promise<void>;
|
|
73
|
-
fetchInstallation(query: SlackInstallationQuery, logger?: unknown): Promise<SlackInstallation>;
|
|
74
|
-
deleteInstallation?(query: SlackInstallationQuery, logger?: unknown): Promise<void>;
|
|
75
|
-
}
|
|
76
|
-
interface SlackStateStore {
|
|
77
|
-
generateStateParam(installOptions: SlackInstallURLOptions, now: Date): Promise<string>;
|
|
78
|
-
verifyStateParam(now: Date, state: string): Promise<SlackInstallURLOptions>;
|
|
79
|
-
}
|
|
80
|
-
interface SlackOAuthInstallPathOptions {
|
|
81
|
-
beforeRedirection?: (request: IncomingMessage, response: ServerResponse, options?: SlackInstallURLOptions) => Promise<boolean>;
|
|
82
|
-
}
|
|
83
|
-
interface SlackOAuthCallbackOptions {
|
|
84
|
-
beforeInstallation?: (options: SlackInstallURLOptions, request: IncomingMessage, response: ServerResponse) => Promise<boolean>;
|
|
85
|
-
afterInstallation?: (installation: SlackInstallation, options: SlackInstallURLOptions, request: IncomingMessage, response: ServerResponse) => Promise<boolean>;
|
|
86
|
-
success?: (installation: SlackInstallation, options: SlackInstallURLOptions, request: IncomingMessage, response: ServerResponse) => void;
|
|
87
|
-
successAsync?: (installation: SlackInstallation, options: SlackInstallURLOptions, request: IncomingMessage, response: ServerResponse) => Promise<void>;
|
|
88
|
-
failure?: (error: SlackOAuthError, options: SlackInstallURLOptions, request: IncomingMessage, response: ServerResponse) => void;
|
|
89
|
-
failureAsync?: (error: SlackOAuthError, options: SlackInstallURLOptions, request: IncomingMessage, response: ServerResponse) => Promise<void>;
|
|
90
|
-
}
|
|
91
|
-
interface SlackAuthorizeSource {
|
|
92
|
-
teamId: string | undefined;
|
|
93
|
-
enterpriseId: string | undefined;
|
|
94
|
-
userId?: string;
|
|
95
|
-
conversationId?: string;
|
|
96
|
-
isEnterpriseInstall: boolean;
|
|
97
|
-
}
|
|
98
|
-
interface SlackAuthorizeResult {
|
|
99
|
-
botToken?: string;
|
|
100
|
-
userToken?: string;
|
|
101
|
-
botId?: string;
|
|
102
|
-
botUserId?: string;
|
|
103
|
-
userId?: string;
|
|
104
|
-
teamId?: string;
|
|
105
|
-
enterpriseId?: string;
|
|
106
|
-
[key: string]: unknown;
|
|
107
|
-
}
|
|
108
|
-
type SlackAuthorizeFn = (source: SlackAuthorizeSource, body?: unknown) => Promise<SlackAuthorizeResult>;
|
|
109
|
-
interface SlackSingleWorkspaceAuthOptions {
|
|
110
|
-
mode?: "single-workspace";
|
|
111
|
-
botToken?: string;
|
|
112
|
-
botId?: string;
|
|
113
|
-
botUserId?: string;
|
|
114
|
-
}
|
|
115
|
-
interface SlackOAuthAuthOptions {
|
|
116
|
-
mode: "oauth";
|
|
117
|
-
clientId?: string;
|
|
118
|
-
clientSecret?: string;
|
|
119
|
-
stateSecret?: string;
|
|
120
|
-
installationStore: SlackInstallationStore;
|
|
121
|
-
stateStore?: SlackStateStore;
|
|
122
|
-
stateVerification?: boolean;
|
|
123
|
-
legacyStateVerification?: boolean;
|
|
124
|
-
stateCookieName?: string;
|
|
125
|
-
stateCookieExpirationSeconds?: number;
|
|
126
|
-
redirectUri?: string;
|
|
127
|
-
scopes?: string[];
|
|
128
|
-
userScopes?: string[];
|
|
129
|
-
metadata?: string;
|
|
130
|
-
installPath?: string;
|
|
131
|
-
callbackPath?: string;
|
|
132
|
-
renderHtmlForInstallPath?: (url: string) => string;
|
|
133
|
-
installPathOptions?: SlackOAuthInstallPathOptions;
|
|
134
|
-
callbackOptions?: SlackOAuthCallbackOptions;
|
|
135
|
-
directInstall?: boolean;
|
|
136
|
-
authVersion?: "v1" | "v2";
|
|
137
|
-
authorizationUrl?: string;
|
|
138
|
-
}
|
|
139
|
-
interface SlackCustomAuthorizeAuthOptions {
|
|
140
|
-
mode: "authorize";
|
|
141
|
-
authorize: SlackAuthorizeFn;
|
|
142
|
-
}
|
|
143
|
-
type SlackDirectAuthOptions = SlackSingleWorkspaceAuthOptions | SlackOAuthAuthOptions | SlackCustomAuthorizeAuthOptions;
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* `createSlackBoltApp` — builds a Bolt `App` + `ExpressReceiver` pair from
|
|
147
|
-
* the package's structured `CreateSlackBoltAppOptions`. Supports
|
|
148
|
-
* single-workspace, OAuth, and custom-authorize auth modes.
|
|
149
|
-
*/
|
|
150
|
-
|
|
151
|
-
interface CreateSlackBoltAppOptions {
|
|
152
|
-
/**
|
|
153
|
-
* Slack signing secret used to verify inbound requests.
|
|
154
|
-
* Defaults to `SLACK_SIGNING_SECRET`.
|
|
155
|
-
*/
|
|
156
|
-
signingSecret?: string;
|
|
157
|
-
/**
|
|
158
|
-
* Exact Slack Events API endpoint path.
|
|
159
|
-
* Defaults to `/slack/events`.
|
|
160
|
-
*/
|
|
161
|
-
path?: string;
|
|
162
|
-
/**
|
|
163
|
-
* Direct-mode auth configuration.
|
|
164
|
-
*
|
|
165
|
-
* - omit for single-workspace token mode
|
|
166
|
-
* - use `{ mode: "oauth", ... }` for Bolt-managed installs
|
|
167
|
-
* - use `{ mode: "authorize", authorize }` for external token resolution
|
|
168
|
-
*/
|
|
169
|
-
auth?: SlackDirectAuthOptions;
|
|
170
|
-
/**
|
|
171
|
-
* Convenience override for single-workspace mode.
|
|
172
|
-
* Defaults to `SLACK_BOT_TOKEN`.
|
|
173
|
-
*/
|
|
174
|
-
botToken?: string;
|
|
175
|
-
/**
|
|
176
|
-
* Pre-existing Express app to mount onto.
|
|
177
|
-
*/
|
|
178
|
-
app?: Application;
|
|
179
|
-
processBeforeResponse?: boolean;
|
|
180
|
-
signatureVerification?: boolean;
|
|
181
|
-
/**
|
|
182
|
-
* Additional Bolt `App` options passed through after this package sets
|
|
183
|
-
* receiver/auth. Use for logger/clientOptions and other native Bolt config.
|
|
184
|
-
*/
|
|
185
|
-
boltAppOptions?: Partial<Omit<AppOptions, "receiver" | "token" | "authorize" | "botId" | "botUserId">>;
|
|
186
|
-
/**
|
|
187
|
-
* Additional Bolt `ExpressReceiver` options passed through after this
|
|
188
|
-
* package sets signing/auth/endpoints. Use for router, custom properties,
|
|
189
|
-
* and receiver-level error handlers.
|
|
190
|
-
*/
|
|
191
|
-
receiverOptions?: Partial<Omit<ExpressReceiverOptions, "signingSecret" | "endpoints" | "processBeforeResponse" | "signatureVerification" | "app" | "clientId" | "clientSecret" | "stateSecret" | "installationStore" | "redirectUri" | "scopes" | "installerOptions">>;
|
|
192
|
-
}
|
|
193
|
-
interface CreateSlackBoltAppResult {
|
|
194
|
-
/** Bolt `App` used for event registration and outbound Slack calls. */
|
|
195
|
-
boltApp: App;
|
|
196
|
-
/** Bolt `ExpressReceiver` that owns request verification and OAuth routes. */
|
|
197
|
-
receiver: ExpressReceiver;
|
|
198
|
-
/** Express app that should receive `receiver.router`. */
|
|
199
|
-
app: Application;
|
|
200
|
-
/** Resolved direct auth mode. */
|
|
201
|
-
authMode: SlackDirectAuthMode;
|
|
202
|
-
/** Exact normalized events endpoint path. */
|
|
203
|
-
routePath: string;
|
|
204
|
-
}
|
|
205
|
-
declare function createSlackBoltApp(options?: CreateSlackBoltAppOptions): Promise<CreateSlackBoltAppResult>;
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* `createSlackSocketBoltApp` — builds a Socket Mode Bolt `App` from the
|
|
209
|
-
* package's structured auth options. Mirrors `createSlackBoltApp` without
|
|
210
|
-
* owning any assistant/app surface mounting.
|
|
211
|
-
*/
|
|
212
|
-
|
|
213
|
-
type ControlledSocketBoltAppOption = "receiver" | "socketMode" | "appToken" | "token" | "authorize" | "botId" | "botUserId" | "clientId" | "clientSecret" | "stateSecret" | "redirectUri" | "installationStore" | "scopes" | "installerOptions";
|
|
214
|
-
type ControlledSocketModeReceiverOption = "appToken" | "clientId" | "clientSecret" | "stateSecret" | "redirectUri" | "installationStore" | "scopes" | "installerOptions" | "logger" | "logLevel";
|
|
215
|
-
interface CreateSlackSocketBoltAppOptions {
|
|
216
|
-
/**
|
|
217
|
-
* Slack app-level token (`xapp-...`) with `connections:write` scope.
|
|
218
|
-
* @default process.env.SLACK_APP_TOKEN
|
|
219
|
-
*/
|
|
220
|
-
appToken?: string;
|
|
221
|
-
/**
|
|
222
|
-
* Convenience override for single-workspace mode.
|
|
223
|
-
* @default process.env.SLACK_BOT_TOKEN
|
|
224
|
-
*/
|
|
225
|
-
botToken?: string;
|
|
226
|
-
/**
|
|
227
|
-
* Direct-mode auth configuration.
|
|
228
|
-
*
|
|
229
|
-
* - omit for single-workspace token mode
|
|
230
|
-
* - use `{ mode: "oauth", ... }` for Bolt-managed installs
|
|
231
|
-
* - use `{ mode: "authorize", authorize }` for external token resolution
|
|
232
|
-
*/
|
|
233
|
-
auth?: SlackDirectAuthOptions;
|
|
234
|
-
/**
|
|
235
|
-
* Additional Bolt `App` options passed after this package sets Socket Mode
|
|
236
|
-
* and auth. Use for logger/clientOptions and non-auth native Bolt config.
|
|
237
|
-
*/
|
|
238
|
-
boltAppOptions?: Partial<Omit<AppOptions, ControlledSocketBoltAppOption>>;
|
|
239
|
-
/**
|
|
240
|
-
* Additional native Socket Mode receiver options. Use this for websocket
|
|
241
|
-
* health tuning such as ping timeouts, reconnect behavior, and receiver
|
|
242
|
-
* error handling. Auth/OAuth fields stay controlled by this helper.
|
|
243
|
-
*/
|
|
244
|
-
socketModeReceiverOptions?: Partial<Omit<SocketModeReceiverOptions, ControlledSocketModeReceiverOption>>;
|
|
245
|
-
}
|
|
246
|
-
interface CreateSlackSocketBoltAppResult {
|
|
247
|
-
boltApp: App;
|
|
248
|
-
authMode: SlackDirectAuthMode;
|
|
249
|
-
}
|
|
250
|
-
declare function createSlackSocketBoltApp(options?: CreateSlackSocketBoltAppOptions): Promise<CreateSlackSocketBoltAppResult>;
|
|
251
|
-
|
|
252
|
-
interface SlackSocketModeProcessLockOptions {
|
|
253
|
-
appSlug: string;
|
|
254
|
-
appToken?: string;
|
|
255
|
-
enabled?: boolean;
|
|
256
|
-
lockDir?: string;
|
|
257
|
-
logger?: Logger;
|
|
258
|
-
}
|
|
259
|
-
interface SlackSocketModeProcessLock {
|
|
260
|
-
path: string;
|
|
261
|
-
release(): void;
|
|
262
|
-
}
|
|
263
|
-
declare function acquireSlackSocketModeProcessLock({ appSlug, appToken, enabled, lockDir, logger, }: SlackSocketModeProcessLockOptions): SlackSocketModeProcessLock | undefined;
|
|
264
|
-
|
|
265
|
-
interface SlackSocketModePostgresLockClient {
|
|
266
|
-
query<T = unknown>(sql: string, values?: readonly unknown[]): Promise<{
|
|
267
|
-
rows: T[];
|
|
268
|
-
rowCount?: number | null;
|
|
269
|
-
}>;
|
|
270
|
-
release?: () => void;
|
|
271
|
-
}
|
|
272
|
-
interface SlackSocketModePostgresLockPool {
|
|
273
|
-
connect(): Promise<SlackSocketModePostgresLockClient>;
|
|
274
|
-
end?: () => Promise<void>;
|
|
275
|
-
}
|
|
276
|
-
interface SlackSocketModePostgresLockOptions {
|
|
277
|
-
appSlug: string;
|
|
278
|
-
appToken?: string;
|
|
279
|
-
client?: SlackSocketModePostgresLockClient;
|
|
280
|
-
connectionString?: string;
|
|
281
|
-
enabled?: boolean;
|
|
282
|
-
logger?: Logger;
|
|
283
|
-
namespace?: string;
|
|
284
|
-
pool?: SlackSocketModePostgresLockPool;
|
|
285
|
-
}
|
|
286
|
-
interface SlackSocketModePostgresLock {
|
|
287
|
-
path: string;
|
|
288
|
-
close(): Promise<void>;
|
|
289
|
-
release(): Promise<void>;
|
|
290
|
-
}
|
|
291
|
-
declare function acquireSlackSocketModePostgresLock({ appSlug, appToken, client, connectionString, enabled, logger, namespace, pool, }: SlackSocketModePostgresLockOptions): Promise<SlackSocketModePostgresLock | undefined>;
|
|
292
|
-
|
|
293
|
-
type SlackSocketModeRuntimePolicy = "single-instance" | "external-coordination";
|
|
294
|
-
interface SlackSocketModeReceiverRuntimeOptions {
|
|
295
|
-
autoReconnectEnabled?: boolean;
|
|
296
|
-
clientPingTimeout?: number;
|
|
297
|
-
pingPongLoggingEnabled?: boolean;
|
|
298
|
-
serverPingTimeout?: number;
|
|
299
|
-
}
|
|
300
|
-
interface SlackSocketModeRuntimeOptions {
|
|
301
|
-
appSlug: string;
|
|
302
|
-
appToken?: string;
|
|
303
|
-
autoReconnectEnabled?: boolean;
|
|
304
|
-
clientPingTimeoutMs?: number;
|
|
305
|
-
exitProcess?: (code: number) => never | void;
|
|
306
|
-
lockDir?: string;
|
|
307
|
-
lockEnabled?: boolean;
|
|
308
|
-
logger?: Logger;
|
|
309
|
-
logLevel?: "debug" | "info" | "warn" | "error";
|
|
310
|
-
pingPongLoggingEnabled?: boolean;
|
|
311
|
-
restartGuardEnabled?: boolean;
|
|
312
|
-
restartGuardMaxWarnings?: number;
|
|
313
|
-
restartGuardWindowMs?: number;
|
|
314
|
-
runtimePolicy?: SlackSocketModeRuntimePolicy;
|
|
315
|
-
serverPingTimeoutMs?: number;
|
|
316
|
-
}
|
|
317
|
-
interface SlackSocketModeRuntime {
|
|
318
|
-
boltAppOptions: {
|
|
319
|
-
logger: Logger$1;
|
|
320
|
-
};
|
|
321
|
-
close(): void;
|
|
322
|
-
socketModeReceiverOptions: SlackSocketModeReceiverRuntimeOptions;
|
|
323
|
-
}
|
|
324
|
-
interface SlackSocketModeRestartGuard {
|
|
325
|
-
record(message: string): void;
|
|
326
|
-
}
|
|
327
|
-
declare function createSlackSocketModeRuntime({ appSlug, appToken, autoReconnectEnabled, clientPingTimeoutMs, exitProcess, lockDir, lockEnabled, logger, logLevel, pingPongLoggingEnabled, restartGuardEnabled, restartGuardMaxWarnings, restartGuardWindowMs, runtimePolicy, serverPingTimeoutMs, }: SlackSocketModeRuntimeOptions): SlackSocketModeRuntime;
|
|
328
|
-
declare function createSlackSocketModeRestartGuard({ enabled, exitProcess, logger, maxWarnings, windowMs, }: {
|
|
329
|
-
enabled: boolean;
|
|
330
|
-
exitProcess: (code: number) => never | void;
|
|
331
|
-
logger?: Logger;
|
|
332
|
-
maxWarnings: number;
|
|
333
|
-
windowMs: number;
|
|
334
|
-
}): SlackSocketModeRestartGuard;
|
|
335
|
-
declare function createSlackSdkLogger({ level, logger, restartGuard, }: {
|
|
336
|
-
level: "debug" | "info" | "warn" | "error";
|
|
337
|
-
logger?: Logger;
|
|
338
|
-
restartGuard?: SlackSocketModeRestartGuard;
|
|
339
|
-
}): Logger$1;
|
|
340
|
-
declare function redactSlackSocketModeLogValue(value: unknown, depth?: number): unknown;
|
|
341
|
-
|
|
342
|
-
declare class InMemorySlackInstallationStore implements SlackInstallationStore {
|
|
343
|
-
private devDB;
|
|
344
|
-
storeInstallation(installation: SlackInstallation): Promise<void>;
|
|
345
|
-
fetchInstallation(query: SlackInstallationQuery): Promise<SlackInstallation>;
|
|
346
|
-
deleteInstallation(query: SlackInstallationQuery): Promise<void>;
|
|
347
|
-
}
|
|
348
|
-
declare function createInMemorySlackInstallationStore(): SlackInstallationStore;
|
|
349
|
-
declare class JsonFileSlackInstallationStore implements SlackInstallationStore {
|
|
350
|
-
private readonly filePath;
|
|
351
|
-
private pending;
|
|
352
|
-
constructor(filePath: string);
|
|
353
|
-
storeInstallation(installation: SlackInstallation): Promise<void>;
|
|
354
|
-
fetchInstallation(query: SlackInstallationQuery): Promise<SlackInstallation>;
|
|
355
|
-
deleteInstallation(query: SlackInstallationQuery): Promise<void>;
|
|
356
|
-
private withLock;
|
|
357
|
-
private readInstallations;
|
|
358
|
-
private writeInstallations;
|
|
359
|
-
}
|
|
360
|
-
declare function createJsonFileSlackInstallationStore(filePath: string): SlackInstallationStore;
|
|
361
|
-
declare function createSlackInstallationStoreAuthorize(store: SlackInstallationStore): SlackAuthorizeFn;
|
|
362
|
-
declare function getSlackInstallationKey(input: SlackInstallation | SlackInstallationQuery): string;
|
|
363
|
-
|
|
364
|
-
export { type CreateSlackBoltAppOptions, type CreateSlackBoltAppResult, type CreateSlackSocketBoltAppOptions, type CreateSlackSocketBoltAppResult, InMemorySlackInstallationStore, JsonFileSlackInstallationStore, type SlackAuthorizeFn, type SlackAuthorizeResult, type SlackAuthorizeSource, type SlackCustomAuthorizeAuthOptions, type SlackDirectAuthMode, type SlackDirectAuthOptions, type SlackInstallation, type SlackInstallationQuery, type SlackInstallationStore, type SlackOAuthAuthOptions, type SlackOAuthCallbackOptions, type SlackOAuthError, type SlackOAuthInstallPathOptions, type SlackSingleWorkspaceAuthOptions, type SlackSocketModePostgresLock, type SlackSocketModePostgresLockClient, type SlackSocketModePostgresLockOptions, type SlackSocketModePostgresLockPool, type SlackSocketModeProcessLock, type SlackSocketModeProcessLockOptions, type SlackSocketModeReceiverRuntimeOptions, type SlackSocketModeRestartGuard, type SlackSocketModeRuntime, type SlackSocketModeRuntimeOptions, type SlackSocketModeRuntimePolicy, type SlackStateStore, acquireSlackSocketModePostgresLock, acquireSlackSocketModeProcessLock, createInMemorySlackInstallationStore, createJsonFileSlackInstallationStore, createSlackBoltApp, createSlackInstallationStoreAuthorize, createSlackSdkLogger, createSlackSocketBoltApp, createSlackSocketModeRestartGuard, createSlackSocketModeRuntime, getSlackInstallationKey, redactSlackSocketModeLogValue };
|
package/dist/chunk-NE57BLLU.js
DELETED
|
File without changes
|
package/dist/diagnostics.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export { I as InspectSlackConnectionOptions, a as InspectSlackTokenScopesOptions, S as SlackApiInspectionError, b as SlackAuthTestIdentity, c as SlackConnectionInspection, d as SlackConnectionInspectionFinding, e as SlackConnectionInspectionFindingSeverity, f as SlackDiagnosticsClient, g as SlackIdentityExpectations, h as SlackIdentityMismatch, i as SlackScopeInspection, j as SlackScopeInspectionMethod, k as SlackScopeInspectionMethodError, l as SlackTokenSource, m as compareSlackIdentity, n as formatSlackIdentityMismatches, o as inspectSlackConnection, p as inspectSlackTokenScopes, q as normalizeSlackAuthTestIdentity } from './inspect-BpY5JA0K.js';
|
|
2
|
-
|
|
3
|
-
interface SlackPayloadDebugSummary {
|
|
4
|
-
rawArgs: unknown;
|
|
5
|
-
rawArgsActionTokenPaths: string[];
|
|
6
|
-
rawArgsKeyPaths: string[];
|
|
7
|
-
rawArgsTokenLikePaths: string[];
|
|
8
|
-
slackActivity: unknown;
|
|
9
|
-
threadContext: unknown;
|
|
10
|
-
}
|
|
11
|
-
declare function summarizeSlackPayloadDebug({ rawArgs, slackActivity, threadContext, }: {
|
|
12
|
-
rawArgs?: unknown;
|
|
13
|
-
slackActivity: unknown;
|
|
14
|
-
threadContext: unknown;
|
|
15
|
-
}): SlackPayloadDebugSummary;
|
|
16
|
-
declare function selectSlackRawArgsForDebug(rawArgs: unknown): unknown;
|
|
17
|
-
declare function selectSlackBodyForDebug(body: unknown): unknown;
|
|
18
|
-
declare function redactSlackDebugValue(value: unknown, depth?: number): unknown;
|
|
19
|
-
declare function collectJsonKeyPaths(value: unknown): string[];
|
|
20
|
-
declare function findJsonKeyPaths(value: unknown, predicate: (key: string) => boolean): string[];
|
|
21
|
-
|
|
22
|
-
export { type SlackPayloadDebugSummary, collectJsonKeyPaths, findJsonKeyPaths, redactSlackDebugValue, selectSlackBodyForDebug, selectSlackRawArgsForDebug, summarizeSlackPayloadDebug };
|
package/dist/shared.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { S as SlackActivityInfo, a as SlackChannelType, b as SlackUserIdentity } from './activity-ByrD9Ftr.js';
|
|
2
|
-
export { ExtractSlackMessageTextOptions, RawSlackActionTokenPayload, RawSlackAppMentionPayload, RawSlackAssistantThreadPayload, RawSlackMessagePayload, SlackAmbientTurnContext, SlackApprovalRequest, SlackAssistantStatusUpdate, SlackAssistantSuggestedPrompt, SlackAssistantSuggestedPrompts, SlackAssistantTaskDisplayMode, SlackAssistantThreadContext, SlackAssistantUtilities, SlackAuthContext, SlackChatStreamStartArgs, SlackEventInteractiveRequestHandler, SlackHumanInputRequest, SlackInteractiveMessage, SlackInteractiveMessageRef, SlackInteractiveRequest, SlackInteractiveRequestBaseContext, SlackInteractiveRequestContext, SlackInteractiveRequestHandler, SlackInteractiveRequestKind, SlackInteractiveResponder, SlackMessageAuthorshipOptions, SlackMessageFormatter, SlackMessageFormattingOptions, SlackMessageTextPayload, SlackThreadStatusSetter, SlackTurnPreparation, SlackTurnRequestContext, currentSlackTurnContext, extractSlackActionToken, extractSlackAttachmentsText, extractSlackAuthContext, extractSlackBlocksText, extractSlackMessageText, extractSlackUserIdentity, formatSlackAttributedFollowUp, isProcessableMessage, markdownToSlackMrkdwn, parseSlackMentionActivity, parseSlackMessageActivity, resolveSlackChannelType, resolveSlackMessageFormatter, resolveThreadAwareSlackSessionId, runWithSlackTurnContext, stripLeadingMentions } from './core.js';
|
package/dist/shared.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import "./chunk-NE57BLLU.js";
|
|
2
|
-
import {
|
|
3
|
-
currentSlackTurnContext,
|
|
4
|
-
formatSlackAttributedFollowUp,
|
|
5
|
-
markdownToSlackMrkdwn,
|
|
6
|
-
resolveSlackMessageFormatter,
|
|
7
|
-
resolveThreadAwareSlackSessionId,
|
|
8
|
-
runWithSlackTurnContext
|
|
9
|
-
} from "./chunk-JZG4IETE.js";
|
|
10
|
-
import {
|
|
11
|
-
extractSlackActionToken,
|
|
12
|
-
extractSlackAuthContext,
|
|
13
|
-
extractSlackUserIdentity,
|
|
14
|
-
parseSlackMentionActivity,
|
|
15
|
-
parseSlackMessageActivity
|
|
16
|
-
} from "./chunk-TWJGVDA2.js";
|
|
17
|
-
import {
|
|
18
|
-
extractSlackAttachmentsText,
|
|
19
|
-
extractSlackBlocksText,
|
|
20
|
-
extractSlackMessageText,
|
|
21
|
-
isProcessableMessage,
|
|
22
|
-
resolveSlackChannelType,
|
|
23
|
-
stripLeadingMentions
|
|
24
|
-
} from "./chunk-FPCE5V5Y.js";
|
|
25
|
-
export {
|
|
26
|
-
currentSlackTurnContext,
|
|
27
|
-
extractSlackActionToken,
|
|
28
|
-
extractSlackAttachmentsText,
|
|
29
|
-
extractSlackAuthContext,
|
|
30
|
-
extractSlackBlocksText,
|
|
31
|
-
extractSlackMessageText,
|
|
32
|
-
extractSlackUserIdentity,
|
|
33
|
-
formatSlackAttributedFollowUp,
|
|
34
|
-
isProcessableMessage,
|
|
35
|
-
markdownToSlackMrkdwn,
|
|
36
|
-
parseSlackMentionActivity,
|
|
37
|
-
parseSlackMessageActivity,
|
|
38
|
-
resolveSlackChannelType,
|
|
39
|
-
resolveSlackMessageFormatter,
|
|
40
|
-
resolveThreadAwareSlackSessionId,
|
|
41
|
-
runWithSlackTurnContext,
|
|
42
|
-
stripLeadingMentions
|
|
43
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|