@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
@@ -1,10 +0,0 @@
1
- export declare function isDiscordAvatarUrl(url: string): boolean;
2
- export declare function getDiscordAvatarCacheDir(): string;
3
- export declare function getDiscordAvatarPublicPath(fileName: string): string;
4
- export declare function getDiscordAvatarCachePath(fileName: string): string;
5
- export declare function buildDiscordAvatarCacheFileName(url: string, userId?: string): string;
6
- export declare function cacheDiscordAvatarUrl(url: string | undefined, options?: {
7
- fetchImpl?: typeof fetch;
8
- userId?: string;
9
- }): Promise<string | undefined>;
10
- //# sourceMappingURL=discord-avatar-cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discord-avatar-cache.d.ts","sourceRoot":"","sources":["../discord-avatar-cache.ts"],"names":[],"mappings":"AAuDA,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAUvD;AAED,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,+BAA+B,CAC9C,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,GACb,MAAM,CAWR;AAED,wBAAsB,qBAAqB,CAC1C,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,OAAO,GAAE;IACR,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACX,GACJ,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAqF7B"}
@@ -1,16 +0,0 @@
1
- import type { ApplicationCommandDataResolvable, Guild } from "discord.js";
2
- import type { InteractionServiceInternals } from "./discord-interactions";
3
- import type { DiscordSlashCommand } from "./types";
4
- /**
5
- * Transforms an ElizaOS slash command to Discord API format.
6
- */
7
- export declare function transformCommandToDiscordApi(cmd: DiscordSlashCommand): ApplicationCommandDataResolvable;
8
- /**
9
- * Checks if a command is guild-only.
10
- */
11
- export declare function isGuildOnlyCommand(cmd: DiscordSlashCommand): boolean;
12
- /**
13
- * Handles the event when the bot joins a guild.
14
- */
15
- export declare function handleGuildCreate(service: InteractionServiceInternals, guild: Guild): Promise<void>;
16
- //# sourceMappingURL=discord-commands.d.ts.map
@@ -1 +0,0 @@
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,56 +0,0 @@
1
- /**
2
- * Discord event listener setup — extracted from service.ts
3
- *
4
- * Contains the body of `setupEventListeners()`: all `client.on(...)` registrations
5
- * for messageCreate, reactions, guild events, interactions, voice streams,
6
- * and permission audit events.
7
- */
8
- import { type ChannelType as ElizaChannelType, type UUID } from "@elizaos/core";
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";
13
- /**
14
- * Subset of DiscordService fields needed by the event listeners.
15
- * Because many of the relevant fields are private, the caller passes
16
- * `this as DiscordServiceInternals`.
17
- */
18
- export interface DiscordServiceInternals {
19
- accountId?: string;
20
- client: NonNullable<DiscordService["client"]>;
21
- runtime: DiscordService["runtime"];
22
- character: DiscordService["character"];
23
- messageManager: DiscordService["messageManager"];
24
- voiceManager: DiscordService["voiceManager"];
25
- messageDebouncer: MessageDebouncer | undefined;
26
- channelDebouncer: ChannelDebouncer | undefined;
27
- discordSettings: {
28
- shouldIgnoreBotMessages: boolean;
29
- };
30
- allowedChannelIds: string[] | undefined;
31
- listenChannelIds?: string[];
32
- allowAllSlashCommands: Set<string>;
33
- slashCommands: DiscordSlashCommand[];
34
- timeouts: ReturnType<typeof setTimeout>[];
35
- userSelections: Map<string, Record<string, unknown>>;
36
- isChannelAllowed(channelId: string): boolean;
37
- resolveDiscordEntityId(userId: string): UUID;
38
- buildMemoryFromMessage(message: Message): Promise<import("@elizaos/core").Memory | null>;
39
- getChannelType(channel: Channel): Promise<ElizaChannelType>;
40
- handleInteractionCreate(interaction: Interaction): Promise<void>;
41
- handleGuildCreate(guild: import("discord.js").Guild): Promise<void>;
42
- handleGuildMemberAdd(member: GuildMember): Promise<void>;
43
- handleReactionAdd(reaction: import("discord.js").MessageReaction | import("discord.js").PartialMessageReaction, user: User | import("discord.js").PartialUser): Promise<void>;
44
- handleReactionRemove(reaction: import("discord.js").MessageReaction | import("discord.js").PartialMessageReaction, user: User | import("discord.js").PartialUser): Promise<void>;
45
- }
46
- /**
47
- * Wire up all Discord.js event listeners on `service.client`.
48
- *
49
- * Returns the created debouncers so the caller can store them on the service
50
- * instance (they must be destroyed on stop).
51
- */
52
- export declare function setupDiscordEventListeners(service: DiscordServiceInternals): {
53
- messageDebouncer: MessageDebouncer;
54
- channelDebouncer: ChannelDebouncer;
55
- };
56
- //# sourceMappingURL=discord-events.d.ts.map
@@ -1 +0,0 @@
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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,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IAClD,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC5D,uBAAuB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,iBAAiB,CAAC,KAAK,EAAE,OAAO,YAAY,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,iBAAiB,CAChB,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;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;AAoED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG;IAC7E,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,gBAAgB,EAAE,gBAAgB,CAAC;CACnC,CA+4BA"}
@@ -1,56 +0,0 @@
1
- /**
2
- * Discord message history / spidering — extracted from service.ts
3
- *
4
- * Contains fetchChannelHistory(), getSpiderState(), saveSpiderState(),
5
- * buildMemoryFromMessage(), ensureConnectionsForMessages().
6
- */
7
- import { ChannelType, type Media, type Memory, type UUID } from "@elizaos/core";
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";
13
- /**
14
- * Subset of DiscordService fields needed by history functions.
15
- */
16
- export interface HistoryServiceInternals {
17
- accountId?: string;
18
- client: NonNullable<DiscordService["client"]>;
19
- runtime: ICompatRuntime;
20
- messageManager: MessageManager | undefined;
21
- resolveDiscordEntityId(userId: string): UUID;
22
- getChannelType(channel: Channel): Promise<ChannelType>;
23
- isGuildTextBasedChannel(channel: Channel | null): channel is GuildTextBasedChannel;
24
- }
25
- /**
26
- * Get spider state for a channel from the database.
27
- */
28
- export declare function getSpiderState(service: HistoryServiceInternals, channelId: string): Promise<ChannelSpiderState | null>;
29
- /**
30
- * Save spider state for a channel to the database.
31
- */
32
- export declare function saveSpiderState(service: HistoryServiceInternals, state: ChannelSpiderState): Promise<void>;
33
- /**
34
- * Builds a Memory object from a Discord Message.
35
- */
36
- export declare function buildMemoryFromMessage(service: HistoryServiceInternals, message: Message, options?: {
37
- processedContent?: string;
38
- processedAttachments?: Media[];
39
- extraContent?: Record<string, unknown>;
40
- extraMetadata?: Record<string, unknown>;
41
- /**
42
- * Connector account ID this message arrived on. Stamped into
43
- * `Memory.metadata.accountId` so downstream actions (and policy
44
- * evaluation) can route outbound replies through the same account.
45
- */
46
- accountId?: string;
47
- }): Promise<Memory | null>;
48
- /**
49
- * Ensures entity connections exist for a batch of Discord messages using batch API.
50
- */
51
- export declare function ensureConnectionsForMessages(service: HistoryServiceInternals, messages: Message[], ensuredEntityIds?: Set<string>): Promise<void>;
52
- /**
53
- * Fetches and persists message history from a Discord channel.
54
- */
55
- export declare function fetchChannelHistory(service: HistoryServiceInternals, channelId: string, options?: ChannelHistoryOptions): Promise<ChannelHistoryResult>;
56
- //# sourceMappingURL=discord-history.d.ts.map
@@ -1 +0,0 @@
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,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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"}
@@ -1,47 +0,0 @@
1
- /**
2
- * Discord interaction handling — extracted from service.ts
3
- *
4
- * Contains handleInteractionCreate(), buildStandardizedRooms(),
5
- * buildStandardizedUsers(), and onReady().
6
- */
7
- import { ChannelType, type Entity, type Room, type UUID } from "@elizaos/core";
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";
12
- /**
13
- * Subset of DiscordService fields needed by interaction handling.
14
- */
15
- export interface InteractionServiceInternals {
16
- accountId?: string;
17
- accountToken?: string;
18
- client: NonNullable<DiscordService["client"]>;
19
- runtime: ICompatRuntime;
20
- character: DiscordService["character"];
21
- slashCommands: DiscordSlashCommand[];
22
- userSelections: Map<string, Record<string, unknown>>;
23
- timeouts: ReturnType<typeof setTimeout>[];
24
- discordSettings: DiscordSettings;
25
- clientReadyPromise: Promise<void> | null;
26
- resolveDiscordEntityId(userId: string): UUID;
27
- getChannelType(channel: Channel): Promise<ChannelType>;
28
- registerSlashCommands(commands: DiscordSlashCommand[]): Promise<void>;
29
- refreshOwnerDiscordUserIds(client: DiscordClient): Promise<void>;
30
- }
31
- /**
32
- * Handles interactions created by the user (commands, message components).
33
- */
34
- export declare function handleInteractionCreate(service: InteractionServiceInternals, interaction: Interaction): Promise<void>;
35
- /**
36
- * Builds a standardized list of rooms from Discord guild channels.
37
- */
38
- export declare function buildStandardizedRooms(service: InteractionServiceInternals, guild: Guild, _worldId: UUID): Promise<Room[]>;
39
- /**
40
- * Builds a standardized list of users (entities) from Discord guild members.
41
- */
42
- export declare function buildStandardizedUsers(service: InteractionServiceInternals, guild: Guild): Promise<Entity[]>;
43
- /**
44
- * Handles tasks to be performed once the Discord client is fully ready.
45
- */
46
- export declare function onReady(service: InteractionServiceInternals, readyClient: DiscordClient<true>): Promise<void>;
47
- //# sourceMappingURL=discord-interactions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discord-interactions.d.ts","sourceRoot":"","sources":["../discord-interactions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACN,WAAW,EAEX,KAAK,MAAM,EAGX,KAAK,IAAI,EAET,KAAK,IAAI,EAET,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,KAAK,OAAO,EAEZ,KAAK,MAAM,IAAI,aAAa,EAC5B,KAAK,KAAK,EAEV,KAAK,WAAW,EAGhB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAO/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAGN,KAAK,eAAe,EACpB,KAAK,mBAAmB,EAExB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,WAAW,CAAC,cAAc,CAAC,QAAQ,CAA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 +0,0 @@
1
- /**
2
- * Discord local IPC connector.
3
- *
4
- * Connects to the Discord desktop app via the local RPC socket, enabling
5
- * message ingestion and macOS UI-automation-based replies. Previously
6
- * lived in `@elizaos/agent` as `discord-local-plugin.ts`; moved here so
7
- * the Discord plugin package owns its own runtime service.
8
- */
9
- import { type IAgentRuntime, type Plugin, Service } from "@elizaos/core";
10
- export declare const DISCORD_LOCAL_PLUGIN_NAME = "@elizaos/plugin-discord-local";
11
- export declare const DISCORD_LOCAL_SERVICE_NAME = "discord-local";
12
- type DiscordLocalUser = {
13
- id: string;
14
- username: string;
15
- global_name?: string | null;
16
- avatar?: string | null;
17
- };
18
- type DiscordLocalChannel = {
19
- id: string;
20
- guild_id?: string | null;
21
- type?: number;
22
- name?: string | null;
23
- recipients?: DiscordLocalUser[];
24
- };
25
- type DiscordLocalGuild = {
26
- id: string;
27
- name: string;
28
- };
29
- export declare class DiscordLocalService extends Service {
30
- static serviceType: string;
31
- capabilityDescription: string;
32
- private readonly sessionPath;
33
- private readonly pendingRequests;
34
- private readonly channelCache;
35
- private readonly guildCache;
36
- private readonly subscribedChannelIds;
37
- private connectorConfig;
38
- private socket;
39
- private connectedIpcPath;
40
- private readBuffer;
41
- private readyPromise;
42
- private readyResolve;
43
- private readyReject;
44
- private reconnectTimer;
45
- private session;
46
- private currentUser;
47
- private connected;
48
- private authenticated;
49
- private lastError;
50
- constructor(runtime?: IAgentRuntime);
51
- static start(runtime: IAgentRuntime): Promise<DiscordLocalService>;
52
- static registerSendHandlers(runtime: IAgentRuntime, service: DiscordLocalService): void;
53
- stop(): Promise<void>;
54
- isConnected(): boolean;
55
- isAuthenticated(): boolean;
56
- getStatus(): {
57
- available: boolean;
58
- connected: boolean;
59
- authenticated: boolean;
60
- currentUser: DiscordLocalUser;
61
- subscribedChannelIds: string[];
62
- configuredChannelIds: string[];
63
- scopes: string[];
64
- lastError: string;
65
- ipcPath: string;
66
- };
67
- authorize(): Promise<ReturnType<DiscordLocalService["getStatus"]>>;
68
- disconnectSession(): Promise<void>;
69
- listGuilds(): Promise<DiscordLocalGuild[]>;
70
- listChannels(guildId: string): Promise<DiscordLocalChannel[]>;
71
- subscribeChannelMessages(channelIds: string[]): Promise<string[]>;
72
- getChannel(channelId: string): Promise<DiscordLocalChannel | null>;
73
- private requireConfig;
74
- private startService;
75
- private ensureAuthenticated;
76
- private subscribeNotifications;
77
- private subscribeConfiguredChannels;
78
- private exchangeAuthorizationCode;
79
- private refreshAccessToken;
80
- private storeTokenResponse;
81
- private loadSession;
82
- private ensureRpcConnection;
83
- private scheduleReconnect;
84
- private handleSocketData;
85
- private handleRpcPayload;
86
- private writeFrame;
87
- private sendRpcCommand;
88
- private rejectPendingRequests;
89
- private ingestMessage;
90
- private sendUiMessage;
91
- }
92
- declare const discordLocalPlugin: Plugin;
93
- export default discordLocalPlugin;
94
- //# sourceMappingURL=discord-local-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discord-local-service.d.ts","sourceRoot":"","sources":["../discord-local-service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,OAAO,EAKN,KAAK,aAAa,EAKlB,KAAK,MAAM,EAEX,OAAO,EAGP,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,yBAAyB,kCAAkC,CAAC;AACzE,eAAO,MAAM,0BAA0B,kBAAkB,CAAC;AAkC1D,KAAK,gBAAgB,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU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mB,CAAC,WAAW,CAAC,CAAC,CAAC;IAsBlE,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IASlC,UAAU,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAc1C,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAgB7D,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAmCjE,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAmBxE,OAAO,CAAC,aAAa;YAUP,YAAY;YAoBZ,mBAAmB;YAoCnB,sBAAsB;YAOtB,2BAA2B;YAe3B,yBAAyB;YA2BzB,kBAAkB;YA4BlB,kBAAkB;YAyClB,WAAW;YA4BX,mBAAmB;IAkEjC,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,gBAAgB;IA+BxB,OAAO,CAAC,gBAAgB;IA8DxB,OAAO,CAAC,UAAU;YAWJ,cAAc;IAwC5B,OAAO,CAAC,qBAAqB;YAOf,aAAa;YA0Hb,aAAa;CAgB3B;AAED,QAAA,MAAM,kBAAkB,EAAE,MAKzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,26 +0,0 @@
1
- import { type AgentRuntime, type Room } from "@elizaos/core";
2
- type DiscordUserProfile = {
3
- avatarUrl?: string;
4
- displayName?: string;
5
- username?: string;
6
- };
7
- type DiscordMessageAuthorProfile = DiscordUserProfile & {
8
- rawUserId?: string;
9
- };
10
- type StoredDiscordEntityProfile = {
11
- avatarUrl?: string;
12
- displayName?: string;
13
- rawUserId?: string;
14
- username?: string;
15
- };
16
- export declare function isCanonicalDiscordSource(source: string | null | undefined): boolean;
17
- export declare function cacheDiscordAvatarForRuntime(runtime: AgentRuntime, avatarUrl: string | undefined, userId?: string): Promise<string | undefined>;
18
- export declare function resolveStoredDiscordEntityProfile(runtime: AgentRuntime, entityId: string | undefined): Promise<StoredDiscordEntityProfile | null>;
19
- export declare function resolveDiscordMessageAuthorProfile(runtime: AgentRuntime, channelId: string, messageId: string): Promise<DiscordMessageAuthorProfile | null>;
20
- export declare function resolveDiscordUserProfile(runtime: AgentRuntime, userId: string): Promise<DiscordUserProfile | null>;
21
- export declare function resolveDiscordRoomProfile(runtime: AgentRuntime, room: Room | undefined, channelIdHint?: string): Promise<{
22
- avatarUrl?: string;
23
- title: string | null;
24
- } | null>;
25
- export {};
26
- //# sourceMappingURL=discord-profiles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discord-profiles.d.ts","sourceRoot":"","sources":["../discord-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,YAAY,EAEjB,KAAK,IAAI,EAET,MAAM,eAAe,CAAC;AAGvB,KAAK,kBAAkB,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,2BAA2B,GAAG,kBAAkB,GAAG;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,0BAA0B,GAAG;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AA6KF,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,OAAO,CAET;AAED,wBAAsB,4BAA4B,CACjD,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAK7B;AAED,wBAAsB,iCAAiC,CACtD,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAkB5C;AAED,wBAAsB,kCAAkC,CACvD,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAqE7C;AAED,wBAAsB,yBAAyB,CAC9C,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAgCpC;AAED,wBAAsB,yBAAyB,CAC9C,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,aAAa,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAAC,CA2C9D"}
@@ -1,30 +0,0 @@
1
- /**
2
- * Discord reaction handling — extracted from service.ts
3
- *
4
- * Contains handleReaction(), handleReactionAdd(), handleReactionRemove().
5
- */
6
- import { type ChannelType, type UUID } from "@elizaos/core";
7
- import type { Channel, MessageReaction, PartialMessageReaction, PartialUser, User } from "discord.js";
8
- import type { DiscordService } from "./service";
9
- /**
10
- * Subset of DiscordService fields needed by reaction handlers.
11
- */
12
- export interface ReactionServiceInternals {
13
- accountId?: string;
14
- runtime: DiscordService["runtime"];
15
- resolveDiscordEntityId(userId: string): UUID;
16
- getChannelType(channel: Channel): Promise<ChannelType>;
17
- }
18
- /**
19
- * Generic handler for reaction events (add/remove).
20
- */
21
- export declare function handleReaction(service: ReactionServiceInternals, reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser, type: "add" | "remove"): Promise<void>;
22
- /**
23
- * Handles reaction addition.
24
- */
25
- export declare function handleReactionAdd(service: ReactionServiceInternals, reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser): Promise<void>;
26
- /**
27
- * Handles reaction removal.
28
- */
29
- export declare function handleReactionRemove(service: ReactionServiceInternals, reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser): Promise<void>;
30
- //# sourceMappingURL=discord-reactions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discord-reactions.d.ts","sourceRoot":"","sources":["../discord-reactions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACN,KAAK,WAAW,EAOhB,KAAK,IAAI,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACX,OAAO,EACP,eAAe,EACf,sBAAsB,EACtB,WAAW,EAEX,IAAI,EACJ,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACnC,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CACvD;AAED;;GAEG;AACH,wBAAsB,cAAc,CACnC,OAAO,EAAE,wBAAwB,EACjC,QAAQ,EAAE,eAAe,GAAG,sBAAsB,EAClD,IAAI,EAAE,IAAI,GAAG,WAAW,EACxB,IAAI,EAAE,KAAK,GAAG,QAAQ,GACpB,OAAO,CAAC,IAAI,CAAC,CAoMf;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,wBAAwB,EACjC,QAAQ,EAAE,eAAe,GAAG,sBAAsB,EAClD,IAAI,EAAE,IAAI,GAAG,WAAW,GACtB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,wBAAwB,EACjC,QAAQ,EAAE,eAAe,GAAG,sBAAsB,EAClD,IAAI,EAAE,IAAI,GAAG,WAAW,GACtB,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -1,9 +0,0 @@
1
- export type BreakPreference = "paragraph" | "newline" | "sentence";
2
- export interface DraftChunkConfig {
3
- minChars: number;
4
- maxChars: number;
5
- breakPreference: BreakPreference;
6
- }
7
- export declare const DEFAULT_DRAFT_CHUNK_CONFIG: DraftChunkConfig;
8
- export declare function findBreakPoint(text: string, maxLen: number, breakPreference?: BreakPreference): number;
9
- //# sourceMappingURL=draft-chunking.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"draft-chunking.d.ts","sourceRoot":"","sources":["../draft-chunking.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;AAEnE,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,eAAe,CAAC;CACjC;AAED,eAAO,MAAM,0BAA0B,EAAE,gBAIxC,CAAC;AAEF,wBAAgB,cAAc,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,eAAe,GAAE,eAA4B,GAC3C,MAAM,CAyCR"}
@@ -1,23 +0,0 @@
1
- import type { Message as DiscordMessage, TextChannel } from "discord.js";
2
- import { type DraftChunkConfig } from "./draft-chunking";
3
- type DraftReplyToMode = "off" | "first" | "all";
4
- export interface DraftStreamOptions {
5
- throttleMs?: number;
6
- minInitialChars?: number;
7
- maxChars?: number;
8
- chunkConfig?: Partial<DraftChunkConfig>;
9
- log?: (msg: string) => void;
10
- warn?: (msg: string) => void;
11
- }
12
- export interface DraftStreamController {
13
- start: (channel: TextChannel, replyToMessageId?: string, replyToMode?: DraftReplyToMode) => Promise<DiscordMessage | null>;
14
- update: (text: string) => void;
15
- finalize: (text: string) => Promise<DiscordMessage[]>;
16
- abort: (reason?: string) => Promise<void>;
17
- messageId: () => string | undefined;
18
- isStarted: () => boolean;
19
- isDone: () => boolean;
20
- }
21
- export declare function createDraftStreamController(options?: DraftStreamOptions): DraftStreamController;
22
- export {};
23
- //# sourceMappingURL=draft-stream.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"draft-stream.d.ts","sourceRoot":"","sources":["../draft-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAEN,KAAK,gBAAgB,EAErB,MAAM,kBAAkB,CAAC;AAE1B,KAAK,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC;AAEhD,MAAM,WAAW,kBAAkB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACxC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACrC,KAAK,EAAE,CACN,OAAO,EAAE,WAAW,EACpB,gBAAgB,CAAC,EAAE,MAAM,EACzB,WAAW,CAAC,EAAE,gBAAgB,KAC1B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACpC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IACtD,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,SAAS,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,OAAO,CAAC;CACtB;AAMD,wBAAgB,2BAA2B,CAC1C,OAAO,GAAE,kBAAuB,GAC9B,qBAAqB,CA8NvB"}
@@ -1,23 +0,0 @@
1
- import type { IAgentRuntime } from "@elizaos/core";
2
- import { z } from "zod";
3
- import type { DiscordSettings } from "./types";
4
- export declare const DISCORD_DEFAULTS: {
5
- readonly SHOULD_IGNORE_BOT_MESSAGES: boolean;
6
- readonly SHOULD_IGNORE_DIRECT_MESSAGES: boolean;
7
- readonly SHOULD_RESPOND_ONLY_TO_MENTIONS: boolean;
8
- readonly ALLOWED_CHANNEL_IDS: string[];
9
- readonly DM_POLICY: "open" | "allowlist" | "pairing" | "disabled";
10
- readonly ALLOW_FROM: string[];
11
- readonly SYNC_PROFILE: boolean;
12
- };
13
- export declare const discordEnvSchema: z.ZodObject<{
14
- DISCORD_API_TOKEN: z.ZodString;
15
- CHANNEL_IDS: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string[], string>>;
16
- DISCORD_SHOULD_IGNORE_BOT_MESSAGES: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<boolean, string>>;
17
- DISCORD_SHOULD_IGNORE_DIRECT_MESSAGES: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<boolean, string>>;
18
- DISCORD_SHOULD_RESPOND_ONLY_TO_MENTIONS: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<boolean, string>>;
19
- }, z.core.$strip>;
20
- export type DiscordConfig = z.infer<typeof discordEnvSchema>;
21
- export declare function getDiscordSettings(runtime: IAgentRuntime): DiscordSettings;
22
- export declare function validateDiscordConfig(runtime: IAgentRuntime): Promise<DiscordConfig>;
23
- //# sourceMappingURL=environment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../environment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAqB/C,eAAO,MAAM,gBAAgB;;;;;wBAezB,MAAM,GACN,WAAW,GACX,SAAS,GACT,UAAU;;;CAGJ,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;;iBAyB3B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,eAAe,CAgH1E;AAED,wBAAsB,qBAAqB,CAC1C,OAAO,EAAE,aAAa,GACpB,OAAO,CAAC,aAAa,CAAC,CA4BxB"}
@@ -1,36 +0,0 @@
1
- /**
2
- * Helper functions to lookup action/provider specs by name.
3
- * These allow language-specific implementations to import their text content
4
- * (description, similes, examples) from the centralized specs.
5
- *
6
- * DO NOT EDIT the spec data - update prompts/actions.json, prompts/providers.json and regenerate.
7
- */
8
- import { type ActionDoc, type ProviderDoc } from "./specs";
9
- /**
10
- * Get an action spec by name from the core specs.
11
- * @param name - The action name
12
- * @returns The action spec or undefined if not found
13
- */
14
- export declare function getActionSpec(name: string): ActionDoc | undefined;
15
- /**
16
- * Get an action spec by name, throwing if not found.
17
- * @param name - The action name
18
- * @returns The action spec
19
- * @throws Error if the action is not found
20
- */
21
- export declare function requireActionSpec(name: string): ActionDoc;
22
- /**
23
- * Get a provider spec by name from the core specs.
24
- * @param name - The provider name
25
- * @returns The provider spec or undefined if not found
26
- */
27
- export declare function getProviderSpec(name: string): ProviderDoc | undefined;
28
- /**
29
- * Get a provider spec by name, throwing if not found.
30
- * @param name - The provider name
31
- * @returns The provider spec
32
- * @throws Error if the provider is not found
33
- */
34
- export declare function requireProviderSpec(name: string): ProviderDoc;
35
- export type { ActionDoc, ProviderDoc };
36
- //# sourceMappingURL=spec-helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spec-helpers.d.ts","sourceRoot":"","sources":["../../../generated/specs/spec-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,SAAS,CAAC;AAgBjB;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAMzD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAM7D;AAGD,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC"}
@@ -1,52 +0,0 @@
1
- /**
2
- * Auto-generated canonical action/provider docs for plugin-discord.
3
- * DO NOT EDIT - Generated from prompts/specs/**.
4
- */
5
- export type ActionDoc = {
6
- name: string;
7
- description: string;
8
- descriptionCompressed?: string;
9
- similes?: readonly string[];
10
- parameters?: readonly unknown[];
11
- examples?: readonly (readonly unknown[])[];
12
- };
13
- export type ProviderDoc = {
14
- name: string;
15
- description: string;
16
- descriptionCompressed?: string;
17
- position?: number;
18
- dynamic?: boolean;
19
- };
20
- export declare const coreActionsSpec: {
21
- readonly version: "1.0.0";
22
- readonly actions: readonly [{
23
- readonly name: "DISCORD_SETUP_CREDENTIALS";
24
- readonly description: "Start Discord credential setup or account pairing when the user requests setup.";
25
- readonly descriptionCompressed: "Set up Discord credentials.";
26
- readonly similes: readonly ["SETUP_CREDENTIALS", "PAIR_CONNECTOR", "CONNECT_ACCOUNT"];
27
- readonly parameters: readonly [];
28
- }];
29
- };
30
- export declare const allActionsSpec: {
31
- readonly version: "1.0.0";
32
- readonly actions: readonly [{
33
- readonly name: "DISCORD_SETUP_CREDENTIALS";
34
- readonly description: "Start Discord credential setup or account pairing when the user requests setup.";
35
- readonly descriptionCompressed: "Set up Discord credentials.";
36
- readonly similes: readonly ["SETUP_CREDENTIALS", "PAIR_CONNECTOR", "CONNECT_ACCOUNT"];
37
- readonly parameters: readonly [];
38
- }];
39
- };
40
- export declare const coreProvidersSpec: {
41
- readonly version: "1.0.0";
42
- readonly providers: readonly [];
43
- };
44
- export declare const allProvidersSpec: {
45
- readonly version: "1.0.0";
46
- readonly providers: readonly [];
47
- };
48
- export declare const coreActionDocs: readonly ActionDoc[];
49
- export declare const allActionDocs: readonly ActionDoc[];
50
- export declare const coreProviderDocs: readonly ProviderDoc[];
51
- export declare const allProviderDocs: readonly ProviderDoc[];
52
- //# sourceMappingURL=specs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../generated/specs/specs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;CAelB,CAAC;AACX,eAAO,MAAM,cAAc;;;;;;;;;CAejB,CAAC;AACX,eAAO,MAAM,iBAAiB;;;CAGpB,CAAC;AACX,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AAEX,eAAO,MAAM,cAAc,EAAE,SAAS,SAAS,EAA4B,CAAC;AAC5E,eAAO,MAAM,aAAa,EAAE,SAAS,SAAS,EAA2B,CAAC;AAC1E,eAAO,MAAM,gBAAgB,EAAE,SAAS,WAAW,EAAgC,CAAC;AACpF,eAAO,MAAM,eAAe,EAAE,SAAS,WAAW,EAA+B,CAAC"}
@@ -1,8 +0,0 @@
1
- import { type IAgentRuntime, type Metadata } from "@elizaos/core";
2
- export declare function resolveElizaOwnerEntityId(runtime: IAgentRuntime): string;
3
- export declare function resolveDiscordRuntimeEntityId(runtime: IAgentRuntime, userId: string, ownerDiscordUserIds?: Iterable<string>): string;
4
- export declare function extractDiscordOwnerUserIds(application: unknown): string[];
5
- export declare function parseDiscordOwnerUserIds(value: unknown): string[];
6
- export declare function buildDiscordWorldMetadata(runtime: IAgentRuntime, guildOwnerId: string | undefined): Metadata | undefined;
7
- export declare function buildDiscordEntityMetadata(userId: string, userName: string, name: string, globalName?: string, avatarUrl?: string): Metadata;
8
- //# sourceMappingURL=identity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,aAAa,EAClB,KAAK,QAAQ,EAGb,MAAM,eAAe,CAAC;AA+CvB,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAQxE;AAED,wBAAgB,6BAA6B,CAC5C,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,MAAM,EACd,mBAAmB,GAAE,QAAQ,CAAC,MAAM,CAAM,GACxC,MAAM,CAOR;AAED,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,EAAE,CA2CzE;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAmBjE;AAED,wBAAgB,yBAAyB,CACxC,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,MAAM,GAAG,SAAS,GAC9B,QAAQ,GAAG,SAAS,CAqBtB;AAED,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GAChB,QAAQ,CA6BV"}
@@ -1,8 +0,0 @@
1
- import { type Message as DiscordMessage } from "discord.js";
2
- export type ChatType = "dm" | "channel" | "thread" | "forum";
3
- export interface EnvelopeResult {
4
- formattedContent: string;
5
- chatType: ChatType;
6
- }
7
- export declare function formatInboundEnvelope(message: DiscordMessage, rawContent: string): Promise<EnvelopeResult>;
8
- //# sourceMappingURL=inbound-envelope.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inbound-envelope.d.ts","sourceRoot":"","sources":["../inbound-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,OAAO,IAAI,cAAc,EAG9B,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;CACnB;AAkFD,wBAAsB,qBAAqB,CAC1C,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,MAAM,GAChB,OAAO,CAAC,cAAc,CAAC,CAuCzB"}
@@ -1,34 +0,0 @@
1
- /**
2
- * Browser Entry Point for Discord Plugin
3
- *
4
- * IMPORTANT: This file provides a browser-compatible stub for the Discord plugin.
5
- * The Discord.js library requires Node.js APIs (WebSocket, Buffer, etc.) that are
6
- * not available in browser environments.
7
- *
8
- * LIMITATIONS:
9
- * - No direct Discord Gateway connection (WebSocket unavailable)
10
- * - No bot token authentication
11
- * - No event handling or message processing
12
- * - No slash command registration
13
- *
14
- * RECOMMENDED ALTERNATIVES:
15
- * 1. Server Proxy: Run the full Discord plugin on a Node.js server and communicate
16
- * via API endpoints from your browser application.
17
- * 2. OAuth Flow: For user-facing apps, implement Discord OAuth2 in the browser
18
- * and handle bot operations server-side.
19
- * 3. Webhooks: For simple message sending, Discord webhooks work from browsers
20
- * (though they're one-way communication only).
21
- *
22
- * @module plugin-discord/browser
23
- */
24
- import type { Plugin } from "@elizaos/core";
25
- /**
26
- * Browser stub for the Discord plugin.
27
- *
28
- * This stub provides the same interface as the full plugin but does not
29
- * implement any Discord functionality. It exists to prevent build errors
30
- * when the plugin is bundled for browser targets.
31
- */
32
- export declare const discordPlugin: Plugin;
33
- export default discordPlugin;
34
- //# sourceMappingURL=index.browser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../index.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AAK3D;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,MAU3B,CAAC;AAEF,eAAe,aAAa,CAAC"}