@herdctl/slack 0.3.0 → 1.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.
Files changed (60) hide show
  1. package/dist/__tests__/command-handler.test.js +1 -0
  2. package/dist/__tests__/command-handler.test.js.map +1 -1
  3. package/dist/__tests__/error-handler.test.js +25 -25
  4. package/dist/__tests__/error-handler.test.js.map +1 -1
  5. package/dist/__tests__/formatting.test.js +9 -9
  6. package/dist/__tests__/formatting.test.js.map +1 -1
  7. package/dist/__tests__/manager.test.d.ts +8 -0
  8. package/dist/__tests__/manager.test.d.ts.map +1 -0
  9. package/dist/__tests__/manager.test.js +278 -0
  10. package/dist/__tests__/manager.test.js.map +1 -0
  11. package/dist/__tests__/slack-connector.test.js +200 -0
  12. package/dist/__tests__/slack-connector.test.js.map +1 -1
  13. package/dist/commands/command-handler.d.ts +3 -3
  14. package/dist/commands/command-handler.d.ts.map +1 -1
  15. package/dist/commands/status.d.ts.map +1 -1
  16. package/dist/commands/status.js +1 -54
  17. package/dist/commands/status.js.map +1 -1
  18. package/dist/error-handler.d.ts +12 -33
  19. package/dist/error-handler.d.ts.map +1 -1
  20. package/dist/error-handler.js +32 -57
  21. package/dist/error-handler.js.map +1 -1
  22. package/dist/formatting.d.ts +4 -45
  23. package/dist/formatting.d.ts.map +1 -1
  24. package/dist/formatting.js +10 -96
  25. package/dist/formatting.js.map +1 -1
  26. package/dist/index.d.ts +7 -8
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +15 -11
  29. package/dist/index.js.map +1 -1
  30. package/dist/manager.d.ts +156 -0
  31. package/dist/manager.d.ts.map +1 -0
  32. package/dist/manager.js +532 -0
  33. package/dist/manager.js.map +1 -0
  34. package/dist/slack-connector.d.ts +10 -2
  35. package/dist/slack-connector.d.ts.map +1 -1
  36. package/dist/slack-connector.js +112 -32
  37. package/dist/slack-connector.js.map +1 -1
  38. package/dist/types.d.ts +8 -24
  39. package/dist/types.d.ts.map +1 -1
  40. package/package.json +3 -2
  41. package/dist/__tests__/session-manager.test.d.ts +0 -2
  42. package/dist/__tests__/session-manager.test.d.ts.map +0 -1
  43. package/dist/__tests__/session-manager.test.js +0 -214
  44. package/dist/__tests__/session-manager.test.js.map +0 -1
  45. package/dist/session-manager/errors.d.ts +0 -58
  46. package/dist/session-manager/errors.d.ts.map +0 -1
  47. package/dist/session-manager/errors.js +0 -70
  48. package/dist/session-manager/errors.js.map +0 -1
  49. package/dist/session-manager/index.d.ts +0 -9
  50. package/dist/session-manager/index.d.ts.map +0 -1
  51. package/dist/session-manager/index.js +0 -13
  52. package/dist/session-manager/index.js.map +0 -1
  53. package/dist/session-manager/session-manager.d.ts +0 -62
  54. package/dist/session-manager/session-manager.d.ts.map +0 -1
  55. package/dist/session-manager/session-manager.js +0 -320
  56. package/dist/session-manager/session-manager.js.map +0 -1
  57. package/dist/session-manager/types.d.ts +0 -154
  58. package/dist/session-manager/types.d.ts.map +0 -1
  59. package/dist/session-manager/types.js +0 -57
  60. package/dist/session-manager/types.js.map +0 -1
@@ -3,39 +3,18 @@
3
3
  *
4
4
  * Provides utilities for:
5
5
  * - Converting standard markdown to Slack's mrkdwn format
6
- * - Splitting long messages to fit Slack's practical limit
7
6
  * - Creating context attachments with color coding
7
+ *
8
+ * Note: Message splitting utilities (findSplitPoint, splitMessage, needsSplit,
9
+ * truncateMessage, formatCodeBlock) are provided by @herdctl/chat.
8
10
  */
11
+ export { findSplitPoint, splitMessage, needsSplit, truncateMessage, formatCodeBlock, DEFAULT_MESSAGE_DELAY_MS, MIN_CHUNK_SIZE, type MessageSplitOptions, type SplitResult, } from "@herdctl/chat";
9
12
  /**
10
13
  * Slack's practical maximum message length
11
14
  *
12
15
  * Hard limit is ~40K, but messages above ~4K become unwieldy in threads.
13
16
  */
14
17
  export declare const SLACK_MAX_MESSAGE_LENGTH = 4000;
15
- /**
16
- * Minimum chunk size when splitting messages
17
- */
18
- export declare const MIN_CHUNK_SIZE = 100;
19
- /**
20
- * Default delay between sending split messages (in milliseconds)
21
- */
22
- export declare const DEFAULT_MESSAGE_DELAY_MS = 500;
23
- /**
24
- * Options for splitting messages
25
- */
26
- export interface MessageSplitOptions {
27
- maxLength?: number;
28
- preserveBoundaries?: boolean;
29
- splitPoints?: string[];
30
- }
31
- /**
32
- * Result from splitting a message
33
- */
34
- export interface SplitResult {
35
- chunks: string[];
36
- wasSplit: boolean;
37
- originalLength: number;
38
- }
39
18
  /**
40
19
  * Context attachment for Slack messages
41
20
  */
@@ -50,32 +29,12 @@ export interface ContextAttachment {
50
29
  * conversion that handles edge cases regex approaches miss.
51
30
  */
52
31
  export declare function markdownToMrkdwn(text: string): string;
53
- /**
54
- * Find the best split point within a text chunk
55
- */
56
- export declare function findSplitPoint(text: string, maxLength: number, splitPoints?: string[]): number;
57
- /**
58
- * Split a message into chunks that fit Slack's message length limit
59
- */
60
- export declare function splitMessage(content: string, options?: MessageSplitOptions): SplitResult;
61
- /**
62
- * Check if a message needs to be split
63
- */
64
- export declare function needsSplit(content: string, maxLength?: number): boolean;
65
32
  /**
66
33
  * Create a context attachment for Slack messages
67
34
  *
68
35
  * Used to display context usage information in a color-coded footer.
69
36
  */
70
37
  export declare function createContextAttachment(contextPercent: number): ContextAttachment;
71
- /**
72
- * Truncate a message to fit within the max length, adding an ellipsis
73
- */
74
- export declare function truncateMessage(content: string, maxLength?: number, ellipsis?: string): string;
75
- /**
76
- * Format code as a Slack code block
77
- */
78
- export declare function formatCodeBlock(code: string, language?: string): string;
79
38
  /**
80
39
  * Escape Slack mrkdwn characters in text
81
40
  */
@@ -1 +1 @@
1
- {"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../src/formatting.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;GAEG;AACH,eAAO,MAAM,wBAAwB,MAAM,CAA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atting.d.ts","sourceRoot":"","sources":["../src/formatting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,EACV,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AAMvB;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAM7C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAMD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUrD;AAMD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAKnB;AAMD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD"}
@@ -3,9 +3,18 @@
3
3
  *
4
4
  * Provides utilities for:
5
5
  * - Converting standard markdown to Slack's mrkdwn format
6
- * - Splitting long messages to fit Slack's practical limit
7
6
  * - Creating context attachments with color coding
7
+ *
8
+ * Note: Message splitting utilities (findSplitPoint, splitMessage, needsSplit,
9
+ * truncateMessage, formatCodeBlock) are provided by @herdctl/chat.
8
10
  */
11
+ import { slackifyMarkdown } from "slackify-markdown";
12
+ // =============================================================================
13
+ // Re-exports from @herdctl/chat
14
+ // =============================================================================
15
+ // Re-export message splitting utilities from @herdctl/chat
16
+ // These are identical between Discord and Slack, just with different max lengths
17
+ export { findSplitPoint, splitMessage, needsSplit, truncateMessage, formatCodeBlock, DEFAULT_MESSAGE_DELAY_MS, MIN_CHUNK_SIZE, } from "@herdctl/chat";
9
18
  // =============================================================================
10
19
  // Constants
11
20
  // =============================================================================
@@ -15,18 +24,9 @@
15
24
  * Hard limit is ~40K, but messages above ~4K become unwieldy in threads.
16
25
  */
17
26
  export const SLACK_MAX_MESSAGE_LENGTH = 4000;
18
- /**
19
- * Minimum chunk size when splitting messages
20
- */
21
- export const MIN_CHUNK_SIZE = 100;
22
- /**
23
- * Default delay between sending split messages (in milliseconds)
24
- */
25
- export const DEFAULT_MESSAGE_DELAY_MS = 500;
26
27
  // =============================================================================
27
28
  // Markdown to mrkdwn Conversion
28
29
  // =============================================================================
29
- import { slackifyMarkdown } from "slackify-markdown";
30
30
  /**
31
31
  * Convert standard markdown to Slack's mrkdwn format
32
32
  *
@@ -44,75 +44,6 @@ export function markdownToMrkdwn(text) {
44
44
  .trimEnd());
45
45
  }
46
46
  // =============================================================================
47
- // Message Splitting
48
- // =============================================================================
49
- const DEFAULT_SPLIT_POINTS = ["\n\n", "\n", ". ", "! ", "? ", ", ", " "];
50
- /**
51
- * Find the best split point within a text chunk
52
- */
53
- export function findSplitPoint(text, maxLength, splitPoints = DEFAULT_SPLIT_POINTS) {
54
- if (text.length <= maxLength) {
55
- return text.length;
56
- }
57
- for (const splitPoint of splitPoints) {
58
- const searchText = text.slice(0, maxLength);
59
- const lastIndex = searchText.lastIndexOf(splitPoint);
60
- if (lastIndex > MIN_CHUNK_SIZE) {
61
- return lastIndex + splitPoint.length;
62
- }
63
- }
64
- const hardSplitIndex = text.lastIndexOf(" ", maxLength);
65
- if (hardSplitIndex > MIN_CHUNK_SIZE) {
66
- return hardSplitIndex + 1;
67
- }
68
- return maxLength;
69
- }
70
- /**
71
- * Split a message into chunks that fit Slack's message length limit
72
- */
73
- export function splitMessage(content, options = {}) {
74
- const { maxLength = SLACK_MAX_MESSAGE_LENGTH, preserveBoundaries = true, splitPoints = DEFAULT_SPLIT_POINTS, } = options;
75
- const originalLength = content.length;
76
- if (content.length <= maxLength) {
77
- return {
78
- chunks: [content],
79
- wasSplit: false,
80
- originalLength,
81
- };
82
- }
83
- const chunks = [];
84
- let remaining = content;
85
- while (remaining.length > 0) {
86
- if (remaining.length <= maxLength) {
87
- chunks.push(remaining.trim());
88
- break;
89
- }
90
- let splitIndex;
91
- if (preserveBoundaries) {
92
- splitIndex = findSplitPoint(remaining, maxLength, splitPoints);
93
- }
94
- else {
95
- splitIndex = maxLength;
96
- }
97
- const chunk = remaining.slice(0, splitIndex).trim();
98
- if (chunk.length > 0) {
99
- chunks.push(chunk);
100
- }
101
- remaining = remaining.slice(splitIndex).trim();
102
- }
103
- return {
104
- chunks,
105
- wasSplit: chunks.length > 1,
106
- originalLength,
107
- };
108
- }
109
- /**
110
- * Check if a message needs to be split
111
- */
112
- export function needsSplit(content, maxLength = SLACK_MAX_MESSAGE_LENGTH) {
113
- return content.length > maxLength;
114
- }
115
- // =============================================================================
116
47
  // Context Attachments
117
48
  // =============================================================================
118
49
  /**
@@ -129,23 +60,6 @@ export function createContextAttachment(contextPercent) {
129
60
  // =============================================================================
130
61
  // Utility Functions
131
62
  // =============================================================================
132
- /**
133
- * Truncate a message to fit within the max length, adding an ellipsis
134
- */
135
- export function truncateMessage(content, maxLength = SLACK_MAX_MESSAGE_LENGTH, ellipsis = "...") {
136
- if (content.length <= maxLength) {
137
- return content;
138
- }
139
- const truncatedLength = maxLength - ellipsis.length;
140
- return content.slice(0, truncatedLength) + ellipsis;
141
- }
142
- /**
143
- * Format code as a Slack code block
144
- */
145
- export function formatCodeBlock(code, language) {
146
- const langTag = language ?? "";
147
- return `\`\`\`${langTag}\n${code}\n\`\`\``;
148
- }
149
63
  /**
150
64
  * Escape Slack mrkdwn characters in text
151
65
  */
@@ -1 +1 @@
1
- {"version":3,"file":"formatting.js","sourceRoot":"","sources":["../src/formatting.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,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* - Single Bolt App shared across all agents (one bot token per workspace)
9
9
  * - Channel->agent routing for multi-agent support
10
10
  * - Channel-based conversation management
11
- * - SessionManager for per-channel conversation context
11
+ *
12
+ * Session management, message splitting, and other shared utilities
13
+ * are provided by @herdctl/chat - import them from there directly.
12
14
  */
13
15
  export declare const VERSION = "0.1.0";
14
16
  export { SlackConnector } from "./slack-connector.js";
17
+ export { SlackManager } from "./manager.js";
15
18
  export { createSlackLogger, createDefaultSlackLogger, } from "./logger.js";
16
19
  export type { SlackLogLevel, SlackLoggerOptions, } from "./logger.js";
17
- export { SessionManager } from "./session-manager/index.js";
18
- export type { SlackConnectorOptions, SlackConnectorState, SlackConnectionStatus, SlackConnectorLogger, SlackMessageEvent, SlackErrorEvent, SlackChannelConfig, ISlackConnector, ISlackSessionManager, SlackConnectorEventMap, SlackConnectorEventName, SlackConnectorEventPayload, } from "./types.js";
19
- export type { SessionManagerOptions, SessionManagerLogger, ISessionManager, SessionResult, ChannelSession, SlackSessionState, } from "./session-manager/index.js";
20
- export { SlackSessionStateSchema, ChannelSessionSchema, createInitialSessionState, createChannelSession, } from "./session-manager/index.js";
20
+ export type { SlackConnectorOptions, SlackConnectorState, SlackConnectionStatus, SlackConnectorLogger, SlackMessageEvent, SlackErrorEvent, SlackChannelConfig, SlackFileUploadParams, ISlackConnector, SlackConnectorEventMap, SlackConnectorEventName, SlackConnectorEventPayload, } from "./types.js";
21
21
  export { SlackErrorCode, SlackConnectorError, SlackConnectionError, AlreadyConnectedError, MissingTokenError, InvalidTokenError, isSlackConnectorError, } from "./errors.js";
22
- export { USER_ERROR_MESSAGES, ErrorCategory, classifyError, safeExecute, safeExecuteWithReply, } from "./error-handler.js";
22
+ export { ErrorCategory, classifyError, safeExecute, safeExecuteWithReply, } from "./error-handler.js";
23
23
  export type { ClassifiedError } from "./error-handler.js";
24
- export { SessionErrorCode, SessionManagerError, SessionStateReadError, SessionStateWriteError, SessionDirectoryCreateError, isSessionManagerError, } from "./session-manager/index.js";
25
24
  export { CommandHandler } from "./commands/index.js";
26
25
  export { helpCommand, resetCommand, statusCommand } from "./commands/index.js";
27
26
  export type { CommandContext, PrefixCommand, CommandHandlerOptions, } from "./commands/index.js";
28
27
  export { isBotMentioned, stripBotMention, stripMentions, shouldProcessMessage, processMessage, } from "./message-handler.js";
29
- export { SLACK_MAX_MESSAGE_LENGTH, DEFAULT_MESSAGE_DELAY_MS, MIN_CHUNK_SIZE, findSplitPoint, splitMessage, needsSplit, truncateMessage, formatCodeBlock, escapeMrkdwn, markdownToMrkdwn, createContextAttachment, } from "./formatting.js";
28
+ export { SLACK_MAX_MESSAGE_LENGTH, markdownToMrkdwn, escapeMrkdwn, createContextAttachment, findSplitPoint, splitMessage, needsSplit, truncateMessage, formatCodeBlock, DEFAULT_MESSAGE_DELAY_MS, MIN_CHUNK_SIZE, } from "./formatting.js";
30
29
  export type { MessageSplitOptions, SplitResult, ContextAttachment, } from "./formatting.js";
31
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,aAAa,EACb,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG5D,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,cAAc,EACd,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,WAAW,EACX,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE/E,YAAY,EACV,cAAc,EACd,aAAa,EACb,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,cAAc,EACd,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,UAAU,EACV,eAAe,EACf,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,mBAAmB,EACnB,WAAW,EACX,iBAAiB,GAClB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,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ACX,iBAAiB,GAClB,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -8,27 +8,31 @@
8
8
  * - Single Bolt App shared across all agents (one bot token per workspace)
9
9
  * - Channel->agent routing for multi-agent support
10
10
  * - Channel-based conversation management
11
- * - SessionManager for per-channel conversation context
11
+ *
12
+ * Session management, message splitting, and other shared utilities
13
+ * are provided by @herdctl/chat - import them from there directly.
12
14
  */
13
15
  export const VERSION = "0.1.0";
14
16
  // Main connector class
15
17
  export { SlackConnector } from "./slack-connector.js";
18
+ // Manager class (used by FleetManager)
19
+ export { SlackManager } from "./manager.js";
16
20
  // Logger
17
21
  export { createSlackLogger, createDefaultSlackLogger, } from "./logger.js";
18
- // Session manager
19
- export { SessionManager } from "./session-manager/index.js";
20
- export { SlackSessionStateSchema, ChannelSessionSchema, createInitialSessionState, createChannelSession, } from "./session-manager/index.js";
21
- // Errors
22
+ // Slack-specific errors
22
23
  export { SlackErrorCode, SlackConnectorError, SlackConnectionError, AlreadyConnectedError, MissingTokenError, InvalidTokenError, isSlackConnectorError, } from "./errors.js";
23
- // Error handling utilities
24
- export { USER_ERROR_MESSAGES, ErrorCategory, classifyError, safeExecute, safeExecuteWithReply, } from "./error-handler.js";
25
- // Session manager errors
26
- export { SessionErrorCode, SessionManagerError, SessionStateReadError, SessionStateWriteError, SessionDirectoryCreateError, isSessionManagerError, } from "./session-manager/index.js";
24
+ // Slack-specific error handling (re-exports shared types + Slack classifier)
25
+ export { ErrorCategory, classifyError, safeExecute, safeExecuteWithReply, } from "./error-handler.js";
27
26
  // Commands
28
27
  export { CommandHandler } from "./commands/index.js";
29
28
  export { helpCommand, resetCommand, statusCommand } from "./commands/index.js";
30
29
  // Message handling
31
30
  export { isBotMentioned, stripBotMention, stripMentions, shouldProcessMessage, processMessage, } from "./message-handler.js";
32
- // Formatting utilities
33
- export { SLACK_MAX_MESSAGE_LENGTH, DEFAULT_MESSAGE_DELAY_MS, MIN_CHUNK_SIZE, findSplitPoint, splitMessage, needsSplit, truncateMessage, formatCodeBlock, escapeMrkdwn, markdownToMrkdwn, createContextAttachment, } from "./formatting.js";
31
+ // Slack-specific formatting utilities
32
+ // Note: Message splitting functions are re-exported from @herdctl/chat
33
+ export {
34
+ // Slack-specific
35
+ SLACK_MAX_MESSAGE_LENGTH, markdownToMrkdwn, escapeMrkdwn, createContextAttachment,
36
+ // Re-exported from @herdctl/chat
37
+ findSplitPoint, splitMessage, needsSplit, truncateMessage, formatCodeBlock, DEFAULT_MESSAGE_DELAY_MS, MIN_CHUNK_SIZE, } from "./formatting.js";
34
38
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,SAAS;AACT,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAOrB,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AA4B5D,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAEpC,SAAS;AACT,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAErB,2BAA2B;AAC3B,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,WAAW,EACX,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAI5B,yBAAyB;AACzB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,GACtB,MA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AAe,EACf,aAAa,EACb,oBAAoB,EACpB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAE9B,sCAAsC;AACtC,uEAAuE;AACvE,OAAO;AACL,iBAAiB;AACjB,wBAAwB,EACxB,gBAAgB,EAChB,YAAY,EACZ,uBAAuB;AACvB,iCAAiC;AACjC,cAAc,EACd,YAAY,EACZ,UAAU,EACV,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,cAAc,GACf,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,156 @@
1
+ /**
2
+ * Slack Manager Module
3
+ *
4
+ * Manages Slack connectors for agents that have `chat.slack` configured.
5
+ * This module is responsible for:
6
+ * - Creating one SlackConnector instance per Slack-enabled agent
7
+ * - Managing connector lifecycle (start/stop)
8
+ * - Providing access to connectors for status queries
9
+ *
10
+ * @module manager
11
+ */
12
+ import type { FleetManagerContext, IChatManager, ChatManagerConnectorState } from "@herdctl/core";
13
+ import { SlackConnector } from "./slack-connector.js";
14
+ /**
15
+ * SlackManager handles Slack connections for agents
16
+ *
17
+ * This class encapsulates the creation and lifecycle management of
18
+ * SlackConnector instances for agents that have Slack chat configured.
19
+ *
20
+ * Implements IChatManager so FleetManager can interact with it through
21
+ * the generic chat manager interface.
22
+ */
23
+ export declare class SlackManager implements IChatManager {
24
+ private ctx;
25
+ private connectors;
26
+ private initialized;
27
+ constructor(ctx: FleetManagerContext);
28
+ /**
29
+ * Initialize Slack connectors for all configured agents
30
+ *
31
+ * This method:
32
+ * 1. Iterates through agents to find those with Slack configured
33
+ * 2. Creates a SlackConnector for each Slack-enabled agent
34
+ *
35
+ * Should be called during FleetManager initialization.
36
+ */
37
+ initialize(): Promise<void>;
38
+ /**
39
+ * Connect all Slack connectors
40
+ *
41
+ * Connects each connector to Slack via Socket Mode and subscribes to events.
42
+ * Errors are logged but don't stop other connectors from connecting.
43
+ */
44
+ start(): Promise<void>;
45
+ /**
46
+ * Disconnect all Slack connectors gracefully
47
+ *
48
+ * Sessions are automatically persisted to disk on every update,
49
+ * so they survive bot restarts. This method logs session state
50
+ * before disconnecting for monitoring purposes.
51
+ *
52
+ * Errors are logged but don't prevent other connectors from disconnecting.
53
+ */
54
+ stop(): Promise<void>;
55
+ /**
56
+ * Get a connector for a specific agent
57
+ *
58
+ * @param agentName - Name of the agent
59
+ * @returns The SlackConnector instance, or undefined if not found
60
+ */
61
+ getConnector(agentName: string): SlackConnector | undefined;
62
+ /**
63
+ * Get all connector names
64
+ *
65
+ * @returns Array of agent names that have Slack connectors
66
+ */
67
+ getConnectorNames(): string[];
68
+ /**
69
+ * Get the number of active connectors
70
+ *
71
+ * @returns Number of connectors that are currently connected
72
+ */
73
+ getConnectedCount(): number;
74
+ /**
75
+ * Check if the manager has been initialized
76
+ */
77
+ isInitialized(): boolean;
78
+ /**
79
+ * Check if a specific agent has a Slack connector
80
+ *
81
+ * @param agentName - Name of the agent
82
+ * @returns true if the agent has a Slack connector
83
+ */
84
+ hasConnector(agentName: string): boolean;
85
+ /**
86
+ * Check if a specific agent has a connector (alias for hasConnector)
87
+ *
88
+ * @param agentName - Name of the agent
89
+ * @returns true if the agent has a connector
90
+ */
91
+ hasAgent(agentName: string): boolean;
92
+ /**
93
+ * Get the state of a connector for a specific agent
94
+ *
95
+ * @param agentName - Name of the agent
96
+ * @returns The connector state, or undefined if not found
97
+ */
98
+ getState(agentName: string): ChatManagerConnectorState | undefined;
99
+ /**
100
+ * Handle an incoming Slack message
101
+ *
102
+ * This method:
103
+ * 1. Gets or creates a session for the channel
104
+ * 2. Builds job context from the message
105
+ * 3. Executes the job via trigger
106
+ * 4. Sends the response back to Slack
107
+ *
108
+ * @param agentName - Name of the agent handling the message
109
+ * @param event - The Slack message event
110
+ */
111
+ private handleMessage;
112
+ /**
113
+ * Handle errors from Slack connectors
114
+ *
115
+ * Logs errors without crashing the connector
116
+ *
117
+ * @param agentName - Name of the agent that encountered the error
118
+ * @param error - The error that occurred
119
+ */
120
+ private handleError;
121
+ /** Slack's maximum message length */
122
+ private static readonly MAX_MESSAGE_LENGTH;
123
+ /**
124
+ * Format an error message for Slack display
125
+ *
126
+ * Creates a user-friendly error message with guidance on how to proceed.
127
+ *
128
+ * @param error - The error that occurred
129
+ * @returns Formatted error message string
130
+ */
131
+ formatErrorMessage(error: Error): string;
132
+ /**
133
+ * Split a response into chunks that fit Slack's 4000 character limit
134
+ *
135
+ * Uses the shared splitMessage utility from @herdctl/chat.
136
+ *
137
+ * @param text - The text to split
138
+ * @returns Array of text chunks, each under 4000 characters
139
+ */
140
+ splitResponse(text: string): string[];
141
+ /**
142
+ * Send a response to Slack, splitting if necessary
143
+ *
144
+ * @param reply - The reply function from the message event
145
+ * @param content - The content to send
146
+ */
147
+ sendResponse(reply: (content: string) => Promise<void>, content: string): Promise<void>;
148
+ /**
149
+ * Resolve the agent's working directory to an absolute path string
150
+ *
151
+ * @param agent - The resolved agent configuration
152
+ * @returns Absolute path to working directory, or undefined if not configured
153
+ */
154
+ private resolveWorkingDirectory;
155
+ }
156
+ //# sourceMappingURL=manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,yBAAyB,EAK1B,MAAM,eAAe,CAAC;AAavB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAsBtD;;;;;;;;GAQG;AACH,qBAAa,YAAa,YAAW,YAAY;IAInC,OAAO,CAAC,GAAG;IAHvB,OAAO,CAAC,UAAU,CAA0C;IAC5D,OAAO,CAAC,WAAW,CAAkB;gBAEjB,GAAG,EAAE,mBAAmB;IAE5C;;;;;;;;OAQG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAiGjC;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyC5B;;;;;;;;OAQG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAA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