@cuylabs/channel-slack 0.1.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/LICENSE +201 -0
- package/README.md +168 -0
- package/dist/activity-ByrD9Ftr.d.ts +66 -0
- package/dist/assistant.d.ts +58 -0
- package/dist/assistant.js +188 -0
- package/dist/bolt.d.ts +344 -0
- package/dist/bolt.js +705 -0
- package/dist/chunk-BODPT4I6.js +322 -0
- package/dist/chunk-FPCE5V5Y.js +292 -0
- package/dist/chunk-FX2JOVX5.js +405 -0
- package/dist/chunk-JZG4IETE.js +141 -0
- package/dist/chunk-NE57BLLU.js +0 -0
- package/dist/chunk-TWJGVDA2.js +108 -0
- package/dist/core.d.ts +425 -0
- package/dist/core.js +42 -0
- package/dist/diagnostics.d.ts +105 -0
- package/dist/diagnostics.js +8 -0
- package/dist/feedback.d.ts +137 -0
- package/dist/feedback.js +128 -0
- package/dist/history.d.ts +266 -0
- package/dist/history.js +747 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +57 -0
- package/dist/logging-Bl3HfcC8.d.ts +8 -0
- package/dist/policy.d.ts +130 -0
- package/dist/policy.js +16 -0
- package/dist/setup.d.ts +165 -0
- package/dist/setup.js +453 -0
- package/dist/shared.d.ts +2 -0
- package/dist/shared.js +43 -0
- package/dist/targets.d.ts +113 -0
- package/dist/targets.js +484 -0
- package/dist/users.d.ts +109 -0
- package/dist/users.js +240 -0
- package/docs/concepts/activity.md +33 -0
- package/docs/concepts/bolt-runtime.md +30 -0
- package/docs/concepts/message-policy.md +49 -0
- package/docs/concepts/setup-requirements.md +44 -0
- package/docs/concepts/supplemental-history.md +55 -0
- package/docs/recipes/app-mention-handler.md +34 -0
- package/docs/recipes/assistant-thread-handler.md +28 -0
- package/docs/recipes/generate-slack-manifest.md +28 -0
- package/docs/recipes/history-visibility.md +36 -0
- package/docs/recipes/socket-mode-app.md +29 -0
- package/docs/reference/channel-slack-boundary.md +50 -0
- package/docs/reference/exports.md +32 -0
- package/package.json +130 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
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';
|
|
3
|
+
export { SlackAsyncMessagePolicyConfig, SlackAsyncMessagePolicyResolver, SlackChannelMessagePolicy, SlackMentionedThreadState, SlackMessagePolicyAcceptReason, SlackMessagePolicyAcceptedDecision, SlackMessagePolicyConfig, SlackMessagePolicyDecision, SlackMessagePolicyRejectReason, SlackMessagePolicyRejectedDecision, SlackMessagePolicyResolver, SlackMessagePolicyStateContext, SlackMessagePolicyStateStore, SlackSyncMessagePolicyStateStore, SlackThreadReplyPolicy, createAsyncSlackMessagePolicyResolver, createInMemorySlackMessagePolicyStateStore, createSlackMessagePolicyMessageKey, createSlackMessagePolicyResolver, createSlackMessagePolicyThreadKey, shouldRegisterSlackPassiveChannelMessages } from './policy.js';
|
|
4
|
+
export { L as Logger } from './logging-Bl3HfcC8.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
import {
|
|
26
|
+
createAsyncSlackMessagePolicyResolver,
|
|
27
|
+
createInMemorySlackMessagePolicyStateStore,
|
|
28
|
+
createSlackMessagePolicyMessageKey,
|
|
29
|
+
createSlackMessagePolicyResolver,
|
|
30
|
+
createSlackMessagePolicyThreadKey,
|
|
31
|
+
shouldRegisterSlackPassiveChannelMessages
|
|
32
|
+
} from "./chunk-BODPT4I6.js";
|
|
33
|
+
export {
|
|
34
|
+
createAsyncSlackMessagePolicyResolver,
|
|
35
|
+
createInMemorySlackMessagePolicyStateStore,
|
|
36
|
+
createSlackMessagePolicyMessageKey,
|
|
37
|
+
createSlackMessagePolicyResolver,
|
|
38
|
+
createSlackMessagePolicyThreadKey,
|
|
39
|
+
currentSlackTurnContext,
|
|
40
|
+
extractSlackActionToken,
|
|
41
|
+
extractSlackAttachmentsText,
|
|
42
|
+
extractSlackAuthContext,
|
|
43
|
+
extractSlackBlocksText,
|
|
44
|
+
extractSlackMessageText,
|
|
45
|
+
extractSlackUserIdentity,
|
|
46
|
+
formatSlackAttributedFollowUp,
|
|
47
|
+
isProcessableMessage,
|
|
48
|
+
markdownToSlackMrkdwn,
|
|
49
|
+
parseSlackMentionActivity,
|
|
50
|
+
parseSlackMessageActivity,
|
|
51
|
+
resolveSlackChannelType,
|
|
52
|
+
resolveSlackMessageFormatter,
|
|
53
|
+
resolveThreadAwareSlackSessionId,
|
|
54
|
+
runWithSlackTurnContext,
|
|
55
|
+
shouldRegisterSlackPassiveChannelMessages,
|
|
56
|
+
stripLeadingMentions
|
|
57
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface Logger {
|
|
2
|
+
debug?(message: string, attributes?: Record<string, unknown>): void;
|
|
3
|
+
info?(message: string, attributes?: Record<string, unknown>): void;
|
|
4
|
+
warn?(message: string, attributes?: Record<string, unknown>): void;
|
|
5
|
+
error(message: string, attributes?: Record<string, unknown>): void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type { Logger as L };
|
package/dist/policy.d.ts
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { S as SlackActivityInfo } from './activity-ByrD9Ftr.js';
|
|
2
|
+
|
|
3
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
4
|
+
type SlackChannelMessagePolicy = "disabled" | "mentioned-threads" | "allowed-channels" | "any-added-channel";
|
|
5
|
+
type SlackThreadReplyPolicy = "anyone" | "original-user" | "mention-required";
|
|
6
|
+
type SlackMessagePolicyAcceptReason = "direct-message" | "bot-mentioned" | "mentioned-thread-reply" | "allowed-channel" | "any-added-channel";
|
|
7
|
+
type SlackMessagePolicyRejectReason = "duplicate-message-event" | "passive-channel-messages-disabled" | "thread-not-mentioned" | "thread-reply-mention-required" | "thread-reply-not-original-user" | "channel-not-allowed";
|
|
8
|
+
interface SlackMessagePolicyConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Channel IDs allowed when `messagePolicy` is `allowed-channels`.
|
|
11
|
+
*/
|
|
12
|
+
allowedChannelIds?: readonly string[];
|
|
13
|
+
/**
|
|
14
|
+
* Passive channel behavior for non-mentioned messages. DMs and direct
|
|
15
|
+
* mentions are always accepted.
|
|
16
|
+
*
|
|
17
|
+
* @default "disabled"
|
|
18
|
+
*/
|
|
19
|
+
messagePolicy?: SlackChannelMessagePolicy;
|
|
20
|
+
/**
|
|
21
|
+
* Continuation policy for non-mentioned replies inside a thread the bot was
|
|
22
|
+
* mentioned in.
|
|
23
|
+
*
|
|
24
|
+
* @default "mention-required"
|
|
25
|
+
*/
|
|
26
|
+
threadReplyPolicy?: SlackThreadReplyPolicy;
|
|
27
|
+
/**
|
|
28
|
+
* Maximum remembered mentioned threads for `mentioned-threads` policy.
|
|
29
|
+
*
|
|
30
|
+
* @default 10000
|
|
31
|
+
*/
|
|
32
|
+
maxMentionedThreads?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Maximum accepted message event keys used for duplicate suppression.
|
|
35
|
+
*
|
|
36
|
+
* @default 10000
|
|
37
|
+
*/
|
|
38
|
+
maxAcceptedMessages?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Optional synchronous state backing for mentioned-thread tracking and
|
|
41
|
+
* accepted-message duplicate suppression. Use
|
|
42
|
+
* `createAsyncSlackMessagePolicyResolver` for async/persistent stores.
|
|
43
|
+
*/
|
|
44
|
+
stateStore?: SlackSyncMessagePolicyStateStore;
|
|
45
|
+
}
|
|
46
|
+
interface SlackMessagePolicyAcceptedDecision {
|
|
47
|
+
accepted: true;
|
|
48
|
+
activity: SlackActivityInfo;
|
|
49
|
+
reason: SlackMessagePolicyAcceptReason;
|
|
50
|
+
text: string;
|
|
51
|
+
}
|
|
52
|
+
interface SlackMessagePolicyRejectedDecision {
|
|
53
|
+
accepted: false;
|
|
54
|
+
activity: SlackActivityInfo;
|
|
55
|
+
reason: SlackMessagePolicyRejectReason;
|
|
56
|
+
}
|
|
57
|
+
type SlackMessagePolicyDecision = SlackMessagePolicyAcceptedDecision | SlackMessagePolicyRejectedDecision;
|
|
58
|
+
interface SlackMessagePolicyResolver {
|
|
59
|
+
resolve(activity: SlackActivityInfo): SlackMessagePolicyDecision;
|
|
60
|
+
/**
|
|
61
|
+
* Adapter-friendly resolver that returns accepted text or `undefined`.
|
|
62
|
+
*/
|
|
63
|
+
resolveMessage(activity: SlackActivityInfo): string | undefined;
|
|
64
|
+
}
|
|
65
|
+
interface SlackAsyncMessagePolicyResolver {
|
|
66
|
+
resolve(activity: SlackActivityInfo): Promise<SlackMessagePolicyDecision>;
|
|
67
|
+
/**
|
|
68
|
+
* Adapter-friendly resolver that returns accepted text or `undefined`.
|
|
69
|
+
*/
|
|
70
|
+
resolveMessage(activity: SlackActivityInfo): Promise<string | undefined>;
|
|
71
|
+
}
|
|
72
|
+
interface SlackMentionedThreadState {
|
|
73
|
+
originalUserId?: string;
|
|
74
|
+
}
|
|
75
|
+
interface SlackMessagePolicyStateContext {
|
|
76
|
+
activity: SlackActivityInfo;
|
|
77
|
+
key: string;
|
|
78
|
+
}
|
|
79
|
+
interface SlackSyncMessagePolicyStateStore {
|
|
80
|
+
getMentionedThread(key: string, context: SlackMessagePolicyStateContext): SlackMentionedThreadState | undefined;
|
|
81
|
+
hasAcceptedMessage(key: string, context: SlackMessagePolicyStateContext): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Atomically record this accepted message key if it has not been seen.
|
|
84
|
+
* Return `true` when this caller claimed the key, or `false` when the key
|
|
85
|
+
* was already claimed by another resolver/process. When omitted, the
|
|
86
|
+
* resolver falls back to `hasAcceptedMessage` + `rememberAcceptedMessage`,
|
|
87
|
+
* which is compatible but not atomic across workers.
|
|
88
|
+
*/
|
|
89
|
+
claimAcceptedMessage?(key: string, context: SlackMessagePolicyStateContext): boolean;
|
|
90
|
+
rememberMentionedThread(key: string, state: SlackMentionedThreadState, context: SlackMessagePolicyStateContext): void;
|
|
91
|
+
rememberAcceptedMessage(key: string, context: SlackMessagePolicyStateContext): void;
|
|
92
|
+
}
|
|
93
|
+
interface SlackMessagePolicyStateStore {
|
|
94
|
+
getMentionedThread(key: string, context: SlackMessagePolicyStateContext): MaybePromise<SlackMentionedThreadState | undefined>;
|
|
95
|
+
hasAcceptedMessage(key: string, context: SlackMessagePolicyStateContext): MaybePromise<boolean>;
|
|
96
|
+
/**
|
|
97
|
+
* Atomically record this accepted message key if it has not been seen.
|
|
98
|
+
* Durable stores should implement this as an insert-if-absent / compare-and-
|
|
99
|
+
* set operation so duplicate Slack events cannot race across workers. When
|
|
100
|
+
* omitted, the resolver falls back to `hasAcceptedMessage` +
|
|
101
|
+
* `rememberAcceptedMessage`, which is compatible but not atomic.
|
|
102
|
+
*/
|
|
103
|
+
claimAcceptedMessage?(key: string, context: SlackMessagePolicyStateContext): MaybePromise<boolean>;
|
|
104
|
+
rememberMentionedThread(key: string, state: SlackMentionedThreadState, context: SlackMessagePolicyStateContext): MaybePromise<void>;
|
|
105
|
+
rememberAcceptedMessage(key: string, context: SlackMessagePolicyStateContext): MaybePromise<void>;
|
|
106
|
+
}
|
|
107
|
+
interface SlackAsyncMessagePolicyConfig extends Omit<SlackMessagePolicyConfig, "stateStore"> {
|
|
108
|
+
/**
|
|
109
|
+
* Optional state backing for mentioned-thread tracking and accepted-message
|
|
110
|
+
* duplicate suppression. Implement this with durable storage to preserve
|
|
111
|
+
* policy state across process restarts.
|
|
112
|
+
*/
|
|
113
|
+
stateStore?: SlackMessagePolicyStateStore;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
declare function createAsyncSlackMessagePolicyResolver(config?: SlackAsyncMessagePolicyConfig): SlackAsyncMessagePolicyResolver;
|
|
117
|
+
|
|
118
|
+
declare function createSlackMessagePolicyMessageKey(activity: SlackActivityInfo): string | undefined;
|
|
119
|
+
declare function createSlackMessagePolicyThreadKey(activity: SlackActivityInfo): string;
|
|
120
|
+
|
|
121
|
+
declare function shouldRegisterSlackPassiveChannelMessages(config?: SlackMessagePolicyConfig): boolean;
|
|
122
|
+
|
|
123
|
+
declare function createSlackMessagePolicyResolver(config?: SlackMessagePolicyConfig): SlackMessagePolicyResolver;
|
|
124
|
+
|
|
125
|
+
declare function createInMemorySlackMessagePolicyStateStore({ maxAcceptedMessages, maxMentionedThreads, }?: {
|
|
126
|
+
maxAcceptedMessages?: number;
|
|
127
|
+
maxMentionedThreads?: number;
|
|
128
|
+
}): SlackSyncMessagePolicyStateStore;
|
|
129
|
+
|
|
130
|
+
export { type SlackAsyncMessagePolicyConfig, type SlackAsyncMessagePolicyResolver, type SlackChannelMessagePolicy, type SlackMentionedThreadState, type SlackMessagePolicyAcceptReason, type SlackMessagePolicyAcceptedDecision, type SlackMessagePolicyConfig, type SlackMessagePolicyDecision, type SlackMessagePolicyRejectReason, type SlackMessagePolicyRejectedDecision, type SlackMessagePolicyResolver, type SlackMessagePolicyStateContext, type SlackMessagePolicyStateStore, type SlackSyncMessagePolicyStateStore, type SlackThreadReplyPolicy, createAsyncSlackMessagePolicyResolver, createInMemorySlackMessagePolicyStateStore, createSlackMessagePolicyMessageKey, createSlackMessagePolicyResolver, createSlackMessagePolicyThreadKey, shouldRegisterSlackPassiveChannelMessages };
|
package/dist/policy.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAsyncSlackMessagePolicyResolver,
|
|
3
|
+
createInMemorySlackMessagePolicyStateStore,
|
|
4
|
+
createSlackMessagePolicyMessageKey,
|
|
5
|
+
createSlackMessagePolicyResolver,
|
|
6
|
+
createSlackMessagePolicyThreadKey,
|
|
7
|
+
shouldRegisterSlackPassiveChannelMessages
|
|
8
|
+
} from "./chunk-BODPT4I6.js";
|
|
9
|
+
export {
|
|
10
|
+
createAsyncSlackMessagePolicyResolver,
|
|
11
|
+
createInMemorySlackMessagePolicyStateStore,
|
|
12
|
+
createSlackMessagePolicyMessageKey,
|
|
13
|
+
createSlackMessagePolicyResolver,
|
|
14
|
+
createSlackMessagePolicyThreadKey,
|
|
15
|
+
shouldRegisterSlackPassiveChannelMessages
|
|
16
|
+
};
|
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { InspectSlackConnectionOptions, SlackDiagnosticsClient, SlackConnectionInspection } from './diagnostics.js';
|
|
2
|
+
|
|
3
|
+
type SlackSetupFeature = "assistant" | "app-mentions" | "direct-messages" | "channel-messages" | "history" | "interactivity" | "feedback" | "user-profiles" | "user-emails";
|
|
4
|
+
type SlackSetupFeaturePreset = "assistant" | "channel-adapter" | "agent-app";
|
|
5
|
+
type SlackSetupTransport = "http" | "socket";
|
|
6
|
+
interface SlackSetupEnvironmentVariable {
|
|
7
|
+
name: string;
|
|
8
|
+
purpose: string;
|
|
9
|
+
}
|
|
10
|
+
interface SlackSetupSettingsRequirements {
|
|
11
|
+
assistantView: boolean;
|
|
12
|
+
eventSubscriptions: boolean;
|
|
13
|
+
interactivity: boolean;
|
|
14
|
+
socketMode: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface SlackSetupRequirements {
|
|
17
|
+
features: SlackSetupFeature[];
|
|
18
|
+
transport: SlackSetupTransport;
|
|
19
|
+
eventsPath: string;
|
|
20
|
+
requestUrl?: string;
|
|
21
|
+
botScopes: string[];
|
|
22
|
+
optionalBotScopes: string[];
|
|
23
|
+
appTokenScopes: string[];
|
|
24
|
+
botEvents: string[];
|
|
25
|
+
settings: SlackSetupSettingsRequirements;
|
|
26
|
+
environment: SlackSetupEnvironmentVariable[];
|
|
27
|
+
}
|
|
28
|
+
interface GetSlackSetupRequirementsOptions {
|
|
29
|
+
/**
|
|
30
|
+
* Package-level preset to start from.
|
|
31
|
+
*
|
|
32
|
+
* - `assistant`: Assistant pane plus default feedback controls
|
|
33
|
+
* - `channel-adapter`: app mentions plus direct messages
|
|
34
|
+
* - `agent-app`: unified mount defaults: Assistant pane, mentions, DMs, feedback
|
|
35
|
+
*
|
|
36
|
+
* Pass `false` to use only the explicit `features` list.
|
|
37
|
+
*
|
|
38
|
+
* @default "agent-app"
|
|
39
|
+
*/
|
|
40
|
+
preset?: SlackSetupFeaturePreset | false;
|
|
41
|
+
/**
|
|
42
|
+
* Extra package features used by the host. When omitted, the selected preset
|
|
43
|
+
* is used as-is.
|
|
44
|
+
*/
|
|
45
|
+
features?: readonly SlackSetupFeature[];
|
|
46
|
+
/**
|
|
47
|
+
* Inbound transport used by the direct Slack app.
|
|
48
|
+
*
|
|
49
|
+
* @default "http"
|
|
50
|
+
*/
|
|
51
|
+
transport?: SlackSetupTransport;
|
|
52
|
+
/**
|
|
53
|
+
* Slack Events API callback path for HTTP mode.
|
|
54
|
+
*
|
|
55
|
+
* @default "/slack/events"
|
|
56
|
+
*/
|
|
57
|
+
eventsPath?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Public base URL for HTTP mode. When provided, the returned requirements
|
|
60
|
+
* and generated manifest include the full Slack request URL.
|
|
61
|
+
*/
|
|
62
|
+
baseUrl?: string;
|
|
63
|
+
/** App-owned bot scopes to include in addition to package requirements. */
|
|
64
|
+
extraBotScopes?: readonly string[];
|
|
65
|
+
/** App-owned optional bot scopes to verify as warnings. */
|
|
66
|
+
extraOptionalBotScopes?: readonly string[];
|
|
67
|
+
/** App-owned bot events to include in addition to package requirements. */
|
|
68
|
+
extraBotEvents?: readonly string[];
|
|
69
|
+
}
|
|
70
|
+
interface SlackManifestAppHome {
|
|
71
|
+
home_tab_enabled: boolean;
|
|
72
|
+
messages_tab_enabled: boolean;
|
|
73
|
+
messages_tab_read_only_enabled: boolean;
|
|
74
|
+
}
|
|
75
|
+
interface SlackManifestSuggestedPrompt {
|
|
76
|
+
title: string;
|
|
77
|
+
message: string;
|
|
78
|
+
}
|
|
79
|
+
interface SlackAppManifest {
|
|
80
|
+
display_information: {
|
|
81
|
+
name: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
background_color?: string;
|
|
84
|
+
};
|
|
85
|
+
features: {
|
|
86
|
+
app_home?: SlackManifestAppHome;
|
|
87
|
+
bot_user: {
|
|
88
|
+
display_name: string;
|
|
89
|
+
always_online?: boolean;
|
|
90
|
+
};
|
|
91
|
+
assistant_view?: {
|
|
92
|
+
assistant_description?: string;
|
|
93
|
+
suggested_prompts?: SlackManifestSuggestedPrompt[];
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
oauth_config: {
|
|
97
|
+
scopes: {
|
|
98
|
+
bot: string[];
|
|
99
|
+
user?: string[];
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
settings: {
|
|
103
|
+
event_subscriptions?: {
|
|
104
|
+
request_url?: string;
|
|
105
|
+
bot_events: string[];
|
|
106
|
+
};
|
|
107
|
+
interactivity?: {
|
|
108
|
+
is_enabled: boolean;
|
|
109
|
+
request_url?: string;
|
|
110
|
+
};
|
|
111
|
+
socket_mode_enabled?: boolean;
|
|
112
|
+
token_rotation_enabled?: boolean;
|
|
113
|
+
org_deploy_enabled?: boolean;
|
|
114
|
+
is_mcp_enabled?: boolean;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
interface CreateSlackAppManifestOptions extends GetSlackSetupRequirementsOptions {
|
|
118
|
+
name: string;
|
|
119
|
+
description?: string;
|
|
120
|
+
backgroundColor?: string;
|
|
121
|
+
botDisplayName?: string;
|
|
122
|
+
alwaysOnline?: boolean;
|
|
123
|
+
assistantDescription?: string;
|
|
124
|
+
suggestedPrompts?: readonly SlackManifestSuggestedPrompt[];
|
|
125
|
+
appHome?: false | Partial<SlackManifestAppHome>;
|
|
126
|
+
extraUserScopes?: readonly string[];
|
|
127
|
+
tokenRotationEnabled?: boolean;
|
|
128
|
+
orgDeployEnabled?: boolean;
|
|
129
|
+
isMcpEnabled?: boolean;
|
|
130
|
+
}
|
|
131
|
+
type SlackAppManifestComparisonFindingSeverity = "warning" | "error";
|
|
132
|
+
interface SlackAppManifestComparisonFinding {
|
|
133
|
+
severity: SlackAppManifestComparisonFindingSeverity;
|
|
134
|
+
code: string;
|
|
135
|
+
message: string;
|
|
136
|
+
path?: string;
|
|
137
|
+
expected?: unknown;
|
|
138
|
+
actual?: unknown;
|
|
139
|
+
}
|
|
140
|
+
interface SlackAppManifestComparison {
|
|
141
|
+
ok: boolean;
|
|
142
|
+
missingBotScopes: string[];
|
|
143
|
+
missingOptionalBotScopes: string[];
|
|
144
|
+
missingBotEvents: string[];
|
|
145
|
+
findings: SlackAppManifestComparisonFinding[];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
declare const slackSetupFeaturePresets: Readonly<Record<SlackSetupFeaturePreset, readonly SlackSetupFeature[]>>;
|
|
149
|
+
declare function getSlackSetupRequirements(options?: GetSlackSetupRequirementsOptions): SlackSetupRequirements;
|
|
150
|
+
|
|
151
|
+
declare function createSlackAppManifest(options: CreateSlackAppManifestOptions): SlackAppManifest;
|
|
152
|
+
declare function compareSlackAppManifest(manifest: unknown, requirements: SlackSetupRequirements): SlackAppManifestComparison;
|
|
153
|
+
|
|
154
|
+
interface InspectSlackAppSetupOptions extends GetSlackSetupRequirementsOptions, Pick<InspectSlackConnectionOptions, "token" | "requestTimeoutMs" | "inspectScopes" | "scopeMethods"> {
|
|
155
|
+
/** Inject a preconfigured Slack Web API client, useful for OAuth stores/tests. */
|
|
156
|
+
client?: SlackDiagnosticsClient;
|
|
157
|
+
}
|
|
158
|
+
interface SlackAppSetupInspection {
|
|
159
|
+
ok: boolean;
|
|
160
|
+
requirements: SlackSetupRequirements;
|
|
161
|
+
connection: SlackConnectionInspection;
|
|
162
|
+
}
|
|
163
|
+
declare function inspectSlackAppSetup(options?: InspectSlackAppSetupOptions): Promise<SlackAppSetupInspection>;
|
|
164
|
+
|
|
165
|
+
export { type CreateSlackAppManifestOptions, type GetSlackSetupRequirementsOptions, type InspectSlackAppSetupOptions, type SlackAppManifest, type SlackAppManifestComparison, type SlackAppManifestComparisonFinding, type SlackAppManifestComparisonFindingSeverity, type SlackAppSetupInspection, SlackDiagnosticsClient, type SlackManifestAppHome, type SlackManifestSuggestedPrompt, type SlackSetupEnvironmentVariable, type SlackSetupFeature, type SlackSetupFeaturePreset, type SlackSetupRequirements, type SlackSetupSettingsRequirements, type SlackSetupTransport, compareSlackAppManifest, createSlackAppManifest, getSlackSetupRequirements, inspectSlackAppSetup, slackSetupFeaturePresets };
|