@herdctl/core 4.1.1 → 5.0.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/dist/fleet-manager/chat-manager-interface.d.ts +116 -0
- package/dist/fleet-manager/chat-manager-interface.d.ts.map +1 -0
- package/dist/fleet-manager/chat-manager-interface.js +11 -0
- package/dist/fleet-manager/chat-manager-interface.js.map +1 -0
- package/dist/fleet-manager/context.d.ts +24 -5
- package/dist/fleet-manager/context.d.ts.map +1 -1
- package/dist/fleet-manager/event-types.d.ts +145 -4
- package/dist/fleet-manager/event-types.d.ts.map +1 -1
- package/dist/fleet-manager/fleet-manager.d.ts +18 -6
- package/dist/fleet-manager/fleet-manager.d.ts.map +1 -1
- package/dist/fleet-manager/fleet-manager.js +79 -20
- package/dist/fleet-manager/fleet-manager.js.map +1 -1
- package/dist/fleet-manager/index.d.ts +2 -3
- package/dist/fleet-manager/index.d.ts.map +1 -1
- package/dist/fleet-manager/index.js +4 -1
- package/dist/fleet-manager/index.js.map +1 -1
- package/dist/fleet-manager/status-queries.d.ts +5 -6
- package/dist/fleet-manager/status-queries.d.ts.map +1 -1
- package/dist/fleet-manager/status-queries.js +52 -59
- package/dist/fleet-manager/status-queries.js.map +1 -1
- package/dist/fleet-manager/types.d.ts +11 -31
- package/dist/fleet-manager/types.d.ts.map +1 -1
- package/dist/runner/index.d.ts +1 -1
- package/dist/runner/index.d.ts.map +1 -1
- package/dist/runner/index.js.map +1 -1
- package/dist/scheduler/__tests__/scheduler.test.js +9 -7
- package/dist/scheduler/__tests__/scheduler.test.js.map +1 -1
- package/dist/scheduler/scheduler.js +5 -4
- package/dist/scheduler/scheduler.js.map +1 -1
- package/package.json +1 -1
- package/dist/fleet-manager/__tests__/discord-manager.test.d.ts +0 -8
- package/dist/fleet-manager/__tests__/discord-manager.test.d.ts.map +0 -1
- package/dist/fleet-manager/__tests__/discord-manager.test.js +0 -3508
- package/dist/fleet-manager/__tests__/discord-manager.test.js.map +0 -1
- package/dist/fleet-manager/__tests__/slack-manager.test.d.ts +0 -11
- package/dist/fleet-manager/__tests__/slack-manager.test.d.ts.map +0 -1
- package/dist/fleet-manager/__tests__/slack-manager.test.js +0 -1027
- package/dist/fleet-manager/__tests__/slack-manager.test.js.map +0 -1
- package/dist/fleet-manager/discord-manager.d.ts +0 -353
- package/dist/fleet-manager/discord-manager.d.ts.map +0 -1
- package/dist/fleet-manager/discord-manager.js +0 -1087
- package/dist/fleet-manager/discord-manager.js.map +0 -1
- package/dist/fleet-manager/slack-manager.d.ts +0 -158
- package/dist/fleet-manager/slack-manager.d.ts.map +0 -1
- package/dist/fleet-manager/slack-manager.js +0 -570
- package/dist/fleet-manager/slack-manager.js.map +0 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat Manager Interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract that platform-specific chat managers (Discord, Slack)
|
|
5
|
+
* must implement. FleetManager uses this interface to interact with chat
|
|
6
|
+
* managers without importing their concrete implementations.
|
|
7
|
+
*
|
|
8
|
+
* @module chat-manager-interface
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* State of a chat connector for an agent
|
|
12
|
+
*
|
|
13
|
+
* This is a normalized view of connector state that works across
|
|
14
|
+
* all chat platforms (Discord, Slack, etc.).
|
|
15
|
+
*/
|
|
16
|
+
export interface ChatManagerConnectorState {
|
|
17
|
+
/**
|
|
18
|
+
* Connection status
|
|
19
|
+
*/
|
|
20
|
+
status: "disconnected" | "connecting" | "connected" | "reconnecting" | "disconnecting" | "error";
|
|
21
|
+
/**
|
|
22
|
+
* ISO timestamp when the connector was connected (null if never connected)
|
|
23
|
+
*/
|
|
24
|
+
connectedAt: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* ISO timestamp when the connector was disconnected (null if never disconnected)
|
|
27
|
+
*/
|
|
28
|
+
disconnectedAt: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Number of reconnection attempts since last successful connection
|
|
31
|
+
*/
|
|
32
|
+
reconnectAttempts: number;
|
|
33
|
+
/**
|
|
34
|
+
* Last error message (null if no error)
|
|
35
|
+
*/
|
|
36
|
+
lastError: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* Bot user information (null if not connected)
|
|
39
|
+
*/
|
|
40
|
+
botUser: {
|
|
41
|
+
id: string;
|
|
42
|
+
username: string;
|
|
43
|
+
} | null;
|
|
44
|
+
/**
|
|
45
|
+
* Message statistics
|
|
46
|
+
*/
|
|
47
|
+
messageStats: {
|
|
48
|
+
received: number;
|
|
49
|
+
sent: number;
|
|
50
|
+
ignored: number;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Interface for chat managers
|
|
55
|
+
*
|
|
56
|
+
* Chat managers (DiscordManager, SlackManager) implement this interface
|
|
57
|
+
* so FleetManager can interact with them generically without importing
|
|
58
|
+
* platform-specific code.
|
|
59
|
+
*
|
|
60
|
+
* FleetManager stores managers in a Map<string, IChatManager> where the
|
|
61
|
+
* key is the platform name (e.g., "discord", "slack").
|
|
62
|
+
*/
|
|
63
|
+
export interface IChatManager {
|
|
64
|
+
/**
|
|
65
|
+
* Initialize the chat manager
|
|
66
|
+
*
|
|
67
|
+
* Creates connectors for agents that have this chat platform configured.
|
|
68
|
+
* Should be called during FleetManager initialization.
|
|
69
|
+
*/
|
|
70
|
+
initialize(): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Start all connectors
|
|
73
|
+
*
|
|
74
|
+
* Connects to the chat platform and begins handling messages.
|
|
75
|
+
* Should be called during FleetManager start.
|
|
76
|
+
*/
|
|
77
|
+
start(): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Stop all connectors
|
|
80
|
+
*
|
|
81
|
+
* Gracefully disconnects from the chat platform.
|
|
82
|
+
* Should be called during FleetManager stop.
|
|
83
|
+
*/
|
|
84
|
+
stop(): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Check if the manager has been initialized
|
|
87
|
+
*/
|
|
88
|
+
isInitialized(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Get names of all agents with connectors
|
|
91
|
+
*
|
|
92
|
+
* @returns Array of agent names that have connectors for this platform
|
|
93
|
+
*/
|
|
94
|
+
getConnectorNames(): string[];
|
|
95
|
+
/**
|
|
96
|
+
* Get the number of currently connected connectors
|
|
97
|
+
*
|
|
98
|
+
* @returns Number of connectors that are currently connected
|
|
99
|
+
*/
|
|
100
|
+
getConnectedCount(): number;
|
|
101
|
+
/**
|
|
102
|
+
* Check if an agent has a connector for this platform
|
|
103
|
+
*
|
|
104
|
+
* @param agentName - Name of the agent
|
|
105
|
+
* @returns true if the agent has a connector
|
|
106
|
+
*/
|
|
107
|
+
hasAgent(agentName: string): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Get the state of a connector for a specific agent
|
|
110
|
+
*
|
|
111
|
+
* @param agentName - Name of the agent
|
|
112
|
+
* @returns The connector state, or undefined if the agent has no connector
|
|
113
|
+
*/
|
|
114
|
+
getState(agentName: string): ChatManagerConnectorState | undefined;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=chat-manager-interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-manager-interface.d.ts","sourceRoot":"","sources":["../../src/fleet-manager/chat-manager-interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,MAAM,EAAE,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,eAAe,GAAG,OAAO,CAAC;IAEjG;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,IAAI,CAAC;IAET;;OAEG;IACH,YAAY,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5B;;;;;OAKG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;;OAKG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC;IAEzB;;;;OAIG;IACH,iBAAiB,IAAI,MAAM,EAAE,CAAC;IAE9B;;;;OAIG;IACH,iBAAiB,IAAI,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAErC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,yBAAyB,GAAG,SAAS,CAAC;CACpE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat Manager Interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract that platform-specific chat managers (Discord, Slack)
|
|
5
|
+
* must implement. FleetManager uses this interface to interact with chat
|
|
6
|
+
* managers without importing their concrete implementations.
|
|
7
|
+
*
|
|
8
|
+
* @module chat-manager-interface
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=chat-manager-interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-manager-interface.js","sourceRoot":"","sources":["../../src/fleet-manager/chat-manager-interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -11,7 +11,8 @@ import type { EventEmitter } from "node:events";
|
|
|
11
11
|
import type { ResolvedConfig } from "../config/index.js";
|
|
12
12
|
import type { StateDirectory } from "../state/index.js";
|
|
13
13
|
import type { Scheduler } from "../scheduler/index.js";
|
|
14
|
-
import type { FleetManagerLogger, FleetManagerStatus } from "./types.js";
|
|
14
|
+
import type { FleetManagerLogger, FleetManagerStatus, TriggerOptions, TriggerResult } from "./types.js";
|
|
15
|
+
import type { IChatManager } from "./chat-manager-interface.js";
|
|
15
16
|
/**
|
|
16
17
|
* Context interface for FleetManager modules
|
|
17
18
|
*
|
|
@@ -73,12 +74,30 @@ export interface FleetManagerContext {
|
|
|
73
74
|
*/
|
|
74
75
|
getEmitter(): EventEmitter;
|
|
75
76
|
/**
|
|
76
|
-
* Get
|
|
77
|
+
* Get a chat manager by platform name
|
|
78
|
+
*
|
|
79
|
+
* @param platform - Platform name (e.g., "discord", "slack")
|
|
80
|
+
* @returns The chat manager for the platform, or undefined if not available
|
|
77
81
|
*/
|
|
78
|
-
|
|
82
|
+
getChatManager?(platform: string): IChatManager | undefined;
|
|
79
83
|
/**
|
|
80
|
-
* Get
|
|
84
|
+
* Get all registered chat managers
|
|
85
|
+
*
|
|
86
|
+
* @returns Map of platform name to chat manager
|
|
81
87
|
*/
|
|
82
|
-
|
|
88
|
+
getChatManagers?(): Map<string, IChatManager>;
|
|
89
|
+
/**
|
|
90
|
+
* Trigger an agent job
|
|
91
|
+
*
|
|
92
|
+
* This method is used by chat managers to execute agent jobs in response
|
|
93
|
+
* to chat messages. It provides a clean interface that doesn't require
|
|
94
|
+
* managers to cast the emitter unsafely.
|
|
95
|
+
*
|
|
96
|
+
* @param agentName - Name of the agent to trigger
|
|
97
|
+
* @param scheduleName - Optional schedule name
|
|
98
|
+
* @param options - Optional trigger options
|
|
99
|
+
* @returns Promise resolving to the trigger result
|
|
100
|
+
*/
|
|
101
|
+
trigger(agentName: string, scheduleName?: string, options?: TriggerOptions): Promise<TriggerResult>;
|
|
83
102
|
}
|
|
84
103
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/fleet-manager/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/fleet-manager/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,SAAS,IAAI,cAAc,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,WAAW,IAAI,MAAM,CAAC;IAEtB;;OAEG;IACH,eAAe,IAAI,cAAc,GAAG,IAAI,CAAC;IAEzC;;OAEG;IACH,SAAS,IAAI,kBAAkB,CAAC;IAEhC;;OAEG;IACH,YAAY,IAAI,SAAS,GAAG,IAAI,CAAC;IAEjC;;OAEG;IACH,SAAS,IAAI,kBAAkB,CAAC;IAEhC;;OAEG;IACH,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAAC;IAElC;;OAEG;IACH,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,gBAAgB,IAAI,MAAM,CAAC;IAE3B;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEjD;;OAEG;IACH,UAAU,IAAI,YAAY,CAAC;IAE3B;;;;;OAKG;IACH,cAAc,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IAE5D;;;;OAIG;IACH,eAAe,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAE9C;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACrG"}
|
|
@@ -172,6 +172,111 @@ export interface JobForkedPayload {
|
|
|
172
172
|
/** ISO timestamp when the job was forked */
|
|
173
173
|
timestamp: string;
|
|
174
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Payload for chat:connector:connected event
|
|
177
|
+
*
|
|
178
|
+
* Generic event emitted when any chat connector connects.
|
|
179
|
+
* The platform field indicates which platform (discord, slack, etc.).
|
|
180
|
+
*/
|
|
181
|
+
export interface ChatConnectorConnectedPayload {
|
|
182
|
+
/** Platform name (e.g., "discord", "slack") */
|
|
183
|
+
platform: string;
|
|
184
|
+
/** Name of the agent whose connector connected */
|
|
185
|
+
agentName: string;
|
|
186
|
+
/** Bot username */
|
|
187
|
+
botUsername: string;
|
|
188
|
+
/** ISO timestamp when the connector connected */
|
|
189
|
+
timestamp: string;
|
|
190
|
+
/** Platform-specific metadata */
|
|
191
|
+
metadata?: Record<string, unknown>;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Payload for chat:connector:disconnected event
|
|
195
|
+
*
|
|
196
|
+
* Generic event emitted when any chat connector disconnects.
|
|
197
|
+
*/
|
|
198
|
+
export interface ChatConnectorDisconnectedPayload {
|
|
199
|
+
/** Platform name (e.g., "discord", "slack") */
|
|
200
|
+
platform: string;
|
|
201
|
+
/** Name of the agent whose connector disconnected */
|
|
202
|
+
agentName: string;
|
|
203
|
+
/** Reason for disconnection (if available) */
|
|
204
|
+
reason?: string;
|
|
205
|
+
/** ISO timestamp when the connector disconnected */
|
|
206
|
+
timestamp: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Payload for chat:connector:error event
|
|
210
|
+
*
|
|
211
|
+
* Generic event emitted when any chat connector encounters an error.
|
|
212
|
+
*/
|
|
213
|
+
export interface ChatConnectorErrorPayload {
|
|
214
|
+
/** Platform name (e.g., "discord", "slack") */
|
|
215
|
+
platform: string;
|
|
216
|
+
/** Name of the agent whose connector had an error */
|
|
217
|
+
agentName: string;
|
|
218
|
+
/** Error message */
|
|
219
|
+
error: string;
|
|
220
|
+
/** ISO timestamp when the error occurred */
|
|
221
|
+
timestamp: string;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Payload for chat:message:handled event
|
|
225
|
+
*
|
|
226
|
+
* Generic event emitted when a chat message is handled.
|
|
227
|
+
*/
|
|
228
|
+
export interface ChatMessageHandledPayload {
|
|
229
|
+
/** Platform name (e.g., "discord", "slack") */
|
|
230
|
+
platform: string;
|
|
231
|
+
/** Name of the agent that handled the message */
|
|
232
|
+
agentName: string;
|
|
233
|
+
/** Channel ID */
|
|
234
|
+
channelId: string;
|
|
235
|
+
/** Message identifier (platform-specific format) */
|
|
236
|
+
messageId: string;
|
|
237
|
+
/** Job ID created for this message */
|
|
238
|
+
jobId: string;
|
|
239
|
+
/** ISO timestamp when the message was handled */
|
|
240
|
+
timestamp: string;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Payload for chat:message:error event
|
|
244
|
+
*
|
|
245
|
+
* Generic event emitted when a chat message fails to be handled.
|
|
246
|
+
*/
|
|
247
|
+
export interface ChatMessageErrorPayload {
|
|
248
|
+
/** Platform name (e.g., "discord", "slack") */
|
|
249
|
+
platform: string;
|
|
250
|
+
/** Name of the agent that failed to handle the message */
|
|
251
|
+
agentName: string;
|
|
252
|
+
/** Channel ID */
|
|
253
|
+
channelId: string;
|
|
254
|
+
/** Message identifier (platform-specific format) */
|
|
255
|
+
messageId: string;
|
|
256
|
+
/** Error message */
|
|
257
|
+
error: string;
|
|
258
|
+
/** ISO timestamp when the error occurred */
|
|
259
|
+
timestamp: string;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Payload for chat:session:lifecycle event
|
|
263
|
+
*
|
|
264
|
+
* Generic event emitted for session lifecycle events.
|
|
265
|
+
*/
|
|
266
|
+
export interface ChatSessionLifecyclePayload {
|
|
267
|
+
/** Platform name (e.g., "discord", "slack") */
|
|
268
|
+
platform: string;
|
|
269
|
+
/** Name of the agent */
|
|
270
|
+
agentName: string;
|
|
271
|
+
/** Lifecycle event type */
|
|
272
|
+
event: "created" | "resumed" | "reset";
|
|
273
|
+
/** Channel ID */
|
|
274
|
+
channelId: string;
|
|
275
|
+
/** Session ID */
|
|
276
|
+
sessionId: string;
|
|
277
|
+
/** ISO timestamp when the lifecycle event occurred */
|
|
278
|
+
timestamp: string;
|
|
279
|
+
}
|
|
175
280
|
/**
|
|
176
281
|
* Payload for discord:connector:connected event
|
|
177
282
|
*/
|
|
@@ -209,9 +314,11 @@ export interface DiscordConnectorErrorPayload {
|
|
|
209
314
|
* Payload for slack:connector:connected event
|
|
210
315
|
*/
|
|
211
316
|
export interface SlackConnectorConnectedPayload {
|
|
317
|
+
/** Name of the agent whose Slack connector connected */
|
|
318
|
+
agentName: string;
|
|
212
319
|
/** Bot username */
|
|
213
320
|
botUsername: string;
|
|
214
|
-
/** Number of
|
|
321
|
+
/** Number of channels configured for this agent */
|
|
215
322
|
channelCount: number;
|
|
216
323
|
/** ISO timestamp when the connector connected */
|
|
217
324
|
timestamp: string;
|
|
@@ -220,6 +327,8 @@ export interface SlackConnectorConnectedPayload {
|
|
|
220
327
|
* Payload for slack:connector:disconnected event
|
|
221
328
|
*/
|
|
222
329
|
export interface SlackConnectorDisconnectedPayload {
|
|
330
|
+
/** Name of the agent whose Slack connector disconnected */
|
|
331
|
+
agentName: string;
|
|
223
332
|
/** Reason for disconnection (if available) */
|
|
224
333
|
reason?: string;
|
|
225
334
|
/** ISO timestamp when the connector disconnected */
|
|
@@ -229,6 +338,8 @@ export interface SlackConnectorDisconnectedPayload {
|
|
|
229
338
|
* Payload for slack:connector:error event
|
|
230
339
|
*/
|
|
231
340
|
export interface SlackConnectorErrorPayload {
|
|
341
|
+
/** Name of the agent whose Slack connector had an error */
|
|
342
|
+
agentName: string;
|
|
232
343
|
/** Error message */
|
|
233
344
|
error: string;
|
|
234
345
|
/** ISO timestamp when the error occurred */
|
|
@@ -384,6 +495,36 @@ export interface FleetManagerEventMap {
|
|
|
384
495
|
* A new job is created based on an existing job's configuration.
|
|
385
496
|
*/
|
|
386
497
|
"job:forked": [payload: JobForkedPayload];
|
|
498
|
+
/**
|
|
499
|
+
* Emitted when any chat connector successfully connects.
|
|
500
|
+
* Use the `platform` field to identify which platform.
|
|
501
|
+
*/
|
|
502
|
+
"chat:connector:connected": [payload: ChatConnectorConnectedPayload];
|
|
503
|
+
/**
|
|
504
|
+
* Emitted when any chat connector disconnects.
|
|
505
|
+
* Use the `platform` field to identify which platform.
|
|
506
|
+
*/
|
|
507
|
+
"chat:connector:disconnected": [payload: ChatConnectorDisconnectedPayload];
|
|
508
|
+
/**
|
|
509
|
+
* Emitted when any chat connector encounters an error.
|
|
510
|
+
* Use the `platform` field to identify which platform.
|
|
511
|
+
*/
|
|
512
|
+
"chat:connector:error": [payload: ChatConnectorErrorPayload];
|
|
513
|
+
/**
|
|
514
|
+
* Emitted when a chat message is successfully handled.
|
|
515
|
+
* Use the `platform` field to identify which platform.
|
|
516
|
+
*/
|
|
517
|
+
"chat:message:handled": [payload: ChatMessageHandledPayload];
|
|
518
|
+
/**
|
|
519
|
+
* Emitted when a chat message fails to be handled.
|
|
520
|
+
* Use the `platform` field to identify which platform.
|
|
521
|
+
*/
|
|
522
|
+
"chat:message:error": [payload: ChatMessageErrorPayload];
|
|
523
|
+
/**
|
|
524
|
+
* Emitted when a session lifecycle event occurs.
|
|
525
|
+
* Use the `platform` field to identify which platform.
|
|
526
|
+
*/
|
|
527
|
+
"chat:session:lifecycle": [payload: ChatSessionLifecyclePayload];
|
|
387
528
|
/**
|
|
388
529
|
* Emitted when a Discord connector successfully connects.
|
|
389
530
|
*/
|
|
@@ -397,15 +538,15 @@ export interface FleetManagerEventMap {
|
|
|
397
538
|
*/
|
|
398
539
|
"discord:connector:error": [payload: DiscordConnectorErrorPayload];
|
|
399
540
|
/**
|
|
400
|
-
* Emitted when
|
|
541
|
+
* Emitted when a Slack connector successfully connects.
|
|
401
542
|
*/
|
|
402
543
|
"slack:connector:connected": [payload: SlackConnectorConnectedPayload];
|
|
403
544
|
/**
|
|
404
|
-
* Emitted when
|
|
545
|
+
* Emitted when a Slack connector disconnects.
|
|
405
546
|
*/
|
|
406
547
|
"slack:connector:disconnected": [payload: SlackConnectorDisconnectedPayload];
|
|
407
548
|
/**
|
|
408
|
-
* Emitted when
|
|
549
|
+
* Emitted when a Slack connector encounters an error.
|
|
409
550
|
*/
|
|
410
551
|
"slack:connector:error": [payload: SlackConnectorErrorPayload];
|
|
411
552
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-types.d.ts","sourceRoot":"","sources":["../../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E,GAAG,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAC7B,IAAI,CAAC"}
|
|
@@ -16,8 +16,7 @@ import { type StateDirectory } from "../state/index.js";
|
|
|
16
16
|
import { Scheduler } from "../scheduler/index.js";
|
|
17
17
|
import type { FleetManagerContext } from "./context.js";
|
|
18
18
|
import type { FleetManagerOptions, FleetManagerState, FleetManagerStatus, FleetManagerLogger, FleetManagerStopOptions, FleetStatus, AgentInfo, ScheduleInfo, TriggerOptions, TriggerResult, JobModifications, CancelJobResult, ForkJobResult, LogEntry, LogStreamOptions, ConfigChange, ConfigReloadedPayload } from "./types.js";
|
|
19
|
-
import {
|
|
20
|
-
import { SlackManager } from "./slack-manager.js";
|
|
19
|
+
import type { IChatManager } from "./chat-manager-interface.js";
|
|
21
20
|
/**
|
|
22
21
|
* FleetManager provides high-level orchestration for autonomous agents
|
|
23
22
|
*
|
|
@@ -43,8 +42,7 @@ export declare class FleetManager extends EventEmitter implements FleetManagerCo
|
|
|
43
42
|
private jobControl;
|
|
44
43
|
private logStreaming;
|
|
45
44
|
private scheduleExecutor;
|
|
46
|
-
private
|
|
47
|
-
private slackManager;
|
|
45
|
+
private chatManagers;
|
|
48
46
|
constructor(options: FleetManagerOptions);
|
|
49
47
|
getConfig(): ResolvedConfig | null;
|
|
50
48
|
getStateDir(): string;
|
|
@@ -58,8 +56,14 @@ export declare class FleetManager extends EventEmitter implements FleetManagerCo
|
|
|
58
56
|
getLastError(): string | null;
|
|
59
57
|
getCheckInterval(): number;
|
|
60
58
|
getEmitter(): EventEmitter;
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Get a chat manager by platform name
|
|
61
|
+
*/
|
|
62
|
+
getChatManager(platform: string): IChatManager | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Get all registered chat managers
|
|
65
|
+
*/
|
|
66
|
+
getChatManagers(): Map<string, IChatManager>;
|
|
63
67
|
get state(): FleetManagerState;
|
|
64
68
|
getAgents(): ResolvedAgent[];
|
|
65
69
|
initialize(): Promise<void>;
|
|
@@ -84,6 +88,14 @@ export declare class FleetManager extends EventEmitter implements FleetManagerCo
|
|
|
84
88
|
streamJobOutput(jobId: string): AsyncIterable<LogEntry>;
|
|
85
89
|
streamAgentLogs(agentName: string): AsyncIterable<LogEntry>;
|
|
86
90
|
private initializeModules;
|
|
91
|
+
/**
|
|
92
|
+
* Dynamically import and initialize chat managers for platforms
|
|
93
|
+
* that have agents configured.
|
|
94
|
+
*
|
|
95
|
+
* This allows FleetManager to work without platform packages installed,
|
|
96
|
+
* and only loads the packages when they're actually needed.
|
|
97
|
+
*/
|
|
98
|
+
private initializeChatManagers;
|
|
87
99
|
private loadConfiguration;
|
|
88
100
|
/**
|
|
89
101
|
* Validate that all agent names are unique
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fleet-manager.d.ts","sourceRoot":"","sources":["../../src/fleet-manager/fleet-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EAGnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAoB,MAAM,uBAAuB,CAAC;AAEpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,SAAS,EACT,YAAY,EACZ,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACtB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"fleet-manager.d.ts","sourceRoot":"","sources":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@@ import { ConfigReload, computeConfigChanges } from "./config-reload.js";
|
|
|
23
23
|
import { JobControl } from "./job-control.js";
|
|
24
24
|
import { LogStreaming } from "./log-streaming.js";
|
|
25
25
|
import { ScheduleExecutor } from "./schedule-executor.js";
|
|
26
|
-
import { DiscordManager } from "./discord-manager.js";
|
|
27
|
-
import { SlackManager } from "./slack-manager.js";
|
|
28
26
|
import { createLogger } from "../utils/logger.js";
|
|
29
27
|
const DEFAULT_CHECK_INTERVAL = 1000;
|
|
30
28
|
function createDefaultLogger() {
|
|
@@ -59,8 +57,9 @@ export class FleetManager extends EventEmitter {
|
|
|
59
57
|
jobControl;
|
|
60
58
|
logStreaming;
|
|
61
59
|
scheduleExecutor;
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
// Chat managers (Discord, Slack, etc.)
|
|
61
|
+
// Key is platform name (e.g., "discord", "slack")
|
|
62
|
+
chatManagers = new Map();
|
|
64
63
|
constructor(options) {
|
|
65
64
|
super();
|
|
66
65
|
this.configPath = options.configPath;
|
|
@@ -85,8 +84,18 @@ export class FleetManager extends EventEmitter {
|
|
|
85
84
|
getLastError() { return this.lastError; }
|
|
86
85
|
getCheckInterval() { return this.checkInterval; }
|
|
87
86
|
getEmitter() { return this; }
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Get a chat manager by platform name
|
|
89
|
+
*/
|
|
90
|
+
getChatManager(platform) {
|
|
91
|
+
return this.chatManagers.get(platform);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get all registered chat managers
|
|
95
|
+
*/
|
|
96
|
+
getChatManagers() {
|
|
97
|
+
return this.chatManagers;
|
|
98
|
+
}
|
|
90
99
|
// ===========================================================================
|
|
91
100
|
// Public State Accessors
|
|
92
101
|
// ===========================================================================
|
|
@@ -122,10 +131,13 @@ export class FleetManager extends EventEmitter {
|
|
|
122
131
|
logger: this.logger,
|
|
123
132
|
onTrigger: (info) => this.handleScheduleTrigger(info),
|
|
124
133
|
});
|
|
125
|
-
//
|
|
126
|
-
await this.
|
|
127
|
-
// Initialize
|
|
128
|
-
|
|
134
|
+
// Dynamically import and create chat managers for configured platforms
|
|
135
|
+
await this.initializeChatManagers();
|
|
136
|
+
// Initialize all chat managers
|
|
137
|
+
for (const [platform, manager] of this.chatManagers) {
|
|
138
|
+
this.logger.debug(`Initializing ${platform} chat manager...`);
|
|
139
|
+
await manager.initialize();
|
|
140
|
+
}
|
|
129
141
|
this.status = "initialized";
|
|
130
142
|
this.initializedAt = new Date().toISOString();
|
|
131
143
|
this.lastError = null;
|
|
@@ -147,10 +159,11 @@ export class FleetManager extends EventEmitter {
|
|
|
147
159
|
this.status = "starting";
|
|
148
160
|
try {
|
|
149
161
|
this.startSchedulerAsync(this.config.agents);
|
|
150
|
-
// Start
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
162
|
+
// Start all chat managers
|
|
163
|
+
for (const [platform, manager] of this.chatManagers) {
|
|
164
|
+
this.logger.debug(`Starting ${platform} chat manager...`);
|
|
165
|
+
await manager.start();
|
|
166
|
+
}
|
|
154
167
|
this.status = "running";
|
|
155
168
|
this.startedAt = new Date().toISOString();
|
|
156
169
|
this.stoppedAt = null;
|
|
@@ -173,10 +186,11 @@ export class FleetManager extends EventEmitter {
|
|
|
173
186
|
this.logger.info("Stopping fleet manager...");
|
|
174
187
|
this.status = "stopping";
|
|
175
188
|
try {
|
|
176
|
-
// Stop
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
189
|
+
// Stop all chat managers first (graceful disconnect)
|
|
190
|
+
for (const [platform, manager] of this.chatManagers) {
|
|
191
|
+
this.logger.debug(`Stopping ${platform} chat manager...`);
|
|
192
|
+
await manager.stop();
|
|
193
|
+
}
|
|
180
194
|
if (this.scheduler) {
|
|
181
195
|
try {
|
|
182
196
|
await this.scheduler.stop({ waitForJobs, timeout });
|
|
@@ -244,8 +258,53 @@ export class FleetManager extends EventEmitter {
|
|
|
244
258
|
this.jobControl = new JobControl(this, () => this.statusQueries.getAgentInfo());
|
|
245
259
|
this.logStreaming = new LogStreaming(this);
|
|
246
260
|
this.scheduleExecutor = new ScheduleExecutor(this);
|
|
247
|
-
|
|
248
|
-
|
|
261
|
+
// Chat managers are created during initialize() via dynamic imports
|
|
262
|
+
// to avoid hard dependencies on platform packages.
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Dynamically import and initialize chat managers for platforms
|
|
266
|
+
* that have agents configured.
|
|
267
|
+
*
|
|
268
|
+
* This allows FleetManager to work without platform packages installed,
|
|
269
|
+
* and only loads the packages when they're actually needed.
|
|
270
|
+
*/
|
|
271
|
+
async initializeChatManagers() {
|
|
272
|
+
if (!this.config)
|
|
273
|
+
return;
|
|
274
|
+
// Check if any agents have Discord configured
|
|
275
|
+
const hasDiscordAgents = this.config.agents.some((agent) => agent.chat?.discord !== undefined);
|
|
276
|
+
if (hasDiscordAgents) {
|
|
277
|
+
try {
|
|
278
|
+
// Dynamic import of @herdctl/discord
|
|
279
|
+
// Use `as string` to prevent TypeScript from resolving types at compile time
|
|
280
|
+
// This allows core to build without discord installed (optional peer dependency)
|
|
281
|
+
const mod = (await import("@herdctl/discord"));
|
|
282
|
+
const manager = new mod.DiscordManager(this);
|
|
283
|
+
this.chatManagers.set("discord", manager);
|
|
284
|
+
this.logger.debug("Discord chat manager created");
|
|
285
|
+
}
|
|
286
|
+
catch {
|
|
287
|
+
// Package not installed - skip Discord integration
|
|
288
|
+
this.logger.debug("@herdctl/discord not installed, skipping Discord integration");
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
// Check if any agents have Slack configured
|
|
292
|
+
const hasSlackAgents = this.config.agents.some((agent) => agent.chat?.slack !== undefined);
|
|
293
|
+
if (hasSlackAgents) {
|
|
294
|
+
try {
|
|
295
|
+
// Dynamic import of @herdctl/slack
|
|
296
|
+
// Use `as string` to prevent TypeScript from resolving types at compile time
|
|
297
|
+
// This allows core to build without slack installed (optional peer dependency)
|
|
298
|
+
const mod = (await import("@herdctl/slack"));
|
|
299
|
+
const manager = new mod.SlackManager(this);
|
|
300
|
+
this.chatManagers.set("slack", manager);
|
|
301
|
+
this.logger.debug("Slack chat manager created");
|
|
302
|
+
}
|
|
303
|
+
catch {
|
|
304
|
+
// Package not installed - skip Slack integration
|
|
305
|
+
this.logger.debug("@herdctl/slack not installed, skipping Slack integration");
|
|
306
|
+
}
|
|
307
|
+
}
|
|
249
308
|
}
|
|
250
309
|
async loadConfiguration() {
|
|
251
310
|
try {
|