@elizaos/plugin-discord 2.0.0-beta.1 → 2.0.3-beta.2

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 (116) hide show
  1. package/README.md +28 -68
  2. package/package.json +28 -10
  3. package/dist/account-client-pool.d.ts +0 -35
  4. package/dist/account-client-pool.d.ts.map +0 -1
  5. package/dist/accounts.d.ts +0 -164
  6. package/dist/accounts.d.ts.map +0 -1
  7. package/dist/actions/actionResultSemantics.d.ts +0 -9
  8. package/dist/actions/actionResultSemantics.d.ts.map +0 -1
  9. package/dist/actions/setup-credentials.d.ts +0 -25
  10. package/dist/actions/setup-credentials.d.ts.map +0 -1
  11. package/dist/addressing.d.ts +0 -15
  12. package/dist/addressing.d.ts.map +0 -1
  13. package/dist/allowlist.d.ts +0 -198
  14. package/dist/allowlist.d.ts.map +0 -1
  15. package/dist/attachments.d.ts +0 -93
  16. package/dist/attachments.d.ts.map +0 -1
  17. package/dist/auto-enable.d.ts +0 -4
  18. package/dist/auto-enable.d.ts.map +0 -1
  19. package/dist/banner.d.ts +0 -39
  20. package/dist/banner.d.ts.map +0 -1
  21. package/dist/compat.d.ts +0 -57
  22. package/dist/compat.d.ts.map +0 -1
  23. package/dist/config.d.ts +0 -156
  24. package/dist/config.d.ts.map +0 -1
  25. package/dist/connector-account-provider.d.ts +0 -26
  26. package/dist/connector-account-provider.d.ts.map +0 -1
  27. package/dist/constants.d.ts +0 -2
  28. package/dist/constants.d.ts.map +0 -1
  29. package/dist/debouncer.d.ts +0 -28
  30. package/dist/debouncer.d.ts.map +0 -1
  31. package/dist/discord-avatar-cache.d.ts +0 -10
  32. package/dist/discord-avatar-cache.d.ts.map +0 -1
  33. package/dist/discord-commands.d.ts +0 -16
  34. package/dist/discord-commands.d.ts.map +0 -1
  35. package/dist/discord-events.d.ts +0 -56
  36. package/dist/discord-events.d.ts.map +0 -1
  37. package/dist/discord-history.d.ts +0 -56
  38. package/dist/discord-history.d.ts.map +0 -1
  39. package/dist/discord-interactions.d.ts +0 -47
  40. package/dist/discord-interactions.d.ts.map +0 -1
  41. package/dist/discord-local-service.d.ts +0 -94
  42. package/dist/discord-local-service.d.ts.map +0 -1
  43. package/dist/discord-profiles.d.ts +0 -26
  44. package/dist/discord-profiles.d.ts.map +0 -1
  45. package/dist/discord-reactions.d.ts +0 -30
  46. package/dist/discord-reactions.d.ts.map +0 -1
  47. package/dist/draft-chunking.d.ts +0 -9
  48. package/dist/draft-chunking.d.ts.map +0 -1
  49. package/dist/draft-stream.d.ts +0 -23
  50. package/dist/draft-stream.d.ts.map +0 -1
  51. package/dist/environment.d.ts +0 -23
  52. package/dist/environment.d.ts.map +0 -1
  53. package/dist/generated/specs/spec-helpers.d.ts +0 -36
  54. package/dist/generated/specs/spec-helpers.d.ts.map +0 -1
  55. package/dist/generated/specs/specs.d.ts +0 -52
  56. package/dist/generated/specs/specs.d.ts.map +0 -1
  57. package/dist/identity.d.ts +0 -8
  58. package/dist/identity.d.ts.map +0 -1
  59. package/dist/inbound-envelope.d.ts +0 -8
  60. package/dist/inbound-envelope.d.ts.map +0 -1
  61. package/dist/index.browser.d.ts +0 -34
  62. package/dist/index.browser.d.ts.map +0 -1
  63. package/dist/index.d.ts +0 -22
  64. package/dist/index.d.ts.map +0 -1
  65. package/dist/index.js +0 -13784
  66. package/dist/index.js.map +0 -56
  67. package/dist/message-coalesce.d.ts +0 -31
  68. package/dist/message-coalesce.d.ts.map +0 -1
  69. package/dist/messages.d.ts +0 -66
  70. package/dist/messages.d.ts.map +0 -1
  71. package/dist/messaging.d.ts +0 -129
  72. package/dist/messaging.d.ts.map +0 -1
  73. package/dist/native-commands.d.ts +0 -142
  74. package/dist/native-commands.d.ts.map +0 -1
  75. package/dist/owner-pairing-service.d.ts +0 -73
  76. package/dist/owner-pairing-service.d.ts.map +0 -1
  77. package/dist/permissionEvents.d.ts +0 -42
  78. package/dist/permissionEvents.d.ts.map +0 -1
  79. package/dist/permissions.d.ts +0 -36
  80. package/dist/permissions.d.ts.map +0 -1
  81. package/dist/profileSync.d.ts +0 -8
  82. package/dist/profileSync.d.ts.map +0 -1
  83. package/dist/reasoning-tags.d.ts +0 -2
  84. package/dist/reasoning-tags.d.ts.map +0 -1
  85. package/dist/service.d.ts +0 -298
  86. package/dist/service.d.ts.map +0 -1
  87. package/dist/setup-routes.d.ts +0 -23
  88. package/dist/setup-routes.d.ts.map +0 -1
  89. package/dist/slash-commands.d.ts +0 -39
  90. package/dist/slash-commands.d.ts.map +0 -1
  91. package/dist/staleness.d.ts +0 -25
  92. package/dist/staleness.d.ts.map +0 -1
  93. package/dist/status-reactions.d.ts +0 -11
  94. package/dist/status-reactions.d.ts.map +0 -1
  95. package/dist/test-setup.d.ts +0 -1
  96. package/dist/test-setup.d.ts.map +0 -1
  97. package/dist/tests.d.ts +0 -123
  98. package/dist/tests.d.ts.map +0 -1
  99. package/dist/types.d.ts +0 -339
  100. package/dist/types.d.ts.map +0 -1
  101. package/dist/typing.d.ts +0 -7
  102. package/dist/typing.d.ts.map +0 -1
  103. package/dist/user-account-scraper/discord-browser-scraper.d.ts +0 -118
  104. package/dist/user-account-scraper/discord-browser-scraper.d.ts.map +0 -1
  105. package/dist/user-account-scraper/discord-desktop-cdp.d.ts +0 -33
  106. package/dist/user-account-scraper/discord-desktop-cdp.d.ts.map +0 -1
  107. package/dist/user-account-scraper/index.d.ts +0 -15
  108. package/dist/user-account-scraper/index.d.ts.map +0 -1
  109. package/dist/user-account-scraper/service.d.ts +0 -92
  110. package/dist/user-account-scraper/service.d.ts.map +0 -1
  111. package/dist/utils.d.ts +0 -51
  112. package/dist/utils.d.ts.map +0 -1
  113. package/dist/vitest.config.d.ts +0 -3
  114. package/dist/vitest.config.d.ts.map +0 -1
  115. package/dist/voice.d.ts +0 -235
  116. package/dist/voice.d.ts.map +0 -1
package/dist/service.d.ts DELETED
@@ -1,298 +0,0 @@
1
- import { ChannelType, type Character, type Content, type IAgentRuntime, type Media, type Memory, type MessageConnectorChatContext, type MessageConnectorQueryContext, type MessageConnectorTarget, type MessageConnectorUserContext, type Room, Service, type TargetInfo, type UUID, type World } from "@elizaos/core";
2
- /**
3
- * IMPORTANT: Discord ID Handling - Why stringToUuid() instead of asUUID()
4
- *
5
- * Discord uses "snowflake" IDs - large 64-bit integers represented as strings
6
- * (e.g., "1253563208833433701"). These are NOT valid UUIDs.
7
- *
8
- * UUID format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (8-4-4-4-12 hex digits with dashes)
9
- * Discord ID: 1253563208833433701 (plain number string)
10
- *
11
- * The two UUID-related functions behave differently:
12
- *
13
- * - `asUUID(str)` - VALIDATES that the string is already a valid UUID format.
14
- * If not, it throws: "Error: Invalid UUID format: 1253563208833433701"
15
- * Use only when you're certain the input is already a valid UUID.
16
- *
17
- * - `stringToUuid(str)` - CONVERTS any string into a deterministic UUID by hashing it.
18
- * Always succeeds. The same input always produces the same UUID output.
19
- * Use this for Discord snowflake IDs.
20
- *
21
- * When working with Discord IDs in ElizaOS:
22
- *
23
- * 1. `stringToUuid(discordId)` - For storing Discord IDs in UUID fields (e.g., `messageServerId`).
24
- *
25
- * 2. `createUniqueUuid(runtime, discordId)` - For `worldId` and `roomId`. This adds the agent's
26
- * ID to the hash, ensuring each agent has its own unique namespace for the same Discord server.
27
- *
28
- * 3. `messageServerId` - The correct property name for server IDs on Room and World objects.
29
- *
30
- * 4. Discord-specific events (e.g., DiscordEventTypes.VOICE_STATE_UPDATE) are not in core's
31
- * EventPayloadMap. When emitting these events, cast to `string[]` and payload to `any`
32
- * to use the generic emitEvent overload.
33
- */
34
- import { type Channel, Client as DiscordJsClient, type Guild, type GuildMember, type Interaction, type Message, type MessageReaction, type PartialMessageReaction, type PartialUser, type User } from "discord.js";
35
- import type { ICompatRuntime } from "./compat";
36
- import { MessageManager } from "./messages";
37
- import type { ChannelHistoryOptions, ChannelHistoryResult, DiscordSettings, DiscordSlashCommand, IDiscordService } from "./types";
38
- import { VoiceManager } from "./voice";
39
- type ConnectorFetchMessagesParams = {
40
- target?: TargetInfo;
41
- accountId?: string;
42
- limit?: number;
43
- before?: string;
44
- after?: string;
45
- cursor?: string;
46
- channelId?: string;
47
- roomId?: UUID;
48
- threadId?: string;
49
- };
50
- type ConnectorSearchMessagesParams = ConnectorFetchMessagesParams & {
51
- query?: string;
52
- author?: string;
53
- };
54
- type ConnectorMessageMutationParams = {
55
- target?: TargetInfo;
56
- accountId?: string;
57
- channelId?: string;
58
- roomId?: UUID;
59
- threadId?: string;
60
- messageId?: string;
61
- emoji?: string;
62
- remove?: boolean;
63
- pin?: boolean;
64
- text?: string;
65
- content?: Content;
66
- };
67
- type ConnectorChannelMutationParams = {
68
- target?: TargetInfo;
69
- accountId?: string;
70
- channelId?: string;
71
- roomId?: UUID;
72
- alias?: string;
73
- };
74
- type ConnectorUserLookupParams = {
75
- accountId?: string;
76
- userId?: string;
77
- username?: string;
78
- handle?: string;
79
- query?: string;
80
- };
81
- /**
82
- * DiscordService class representing a service for interacting with Discord.
83
- * @extends Service
84
- * @implements IDiscordService
85
- * @property {string} serviceType - The type of service, set to DISCORD_SERVICE_NAME.
86
- * @property {string} capabilityDescription - A description of the service's capabilities.
87
- * @property {DiscordJsClient} client - The DiscordJsClient used for communication.
88
- * @property {Character} character - The character associated with the service.
89
- * @property {MessageManager} messageManager - The manager for handling messages.
90
- * @property {VoiceManager} voiceManager - The manager for handling voice communication.
91
- */
92
- export declare class DiscordService extends Service implements IDiscordService {
93
- protected runtime: ICompatRuntime;
94
- static serviceType: string;
95
- capabilityDescription: string;
96
- /**
97
- * Connector account ID this service instance speaks for. Single-account
98
- * env-only deployments use DEFAULT_ACCOUNT_ID. When the multi-account
99
- * pool is wired in, each pool slot owns one client and one accountId.
100
- */
101
- accountId: string;
102
- private defaultAccountId;
103
- private readonly accountPool;
104
- client: DiscordJsClient | null;
105
- character: Character;
106
- discordSettings: DiscordSettings;
107
- messageManager?: MessageManager;
108
- voiceManager?: VoiceManager;
109
- private messageDebouncer?;
110
- private channelDebouncer?;
111
- private _loginFailed;
112
- private userSelections;
113
- private timeouts;
114
- clientReadyPromise: Promise<void> | null;
115
- /**
116
- * List of allowed channel IDs (parsed from CHANNEL_IDS env var).
117
- * If undefined, all channels are allowed.
118
- */
119
- private allowedChannelIds?;
120
- /**
121
- * Set of dynamically added channel IDs through joinChannel action.
122
- * These are merged with allowedChannelIds for runtime channel management.
123
- */
124
- private dynamicChannelIds;
125
- private ownerDiscordUserIds;
126
- slashCommands: DiscordSlashCommand[];
127
- private commandRegistrationQueue;
128
- allowAllSlashCommands: Set<string>;
129
- /**
130
- * Resolves owner Discord user IDs from either the explicit
131
- * ELIZA_DISCORD_OWNER_USER_IDS_JSON setting or the Discord application's
132
- * team/owner metadata, and registers them as Discord connector admins.
133
- * Called from the extracted onReady handler once the client is ready.
134
- */
135
- refreshOwnerDiscordUserIds(client: DiscordJsClient): Promise<void>;
136
- /**
137
- * Registers slash commands with Discord. Called from the onReady event
138
- * handler via the DISCORD_REGISTER_COMMANDS event emitted by
139
- * registerBuiltinSlashCommands(). Merges incoming commands with the
140
- * existing set, then pushes them to Discord both globally (for DMs) and
141
- * per-guild (for instant availability).
142
- */
143
- registerSlashCommands(commands: DiscordSlashCommand[], accountId?: string | null): Promise<void>;
144
- private resolveDiscordTargetUserId;
145
- private resolveDiscordSettingsForAccount;
146
- private resolveListenChannelIdsForAccount;
147
- private createDiscordJsClient;
148
- private syncLegacyDefaultAliases;
149
- private getAccountState;
150
- private getDefaultAccountState;
151
- private requireAccountState;
152
- private resolveAccountIdFromTarget;
153
- getDefaultAccountId(): string;
154
- getAccountIds(): string[];
155
- getClient(accountId?: string | null): DiscordJsClient | null;
156
- getAccountLabel(accountId?: string | null): string;
157
- private createAccountServiceFacade;
158
- private initializeAccount;
159
- /**
160
- * Constructor for Discord client.
161
- * Initializes the Discord client with specified intents and partials,
162
- * sets up event listeners, and ensures all servers exist.
163
- *
164
- * @param {IAgentRuntime} runtime - The AgentRuntime instance
165
- */
166
- constructor(runtime: IAgentRuntime);
167
- isHealthy(): boolean;
168
- static start(runtime: IAgentRuntime): Promise<DiscordService>;
169
- /**
170
- * The SendHandlerFunction implementation for Discord.
171
- * @param {IAgentRuntime} runtime - The runtime instance.
172
- * @param {TargetInfo} target - The target information for the message.
173
- * @param {Content} content - The content of the message to send.
174
- * @returns {Promise<void>} A promise that resolves when the message is sent or rejects on error.
175
- * @throws {Error} If the client is not ready, target is invalid, or sending fails.
176
- */
177
- handleSendMessage(runtime: IAgentRuntime, target: TargetInfo, content: Content): Promise<void>;
178
- private buildConnectorChannelTarget;
179
- private buildConnectorUserTarget;
180
- private dedupeConnectorTargets;
181
- resolveConnectorTargets(query: string, context: MessageConnectorQueryContext): Promise<MessageConnectorTarget[]>;
182
- listConnectorRooms(context: MessageConnectorQueryContext): Promise<MessageConnectorTarget[]>;
183
- listRecentConnectorTargets(context: MessageConnectorQueryContext): Promise<MessageConnectorTarget[]>;
184
- getConnectorChatContext(target: TargetInfo, context: MessageConnectorQueryContext): Promise<MessageConnectorChatContext | null>;
185
- getConnectorUserContext(entityId: UUID | string, context: MessageConnectorQueryContext): Promise<MessageConnectorUserContext | null>;
186
- private resolveConnectorTextChannel;
187
- private fetchConnectorDiscordMessage;
188
- listConnectorServers(context: MessageConnectorQueryContext): Promise<World[]>;
189
- fetchConnectorMessages(_context: MessageConnectorQueryContext, params: ConnectorFetchMessagesParams): Promise<Memory[]>;
190
- searchConnectorMessages(context: MessageConnectorQueryContext, params: ConnectorSearchMessagesParams): Promise<Memory[]>;
191
- reactConnectorMessage(_runtime: IAgentRuntime, params: ConnectorMessageMutationParams): Promise<void>;
192
- editConnectorMessage(_runtime: IAgentRuntime, params: ConnectorMessageMutationParams): Promise<Memory>;
193
- deleteConnectorMessage(_runtime: IAgentRuntime, params: ConnectorMessageMutationParams): Promise<void>;
194
- pinConnectorMessage(_runtime: IAgentRuntime, params: ConnectorMessageMutationParams): Promise<void>;
195
- joinConnectorChannel(_runtime: IAgentRuntime, params: ConnectorChannelMutationParams): Promise<Room | null>;
196
- leaveConnectorChannel(_runtime: IAgentRuntime, params: ConnectorChannelMutationParams): Promise<void>;
197
- getConnectorUser(_runtime: IAgentRuntime, params: ConnectorUserLookupParams): Promise<unknown>;
198
- /**
199
- * Set up event listeners for the client.
200
- * Delegates to the extracted setupDiscordEventListeners() function.
201
- * @private
202
- */
203
- private setupEventListenersForAccount;
204
- /**
205
- * Handles tasks to be performed once the Discord client is fully ready. Delegates to extracted module.
206
- * @private
207
- */
208
- private onReadyForAccount;
209
- /**
210
- * Registers send handlers for the Discord service instance.
211
- * @static
212
- */
213
- static registerSendHandlers(runtime: IAgentRuntime, serviceInstance: DiscordService): void;
214
- /**
215
- * Fetches all members who have access to a specific text channel.
216
- */
217
- getTextChannelMembers(channelId: string, useCache?: boolean, accountId?: string | null): Promise<Array<{
218
- id: string;
219
- username: string;
220
- displayName: string;
221
- }>>;
222
- /**
223
- * Fetches the topic/description of a Discord text channel.
224
- */
225
- getChannelTopic(channelId: string, accountId?: string | null): Promise<string | null>;
226
- /**
227
- * Checks if a channel ID is allowed based on both env config and dynamic additions.
228
- */
229
- isChannelAllowed(channelId: string, accountId?: string | null): boolean;
230
- /**
231
- * Adds a channel to the dynamic allowed list.
232
- */
233
- addAllowedChannel(channelId: string, accountId?: string | null): boolean;
234
- /**
235
- * Removes a channel from the dynamic allowed list.
236
- */
237
- removeAllowedChannel(channelId: string, accountId?: string | null): boolean;
238
- /**
239
- * Gets the list of all allowed channels (env + dynamic).
240
- */
241
- getAllowedChannels(accountId?: string | null): string[];
242
- /**
243
- * Fetches and persists message history from a Discord channel. Delegates to extracted module.
244
- */
245
- fetchChannelHistory(channelId: string, options?: ChannelHistoryOptions): Promise<ChannelHistoryResult>;
246
- /**
247
- * Builds a Memory object from a Discord Message. Delegates to extracted module.
248
- */
249
- buildMemoryFromMessage(message: Message, options?: {
250
- processedContent?: string;
251
- processedAttachments?: Media[];
252
- extraContent?: Record<string, unknown>;
253
- extraMetadata?: Record<string, unknown>;
254
- accountId?: string;
255
- }): Promise<Memory | null>;
256
- /**
257
- * Maps a Discord snowflake user id to the runtime entity UUID, substituting
258
- * the canonical Eliza owner entity when the user is a known Discord owner.
259
- */
260
- resolveDiscordEntityId(userId: string): UUID;
261
- /**
262
- * Handles reaction addition. Delegates to extracted module.
263
- */
264
- handleReactionAdd(reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser): Promise<void>;
265
- private handleReactionAddForAccount;
266
- /**
267
- * Handles reaction removal. Delegates to extracted module.
268
- */
269
- handleReactionRemove(reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser): Promise<void>;
270
- private handleReactionRemoveForAccount;
271
- /**
272
- * Handles guild creation (bot joined a guild). Delegates to extracted module.
273
- */
274
- handleGuildCreate(guild: Guild): Promise<void>;
275
- private handleGuildCreateForAccount;
276
- /**
277
- * Handles interaction creation (slash commands, modals, etc). Delegates to
278
- * extracted module.
279
- */
280
- handleInteractionCreate(interaction: Interaction): Promise<void>;
281
- private handleInteractionCreateForAccount;
282
- /**
283
- * Handles a new guild member joining — emits an ENTITY_JOINED event so the
284
- * runtime can create the entity record.
285
- */
286
- handleGuildMemberAdd(member: GuildMember): Promise<void>;
287
- private handleGuildMemberAddForAccount;
288
- /**
289
- * Stops the Discord service and cleans up resources.
290
- */
291
- stop(): Promise<void>;
292
- /**
293
- * Asynchronously retrieves the type of a given channel.
294
- */
295
- getChannelType(channel: Channel): Promise<ChannelType>;
296
- }
297
- export {};
298
- //# sourceMappingURL=service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../service.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,KAAK,SAAS,EACd,KAAK,OAAO,EAIZ,KAAK,aAAa,EAClB,KAAK,KAAK,EACV,KAAK,MAAM,EAEX,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EA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,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;YAI7C,2BAA2B;IAUzC;;;OAGG;IACU,uBAAuB,CACnC,WAAW,EAAE,WAAW,GACtB,OAAO,CAAC,IAAI,CAAC;YAOF,iCAAiC;IAW/C;;;OAGG;IACU,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;YAIvD,8BAA8B;IAuC5C;;OAEG;IACU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA0DlC;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC;CAgC5D"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Discord local setup HTTP routes.
3
- *
4
- * Provides status, authorization, and subscription management for the
5
- * Discord local IPC connector:
6
- *
7
- * GET /api/discord-local/status connection + auth status
8
- * POST /api/discord-local/authorize start OAuth authorize flow
9
- * POST /api/discord-local/disconnect tear down session
10
- * GET /api/discord-local/guilds list guilds (requires auth)
11
- * GET /api/discord-local/channels list channels for a guild
12
- * POST /api/discord-local/subscriptions subscribe to channel messages
13
- *
14
- * These routes are registered with `rawPath: true` so they mount at their
15
- * legacy paths without the plugin-name prefix.
16
- */
17
- import type { Route } from "@elizaos/core";
18
- /**
19
- * Plugin routes for Discord local setup.
20
- * Registered with `rawPath: true` to preserve legacy `/api/discord-local/*` paths.
21
- */
22
- export declare const discordSetupRoutes: Route[];
23
- //# sourceMappingURL=setup-routes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setup-routes.d.ts","sourceRoot":"","sources":["../setup-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAEX,KAAK,EAGL,MAAM,eAAe,CAAC;AA6RvB;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,EAqCrC,CAAC"}
@@ -1,39 +0,0 @@
1
- import { type IAgentRuntime } from "@elizaos/core";
2
- import type { AutocompleteInteraction, ChatInputCommandInteraction } from "discord.js";
3
- type SlashCommandRole = "OWNER" | "ADMIN" | "USER" | "GUEST";
4
- interface SlashCommand {
5
- name: string;
6
- description: string;
7
- options?: SlashCommandOption[];
8
- ephemeral?: boolean;
9
- cooldown?: number;
10
- ownerOnly?: boolean;
11
- /** Minimum elizaOS role required to execute this command. */
12
- requiredRole?: SlashCommandRole;
13
- execute: (interaction: ChatInputCommandInteraction, runtime: IAgentRuntime) => Promise<void>;
14
- autocomplete?: (interaction: AutocompleteInteraction) => Promise<void>;
15
- }
16
- /** Context resolved by the Discord service before dispatching built-in commands. */
17
- export interface SlashCommandContext {
18
- entityId: string;
19
- roomId: string;
20
- }
21
- interface SlashCommandOption {
22
- name: string;
23
- description: string;
24
- type: "string" | "number" | "boolean" | "user" | "channel" | "role";
25
- required?: boolean;
26
- choices?: Array<{
27
- name: string;
28
- value: string;
29
- }>;
30
- autocomplete?: boolean;
31
- }
32
- export declare function registerSlashCommands(runtime: IAgentRuntime): Promise<void>;
33
- export declare function handleSlashCommand(interaction: ChatInputCommandInteraction, runtime: IAgentRuntime, context?: SlashCommandContext): Promise<void>;
34
- export declare function handleAutocomplete(interaction: AutocompleteInteraction): Promise<void>;
35
- export declare function getRegisteredCommands(): ReadonlyMap<string, SlashCommand>;
36
- export declare function addCommand(command: SlashCommand): void;
37
- export declare function removeCommand(name: string): boolean;
38
- export {};
39
- //# sourceMappingURL=slash-commands.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EACX,uBAAuB,EACvB,2BAA2B,EAC3B,MAAM,YAAY,CAAC;AAKpB,KAAK,gBAAgB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;AAE7D,UAAU,YAAY;IACrB,IAAI,EAAE,MAAM,CAA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AAgB,qBAAqB,IAAI,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAEzE;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAEtD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD"}
@@ -1,25 +0,0 @@
1
- import type { Content } from "@elizaos/core";
2
- import type { Message as DiscordMessage } from "discord.js";
3
- export type DiscordStalenessBehavior = "tag" | "skip" | "ignore";
4
- export interface DiscordStalenessConfig {
5
- enabled: boolean;
6
- behavior: DiscordStalenessBehavior;
7
- threshold: number;
8
- }
9
- export declare function getDiscordStalenessConfig(getSetting: (key: string) => unknown): DiscordStalenessConfig;
10
- export declare function recordDiscordChannelMessageSeen(owner: object | undefined, channelId: string | undefined, messageId?: string): number;
11
- export declare function getDiscordChannelMessageSequence(owner: object | undefined, channelId: string | undefined): number;
12
- export interface DiscordStalenessDecision {
13
- shouldSend: boolean;
14
- stale: boolean;
15
- messagesSinceTurnStart: number;
16
- behavior: DiscordStalenessBehavior;
17
- }
18
- export declare function applyDiscordStalenessGuard(options: {
19
- config: DiscordStalenessConfig;
20
- owner: object | undefined;
21
- message: DiscordMessage;
22
- startSequence: number;
23
- content: Content;
24
- }): DiscordStalenessDecision;
25
- //# sourceMappingURL=staleness.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"staleness.d.ts","sourceRoot":"","sources":["../staleness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEjE,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,wBAAwB,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;CAClB;AAsCD,wBAAgB,yBAAyB,CACxC,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAClC,sBAAsB,CASxB;AAED,wBAAgB,+BAA+B,CAC9C,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,SAAS,CAAC,EAAE,MAAM,GAChB,MAAM,CAgBR;AAED,wBAAgB,gCAAgC,CAC/C,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAAG,SAAS,GAC3B,MAAM,CAKR;AAED,MAAM,WAAW,wBAAwB;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,sBAAsB,EAAE,MAAM,CAAC;IAC/B,QAAQ,EAAE,wBAAwB,CAAC;CACnC;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE;IACnD,MAAM,EAAE,sBAAsB,CAAC;IAC/B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,EAAE,cAAc,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;CACjB,GAAG,wBAAwB,CAkD3B"}
@@ -1,11 +0,0 @@
1
- import type { Message as DiscordMessage } from "discord.js";
2
- export type StatusReactionScope = "all" | "group-mentions" | "none";
3
- export interface StatusReactionController {
4
- setQueued: () => void;
5
- setThinking: () => void;
6
- setDone: () => void;
7
- setError: () => void;
8
- }
9
- export declare function shouldShowStatusReaction(scope: StatusReactionScope, message: DiscordMessage, botId: string | undefined): boolean;
10
- export declare function createStatusReactionController(message: DiscordMessage): StatusReactionController;
11
- //# sourceMappingURL=status-reactions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status-reactions.d.ts","sourceRoot":"","sources":["../status-reactions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5D,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAEpE,MAAM,WAAW,wBAAwB;IACxC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACrB;AAOD,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,mBAAmB,EAC1B,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,MAAM,GAAG,SAAS,GACvB,OAAO,CAkBT;AAED,wBAAgB,8BAA8B,CAC7C,OAAO,EAAE,cAAc,GACrB,wBAAwB,CA6C1B"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=test-setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../test-setup.ts"],"names":[],"mappings":""}
package/dist/tests.d.ts DELETED
@@ -1,123 +0,0 @@
1
- import type { Readable } from "node:stream";
2
- import { type VoiceConnection } from "@discordjs/voice";
3
- import { type IAgentRuntime, type TestSuite } from "@elizaos/core";
4
- import { AttachmentBuilder, type Guild, type TextChannel } from "discord.js";
5
- import type { DiscordService } from "./service";
6
- /**
7
- * Represents a test suite for Discord functionality.
8
- * @class DiscordTestSuite
9
- * @implements TestSuite
10
- * @property {string} name - The name of the test suite
11
- * @property {DiscordService | null} discordClient - The Discord client instance
12
- * @property {Array<{ name: string; fn: (runtime: IAgentRuntime) => Promise<void> }>} tests - Array of test functions
13
- */
14
- export declare class DiscordTestSuite implements TestSuite {
15
- name: string;
16
- private discordClient;
17
- tests: {
18
- name: string;
19
- fn: (runtime: IAgentRuntime) => Promise<void>;
20
- }[];
21
- /**
22
- * Constructor for initializing the tests array with test cases to be executed.
23
- *
24
- * @constructor
25
- * @this {TestSuite}
26
- */
27
- constructor();
28
- /**
29
- * Asynchronously tests the creation of Discord client using the provided runtime.
30
- *
31
- * @param {IAgentRuntime} runtime - The agent runtime used to obtain the Discord service.
32
- * @returns {Promise<void>} - A Promise that resolves once the Discord client is ready.
33
- * @throws {Error} - If an error occurs while creating the Discord client.
34
- */
35
- testCreatingDiscordClient(runtime: IAgentRuntime): Promise<void>;
36
- /**
37
- * Asynchronously tests the join voice slash command functionality.
38
- *
39
- * @param {IAgentRuntime} runtime - The runtime environment for the agent.
40
- * @returns {Promise<void>} - A promise that resolves once the test is complete.
41
- * @throws {Error} - If there is an error in executing the slash command test.
42
- */
43
- testJoinVoiceSlashCommand(runtime: IAgentRuntime): Promise<void>;
44
- /**
45
- * Asynchronously tests the leave voice channel slash command.
46
- *
47
- * @param {IAgentRuntime} runtime - The Agent Runtime instance.
48
- * @returns {Promise<void>} A promise that resolves when the test is complete.
49
- */
50
- testLeaveVoiceSlashCommand(runtime: IAgentRuntime): Promise<void>;
51
- /**
52
- * Test Text to Speech playback.
53
- * @param {IAgentRuntime} runtime - The Agent Runtime instance.
54
- * @throws {Error} - If voice channel is invalid, voice connection fails to become ready, or no text to speech service found.
55
- */
56
- testTextToSpeechPlayback(runtime: IAgentRuntime): Promise<void>;
57
- /**
58
- * Asynchronously tests sending a text message to a specified channel.
59
- *
60
- * @param {IAgentRuntime} runtime - The runtime for the agent.
61
- * @returns {Promise<void>} A Promise that resolves when the message is sent successfully.
62
- * @throws {Error} If there is an error in sending the text message.
63
- */
64
- testSendingTextMessage(runtime: IAgentRuntime): Promise<void>;
65
- /**
66
- * Asynchronously handles sending a test message using the given runtime and mock user data.
67
- *
68
- * @param {IAgentRuntime} runtime - The agent runtime object.
69
- * @returns {Promise<void>} A Promise that resolves once the message is handled.
70
- */
71
- testHandlingMessage(runtime: IAgentRuntime): Promise<void>;
72
- /**
73
- * Asynchronously retrieves the test channel associated with the provided runtime.
74
- *
75
- * @param {IAgentRuntime} runtime - The runtime object containing necessary information.
76
- * @returns {Promise<Channel>} The test channel retrieved from the Discord client.
77
- * @throws {Error} If no test channel is found.
78
- */
79
- getTestChannel(runtime: IAgentRuntime): Promise<import("discord.js").Channel>;
80
- /**
81
- * Async function to send a message to a text-based channel.
82
- *
83
- * @param {TextChannel} channel - The text-based channel the message is being sent to.
84
- * @param {string} messageContent - The content of the message being sent.
85
- * @param {AttachmentBuilder[]} files - An array of files to include in the message.
86
- * @throws {Error} If the channel is not a text-based channel or does not exist.
87
- * @throws {Error} If there is an error sending the message.
88
- */
89
- sendMessageToChannel(channel: TextChannel, messageContent: string, files: AttachmentBuilder[]): Promise<void>;
90
- /**
91
- * Play an audio stream from a given response stream using the provided VoiceConnection.
92
- *
93
- * @param responseStream - The response stream to play as audio.
94
- * @param connection - The VoiceConnection to use for playing the audio.
95
- * @returns A Promise that resolves when the TTS playback is finished.
96
- */
97
- playAudioStream(responseStream: ReadableStream | NodeJS.ReadableStream | Readable, connection: VoiceConnection): Promise<void>;
98
- /**
99
- * Retrieves the active guild where the bot is currently connected to a voice channel.
100
- *
101
- * @param {DiscordService} discordClient The DiscordService instance used to interact with the Discord API.
102
- * @returns {Promise<Guild>} The active guild where the bot is currently connected to a voice channel.
103
- * @throws {Error} If no active voice connection is found for the bot.
104
- */
105
- getActiveGuild(discordClient: DiscordService): Promise<Guild>;
106
- /**
107
- * Waits for the VoiceManager in the Discord client to be ready.
108
- *
109
- * @param {DiscordService} discordClient - The Discord client to check for VoiceManager readiness.
110
- * @throws {Error} If the Discord client is not initialized.
111
- * @returns {Promise<void>} A promise that resolves when the VoiceManager is ready.
112
- */
113
- private waitForVoiceManagerReady;
114
- /**
115
- * Validates the Discord test channel ID by checking if it is set in the runtime or environment variables.
116
- * If the test channel ID is not set, an error is thrown.
117
- *
118
- * @param {IAgentRuntime} runtime The runtime object containing the settings and environment variables.
119
- * @returns {string} The validated Discord test channel ID.
120
- */
121
- private validateChannelId;
122
- }
123
- //# sourceMappingURL=tests.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../tests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA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