@elizaos/plugin-discord 2.0.0-beta.2 → 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 +29 -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/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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-discord",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.3-beta.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,6 +17,12 @@
17
17
  "types": "./dist/index.d.ts",
18
18
  "import": "./dist/index.js",
19
19
  "default": "./dist/index.js"
20
+ },
21
+ "./*.css": "./dist/*.css",
22
+ "./*": {
23
+ "types": "./dist/*.d.ts",
24
+ "import": "./dist/*.js",
25
+ "default": "./dist/*.js"
20
26
  }
21
27
  },
22
28
  "files": [
@@ -29,29 +35,42 @@
29
35
  "build": "bun run build.ts",
30
36
  "build:ts": "bun run build.ts",
31
37
  "dev": "bun --hot build.ts",
32
- "clean": "rm -rf dist .turbo && find . \\( -path ./dist -o -path ./node_modules \\) -prune -o -type f -name '*.ts' -print | while IFS= read -r ts; do b=\"${ts%.ts}\"; rm -f \"$b.d.ts\" \"$b.d.ts.map\"; done",
38
+ "clean": "rm -rf dist .turbo && node ../../packages/scripts/clean-stray-dts.mjs",
33
39
  "test": "vitest run",
34
40
  "typecheck": "tsc --noEmit",
35
- "lint": "../../node_modules/.bin/biome check --write --unsafe .",
36
- "lint:check": "../../node_modules/.bin/biome check .",
37
- "format": "../../node_modules/.bin/biome format --write .",
38
- "format:check": "../../node_modules/.bin/biome format .",
41
+ "lint": "bunx @biomejs/biome check --write --unsafe .",
42
+ "lint:check": "bunx @biomejs/biome check .",
43
+ "format": "bunx @biomejs/biome format --write .",
44
+ "format:check": "bunx @biomejs/biome format .",
39
45
  "test:e2e": "node ../../packages/app-core/scripts/run-local-plugin-live-smoke.mjs",
40
46
  "test:live": "bun run test:e2e"
41
47
  },
42
48
  "dependencies": {
49
+ "@discordjs/builders": "^1.14.1",
50
+ "@discordjs/collection": "2.1.1",
51
+ "@discordjs/formatters": "^0.6.2",
52
+ "@discordjs/opus": "^0.10.0",
43
53
  "@discordjs/rest": "^2.6.1",
54
+ "@discordjs/util": "^1.2.0",
44
55
  "@discordjs/voice": "^0.19.2",
45
- "@elizaos/core": "2.0.0-beta.1",
46
- "@elizaos/plugin-browser": "2.0.0-beta.1",
56
+ "@discordjs/ws": "^1.2.3",
57
+ "@elizaos/core": "2.0.3-beta.2",
58
+ "@elizaos/plugin-browser": "2.0.3-beta.2",
59
+ "@elizaos/plugin-commands": "2.0.3-beta.2",
60
+ "@sapphire/snowflake": "3.5.5",
47
61
  "discord-api-types": "^0.38.0",
48
62
  "discord.js": "^14.26.4",
63
+ "fast-deep-equal": "3.1.3",
49
64
  "fast-levenshtein": "^3.0.0",
50
65
  "fluent-ffmpeg": "^2.1.3",
51
66
  "get-func-name": "^3.0.0",
52
67
  "libsodium-wrappers": "^0.8.0",
68
+ "lodash.snakecase": "4.1.1",
69
+ "magic-bytes.js": "^1.13.0",
53
70
  "opusscript": "^0.1.1",
54
71
  "prism-media": "1.3.5",
72
+ "tslib": "^2.6.3",
73
+ "undici": "8.5.0",
55
74
  "zod": "^4.4.3"
56
75
  },
57
76
  "devDependencies": {
@@ -61,7 +80,7 @@
61
80
  "vitest": "^4.1.4"
62
81
  },
63
82
  "peerDependencies": {
64
- "@elizaos/core": "2.0.0-beta.1"
83
+ "@elizaos/core": "2.0.3-beta.2"
65
84
  },
66
85
  "publishConfig": {
67
86
  "access": "public"
@@ -134,5 +153,5 @@
134
153
  "node": "Default export (Node.js)"
135
154
  }
136
155
  },
137
- "gitHead": "05d4ca11d769db8c7f54a722ee24b2ce2b951543"
156
+ "gitHead": "82fe0f44215954c2417328203f5bd6510985c1fc"
138
157
  }
@@ -1,35 +0,0 @@
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";
7
- export interface DiscordAccountClientState {
8
- accountId: string;
9
- account: ResolvedDiscordAccount;
10
- client: DiscordJsClient | null;
11
- settings: DiscordSettings;
12
- allowedChannelIds?: string[];
13
- listenChannelIds?: string[];
14
- dynamicChannelIds: Set<string>;
15
- clientReadyPromise: Promise<void> | null;
16
- loginFailed: boolean;
17
- messageManager?: MessageManager;
18
- voiceManager?: VoiceManager;
19
- messageDebouncer?: MessageDebouncer;
20
- channelDebouncer?: ChannelDebouncer;
21
- }
22
- export declare class DiscordAccountClientPool {
23
- private defaultAccountId;
24
- private readonly clients;
25
- constructor(defaultAccountId?: string);
26
- setDefaultAccountId(accountId: string): void;
27
- getDefaultAccountId(): string;
28
- set(state: DiscordAccountClientState): void;
29
- get(accountId?: string | null): DiscordAccountClientState | null;
30
- getDefault(): DiscordAccountClientState | null;
31
- list(): DiscordAccountClientState[];
32
- listAccountIds(): string[];
33
- clear(): void;
34
- }
35
- //# sourceMappingURL=account-client-pool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"account-client-pool.d.ts","sourceRoot":"","sources":["../account-client-pool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAGN,KAAK,sBAAsB,EAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,yBAAyB;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,sBAAsB,CAAC;IAChC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,kBAAkB,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACzC,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACpC;AAED,qBAAa,wBAAwB;IACpC,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgD;gBAE5D,gBAAgB,SAAqB;IAIjD,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAI5C,mBAAmB,IAAI,MAAM;IAI7B,GAAG,CAAC,KAAK,EAAE,yBAAyB,GAAG,IAAI;IAM3C,GAAG,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,yBAAyB,GAAG,IAAI;IAKhE,UAAU,IAAI,yBAAyB,GAAG,IAAI;IAI9C,IAAI,IAAI,yBAAyB,EAAE;IAInC,cAAc,IAAI,MAAM,EAAE;IAI1B,KAAK,IAAI,IAAI;CAGb"}
@@ -1,164 +0,0 @@
1
- import type { IAgentRuntime } from "@elizaos/core";
2
- /**
3
- * Default account identifier used when no specific account is configured
4
- */
5
- export declare const DEFAULT_ACCOUNT_ID = "default";
6
- /**
7
- * Source of the Discord token
8
- */
9
- export type DiscordTokenSource = "env" | "config" | "character" | "none";
10
- /**
11
- * Result of token resolution
12
- */
13
- export interface DiscordTokenResolution {
14
- token: string;
15
- source: DiscordTokenSource;
16
- }
17
- /**
18
- * Configuration for a single Discord account
19
- */
20
- export interface DiscordAccountConfig {
21
- /** Optional display name for this account */
22
- name?: string;
23
- /** If false, do not start this Discord account */
24
- enabled?: boolean;
25
- /** Discord bot token for this account */
26
- token?: string;
27
- /** Allow bot-authored messages to trigger replies */
28
- allowBots?: boolean;
29
- /** Controls how guild channel messages are handled */
30
- groupPolicy?: "open" | "disabled" | "allowlist";
31
- /** Outbound text chunk size (chars) */
32
- textChunkLimit?: number;
33
- /** Max lines per message */
34
- maxLinesPerMessage?: number;
35
- /** Max media size in MB */
36
- mediaMaxMb?: number;
37
- /** History limit for context */
38
- historyLimit?: number;
39
- /** Max DM turns to keep as history context */
40
- dmHistoryLimit?: number;
41
- /** DM configuration */
42
- dm?: DiscordDmConfig;
43
- /** Per-guild configuration */
44
- guilds?: Record<string, DiscordGuildEntry>;
45
- /** Channel IDs to allow */
46
- channelIds?: string[];
47
- /** Listen-only channel IDs */
48
- listenChannelIds?: string[];
49
- /** Whether to ignore bot messages */
50
- shouldIgnoreBotMessages?: boolean;
51
- /** Whether to ignore direct messages */
52
- shouldIgnoreDirectMessages?: boolean;
53
- /** Whether to respond only to mentions */
54
- shouldRespondOnlyToMentions?: boolean;
55
- }
56
- /**
57
- * DM-specific configuration
58
- */
59
- export interface DiscordDmConfig {
60
- /** If false, ignore all incoming Discord DMs */
61
- enabled?: boolean;
62
- /** Direct message access policy */
63
- policy?: "open" | "disabled" | "allowlist" | "pairing";
64
- /** Allowlist for DM senders (ids or names) */
65
- allowFrom?: Array<string | number>;
66
- /** If true, allow group DMs */
67
- groupEnabled?: boolean;
68
- /** Optional allowlist for group DM channels */
69
- groupChannels?: Array<string | number>;
70
- }
71
- /**
72
- * Channel-specific configuration within a guild
73
- */
74
- export interface DiscordGuildChannelConfig {
75
- /** Whether this channel is allowed */
76
- allow?: boolean;
77
- /** Require bot mention to respond */
78
- requireMention?: boolean;
79
- /** Skills to load for this channel */
80
- skills?: string[];
81
- /** If false, disable the bot for this channel */
82
- enabled?: boolean;
83
- /** Allowlist for channel senders */
84
- users?: Array<string | number>;
85
- /** System prompt snippet for this channel */
86
- systemPrompt?: string;
87
- /** Auto-create threads for replies */
88
- autoThread?: boolean;
89
- }
90
- /**
91
- * Guild-level configuration
92
- */
93
- export interface DiscordGuildEntry {
94
- /** Guild slug for name-based matching */
95
- slug?: string;
96
- /** Require bot mention to respond */
97
- requireMention?: boolean;
98
- /** Reaction notification mode */
99
- reactionNotifications?: "off" | "own" | "all" | "allowlist";
100
- /** Allowlist for guild users */
101
- users?: Array<string | number>;
102
- /** Per-channel configuration */
103
- channels?: Record<string, DiscordGuildChannelConfig>;
104
- }
105
- /**
106
- * Multi-account Discord configuration structure
107
- */
108
- export interface DiscordMultiAccountConfig {
109
- /** Default/base configuration applied to all accounts */
110
- enabled?: boolean;
111
- token?: string;
112
- /** Per-account configuration overrides */
113
- accounts?: Record<string, DiscordAccountConfig>;
114
- }
115
- /**
116
- * Resolved Discord account with all configuration merged
117
- */
118
- export interface ResolvedDiscordAccount {
119
- accountId: string;
120
- enabled: boolean;
121
- name?: string;
122
- token: string;
123
- tokenSource: DiscordTokenSource;
124
- config: DiscordAccountConfig;
125
- }
126
- /**
127
- * Normalizes an account ID, returning the default if not provided
128
- */
129
- export declare function normalizeAccountId(accountId?: string | null): string;
130
- /**
131
- * Normalizes a Discord token by trimming and removing "Bot " prefix
132
- */
133
- export declare function normalizeDiscordToken(raw?: string | null): string | undefined;
134
- /**
135
- * Gets the multi-account configuration from runtime settings
136
- */
137
- export declare function getMultiAccountConfig(runtime: IAgentRuntime): DiscordMultiAccountConfig;
138
- /**
139
- * Lists all configured account IDs
140
- */
141
- export declare function listDiscordAccountIds(runtime: IAgentRuntime): string[];
142
- /**
143
- * Resolves the default account ID to use
144
- */
145
- export declare function resolveDefaultDiscordAccountId(runtime: IAgentRuntime): string;
146
- /**
147
- * Resolves the Discord token for a specific account
148
- */
149
- export declare function resolveDiscordToken(runtime: IAgentRuntime, opts?: {
150
- accountId?: string | null;
151
- }): DiscordTokenResolution;
152
- /**
153
- * Resolves a complete Discord account configuration
154
- */
155
- export declare function resolveDiscordAccount(runtime: IAgentRuntime, accountId?: string | null): ResolvedDiscordAccount;
156
- /**
157
- * Lists all enabled Discord accounts
158
- */
159
- export declare function listEnabledDiscordAccounts(runtime: IAgentRuntime): ResolvedDiscordAccount[];
160
- /**
161
- * Checks if multi-account mode is enabled
162
- */
163
- export declare function isMultiAccountEnabled(runtime: IAgentRuntime): boolean;
164
- //# sourceMappingURL=accounts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,WAAW,GAAG,MAAM,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,kBAAkB,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;IAChD,uCAAuC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4BAA4B;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB;IACvB,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC3C,2BAA2B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E;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,GACtC,sBAAsB,CAiCxB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,aAAa,EACtB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,sBAAsB,CAqBxB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACzC,OAAO,EAAE,aAAa,GACpB,sBAAsB,EAAE,CAI1B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAGrE"}
@@ -1,9 +0,0 @@
1
- import type { ActionResult } from "@elizaos/core";
2
- type ActionResultData = NonNullable<ActionResult["data"]>;
3
- export declare const terminalActionInteractionSemantics: {
4
- readonly suppressPostActionContinuation: true;
5
- readonly suppressActionResultClipboard: true;
6
- };
7
- export declare function terminalActionResultData(data?: ActionResultData): ActionResultData;
8
- export {};
9
- //# sourceMappingURL=actionResultSemantics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actionResultSemantics.d.ts","sourceRoot":"","sources":["../../actions/actionResultSemantics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,KAAK,gBAAgB,GAAG,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;AAE1D,eAAO,MAAM,kCAAkC;;;CAGrC,CAAC;AAEX,wBAAgB,wBAAwB,CACvC,IAAI,GAAE,gBAAqB,GACzB,gBAAgB,CAMlB"}
@@ -1,25 +0,0 @@
1
- import { type Action } from "@elizaos/core";
2
- export interface CredentialPreset {
3
- name: string;
4
- displayName: string;
5
- fields: CredentialField[];
6
- helpUrl: string;
7
- helpText: string;
8
- validate: (credentials: Record<string, string>) => Promise<{
9
- valid: boolean;
10
- identity?: string;
11
- error?: string;
12
- }>;
13
- }
14
- export interface CredentialField {
15
- key: string;
16
- label: string;
17
- secret: boolean;
18
- }
19
- export declare function registerPreset(preset: CredentialPreset): void;
20
- export declare function getPreset(name: string): CredentialPreset | undefined;
21
- export declare function listPresets(): string[];
22
- export declare function loadCredentials(service: string): Record<string, string> | null;
23
- export declare const setupCredentials: Action;
24
- export default setupCredentials;
25
- //# sourceMappingURL=setup-credentials.d.ts.map
@@ -1 +0,0 @@
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,15 +0,0 @@
1
- /**
2
- * Discord-native addressing helper.
3
- *
4
- * A bot can be mentioned as the subject of a message addressed to someone else.
5
- * Connector routing should only treat the bot as directly addressed when the
6
- * platform facts say so: the message replies to the bot, or the first user
7
- * mention in the raw Discord content is the bot.
8
- */
9
- export declare function isDiscordUserAddressed({ text, userId, hasMessageReference, repliedUserId, }: {
10
- text?: string | null;
11
- userId?: string | null;
12
- hasMessageReference?: boolean;
13
- repliedUserId?: string | null;
14
- }): boolean;
15
- //# sourceMappingURL=addressing.d.ts.map
@@ -1 +0,0 @@
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"}