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

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 (78) hide show
  1. package/README.md +28 -68
  2. package/dist/account-client-pool.d.ts +5 -5
  3. package/dist/accounts.d.ts +2 -2
  4. package/dist/actions/setup-credentials.d.ts +0 -3
  5. package/dist/actions/setup-credentials.d.ts.map +1 -1
  6. package/dist/addressing.d.ts.map +1 -1
  7. package/dist/allowlist.d.ts +1 -1
  8. package/dist/attachments.d.ts +1 -1
  9. package/dist/attachments.d.ts.map +1 -1
  10. package/dist/banner.d.ts +1 -1
  11. package/dist/catalog-commands.d.ts +65 -0
  12. package/dist/catalog-commands.d.ts.map +1 -0
  13. package/dist/compat.d.ts +0 -25
  14. package/dist/compat.d.ts.map +1 -1
  15. package/dist/config.d.ts +1 -1
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/connector-account-provider.d.ts +4 -3
  18. package/dist/connector-account-provider.d.ts.map +1 -1
  19. package/dist/data-routes.d.ts +22 -0
  20. package/dist/data-routes.d.ts.map +1 -0
  21. package/dist/debouncer.d.ts +14 -0
  22. package/dist/debouncer.d.ts.map +1 -1
  23. package/dist/discord-commands.d.ts +2 -2
  24. package/dist/discord-commands.d.ts.map +1 -1
  25. package/dist/discord-events.d.ts +4 -3
  26. package/dist/discord-events.d.ts.map +1 -1
  27. package/dist/discord-history.d.ts +4 -4
  28. package/dist/discord-history.d.ts.map +1 -1
  29. package/dist/discord-interactions.d.ts +3 -3
  30. package/dist/discord-interactions.d.ts.map +1 -1
  31. package/dist/discord-local-service.d.ts +11 -3
  32. package/dist/discord-local-service.d.ts.map +1 -1
  33. package/dist/discord-reactions.d.ts +1 -1
  34. package/dist/draft-stream.d.ts +1 -1
  35. package/dist/environment.d.ts +5 -5
  36. package/dist/generated/specs/spec-helpers.d.ts +1 -1
  37. package/dist/generated/specs/specs.d.ts +2 -14
  38. package/dist/generated/specs/specs.d.ts.map +1 -1
  39. package/dist/inbound-envelope.d.ts +8 -1
  40. package/dist/inbound-envelope.d.ts.map +1 -1
  41. package/dist/index.browser.d.ts +4 -4
  42. package/dist/index.browser.d.ts.map +1 -1
  43. package/dist/index.d.ts +19 -18
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +10452 -9822
  46. package/dist/index.js.map +36 -33
  47. package/dist/interactions.d.ts +35 -0
  48. package/dist/interactions.d.ts.map +1 -0
  49. package/dist/messages.d.ts +7 -3
  50. package/dist/messages.d.ts.map +1 -1
  51. package/dist/owner-pairing-service.d.ts.map +1 -1
  52. package/dist/permissionEvents.d.ts +1 -1
  53. package/dist/profileSync.d.ts +1 -1
  54. package/dist/sensitive-request-adapter.d.ts +19 -0
  55. package/dist/sensitive-request-adapter.d.ts.map +1 -0
  56. package/dist/service.d.ts +25 -8
  57. package/dist/service.d.ts.map +1 -1
  58. package/dist/setup-routes.d.ts +16 -11
  59. package/dist/setup-routes.d.ts.map +1 -1
  60. package/dist/slash-commands.d.ts +3 -4
  61. package/dist/slash-commands.d.ts.map +1 -1
  62. package/dist/status-reactions.d.ts.map +1 -1
  63. package/dist/tests.d.ts +3 -3
  64. package/dist/tests.d.ts.map +1 -1
  65. package/dist/types.d.ts +8 -2
  66. package/dist/types.d.ts.map +1 -1
  67. package/dist/user-account-scraper/discord-desktop-cdp.d.ts +1 -1
  68. package/dist/user-account-scraper/discord-desktop-cdp.d.ts.map +1 -1
  69. package/dist/user-account-scraper/index.d.ts +3 -3
  70. package/dist/user-account-scraper/service.d.ts +2 -2
  71. package/dist/user-account-scraper/service.d.ts.map +1 -1
  72. package/dist/utils.d.ts +9 -7
  73. package/dist/utils.d.ts.map +1 -1
  74. package/dist/vitest.config.d.ts.map +1 -1
  75. package/dist/voice.d.ts +19 -12
  76. package/dist/voice.d.ts.map +1 -1
  77. package/package.json +37 -10
  78. package/registry-entry.json +120 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @elizaos/plugin-discord
2
2
 
3
- A Discord plugin implementation for ElizaOS, enabling rich integration with Discord servers for managing interactions, voice, and message handling.
3
+ A Discord connector plugin for elizaOS, enabling rich integration with Discord servers for managing interactions, voice, and message handling.
4
4
 
5
5
  ## Features
6
6
 
@@ -10,9 +10,7 @@ A Discord plugin implementation for ElizaOS, enabling rich integration with Disc
10
10
  - Slash command registration and interaction handling
11
11
  - Support for Discord attachments and media files
12
12
  - Voice channel join/leave functionality
13
- - Conversation summarization
14
- - Media transcription capabilities
15
- - Channel state and voice state providers
13
+ - Media transcription for voice and attachments
16
14
  - Channel restriction support (limit bot to specific channels)
17
15
  - Robust permissions management and audit event tracking
18
16
  - Event-driven architecture with comprehensive event handling
@@ -20,7 +18,7 @@ A Discord plugin implementation for ElizaOS, enabling rich integration with Disc
20
18
 
21
19
  ## Installation
22
20
 
23
- As this is a workspace package, it's installed as part of the ElizaOS monorepo:
21
+ As this is a workspace package, it is installed as part of the elizaOS monorepo:
24
22
 
25
23
  ```bash
26
24
  bun install
@@ -38,7 +36,6 @@ DISCORD_API_TOKEN=your_api_token
38
36
  # Channel Restrictions (Optional)
39
37
  # Comma-separated list of Discord channel IDs to restrict the bot to.
40
38
  # If not set, the bot operates in all channels.
41
- # These channels cannot be removed via the leaveChannel action.
42
39
  CHANNEL_IDS=123456789012345678,987654321098765432
43
40
 
44
41
  # Listen-only channels (Optional)
@@ -90,7 +87,7 @@ Settings can also be configured in your character file under `settings.discord`:
90
87
 
91
88
  ## Slash Command Permissions
92
89
 
93
- The plugin uses a hybrid permission system that combines Discord's native features with ElizaOS-specific controls.
90
+ The plugin uses a hybrid permission system that combines Discord's native features with elizaOS-specific controls.
94
91
 
95
92
  ### Permission Layers
96
93
 
@@ -100,7 +97,7 @@ Commands go through multiple permission checks in this order:
100
97
  - User must have required Discord permissions
101
98
  - Command must be available in the current context (guild vs DM)
102
99
 
103
- 2. **ElizaOS Channel Whitelist** (if `CHANNEL_IDS` is set):
100
+ 2. **elizaOS Channel Whitelist** (if `CHANNEL_IDS` is set):
104
101
  - Commands only work in whitelisted channels
105
102
  - Unless command has `bypassChannelWhitelist: true`
106
103
 
@@ -186,38 +183,9 @@ From Discord.js `PermissionFlagsBits`:
186
183
  - `ManageRoles` - Role management
187
184
  - `Administrator` - Full access
188
185
 
189
- ### Design Rationale
186
+ ### Actions / Providers
190
187
 
191
- **Why Hybrid Approach?**
192
-
193
- - Discord's native permissions are powerful but limited to role-based access
194
- - ElizaOS needs programmatic control for channel restrictions and custom logic
195
- - Combining both gives developers the best of both worlds
196
-
197
- **Why Simple Flags?**
198
-
199
- - `guildOnly: true` is clearer than `contexts: [0]`
200
- - Abstracts Discord API details
201
- - Sensible defaults: zero config should "just work"
202
-
203
- **Why Keep Channel Whitelist?**
204
-
205
- - Discord's channel permissions are UI-based (Server Settings > Integrations)
206
- - Programmatic control is better for developer experience
207
- - Allows dynamic, runtime-based channel restrictions
208
-
209
- ### Available Actions
210
-
211
- The plugin provides the following actions:
212
-
213
- | Action | Description |
214
- | -------------------------------- | -------------------------------------------------------- |
215
- | **MESSAGE** | Send, read, search, list, react, edit, delete, pin, join, leave, or get user info through the Discord message connector |
216
- | **DISCORD_SETUP_CREDENTIALS** | Set up Discord credential pairing |
217
-
218
- ### Providers
219
-
220
- Discord message context is exposed through the MESSAGE connector hooks rather than Discord-specific prompt providers.
188
+ No actions or providers are registered. The plugin operates entirely through services and events. Credential pairing is handled by connector account providers and owner-only slash commands.
221
189
 
222
190
  ### Event Types
223
191
 
@@ -246,7 +214,7 @@ The plugin emits the following Discord-specific events:
246
214
 
247
215
  ### DiscordService
248
216
 
249
- Main service class that extends ElizaOS Service:
217
+ Main service class that extends elizaOS Service:
250
218
 
251
219
  - Handles authentication and session management
252
220
  - Manages Discord client connection
@@ -267,7 +235,7 @@ Main service class that extends ElizaOS Service:
267
235
  - Processes voice events and audio streams
268
236
  - Integrates with transcription services
269
237
 
270
- ### Attachment Handler
238
+ ### AttachmentManager
271
239
 
272
240
  - Downloads and processes Discord attachments
273
241
  - Supports various media types
@@ -432,6 +400,7 @@ interface RoleLifecyclePayload {
432
400
 
433
401
  ```typescript
434
402
  import { DiscordEventTypes } from "@elizaos/plugin-discord";
403
+ import { logger } from "@elizaos/core";
435
404
 
436
405
  // Alert on dangerous permission grants
437
406
  runtime.registerEvent({
@@ -444,12 +413,10 @@ runtime.registerEvent({
444
413
  dangerousPerms.includes(change.permission) &&
445
414
  change.newState === "ALLOW"
446
415
  ) {
447
- console.warn(`⚠️ Dangerous permission granted!`, {
448
- channel: payload.channel.name,
449
- target: payload.target.name,
450
- permission: change.permission,
451
- grantedBy: payload.audit?.executorTag || "Unknown",
452
- });
416
+ logger.warn(
417
+ { channel: payload.channel.name, target: payload.target.name, permission: change.permission, grantedBy: payload.audit?.executorTag || "Unknown" },
418
+ "[SecurityMonitor] Dangerous permission granted",
419
+ );
453
420
  }
454
421
  }
455
422
  },
@@ -464,10 +431,10 @@ runtime.registerEvent({
464
431
  );
465
432
 
466
433
  if (adminRoles.length > 0) {
467
- console.warn(`⚠️ Admin role granted to ${payload.member.tag}`, {
468
- roles: adminRoles.map((r) => r.name),
469
- grantedBy: payload.audit?.executorTag || "Unknown",
470
- });
434
+ logger.warn(
435
+ { member: payload.member.tag, roles: adminRoles.map((r) => r.name), grantedBy: payload.audit?.executorTag || "Unknown" },
436
+ "[SecurityMonitor] Admin role granted",
437
+ );
471
438
  }
472
439
  },
473
440
  });
@@ -476,10 +443,10 @@ runtime.registerEvent({
476
443
  runtime.registerEvent({
477
444
  name: DiscordEventTypes.ROLE_CREATED,
478
445
  handler: async (payload) => {
479
- console.log(`New role created: ${payload.role.name}`, {
480
- permissions: payload.role.permissions,
481
- createdBy: payload.audit?.executorTag || "Unknown",
482
- });
446
+ logger.info(
447
+ { role: payload.role.name, permissions: payload.role.permissions, createdBy: payload.audit?.executorTag || "Unknown" },
448
+ "[SecurityMonitor] New role created",
449
+ );
483
450
  },
484
451
  });
485
452
  ```
@@ -495,11 +462,10 @@ runtime.registerEvent({
495
462
  const botId = runtime.getSetting("DISCORD_APPLICATION_ID");
496
463
 
497
464
  if (payload.member.id === botId && payload.removed.length > 0) {
498
- console.error(`🚨 Bot roles removed!`, {
499
- removed: payload.removed.map((r) => r.name),
500
- by: payload.audit?.executorTag || "Unknown",
501
- });
502
- // Could trigger alerts, notifications, etc.
465
+ logger.error(
466
+ { removed: payload.removed.map((r) => r.name), by: payload.audit?.executorTag || "Unknown" },
467
+ "[SecurityMonitor] Bot roles removed",
468
+ );
503
469
  }
504
470
  },
505
471
  });
@@ -507,13 +473,7 @@ runtime.registerEvent({
507
473
 
508
474
  ## Cross-Core Compatibility
509
475
 
510
- This plugin includes a compatibility layer (`compat.ts`) that allows it to work with both old and new versions of `@elizaos/core`. The compatibility layer:
511
-
512
- - Automatically handles `serverId` vs `messageServerId` differences
513
- - Uses a runtime proxy to intercept and adapt API calls
514
- - Requires no changes to existing code
515
-
516
- When migrating to a new core version, see the comments in `compat.ts` for removal instructions.
476
+ This plugin includes a type-level compatibility layer (`compat.ts`) so it typechecks against both old and new versions of `@elizaos/core`. It exports widened types (`ICompatRuntime`, `WorldCompat`, `RoomCompat`) that allow either `serverId` or `messageServerId` on `World`/`Room` objects and on the `ensureConnection`/`ensureWorldExists`/`ensureRoomExists` runtime methods. There is no runtime proxy — it is purely TypeScript declarations consumed where the runtime is referenced (`service.ts`, `messages.ts`, `voice.ts`, `discord-interactions.ts`, `discord-history.ts`).
517
477
 
518
478
  ## Testing
519
479
 
@@ -528,5 +488,5 @@ bun run test
528
488
  - Ensure that your `.env` file includes the required `DISCORD_API_TOKEN`
529
489
  - The bot requires appropriate Discord permissions (send messages, connect to voice, etc.)
530
490
  - If no token is provided, the plugin will load but remain non-functional with appropriate warnings
531
- - The plugin uses Discord.js v14.18.0 with comprehensive intent support
491
+ - The plugin uses discord.js v14 (`^14.26.4`) with comprehensive intent support
532
492
  - Slash commands and modal/component interactions bypass channel whitelists
@@ -1,9 +1,9 @@
1
1
  import type { Client as DiscordJsClient } from "discord.js";
2
- import { type ResolvedDiscordAccount } from "./accounts";
3
- import type { ChannelDebouncer, MessageDebouncer } from "./debouncer";
4
- import type { MessageManager } from "./messages";
5
- import type { DiscordSettings } from "./types";
6
- import type { VoiceManager } from "./voice";
2
+ import { type ResolvedDiscordAccount } from "./accounts.js";
3
+ import type { ChannelDebouncer, MessageDebouncer } from "./debouncer.js";
4
+ import type { MessageManager } from "./messages.js";
5
+ import type { DiscordSettings } from "./types.js";
6
+ import type { VoiceManager } from "./voice.js";
7
7
  export interface DiscordAccountClientState {
8
8
  accountId: string;
9
9
  account: ResolvedDiscordAccount;
@@ -132,7 +132,7 @@ export declare function normalizeAccountId(accountId?: string | null): string;
132
132
  */
133
133
  export declare function normalizeDiscordToken(raw?: string | null): string | undefined;
134
134
  /**
135
- * Gets the multi-account configuration from runtime settings
135
+ * Gets the account configuration records from runtime settings
136
136
  */
137
137
  export declare function getMultiAccountConfig(runtime: IAgentRuntime): DiscordMultiAccountConfig;
138
138
  /**
@@ -158,7 +158,7 @@ export declare function resolveDiscordAccount(runtime: IAgentRuntime, accountId?
158
158
  */
159
159
  export declare function listEnabledDiscordAccounts(runtime: IAgentRuntime): ResolvedDiscordAccount[];
160
160
  /**
161
- * Checks if multi-account mode is enabled
161
+ * Checks whether more than one enabled account is configured
162
162
  */
163
163
  export declare function isMultiAccountEnabled(runtime: IAgentRuntime): boolean;
164
164
  //# sourceMappingURL=accounts.d.ts.map
@@ -1,4 +1,3 @@
1
- import { type Action } from "@elizaos/core";
2
1
  export interface CredentialPreset {
3
2
  name: string;
4
3
  displayName: string;
@@ -20,6 +19,4 @@ export declare function registerPreset(preset: CredentialPreset): void;
20
19
  export declare function getPreset(name: string): CredentialPreset | undefined;
21
20
  export declare function listPresets(): string[];
22
21
  export declare function loadCredentials(service: string): Record<string, string> | null;
23
- export declare const setupCredentials: Action;
24
- export default setupCredentials;
25
22
  //# sourceMappingURL=setup-credentials.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup-credentials.d.ts","sourceRoot":"","sources":["../../actions/setup-credentials.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,MAAM,EASX,MAAM,eAAe,CAAC;AASvB,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CACT,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC/B,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpE;AAED,MAAM,WAAW,eAAe;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CAChB;AA4CD,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAQ7D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAEpE;AAED,wBAAgB,WAAW,IAAI,MAAM,EAAE,CAEtC;AA8PD,wBAAgB,eAAe,CAC9B,OAAO,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAa/B;AAuID,eAAO,MAAM,gBAAgB,EAAE,MAoY9B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"setup-credentials.d.ts","sourceRoot":"","sources":["../../actions/setup-credentials.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CACT,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC/B,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpE;AAED,MAAM,WAAW,eAAe;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CAChB;AAoBD,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAQ7D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAEpE;AAED,wBAAgB,WAAW,IAAI,MAAM,EAAE,CAEtC;AA4OD,wBAAgB,eAAe,CAC9B,OAAO,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAa/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"addressing.d.ts","sourceRoot":"","sources":["../addressing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAyBH,wBAAgB,sBAAsB,CAAC,EACtC,IAAI,EACJ,MAAM,EACN,mBAA2B,EAC3B,aAAa,GACb,EAAE;IACF,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,GAAG,OAAO,CAKV"}
1
+ {"version":3,"file":"addressing.d.ts","sourceRoot":"","sources":["../addressing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAyBH,wBAAgB,sBAAsB,CAAC,EACtC,IAAI,EACJ,MAAM,EACN,mBAA2B,EAC3B,aAAa,GACb,EAAE;IACF,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,GAAG,OAAO,CASV"}
@@ -1,5 +1,5 @@
1
1
  import type { Guild, GuildMember, User } from "discord.js";
2
- import type { DiscordAccountConfig, DiscordGuildEntry } from "./accounts";
2
+ import type { DiscordAccountConfig, DiscordGuildEntry } from "./accounts.js";
3
3
  /**
4
4
  * Normalized allowlist structure for Discord entities
5
5
  */
@@ -46,7 +46,7 @@ export declare class AttachmentManager {
46
46
  * Processes a PDF attachment by fetching the PDF file from the specified URL,
47
47
  * converting it to text, generating a summary, and returning a Media object
48
48
  * with the extracted information.
49
- * If an error occurs during processing, a placeholder Media object is returned
49
+ * If an error occurs during processing, an error Media object is returned
50
50
  * with an error message.
51
51
  *
52
52
  * @param {Attachment} attachment - The PDF attachment to process.
@@ -1 +1 @@
1
- {"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../attachments.ts"],"names":[],"mappings":"AAGA,OAAO,EAEN,KAAK,aAAa,EAClB,KAAK,KAAK,EAIV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAoEzD;;GAEG;AACH,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,eAAe,CAAiC;IACxD,OAAO,CAAC,OAAO,CAAgB;IAE/B;;;;OAIG;gBACS,OAAO,EAAE,aAAa;IAIlC,OAAO,CAAC,yBAAyB;IAejC;;;;OAIG;IACG,kBAAkB,CACvB,WAAW,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,UAAU,EAAE,GACxD,OAAO,CAAC,KAAK,EAAE,CAAC;IAiBnB;;;;;;;;OAQG;IACG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;OAIG;YACW,wBAAwB;CAYtC"}
package/dist/banner.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Includes tiered permission system for invite URLs
5
5
  */
6
6
  import type { IAgentRuntime } from "@elizaos/core";
7
- import { type DiscordPermissionValues } from "./permissions";
7
+ import { type DiscordPermissionValues } from "./permissions.js";
8
8
  export interface PluginSetting {
9
9
  name: string;
10
10
  value: unknown;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Universal slash-command catalog → Discord native commands.
3
+ *
4
+ * Maps the connector-neutral command catalog from `@elizaos/plugin-commands`
5
+ * (`getConnectorCommands("discord")`) onto the plugin's in-process
6
+ * `SlashCommand` registry so the catalog's navigation + agent-capability
7
+ * commands appear alongside the hand-written Discord built-ins.
8
+ *
9
+ * This is Discord's implementation of the shared `ConnectorCommandBridge`
10
+ * contract (#8790): the same register/dispatch shape and the same auth-gating
11
+ * decision Telegram uses, so both connectors behave consistently.
12
+ *
13
+ * Dedupe decision: the existing Discord built-ins (`help`, `status`, `model`,
14
+ * `settings`, `search`, `clear`, `setup`) already have working, role-gated
15
+ * handlers (some with autocomplete and Discord-specific behavior). To PRESERVE
16
+ * all existing behavior we register only the catalog commands whose sanitized
17
+ * name does NOT already exist in the registry — built-ins always win. This adds
18
+ * the new catalog commands (think, reasoning, views, orchestrator, knowledge,
19
+ * plugins, …) without touching the tested built-in command surface.
20
+ *
21
+ * Per-target dispatch:
22
+ * - `agent` → deterministic commands
23
+ * (help/status/think/model/reset/…) resolve to a local reply
24
+ * via `resolveCommand`; pipeline-owned agent commands route
25
+ * the reconstructed command text through the runtime's message
26
+ * pipeline and reply with the agent's answer.
27
+ * - `navigate` → reply (ephemeral) describing the destination, resolving the
28
+ * `/settings <section>` argument when present.
29
+ * - `client` → GUI/TUI-only behaviors are filtered out of the discord
30
+ * surface upstream; handled defensively with a short reply.
31
+ *
32
+ * Auth gating: `requiresAuth` / `requiresElevated` commands are gated at the
33
+ * connector boundary using the agent's role model (`hasRoleAccess`) — the same
34
+ * mechanism the built-in slash commands use. The Discord sender is mapped to a
35
+ * runtime entity, and a command is refused with a clear reply when the sender
36
+ * is not an owner (for `requiresAuth`) or admin (for `requiresElevated`).
37
+ */
38
+ import { type IAgentRuntime } from "@elizaos/core";
39
+ import { type ConnectorCommand, type ConnectorSenderAuth } from "@elizaos/plugin-commands";
40
+ import type { ChatInputCommandInteraction } from "discord.js";
41
+ import { type SlashCommand } from "./slash-commands.js";
42
+ /**
43
+ * Resolve the Discord sender's trust level using the agent's role model — the
44
+ * same `hasRoleAccess` check the built-in slash commands run. OWNER access
45
+ * satisfies `requiresAuth`; ADMIN access satisfies `requiresElevated`. Role
46
+ * resolution maps the Discord user id through `createUniqueUuid` and reads the
47
+ * canonical-owner / connector-admin whitelist the Discord service populates.
48
+ */
49
+ export declare function resolveDiscordSenderAuth(interaction: ChatInputCommandInteraction, runtime: IAgentRuntime): Promise<ConnectorSenderAuth>;
50
+ /** Map one catalog command onto an in-process `SlashCommand`. */
51
+ export declare function mapCatalogCommand(command: ConnectorCommand): SlashCommand;
52
+ /**
53
+ * Build the catalog commands for the Discord surface, deduped against an
54
+ * existing set of command names (built-ins win). Pure — no side effects.
55
+ */
56
+ export declare function buildCatalogSlashCommands(existingNames?: ReadonlySet<string>, agentId?: string | null): SlashCommand[];
57
+ /**
58
+ * Register the universal catalog commands into the in-process registry and
59
+ * return them. Names already present (built-ins) are skipped so existing
60
+ * behavior is preserved. Called from `onReady` right after the built-ins are
61
+ * registered; the returned commands are folded into the
62
+ * `DISCORD_REGISTER_COMMANDS` payload by `registerSlashCommands`.
63
+ */
64
+ export declare function registerCatalogSlashCommands(runtime: IAgentRuntime): SlashCommand[];
65
+ //# sourceMappingURL=catalog-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-commands.d.ts","sourceRoot":"","sources":["../catalog-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,EAGN,KAAK,aAAa,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EAKxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAE9D,OAAO,EAGN,KAAK,YAAY,EAEjB,MAAM,kBAAkB,CAAC;AAkD1B;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC7C,WAAW,EAAE,2BAA2B,EACxC,OAAO,EAAE,aAAa,GACpB,OAAO,CAAC,mBAAmB,CAAC,CAW9B;AA+ND,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,YAAY,CAQzE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACxC,aAAa,GAAE,WAAW,CAAC,MAAM,CAAa,EAC9C,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACrB,YAAY,EAAE,CAShB;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,aAAa,GACpB,YAAY,EAAE,CAehB"}
package/dist/compat.d.ts CHANGED
@@ -1,25 +1,4 @@
1
- /**
2
- * Runtime compatibility layer for old/new core.
3
- *
4
- * Automatically adds serverId when messageServerId is provided,
5
- * making plugin code work with both core versions unchanged.
6
- *
7
- * Old core expects: serverId (string)
8
- * New core expects: messageServerId (UUID)
9
- *
10
- * NOTE: UUID function usage for Discord IDs:
11
- * - `stringToUuid(str)` - CONVERTS any string to a deterministic UUID by hashing.
12
- * Use this for Discord snowflake IDs (always succeeds, same input = same output).
13
- * - `asUUID(str)` - VALIDATES that string is already a valid UUID format.
14
- * Throws if not a valid UUID. Only use when input is already a UUID.
15
- *
16
- * REMOVAL: Delete this file and remove createCompatRuntime() call in service.ts
17
- */
18
1
  import type { ChannelType, Entity, IAgentRuntime, Metadata, Room, UUID, World } from "@elizaos/core";
19
- /**
20
- * Extended types that support messageServerId for cross-core compatibility.
21
- * These allow TypeScript to accept messageServerId in object literals.
22
- */
23
2
  export type WorldCompat = Omit<World, "serverId"> & {
24
3
  serverId?: string;
25
4
  messageServerId?: UUID;
@@ -44,14 +23,10 @@ export interface EnsureConnectionParams {
44
23
  userId?: UUID;
45
24
  metadata?: Metadata;
46
25
  }
47
- /**
48
- * Extended runtime interface that accepts messageServerId in method parameters.
49
- */
50
26
  export interface ICompatRuntime extends Omit<IAgentRuntime, "ensureWorldExists" | "ensureRoomExists" | "ensureConnection" | "ensureConnections"> {
51
27
  ensureWorldExists(world: WorldCompat): Promise<void>;
52
28
  ensureRoomExists(room: RoomCompat): Promise<void>;
53
29
  ensureConnection(params: EnsureConnectionParams): Promise<void>;
54
30
  ensureConnections(entities: Entity[], rooms: RoomCompat[], source: string, world: WorldCompat): Promise<void>;
55
31
  }
56
- export declare function createCompatRuntime(runtime: IAgentRuntime): ICompatRuntime;
57
32
  //# sourceMappingURL=compat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["../compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EACX,WAAW,EACX,MAAM,EACN,aAAa,EACb,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,MAAM,eAAe,CAAC;AAEvB;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACtC,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,IAAI,CAAC;IACb,Q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AE,UAAU,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,WAAW,GAChB,OAAO,CAAC,IAAI,CAAC,CAAC;CACjB"}
package/dist/config.d.ts CHANGED
@@ -149,7 +149,7 @@ export type DiscordAccountConfig = {
149
149
  pluralkit?: DiscordPluralKitConfig;
150
150
  };
151
151
  export type DiscordChannelConfig = {
152
- /** Optional per-account Discord configuration (multi-account). */
152
+ /** Optional named Discord account configuration records. */
153
153
  accounts?: Record<string, DiscordAccountConfig>;
154
154
  } & DiscordAccountConfig;
155
155
  export type { DiscordChannelConfig as DiscordConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACX,4BAA4B,EAC5B,gCAAgC,EAChC,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,6BAA6B,EAC7B,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,WAAW,EACX,MAAM,eAAe,CAAC;AAMvB,MAAM,MAAM,sBAAsB,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAMF,MAAM,MAAM,eAAe,GAAG;IAC7B,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uDAAuD;IACvD,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACnC,iDAAiD;IACjD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+DAA+D;IAC/D,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CACvC,CAAC;AAMF,MAAM,MAAM,yBAAyB,GAAG;IACvC,KAAK,CAAC,EAAE,OAAO,CA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IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC/B,mDAAmD;IACnD,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,sDAAsD;IACtD,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,2EAA2E;IAC3E,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC3C,sDAAsD;IACtD,SAAS,CAAC,EAAE,gCAAgC,CAAC;IAC7C,8CAA8C;IAC9C,aAAa,CAAC,EAAE,yBAAyB,CAAC;IAC1C,qFAAqF;IACrF,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACnC,CAAC;AAMF,MAAM,MAAM,oBAAoB,GAAG;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAChD,GAAG,oBAAoB,CAAC;AAGzB,YAAY,EAAE,oBAAoB,IAAI,aAAa,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Discord ConnectorAccountManager provider.
3
3
  *
4
- * Adapts the existing multi-account scaffolding in `accounts.ts` to the
4
+ * Adapts the existing multi-account resolution in `accounts.ts` to the
5
5
  * `ConnectorAccountProvider` contract from
6
6
  * `@elizaos/core/connectors/account-manager`.
7
7
  *
@@ -13,8 +13,9 @@
13
13
  *
14
14
  * OAuth: Discord uses bot installation (out-of-band) plus an in-app pairing
15
15
  * flow handled by `owner-pairing-service.ts`. `startOAuth` returns a Discord
16
- * application install URL; `completeOAuth` is a no-op marker because the
17
- * pairing happens via the `/eliza-pair` slash command, not a redirect.
16
+ * application install URL; `completeOAuth` only reports that callback
17
+ * completion is handled through the `/eliza-pair` slash command, not a
18
+ * redirect.
18
19
  */
19
20
  import type { ConnectorAccountProvider, IAgentRuntime } from "@elizaos/core";
20
21
  export declare const DISCORD_PROVIDER_ID = "discord";
@@ -1 +1 @@
1
- {"version":3,"file":"connector-account-provider.d.ts","sourceRoot":"","sources":["../connector-account-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAIX,wBAAwB,EAKxB,aAAa,EACb,MAAM,eAAe,CAAC;AASvB,eAAO,MAAM,mBAAmB,YAAY,CAAC;AA8C7C;;;GAGG;AACH,wBAAgB,qCAAqC,CACpD,OAAO,EAAE,aAAa,GACpB,wBAAwB,CA+F1B"}
1
+ {"version":3,"file":"connector-account-provider.d.ts","sourceRoot":"","sources":["../connector-account-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAIX,wBAAwB,EAKxB,aAAa,EACb,MAAM,eAAe,CAAC;AASvB,eAAO,MAAM,mBAAmB,YAAY,CAAC;AA8C7C;;;GAGG;AACH,wBAAgB,qCAAqC,CACpD,OAAO,EAAE,aAAa,GACpB,wBAAwB,CA+F1B"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Discord local connector post-setup data routes.
3
+ *
4
+ * These endpoints live under `/api/discord/` (not `/api/setup/discord/`)
5
+ * because they're invoked after the connector is authorized to drive the
6
+ * channel-picker UI — they are not part of the setup state machine.
7
+ *
8
+ * GET /api/discord/guilds list guilds the user can manage
9
+ * GET /api/discord/channels list channels for a given guildId
10
+ * POST /api/discord/subscriptions subscribe to a set of channel IDs
11
+ *
12
+ * These routes are registered with `rawPath: true` so they mount at their
13
+ * canonical paths without the plugin-name prefix.
14
+ */
15
+ import type { Route } from "@elizaos/core";
16
+ /**
17
+ * Plugin routes for Discord local post-setup data fetches.
18
+ *
19
+ * These run after the connector is authorized to drive the channel-picker UI.
20
+ */
21
+ export declare const discordDataRoutes: Route[];
22
+ //# sourceMappingURL=data-routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-routes.d.ts","sourceRoot":"","sources":["../data-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAEX,KAAK,EAGL,MAAM,eAAe,CAAC;AA2RvB;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,EAmBpC,CAAC"}
@@ -13,6 +13,20 @@ export interface ChannelDebouncerOptions {
13
13
  getBotUserId?: () => string | undefined;
14
14
  coalesceEnabled?: boolean;
15
15
  maxBatch?: number;
16
+ /**
17
+ * Only when true (strict / mention-only mode) do we carry recent unaddressed
18
+ * messages forward into the next addressed batch. In respond-to-all mode the
19
+ * agent already answers those messages on their own flush, so buffering them
20
+ * would prepend already-handled chatter onto a later addressed turn.
21
+ */
22
+ shouldRespondOnlyToMentions?: boolean;
23
+ /**
24
+ * How long a recent unaddressed message stays eligible to be folded into a
25
+ * following addressed message's "[Recent channel context]". Must be >= the
26
+ * channel debounce window so a just-flushed unaddressed message is still live
27
+ * when the addressed anchor lands a beat later.
28
+ */
29
+ bufferTtlMs?: number;
16
30
  }
17
31
  export interface ChannelDebouncer {
18
32
  enqueue: (message: DiscordMessage) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"debouncer.d.ts","sourceRoot":"","sources":["../debouncer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5D,MAAM,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IA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AQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAkBD,MAAM,WAAW,uBAAuB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACxC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3C,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAOD,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,sBAAsB,EAC/B,OAAO,GAAE,uBAA4B,GACnC,gBAAgB,CAiOlB;AAED,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,sBAAsB,EAC/B,UAAU,GAAE,MAA4B,EACxC,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GACjC,gBAAgB,CA2ElB"}
@@ -1,6 +1,6 @@
1
1
  import type { ApplicationCommandDataResolvable, Guild } from "discord.js";
2
- import type { InteractionServiceInternals } from "./discord-interactions";
3
- import type { DiscordSlashCommand } from "./types";
2
+ import type { InteractionServiceInternals } from "./discord-interactions.js";
3
+ import type { DiscordSlashCommand } from "./types.js";
4
4
  /**
5
5
  * Transforms an ElizaOS slash command to Discord API format.
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"discord-commands.d.ts","sourceRoot":"","sources":["../discord-commands.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACX,gCAAgC,EAEhC,KAAK,EACL,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAM1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD;;GAEG;AACH,wBAAgB,4BAA4B,CAC3C,GAAG,EAAE,mBAAmB,GACtB,gCAAgC,CAwBlC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAKpE;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,2BAA2B,EACpC,KAAK,EAAE,KAAK,GACV,OAAO,CAAC,IAAI,CAAC,CAwFf"}
1
+ {"version":3,"file":"discord-commands.d.ts","sourceRoot":"","sources":["../discord-commands.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACX,gCAAgC,EAEhC,KAAK,EACL,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAM1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD;;GAEG;AACH,wBAAgB,4BAA4B,CAC3C,GAAG,EAAE,mBAAmB,GACtB,gCAAgC,CAwBlC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAKpE;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,2BAA2B,EACpC,KAAK,EAAE,KAAK,GACV,OAAO,CAAC,IAAI,CAAC,CAqFf"}
@@ -7,9 +7,9 @@
7
7
  */
8
8
  import { type ChannelType as ElizaChannelType, type UUID } from "@elizaos/core";
9
9
  import { type Channel, type GuildMember, type Interaction, type Message, type User } from "discord.js";
10
- import { type ChannelDebouncer, type MessageDebouncer } from "./debouncer";
11
- import type { DiscordService } from "./service";
12
- import { type DiscordSlashCommand } from "./types";
10
+ import { type ChannelDebouncer, type MessageDebouncer } from "./debouncer.js";
11
+ import type { DiscordService } from "./service.js";
12
+ import { type DiscordSlashCommand } from "./types.js";
13
13
  /**
14
14
  * Subset of DiscordService fields needed by the event listeners.
15
15
  * Because many of the relevant fields are private, the caller passes
@@ -26,6 +26,7 @@ export interface DiscordServiceInternals {
26
26
  channelDebouncer: ChannelDebouncer | undefined;
27
27
  discordSettings: {
28
28
  shouldIgnoreBotMessages: boolean;
29
+ shouldRespondOnlyToMentions?: boolean;
29
30
  };
30
31
  allowedChannelIds: string[] | undefined;
31
32
  listenChannelIds?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"discord-events.d.ts","sourceRoot":"","sources":["../discord-events.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAEN,KAAK,WAAW,IAAI,gBAAgB,EAEpC,KAAK,IAAI,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAEN,KAAK,OAAO,EAIZ,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,KAAK,gBAAgB,EAGrB,KAAK,gBAAgB,EACrB,MAAM,aAAa,CAAC;AAWrB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAMhD,OAAO,EAIN,KAAK,mBAAmB,EACxB,MAAM,SAAS,CAAC;AAEjB;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,WAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9C,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACnC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,CA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O,YAAY,EAAE,WAAW,GAC3C,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,oBAAoB,CACnB,QAAQ,EACL,OAAO,YAAY,EAAE,eAAe,GACpC,OAAO,YAAY,EAAE,sBAAsB,EAC9C,IAAI,EAAE,IAAI,GAAG,OAAO,YAAY,EAAE,WAAW,GAC3C,OAAO,CAAC,IAAI,CAAC,CAAC;CACjB;AA8FD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG;IAC7E,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,gBAAgB,EAAE,gBAAgB,CAAC;CACnC,CA+5BA"}
@@ -6,10 +6,10 @@
6
6
  */
7
7
  import { ChannelType, type Media, type Memory, type UUID } from "@elizaos/core";
8
8
  import type { Channel, GuildTextBasedChannel, Message } from "discord.js";
9
- import type { ICompatRuntime } from "./compat";
10
- import type { MessageManager } from "./messages";
11
- import type { DiscordService } from "./service";
12
- import type { ChannelHistoryOptions, ChannelHistoryResult, ChannelSpiderState } from "./types";
9
+ import type { ICompatRuntime } from "./compat.js";
10
+ import type { MessageManager } from "./messages.js";
11
+ import type { DiscordService } from "./service.js";
12
+ import type { ChannelHistoryOptions, ChannelHistoryResult, ChannelSpiderState } from "./types.js";
13
13
  /**
14
14
  * Subset of DiscordService fields needed by history functions.
15
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"discord-history.d.ts","sourceRoot":"","sources":["../discord-history.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACN,WAAW,EAGX,KAAK,KAAK,EACV,KAAK,MAAM,EAGX,KAAK,IAAI,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,UAAU,CAAC;AAK5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAA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B,OAAO,EAAE,OAAO,GAAG,IAAI,GACrB,OAAO,IAAI,qBAAqB,CAAC;CACpC;AASD;;GAEG;AACH,wBAAsB,cAAc,CACnC,OAAO,EAAE,uBAAuB,EAChC,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAmCpC;AAED;;GAEG;AACH,wBAAsB,eAAe,CACpC,OAAO,EAAE,uBAAuB,EAChC,KAAK,EAAE,kBAAkB,GACvB,OAAO,CAAC,IAAI,CAAC,CAyNf;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC3C,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE;IACT,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,KAAK,EAAE,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,GACC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAwHxB;AAED;;GAEG;AACH,wBAAsB,4BAA4B,CACjD,OAAO,EAAE,uBAAuB,EAChC,QAAQ,EAAE,OAAO,EAAE,EACnB,gBAAgB,GAAE,GAAG,CAAC,MAAM,CAAa,GACvC,OAAO,CAAC,IAAI,CAAC,CA0Gf;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,uBAAuB,EAChC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,qBAA0B,GACjC,OAAO,CAAC,oBAAoB,CAAC,CA4jB/B"}
@@ -6,9 +6,9 @@
6
6
  */
7
7
  import { ChannelType, type Entity, type Room, type UUID } from "@elizaos/core";
8
8
  import { type Channel, type Client as DiscordClient, type Guild, type Interaction } from "discord.js";
9
- import type { ICompatRuntime } from "./compat";
10
- import type { DiscordService } from "./service";
11
- import { type DiscordSettings, type DiscordSlashCommand } from "./types";
9
+ import type { ICompatRuntime } from "./compat.js";
10
+ import type { DiscordService } from "./service.js";
11
+ import { type DiscordSettings, type DiscordSlashCommand } from "./types.js";
12
12
  /**
13
13
  * Subset of DiscordService fields needed by interaction handling.
14
14
  */