@elizaos/plugin-discord 1.3.8 → 2.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accounts.d.ts +164 -0
- package/dist/accounts.d.ts.map +1 -0
- package/dist/actions/chatWithAttachments.d.ts +4 -0
- package/dist/actions/chatWithAttachments.d.ts.map +1 -0
- package/dist/actions/createPoll.d.ts +4 -0
- package/dist/actions/createPoll.d.ts.map +1 -0
- package/dist/actions/deleteMessage.d.ts +4 -0
- package/dist/actions/deleteMessage.d.ts.map +1 -0
- package/dist/actions/downloadMedia.d.ts +4 -0
- package/dist/actions/downloadMedia.d.ts.map +1 -0
- package/dist/actions/editMessage.d.ts +4 -0
- package/dist/actions/editMessage.d.ts.map +1 -0
- package/dist/actions/getUserInfo.d.ts +4 -0
- package/dist/actions/getUserInfo.d.ts.map +1 -0
- package/dist/actions/joinChannel.d.ts +4 -0
- package/dist/actions/joinChannel.d.ts.map +1 -0
- package/dist/actions/leaveChannel.d.ts +4 -0
- package/dist/actions/leaveChannel.d.ts.map +1 -0
- package/dist/actions/listChannels.d.ts +4 -0
- package/dist/actions/listChannels.d.ts.map +1 -0
- package/dist/actions/pinMessage.d.ts +4 -0
- package/dist/actions/pinMessage.d.ts.map +1 -0
- package/dist/actions/reactToMessage.d.ts +4 -0
- package/dist/actions/reactToMessage.d.ts.map +1 -0
- package/dist/actions/readChannel.d.ts +4 -0
- package/dist/actions/readChannel.d.ts.map +1 -0
- package/dist/actions/searchMessages.d.ts +4 -0
- package/dist/actions/searchMessages.d.ts.map +1 -0
- package/dist/actions/sendDM.d.ts +4 -0
- package/dist/actions/sendDM.d.ts.map +1 -0
- package/dist/actions/sendMessage.d.ts +4 -0
- package/dist/actions/sendMessage.d.ts.map +1 -0
- package/dist/actions/serverInfo.d.ts +4 -0
- package/dist/actions/serverInfo.d.ts.map +1 -0
- package/dist/actions/summarizeConversation.d.ts +4 -0
- package/dist/actions/summarizeConversation.d.ts.map +1 -0
- package/dist/actions/transcribeMedia.d.ts +4 -0
- package/dist/actions/transcribeMedia.d.ts.map +1 -0
- package/dist/actions/unpinMessage.d.ts +4 -0
- package/dist/actions/unpinMessage.d.ts.map +1 -0
- package/dist/allowlist.d.ts +198 -0
- package/dist/allowlist.d.ts.map +1 -0
- package/dist/attachments.d.ts +92 -0
- package/dist/attachments.d.ts.map +1 -0
- package/dist/banner.d.ts +39 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/compat.d.ts +56 -0
- package/dist/compat.d.ts.map +1 -0
- package/dist/config.d.ts +156 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/environment.d.ts +22 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/generated/prompts/typescript/prompts.d.ts +44 -0
- package/dist/generated/prompts/typescript/prompts.d.ts.map +1 -0
- package/dist/generated/specs/spec-helpers.d.ts +49 -0
- package/dist/generated/specs/spec-helpers.d.ts.map +1 -0
- package/dist/generated/specs/specs.d.ts +87 -0
- package/dist/generated/specs/specs.d.ts.map +1 -0
- package/dist/index.browser.d.ts +34 -0
- package/dist/index.browser.d.ts.map +1 -0
- package/dist/index.d.ts +2 -942
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9865 -7014
- package/dist/index.js.map +132 -1
- package/dist/messages.d.ts +55 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messaging.d.ts +129 -0
- package/dist/messaging.d.ts.map +1 -0
- package/dist/native-commands.d.ts +142 -0
- package/dist/native-commands.d.ts.map +1 -0
- package/dist/permissionEvents.d.ts +42 -0
- package/dist/permissionEvents.d.ts.map +1 -0
- package/dist/permissions.d.ts +36 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/providers/channelState.d.ts +14 -0
- package/dist/providers/channelState.d.ts.map +1 -0
- package/dist/providers/guildInfo.d.ts +15 -0
- package/dist/providers/guildInfo.d.ts.map +1 -0
- package/dist/providers/voiceState.d.ts +12 -0
- package/dist/providers/voiceState.d.ts.map +1 -0
- package/dist/service.d.ts +403 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/test-setup.d.ts +1 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/tests.d.ts +123 -0
- package/dist/tests.d.ts.map +1 -0
- package/dist/types.d.ts +315 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +44 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/vitest.config.d.ts +3 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/dist/voice.d.ts +230 -0
- package/dist/voice.d.ts.map +1 -0
- package/package.json +134 -123
- package/LICENSE +0 -21
- package/README.md +0 -531
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type IAgentRuntime, type Media } from "@elizaos/core";
|
|
2
|
+
import { type Attachment, Collection } from "discord.js";
|
|
3
|
+
/**
|
|
4
|
+
* Class representing an Attachment Manager.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AttachmentManager {
|
|
7
|
+
private attachmentCache;
|
|
8
|
+
private runtime;
|
|
9
|
+
/**
|
|
10
|
+
* Constructor for creating a new instance of the class.
|
|
11
|
+
*
|
|
12
|
+
* @param {IAgentRuntime} runtime The runtime object to be injected into the instance.
|
|
13
|
+
*/
|
|
14
|
+
constructor(runtime: IAgentRuntime);
|
|
15
|
+
/**
|
|
16
|
+
* Processes attachments and returns an array of Media objects.
|
|
17
|
+
* @param {Collection<string, Attachment> | Attachment[]} attachments - The attachments to be processed
|
|
18
|
+
* @returns {Promise<Media[]>} - An array of processed Media objects
|
|
19
|
+
*/
|
|
20
|
+
processAttachments(attachments: Collection<string, Attachment> | Attachment[]): Promise<Media[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Processes the provided attachment to generate a media object.
|
|
23
|
+
* If the media for the attachment URL is already cached, it will return the cached media.
|
|
24
|
+
* Otherwise, it will determine the type of attachment (PDF, text, audio, video, image, generic)
|
|
25
|
+
* and call the corresponding processing method to generate the media object.
|
|
26
|
+
*
|
|
27
|
+
* @param attachment The attachment to process
|
|
28
|
+
* @returns A promise that resolves to a Media object representing the attachment, or null if the attachment could not be processed
|
|
29
|
+
*/
|
|
30
|
+
processAttachment(attachment: Attachment): Promise<Media | null>;
|
|
31
|
+
/**
|
|
32
|
+
* Asynchronously processes an audio or video attachment provided as input and returns a Media object.
|
|
33
|
+
* @param {Attachment} attachment - The attachment object containing information about the audio/video file.
|
|
34
|
+
* @returns {Promise<Media>} A Promise that resolves to a Media object representing the processed audio/video attachment.
|
|
35
|
+
*/
|
|
36
|
+
private processAudioVideoAttachment;
|
|
37
|
+
/**
|
|
38
|
+
* Extracts the audio stream from the provided MP4 data and converts it to MP3 format.
|
|
39
|
+
*
|
|
40
|
+
* @param {ArrayBuffer} mp4Data - The MP4 data to extract audio from
|
|
41
|
+
* @returns {Promise<Buffer>} - A Promise that resolves with the converted audio data as a Buffer
|
|
42
|
+
*/
|
|
43
|
+
private extractAudioFromMP4;
|
|
44
|
+
/**
|
|
45
|
+
* Processes a PDF attachment by fetching the PDF file from the specified URL,
|
|
46
|
+
* converting it to text, generating a summary, and returning a Media object
|
|
47
|
+
* with the extracted information.
|
|
48
|
+
* If an error occurs during processing, a placeholder Media object is returned
|
|
49
|
+
* with an error message.
|
|
50
|
+
*
|
|
51
|
+
* @param {Attachment} attachment - The PDF attachment to process.
|
|
52
|
+
* @returns {Promise<Media>} A promise that resolves to a Media object representing
|
|
53
|
+
* the processed PDF attachment.
|
|
54
|
+
*/
|
|
55
|
+
private processPdfAttachment;
|
|
56
|
+
/**
|
|
57
|
+
* Processes a plaintext attachment by fetching its content, generating a summary, and returning a Media object.
|
|
58
|
+
* @param {Attachment} attachment - The attachment object to process.
|
|
59
|
+
* @returns {Promise<Media>} A promise that resolves to a Media object representing the processed plaintext attachment.
|
|
60
|
+
*/
|
|
61
|
+
private processPlaintextAttachment;
|
|
62
|
+
/**
|
|
63
|
+
* Process the image attachment by fetching description and title using the IMAGE_DESCRIPTION model.
|
|
64
|
+
* If successful, returns a Media object populated with the details. If unsuccessful, creates a fallback
|
|
65
|
+
* Media object and logs the error.
|
|
66
|
+
*
|
|
67
|
+
* @param {Attachment} attachment - The attachment object containing the image details.
|
|
68
|
+
* @returns {Promise<Media>} A promise that resolves to a Media object.
|
|
69
|
+
*/
|
|
70
|
+
private processImageAttachment;
|
|
71
|
+
/**
|
|
72
|
+
* Creates a fallback Media object for image attachments that could not be recognized.
|
|
73
|
+
*
|
|
74
|
+
* @param {Attachment} attachment - The attachment object containing image details.
|
|
75
|
+
* @returns {Media} - The fallback Media object with basic information about the image attachment.
|
|
76
|
+
*/
|
|
77
|
+
private createFallbackImageMedia;
|
|
78
|
+
/**
|
|
79
|
+
* Process a video attachment to extract video information.
|
|
80
|
+
* @param {Attachment} attachment - The attachment object containing video information.
|
|
81
|
+
* @returns {Promise<Media>} A promise that resolves to a Media object with video details.
|
|
82
|
+
* @throws {Error} If video service is not available.
|
|
83
|
+
*/
|
|
84
|
+
private processVideoAttachment;
|
|
85
|
+
/**
|
|
86
|
+
* Process a generic attachment and return a Media object with specified properties.
|
|
87
|
+
* @param {Attachment} attachment - The attachment object to process.
|
|
88
|
+
* @returns {Promise<Media>} A Promise that resolves to a Media object with specified properties.
|
|
89
|
+
*/
|
|
90
|
+
private processGenericAttachment;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=attachments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../attachments.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,KAAK,EAIV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIzD;;GAEG;AACH,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,eAAe,CAAiC;IACxD,OAAO,CAAC,OAAO,CAAgB;IAE/B;;;;OAIG;gBACS,OAAO,EAAE,aAAa;IAIlC;;;;OAIG;IACG,kBAAkB,CACvB,WAAW,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,UAAU,EAAE,GACxD,OAAO,CAAC,KAAK,EAAE,CAAC;IAiBnB;;;;;;;;OAQG;IACG,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAqCtE;;;;OAIG;YACW,2BAA2B;IAqIzC;;;;;OAKG;YACW,mBAAmB;IAwGjC;;;;;;;;;;OAUG;YACW,oBAAoB;IAqDlC;;;;OAIG;YACW,0BAA0B;IAgDxC;;;;;;;OAOG;YACW,sBAAsB;IA8BpC;;;;;OAKG;IAEH,OAAO,CAAC,wBAAwB;IAWhC;;;;;OAKG;YACW,sBAAsB;IAsDpC;;;;OAIG;YACW,wBAAwB;CAYtC"}
|
package/dist/banner.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discord Plugin Settings Banner
|
|
3
|
+
* Beautiful ANSI art display for configuration on startup
|
|
4
|
+
* Includes tiered permission system for invite URLs
|
|
5
|
+
*/
|
|
6
|
+
import type { IAgentRuntime } from "@elizaos/core";
|
|
7
|
+
import { type DiscordPermissionValues } from "./permissions";
|
|
8
|
+
export interface PluginSetting {
|
|
9
|
+
name: string;
|
|
10
|
+
value: unknown;
|
|
11
|
+
defaultValue?: unknown;
|
|
12
|
+
sensitive?: boolean;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface BannerOptions {
|
|
16
|
+
pluginName: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
settings: PluginSetting[];
|
|
19
|
+
runtime: IAgentRuntime;
|
|
20
|
+
/** Discord Application ID for generating invite URLs */
|
|
21
|
+
applicationId?: string;
|
|
22
|
+
/** Permission values for the 3x2 tier matrix */
|
|
23
|
+
discordPermissions?: DiscordPermissionValues;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Render a framed ANSI banner that displays plugin settings and, when available, tiered Discord invite URLs.
|
|
27
|
+
*
|
|
28
|
+
* The banner lists each setting with masked or truncated values, a status (custom/default/unset/required),
|
|
29
|
+
* and an optional Discord invite section generated from `applicationId` and `discordPermissions`.
|
|
30
|
+
*
|
|
31
|
+
* @param options - Configuration for the banner, including `settings`, the `runtime` used to emit the banner,
|
|
32
|
+
* and optional Discord invite data (`applicationId`, `discordPermissions`).
|
|
33
|
+
*/
|
|
34
|
+
export declare function printBanner(options: BannerOptions): void;
|
|
35
|
+
/**
|
|
36
|
+
* Print the Discord plugin banner with current settings.
|
|
37
|
+
*/
|
|
38
|
+
export declare function printDiscordBanner(runtime: IAgentRuntime): void;
|
|
39
|
+
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../banner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACN,KAAK,uBAAuB,EAE5B,MAAM,eAAe,CAAC;AAgBvB,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,OAAO,EAAE,aAAa,CAAC;IACvB,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,kBAAkB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAoFD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAoIxD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CA6C/D"}
|
package/dist/compat.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
import type { ChannelType, Entity, IAgentRuntime, 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
|
+
export type WorldCompat = Omit<World, "serverId"> & {
|
|
24
|
+
serverId?: string;
|
|
25
|
+
messageServerId?: UUID;
|
|
26
|
+
};
|
|
27
|
+
export type RoomCompat = Omit<Room, "serverId"> & {
|
|
28
|
+
serverId?: string;
|
|
29
|
+
messageServerId?: UUID;
|
|
30
|
+
};
|
|
31
|
+
export interface EnsureConnectionParams {
|
|
32
|
+
entityId: UUID;
|
|
33
|
+
roomId: UUID;
|
|
34
|
+
userName?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
worldName?: string;
|
|
37
|
+
source?: string;
|
|
38
|
+
channelId?: string;
|
|
39
|
+
serverId?: string;
|
|
40
|
+
messageServerId?: UUID;
|
|
41
|
+
type?: ChannelType | string;
|
|
42
|
+
worldId: UUID;
|
|
43
|
+
userId?: UUID;
|
|
44
|
+
metadata?: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Extended runtime interface that accepts messageServerId in method parameters.
|
|
48
|
+
*/
|
|
49
|
+
export interface ICompatRuntime extends Omit<IAgentRuntime, "ensureWorldExists" | "ensureRoomExists" | "ensureConnection" | "ensureConnections"> {
|
|
50
|
+
ensureWorldExists(world: WorldCompat): Promise<void>;
|
|
51
|
+
ensureRoomExists(room: RoomCompat): Promise<void>;
|
|
52
|
+
ensureConnection(params: EnsureConnectionParams): Promise<void>;
|
|
53
|
+
ensureConnections(entities: Entity[], rooms: RoomCompat[], source: string, world: WorldCompat): Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
export declare function createCompatRuntime(runtime: IAgentRuntime): ICompatRuntime;
|
|
56
|
+
//# sourceMappingURL=compat.d.ts.map
|
|
@@ -0,0 +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,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;CAC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* These types define the configuration schema for the Discord plugin.
|
|
5
|
+
* Shared base types are imported from @elizaos/core.
|
|
6
|
+
*/
|
|
7
|
+
import type { BlockStreamingCoalesceConfig, ChannelHeartbeatVisibilityConfig, DmConfig, DmPolicy, GroupPolicy, GroupToolPolicyBySenderConfig, GroupToolPolicyConfig, MarkdownConfig, OutboundRetryConfig, ProviderCommandsConfig, ReplyToMode } from "@elizaos/core";
|
|
8
|
+
export type DiscordPluralKitConfig = {
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
detectProxied?: boolean;
|
|
11
|
+
cacheUsers?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type DiscordDmConfig = {
|
|
14
|
+
/** If false, ignore all incoming Discord DMs. Default: true. */
|
|
15
|
+
enabled?: boolean;
|
|
16
|
+
/** Direct message access policy (default: pairing). */
|
|
17
|
+
policy?: DmPolicy;
|
|
18
|
+
/** Allowlist for DM senders (ids or names). */
|
|
19
|
+
allowFrom?: Array<string | number>;
|
|
20
|
+
/** If true, allow group DMs (default: false). */
|
|
21
|
+
groupEnabled?: boolean;
|
|
22
|
+
/** Optional allowlist for group DM channels (ids or slugs). */
|
|
23
|
+
groupChannels?: Array<string | number>;
|
|
24
|
+
};
|
|
25
|
+
export type DiscordGuildChannelConfig = {
|
|
26
|
+
allow?: boolean;
|
|
27
|
+
requireMention?: boolean;
|
|
28
|
+
/** Optional tool policy overrides for this channel. */
|
|
29
|
+
tools?: GroupToolPolicyConfig;
|
|
30
|
+
toolsBySender?: GroupToolPolicyBySenderConfig;
|
|
31
|
+
/** If specified, only load these skills for this channel. Omit = all skills; empty = no skills. */
|
|
32
|
+
skills?: string[];
|
|
33
|
+
/** If false, disable the bot for this channel. */
|
|
34
|
+
enabled?: boolean;
|
|
35
|
+
/** Optional allowlist for channel senders (ids or names). */
|
|
36
|
+
users?: Array<string | number>;
|
|
37
|
+
/** Optional system prompt snippet for this channel. */
|
|
38
|
+
systemPrompt?: string;
|
|
39
|
+
};
|
|
40
|
+
export type DiscordReactionNotificationMode = "off" | "own" | "all" | "allowlist";
|
|
41
|
+
export type DiscordGuildEntry = {
|
|
42
|
+
slug?: string;
|
|
43
|
+
requireMention?: boolean;
|
|
44
|
+
/** Optional tool policy overrides for this guild (used when channel override is missing). */
|
|
45
|
+
tools?: GroupToolPolicyConfig;
|
|
46
|
+
toolsBySender?: GroupToolPolicyBySenderConfig;
|
|
47
|
+
/** Reaction notification mode (off|own|all|allowlist). Default: own. */
|
|
48
|
+
reactionNotifications?: DiscordReactionNotificationMode;
|
|
49
|
+
users?: Array<string | number>;
|
|
50
|
+
channels?: Record<string, DiscordGuildChannelConfig>;
|
|
51
|
+
};
|
|
52
|
+
export type DiscordActionConfig = {
|
|
53
|
+
reactions?: boolean;
|
|
54
|
+
stickers?: boolean;
|
|
55
|
+
polls?: boolean;
|
|
56
|
+
permissions?: boolean;
|
|
57
|
+
messages?: boolean;
|
|
58
|
+
threads?: boolean;
|
|
59
|
+
pins?: boolean;
|
|
60
|
+
search?: boolean;
|
|
61
|
+
memberInfo?: boolean;
|
|
62
|
+
roleInfo?: boolean;
|
|
63
|
+
roles?: boolean;
|
|
64
|
+
channelInfo?: boolean;
|
|
65
|
+
voiceStatus?: boolean;
|
|
66
|
+
events?: boolean;
|
|
67
|
+
moderation?: boolean;
|
|
68
|
+
emojiUploads?: boolean;
|
|
69
|
+
stickerUploads?: boolean;
|
|
70
|
+
channels?: boolean;
|
|
71
|
+
/** Enable bot presence/activity changes (default: false). */
|
|
72
|
+
presence?: boolean;
|
|
73
|
+
};
|
|
74
|
+
export type DiscordIntentsConfig = {
|
|
75
|
+
/** Enable Guild Presences privileged intent (requires Portal opt-in). Default: false. */
|
|
76
|
+
presence?: boolean;
|
|
77
|
+
/** Enable Guild Members privileged intent (requires Portal opt-in). Default: false. */
|
|
78
|
+
guildMembers?: boolean;
|
|
79
|
+
};
|
|
80
|
+
export type DiscordExecApprovalConfig = {
|
|
81
|
+
/** Enable exec approval forwarding to Discord DMs. Default: false. */
|
|
82
|
+
enabled?: boolean;
|
|
83
|
+
/** Discord user IDs to receive approval prompts. Required if enabled. */
|
|
84
|
+
approvers?: Array<string | number>;
|
|
85
|
+
/** Only forward approvals for these agent IDs. Omit = all agents. */
|
|
86
|
+
agentFilter?: string[];
|
|
87
|
+
/** Only forward approvals matching these session key patterns (substring or regex). */
|
|
88
|
+
sessionFilter?: string[];
|
|
89
|
+
};
|
|
90
|
+
export type DiscordAccountConfig = {
|
|
91
|
+
/** Optional display name for this account (used in CLI/UI lists). */
|
|
92
|
+
name?: string;
|
|
93
|
+
/** Optional provider capability tags used for agent/runtime guidance. */
|
|
94
|
+
capabilities?: string[];
|
|
95
|
+
/** Markdown formatting overrides (tables). */
|
|
96
|
+
markdown?: MarkdownConfig;
|
|
97
|
+
/** Override native command registration for Discord (bool or "auto"). */
|
|
98
|
+
commands?: ProviderCommandsConfig;
|
|
99
|
+
/** Allow channel-initiated config writes (default: true). */
|
|
100
|
+
configWrites?: boolean;
|
|
101
|
+
/** If false, do not start this Discord account. Default: true. */
|
|
102
|
+
enabled?: boolean;
|
|
103
|
+
token?: string;
|
|
104
|
+
/** Allow bot-authored messages to trigger replies (default: false). */
|
|
105
|
+
allowBots?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Controls how guild channel messages are handled:
|
|
108
|
+
* - "open": guild channels bypass allowlists; mention-gating applies
|
|
109
|
+
* - "disabled": block all guild channel messages
|
|
110
|
+
* - "allowlist": only allow channels present in discord.guilds.*.channels
|
|
111
|
+
*/
|
|
112
|
+
groupPolicy?: GroupPolicy;
|
|
113
|
+
/** Outbound text chunk size (chars). Default: 2000. */
|
|
114
|
+
textChunkLimit?: number;
|
|
115
|
+
/** Chunking mode: "length" (default) splits by size; "newline" splits on every newline. */
|
|
116
|
+
chunkMode?: "length" | "newline";
|
|
117
|
+
/** Disable block streaming for this account. */
|
|
118
|
+
blockStreaming?: boolean;
|
|
119
|
+
/** Merge streamed block replies before sending. */
|
|
120
|
+
blockStreamingCoalesce?: BlockStreamingCoalesceConfig;
|
|
121
|
+
/**
|
|
122
|
+
* Soft max line count per Discord message.
|
|
123
|
+
* Discord clients can clip/collapse very tall messages; splitting by lines
|
|
124
|
+
* keeps replies readable in-channel. Default: 17.
|
|
125
|
+
*/
|
|
126
|
+
maxLinesPerMessage?: number;
|
|
127
|
+
mediaMaxMb?: number;
|
|
128
|
+
historyLimit?: number;
|
|
129
|
+
/** Max DM turns to keep as history context. */
|
|
130
|
+
dmHistoryLimit?: number;
|
|
131
|
+
/** Per-DM config overrides keyed by user ID. */
|
|
132
|
+
dms?: Record<string, DmConfig>;
|
|
133
|
+
/** Retry policy for outbound Discord API calls. */
|
|
134
|
+
retry?: OutboundRetryConfig;
|
|
135
|
+
/** Per-action tool gating (default: true for all). */
|
|
136
|
+
actions?: DiscordActionConfig;
|
|
137
|
+
/** Control reply threading when reply tags are present (off|first|all). */
|
|
138
|
+
replyToMode?: ReplyToMode;
|
|
139
|
+
dm?: DiscordDmConfig;
|
|
140
|
+
/** New per-guild config keyed by guild id or slug. */
|
|
141
|
+
guilds?: Record<string, DiscordGuildEntry>;
|
|
142
|
+
/** Heartbeat visibility settings for this channel. */
|
|
143
|
+
heartbeat?: ChannelHeartbeatVisibilityConfig;
|
|
144
|
+
/** Exec approval forwarding configuration. */
|
|
145
|
+
execApprovals?: DiscordExecApprovalConfig;
|
|
146
|
+
/** Privileged Gateway Intents (must also be enabled in Discord Developer Portal). */
|
|
147
|
+
intents?: DiscordIntentsConfig;
|
|
148
|
+
/** PluralKit identity resolution for proxied messages. */
|
|
149
|
+
pluralkit?: DiscordPluralKitConfig;
|
|
150
|
+
};
|
|
151
|
+
export type DiscordChannelConfig = {
|
|
152
|
+
/** Optional per-account Discord configuration (multi-account). */
|
|
153
|
+
accounts?: Record<string, DiscordAccountConfig>;
|
|
154
|
+
} & DiscordAccountConfig;
|
|
155
|
+
export type { DiscordChannelConfig as DiscordConfig };
|
|
156
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@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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,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAChD,GAAG,oBAAoB,CAAC;AAGzB,YAAY,EAAE,oBAAoB,IAAI,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,YAAY,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
};
|
|
12
|
+
export declare const discordEnvSchema: z.ZodObject<{
|
|
13
|
+
DISCORD_API_TOKEN: z.ZodString;
|
|
14
|
+
CHANNEL_IDS: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string[], string>>;
|
|
15
|
+
DISCORD_SHOULD_IGNORE_BOT_MESSAGES: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<boolean, string>>;
|
|
16
|
+
DISCORD_SHOULD_IGNORE_DIRECT_MESSAGES: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<boolean, string>>;
|
|
17
|
+
DISCORD_SHOULD_RESPOND_ONLY_TO_MENTIONS: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<boolean, string>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type DiscordConfig = z.infer<typeof discordEnvSchema>;
|
|
20
|
+
export declare function getDiscordSettings(runtime: IAgentRuntime): DiscordSettings;
|
|
21
|
+
export declare function validateDiscordConfig(runtime: IAgentRuntime): Promise<DiscordConfig>;
|
|
22
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;;CAEJ,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,CAoF1E;AAED,wBAAsB,qBAAqB,CAC1C,OAAO,EAAE,aAAa,GACpB,OAAO,CAAC,aAAa,CAAC,CA4BxB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated prompt templates
|
|
3
|
+
* DO NOT EDIT - Generated from ../../../../prompts/*.txt
|
|
4
|
+
*
|
|
5
|
+
* These prompts use Handlebars-style template syntax:
|
|
6
|
+
* - {{variableName}} for simple substitution
|
|
7
|
+
* - {{#each items}}...{{/each}} for iteration
|
|
8
|
+
* - {{#if condition}}...{{/if}} for conditionals
|
|
9
|
+
*/
|
|
10
|
+
export declare const attachmentIdsTemplate = "# Messages we are summarizing\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting a summary of specific attachments. Your goal is to determine their objective, along with the list of attachment IDs to summarize.\nThe \"objective\" is a detailed description of what the user wants to summarize based on the conversation.\nThe \"attachmentIds\" is an array of attachment IDs that the user wants to summarize. If not specified, default to including all attachments from the conversation.\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"objective\": \"<What the user wants to summarize>\",\n \"attachmentIds\": [\"<Attachment ID 1>\", \"<Attachment ID 2>\", ...]\n}\n```";
|
|
11
|
+
export declare const ATTACHMENT_IDS_TEMPLATE = "# Messages we are summarizing\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting a summary of specific attachments. Your goal is to determine their objective, along with the list of attachment IDs to summarize.\nThe \"objective\" is a detailed description of what the user wants to summarize based on the conversation.\nThe \"attachmentIds\" is an array of attachment IDs that the user wants to summarize. If not specified, default to including all attachments from the conversation.\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"objective\": \"<What the user wants to summarize>\",\n \"attachmentIds\": [\"<Attachment ID 1>\", \"<Attachment ID 2>\", ...]\n}\n```";
|
|
12
|
+
export declare const attachmentSummarizationTemplate = "# Summarized so far (we are adding to this)\n{{currentSummary}}\n\n# Current attachments we are summarizing\n{{attachmentsWithText}}\n\nSummarization objective: {{objective}}\n\n# Instructions: Summarize the attachments. Return the summary. Do not acknowledge this request, just summarize and continue the existing summary if there is one. Capture any important details based on the objective. Only respond with the new summary text.";
|
|
13
|
+
export declare const ATTACHMENT_SUMMARIZATION_TEMPLATE = "# Summarized so far (we are adding to this)\n{{currentSummary}}\n\n# Current attachments we are summarizing\n{{attachmentsWithText}}\n\nSummarization objective: {{objective}}\n\n# Instructions: Summarize the attachments. Return the summary. Do not acknowledge this request, just summarize and continue the existing summary if there is one. Capture any important details based on the objective. Only respond with the new summary text.";
|
|
14
|
+
export declare const channelInfoTemplate = "# Messages we are searching for channel information\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting to read messages from a specific Discord channel. Your goal is to determine:\n1. The channel they want to read from (could be the current channel or a mentioned channel)\n2. How many messages they want to read (default to 10 if not specified)\n3. Whether they want a summary or just the messages\n4. If they're looking for messages from a specific person\n\nIf they say \"this channel\" or \"here\", use the current channel.\nIf they mention a specific channel name or ID, extract that.\nIf they ask to \"summarize\" or mention what someone is \"talking about\", set summarize to true.\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"channelIdentifier\": \"<current|channel-name|channel-id>\",\n \"messageCount\": <number between 1 and 50>,\n \"summarize\": true/false,\n \"focusUser\": \"<username or null>\"\n}\n```";
|
|
15
|
+
export declare const CHANNEL_INFO_TEMPLATE = "# Messages we are searching for channel information\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting to read messages from a specific Discord channel. Your goal is to determine:\n1. The channel they want to read from (could be the current channel or a mentioned channel)\n2. How many messages they want to read (default to 10 if not specified)\n3. Whether they want a summary or just the messages\n4. If they're looking for messages from a specific person\n\nIf they say \"this channel\" or \"here\", use the current channel.\nIf they mention a specific channel name or ID, extract that.\nIf they ask to \"summarize\" or mention what someone is \"talking about\", set summarize to true.\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"channelIdentifier\": \"<current|channel-name|channel-id>\",\n \"messageCount\": <number between 1 and 50>,\n \"summarize\": true/false,\n \"focusUser\": \"<username or null>\"\n}\n```";
|
|
16
|
+
export declare const createPollTemplate = "# Creating a Discord poll\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting to create a poll. Extract:\n1. The poll question\n2. The poll options (2-10 options)\n3. Whether to use emoji reactions (default: true)\n\nExamples:\n- \"create a poll: What game should we play? Options: Minecraft, Fortnite, Among Us\" \n -> question: \"What game should we play?\", options: [\"Minecraft\", \"Fortnite\", \"Among Us\"]\n- \"poll: Should we have a meeting tomorrow? Yes/No\"\n -> question: \"Should we have a meeting tomorrow?\", options: [\"Yes\", \"No\"]\n\nYour response must be formatted as a JSON block:\n```json\n{\n \"question\": \"<poll question>\",\n \"options\": [\"<option1>\", \"<option2>\", ...],\n \"useEmojis\": true/false\n}\n```";
|
|
17
|
+
export declare const CREATE_POLL_TEMPLATE = "# Creating a Discord poll\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting to create a poll. Extract:\n1. The poll question\n2. The poll options (2-10 options)\n3. Whether to use emoji reactions (default: true)\n\nExamples:\n- \"create a poll: What game should we play? Options: Minecraft, Fortnite, Among Us\" \n -> question: \"What game should we play?\", options: [\"Minecraft\", \"Fortnite\", \"Among Us\"]\n- \"poll: Should we have a meeting tomorrow? Yes/No\"\n -> question: \"Should we have a meeting tomorrow?\", options: [\"Yes\", \"No\"]\n\nYour response must be formatted as a JSON block:\n```json\n{\n \"question\": \"<poll question>\",\n \"options\": [\"<option1>\", \"<option2>\", ...],\n \"useEmojis\": true/false\n}\n```";
|
|
18
|
+
export declare const dateRangeTemplate = "# Messages we are summarizing (the conversation is continued after this)\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting a summary of the conversation. Your goal is to determine their objective, along with the range of dates that their request covers.\nThe \"objective\" is a detailed description of what the user wants to summarize based on the conversation. If they just ask for a general summary, you can either base it off the conversation if the summary range is very recent, or set the object to be general, like \"a detailed summary of the conversation between all users\".\nThe \"start\" and \"end\" are the range of dates that the user wants to summarize, relative to the current time. The start and end should be relative to the current time, and measured in seconds, minutes, hours and days. The format is \"2 days ago\" or \"3 hours ago\" or \"4 minutes ago\" or \"5 seconds ago\", i.e. \"<integer> <unit> ago\".\nIf you aren't sure, you can use a default range of \"0 minutes ago\" to \"2 hours ago\" or more. Better to err on the side of including too much than too little.\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"objective\": \"<What the user wants to summarize>\",\n \"start\": \"0 minutes ago\",\n \"end\": \"2 hours ago\"\n}\n```";
|
|
19
|
+
export declare const DATE_RANGE_TEMPLATE = "# Messages we are summarizing (the conversation is continued after this)\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting a summary of the conversation. Your goal is to determine their objective, along with the range of dates that their request covers.\nThe \"objective\" is a detailed description of what the user wants to summarize based on the conversation. If they just ask for a general summary, you can either base it off the conversation if the summary range is very recent, or set the object to be general, like \"a detailed summary of the conversation between all users\".\nThe \"start\" and \"end\" are the range of dates that the user wants to summarize, relative to the current time. The start and end should be relative to the current time, and measured in seconds, minutes, hours and days. The format is \"2 days ago\" or \"3 hours ago\" or \"4 minutes ago\" or \"5 seconds ago\", i.e. \"<integer> <unit> ago\".\nIf you aren't sure, you can use a default range of \"0 minutes ago\" to \"2 hours ago\" or more. Better to err on the side of including too much than too little.\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"objective\": \"<What the user wants to summarize>\",\n \"start\": \"0 minutes ago\",\n \"end\": \"2 hours ago\"\n}\n```";
|
|
20
|
+
export declare const getUserInfoTemplate = "# Getting Discord user information\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting information about a Discord user. Extract:\n1. The user identifier (username, user ID, or mention)\n2. Whether they want detailed server-specific info\n\nExamples:\n- \"who is @john?\" -> userIdentifier: \"john\", detailed: false\n- \"tell me about user 123456789\" -> userIdentifier: \"123456789\", detailed: false \n- \"get detailed info on @admin\" -> userIdentifier: \"admin\", detailed: true\n- \"who am I?\" -> userIdentifier: \"self\", detailed: false\n\nYour response must be formatted as a JSON block:\n```json\n{\n \"userIdentifier\": \"<username|user-id|mention|self>\",\n \"detailed\": true/false\n}\n```";
|
|
21
|
+
export declare const GET_USER_INFO_TEMPLATE = "# Getting Discord user information\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting information about a Discord user. Extract:\n1. The user identifier (username, user ID, or mention)\n2. Whether they want detailed server-specific info\n\nExamples:\n- \"who is @john?\" -> userIdentifier: \"john\", detailed: false\n- \"tell me about user 123456789\" -> userIdentifier: \"123456789\", detailed: false \n- \"get detailed info on @admin\" -> userIdentifier: \"admin\", detailed: true\n- \"who am I?\" -> userIdentifier: \"self\", detailed: false\n\nYour response must be formatted as a JSON block:\n```json\n{\n \"userIdentifier\": \"<username|user-id|mention|self>\",\n \"detailed\": true/false\n}\n```";
|
|
22
|
+
export declare const joinChannelTemplate = "# Messages we are searching for channel join information\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting the bot to join a specific Discord channel (text or voice). Your goal is to determine which channel they want to join.\n\nExtract the channel identifier from their request:\n- If they mention a channel like #general or <#channelid>, extract that\n- If they provide a channel name, extract that\n- If they provide a channel ID (long number), extract that\n- If they mention \"voice\", \"vc\", \"voice channel\", include that as a hint\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"channelIdentifier\": \"<channel-name|channel-id|#mention>\",\n \"isVoiceChannel\": true/false\n}\n```";
|
|
23
|
+
export declare const JOIN_CHANNEL_TEMPLATE = "# Messages we are searching for channel join information\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting the bot to join a specific Discord channel (text or voice). Your goal is to determine which channel they want to join.\n\nExtract the channel identifier from their request:\n- If they mention a channel like #general or <#channelid>, extract that\n- If they provide a channel name, extract that\n- If they provide a channel ID (long number), extract that\n- If they mention \"voice\", \"vc\", \"voice channel\", include that as a hint\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"channelIdentifier\": \"<channel-name|channel-id|#mention>\",\n \"isVoiceChannel\": true/false\n}\n```";
|
|
24
|
+
export declare const leaveChannelTemplate = "# Messages we are searching for channel leave information\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting the bot to leave a specific Discord channel (text or voice). Your goal is to determine which channel they want to leave.\n\nExtract the channel identifier from their request:\n- If they mention a channel like #general or <#channelid>, extract that\n- If they provide a channel name (like \"dev-voice\" or \"general\"), extract just the name\n- If they provide a channel ID (long number), extract that\n- If they say \"this channel\" or \"here\", use \"current\"\n- If they don't specify a channel but mention \"voice\", \"vc\", use \"current\" and mark as voice\n\nExamples:\n- \"leave the dev-voice channel\" -> channelIdentifier: \"dev-voice\", isVoiceChannel: true\n- \"leave #general\" -> channelIdentifier: \"general\", isVoiceChannel: false\n- \"leave voice\" -> channelIdentifier: \"current\", isVoiceChannel: true\n- \"stop listening to this channel\" -> channelIdentifier: \"current\", isVoiceChannel: false\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"channelIdentifier\": \"<actual-channel-name-or-id-or-current>\",\n \"isVoiceChannel\": true/false\n}\n```";
|
|
25
|
+
export declare const LEAVE_CHANNEL_TEMPLATE = "# Messages we are searching for channel leave information\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting the bot to leave a specific Discord channel (text or voice). Your goal is to determine which channel they want to leave.\n\nExtract the channel identifier from their request:\n- If they mention a channel like #general or <#channelid>, extract that\n- If they provide a channel name (like \"dev-voice\" or \"general\"), extract just the name\n- If they provide a channel ID (long number), extract that\n- If they say \"this channel\" or \"here\", use \"current\"\n- If they don't specify a channel but mention \"voice\", \"vc\", use \"current\" and mark as voice\n\nExamples:\n- \"leave the dev-voice channel\" -> channelIdentifier: \"dev-voice\", isVoiceChannel: true\n- \"leave #general\" -> channelIdentifier: \"general\", isVoiceChannel: false\n- \"leave voice\" -> channelIdentifier: \"current\", isVoiceChannel: true\n- \"stop listening to this channel\" -> channelIdentifier: \"current\", isVoiceChannel: false\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"channelIdentifier\": \"<actual-channel-name-or-id-or-current>\",\n \"isVoiceChannel\": true/false\n}\n```";
|
|
26
|
+
export declare const mediaAttachmentIdTemplate = "# Messages we are transcribing\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting a transcription of a specific media file (audio or video). Your goal is to determine the ID of the attachment they want transcribed.\nThe \"attachmentId\" is the ID of the media file attachment that the user wants transcribed. If not specified, return null.\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"attachmentId\": \"<Attachment ID>\"\n}\n```";
|
|
27
|
+
export declare const MEDIA_ATTACHMENT_ID_TEMPLATE = "# Messages we are transcribing\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting a transcription of a specific media file (audio or video). Your goal is to determine the ID of the attachment they want transcribed.\nThe \"attachmentId\" is the ID of the media file attachment that the user wants transcribed. If not specified, return null.\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"attachmentId\": \"<Attachment ID>\"\n}\n```";
|
|
28
|
+
export declare const mediaUrlTemplate = "# Messages we are searching for a media URL\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting to download a specific media file (video or audio). Your goal is to determine the URL of the media they want to download.\nThe \"mediaUrl\" is the URL of the media file that the user wants downloaded. If not specified, return null.\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"mediaUrl\": \"<Media URL>\"\n}\n```";
|
|
29
|
+
export declare const MEDIA_URL_TEMPLATE = "# Messages we are searching for a media URL\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting to download a specific media file (video or audio). Your goal is to determine the URL of the media they want to download.\nThe \"mediaUrl\" is the URL of the media file that the user wants downloaded. If not specified, return null.\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"mediaUrl\": \"<Media URL>\"\n}\n```";
|
|
30
|
+
export declare const pinMessageTemplate = "# Pinning a Discord message\n{{recentMessages}}\n\n# Instructions: {{senderName}} wants to pin a message. Extract which message they want to pin.\n\nExamples:\n- \"pin that message\" -> messageRef: \"last\"\n- \"pin the last message\" -> messageRef: \"last\"\n- \"pin john's message about the meeting\" -> messageRef: \"john meeting\"\n- \"pin message 123456789\" -> messageRef: \"123456789\"\n\nYour response must be formatted as a JSON block:\n```json\n{\n \"messageRef\": \"<last|previous|message-id|search-text>\"\n}\n```";
|
|
31
|
+
export declare const PIN_MESSAGE_TEMPLATE = "# Pinning a Discord message\n{{recentMessages}}\n\n# Instructions: {{senderName}} wants to pin a message. Extract which message they want to pin.\n\nExamples:\n- \"pin that message\" -> messageRef: \"last\"\n- \"pin the last message\" -> messageRef: \"last\"\n- \"pin john's message about the meeting\" -> messageRef: \"john meeting\"\n- \"pin message 123456789\" -> messageRef: \"123456789\"\n\nYour response must be formatted as a JSON block:\n```json\n{\n \"messageRef\": \"<last|previous|message-id|search-text>\"\n}\n```";
|
|
32
|
+
export declare const reactToMessageTemplate = "# Adding reactions to Discord messages\n{{recentMessages}}\n\n# Instructions: {{senderName}} wants to add a reaction to a message. Extract:\n1. Which message to react to (last, specific message reference, or by content)\n2. What emoji/reaction to add\n\nExamples:\n- \"react with \uD83D\uDC4D to the last message\" -> messageRef: \"last\", emoji: \"\uD83D\uDC4D\"\n- \"add :fire: reaction\" -> messageRef: \"last\", emoji: \"\uD83D\uDD25\" or \":fire:\"\n- \"react to that message with \u2764\uFE0F\" -> messageRef: \"previous\", emoji: \"\u2764\uFE0F\"\n- \"add a thumbs up to john's message about the meeting\" -> messageRef: \"john meeting\", emoji: \"\uD83D\uDC4D\"\n\nYour response must be formatted as a JSON block:\n```json\n{\n \"messageRef\": \"<last|previous|message-id|search-text>\",\n \"emoji\": \"<emoji-character|:emoji-name:>\"\n}\n```";
|
|
33
|
+
export declare const REACT_TO_MESSAGE_TEMPLATE = "# Adding reactions to Discord messages\n{{recentMessages}}\n\n# Instructions: {{senderName}} wants to add a reaction to a message. Extract:\n1. Which message to react to (last, specific message reference, or by content)\n2. What emoji/reaction to add\n\nExamples:\n- \"react with \uD83D\uDC4D to the last message\" -> messageRef: \"last\", emoji: \"\uD83D\uDC4D\"\n- \"add :fire: reaction\" -> messageRef: \"last\", emoji: \"\uD83D\uDD25\" or \":fire:\"\n- \"react to that message with \u2764\uFE0F\" -> messageRef: \"previous\", emoji: \"\u2764\uFE0F\"\n- \"add a thumbs up to john's message about the meeting\" -> messageRef: \"john meeting\", emoji: \"\uD83D\uDC4D\"\n\nYour response must be formatted as a JSON block:\n```json\n{\n \"messageRef\": \"<last|previous|message-id|search-text>\",\n \"emoji\": \"<emoji-character|:emoji-name:>\"\n}\n```";
|
|
34
|
+
export declare const searchMessagesTemplate = "# Searching for Discord messages\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting to search for messages in Discord. Extract:\n1. The search query/keywords\n2. The channel to search in (current if not specified)\n3. Optional filters like author, time range, or message count\n\nExamples:\n- \"search for messages containing 'meeting'\" -> query: \"meeting\", channelIdentifier: \"current\", NO author field\n- \"find messages from @user about bugs\" -> query: \"bugs\", channelIdentifier: \"current\", author: \"user\"\n- \"search #general for links from last week\" -> query: \"links\", channelIdentifier: \"general\", timeRange: \"week\"\n- \"search for messages about 'spartan' in this channel\" -> query: \"spartan\", channelIdentifier: \"current\"\n\nYour response must be formatted as a JSON block:\n```json\n{\n \"query\": \"<search keywords>\",\n \"channelIdentifier\": \"<channel-name|channel-id|current>\",\n \"author\": \"<username>\",\n \"timeRange\": \"<hour|day|week|month>\",\n \"limit\": <number between 1-100, default 20>\n}\n```";
|
|
35
|
+
export declare const SEARCH_MESSAGES_TEMPLATE = "# Searching for Discord messages\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting to search for messages in Discord. Extract:\n1. The search query/keywords\n2. The channel to search in (current if not specified)\n3. Optional filters like author, time range, or message count\n\nExamples:\n- \"search for messages containing 'meeting'\" -> query: \"meeting\", channelIdentifier: \"current\", NO author field\n- \"find messages from @user about bugs\" -> query: \"bugs\", channelIdentifier: \"current\", author: \"user\"\n- \"search #general for links from last week\" -> query: \"links\", channelIdentifier: \"general\", timeRange: \"week\"\n- \"search for messages about 'spartan' in this channel\" -> query: \"spartan\", channelIdentifier: \"current\"\n\nYour response must be formatted as a JSON block:\n```json\n{\n \"query\": \"<search keywords>\",\n \"channelIdentifier\": \"<channel-name|channel-id|current>\",\n \"author\": \"<username>\",\n \"timeRange\": \"<hour|day|week|month>\",\n \"limit\": <number between 1-100, default 20>\n}\n```";
|
|
36
|
+
export declare const sendDmTemplate = "# Messages we are searching for DM information\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting to send a direct message to a specific Discord user. Your goal is to determine:\n1. The recipient they want to message (could be a username, user ID, or mentioned user)\n2. The message content they want to send\n\nExtract the recipient identifier and the message content from their request.\n- If they mention a user like @username or <@userid>, extract that\n- If they provide a username or display name, extract that\n- If they provide a user ID (long number), extract that\n- Extract the complete message they want to send\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"recipientIdentifier\": \"<username|user-id|@mention>\",\n \"messageContent\": \"<the message to send>\"\n}\n```";
|
|
37
|
+
export declare const SEND_DM_TEMPLATE = "# Messages we are searching for DM information\n{{recentMessages}}\n\n# Instructions: {{senderName}} is requesting to send a direct message to a specific Discord user. Your goal is to determine:\n1. The recipient they want to message (could be a username, user ID, or mentioned user)\n2. The message content they want to send\n\nExtract the recipient identifier and the message content from their request.\n- If they mention a user like @username or <@userid>, extract that\n- If they provide a username or display name, extract that\n- If they provide a user ID (long number), extract that\n- Extract the complete message they want to send\n\nYour response must be formatted as a JSON block with this structure:\n```json\n{\n \"recipientIdentifier\": \"<username|user-id|@mention>\",\n \"messageContent\": \"<the message to send>\"\n}\n```";
|
|
38
|
+
export declare const summarizationTemplate = "# Summarized so far (we are adding to this)\n{{currentSummary}}\n\n# Current conversation chunk we are summarizing (includes attachments)\n{{memoriesWithAttachments}}\n\nSummarization objective: {{objective}}\n\n# Instructions: Summarize the conversation so far. Return the summary. Do not acknowledge this request, just summarize and continue the existing summary if there is one. Capture any important details to the objective. Only respond with the new summary text.\nYour response should be extremely detailed and include any and all relevant information.";
|
|
39
|
+
export declare const SUMMARIZATION_TEMPLATE = "# Summarized so far (we are adding to this)\n{{currentSummary}}\n\n# Current conversation chunk we are summarizing (includes attachments)\n{{memoriesWithAttachments}}\n\nSummarization objective: {{objective}}\n\n# Instructions: Summarize the conversation so far. Return the summary. Do not acknowledge this request, just summarize and continue the existing summary if there is one. Capture any important details to the objective. Only respond with the new summary text.\nYour response should be extremely detailed and include any and all relevant information.";
|
|
40
|
+
export declare const transcriptionTemplate = "# Transcription of media file\n{{mediaTranscript}}\n\n# Instructions: Return only the full transcript of the media file without any additional prompt or commentary.";
|
|
41
|
+
export declare const TRANSCRIPTION_TEMPLATE = "# Transcription of media file\n{{mediaTranscript}}\n\n# Instructions: Return only the full transcript of the media file without any additional prompt or commentary.";
|
|
42
|
+
export declare const unpinMessageTemplate = "# Unpinning a Discord message\n{{recentMessages}}\n\n# Instructions: {{senderName}} wants to unpin a message. Extract which message they want to unpin.\n\nExamples:\n- \"unpin that message\" -> messageRef: \"last_pinned\"\n- \"unpin the last pinned message\" -> messageRef: \"last_pinned\"\n- \"unpin john's message\" -> messageRef: \"john\"\n- \"unpin message about the meeting\" -> messageRef: \"meeting\"\n\nYour response must be formatted as a JSON block:\n```json\n{\n \"messageRef\": \"<last_pinned|message-id|search-text>\"\n}\n```";
|
|
43
|
+
export declare const UNPIN_MESSAGE_TEMPLATE = "# Unpinning a Discord message\n{{recentMessages}}\n\n# Instructions: {{senderName}} wants to unpin a message. Extract which message they want to unpin.\n\nExamples:\n- \"unpin that message\" -> messageRef: \"last_pinned\"\n- \"unpin the last pinned message\" -> messageRef: \"last_pinned\"\n- \"unpin john's message\" -> messageRef: \"john\"\n- \"unpin message about the meeting\" -> messageRef: \"meeting\"\n\nYour response must be formatted as a JSON block:\n```json\n{\n \"messageRef\": \"<last_pinned|message-id|search-text>\"\n}\n```";
|
|
44
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../../generated/prompts/typescript/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,qBAAqB,ytBAa3B,CAAC;AAER,eAAO,MAAM,uBAAuB,ytBAAwB,CAAC;AAE7D,eAAO,MAAM,+BAA+B,sbAQoN,CAAC;AAEjQ,eAAO,MAAM,iCAAiC,sbACd,CAAC;AAEjC,eAAO,MAAM,mBAAmB,09BAqBzB,CAAC;AAER,eAAO,MAAM,qBAAqB,09BAAsB,CAAC;AAEzD,eAAO,MAAM,kBAAkB,6vBAqBxB,CAAC;AAER,eAAO,MAAM,oBAAoB,6vBAAqB,CAAC;AAEvD,eAAO,MAAM,iBAAiB,2yCAevB,CAAC;AAER,eAAO,MAAM,mBAAmB,2yCAAoB,CAAC;AAErD,eAAO,MAAM,mBAAmB,utBAmBzB,CAAC;AAER,eAAO,MAAM,sBAAsB,utBAAsB,CAAC;AAE1D,eAAO,MAAM,mBAAmB,mvBAiBzB,CAAC;AAER,eAAO,MAAM,qBAAqB,mvBAAsB,CAAC;AAEzD,eAAO,MAAM,oBAAoB,2tCAwB1B,CAAC;AAER,eAAO,MAAM,sBAAsB,2tCAAuB,CAAC;AAE3D,eAAO,MAAM,yBAAyB,8eAW/B,CAAC;AAER,eAAO,MAAM,4BAA4B,8eAA4B,CAAC;AAEtE,eAAO,MAAM,gBAAgB,ydAWtB,CAAC;AAER,eAAO,MAAM,kBAAkB,ydAAmB,CAAC;AAEnD,eAAO,MAAM,kBAAkB,mhBAgBxB,CAAC;AAER,eAAO,MAAM,oBAAoB,mhBAAqB,CAAC;AAEvD,eAAO,MAAM,sBAAsB,01BAmB5B,CAAC;AAER,eAAO,MAAM,yBAAyB,01BAAyB,CAAC;AAEhE,eAAO,MAAM,sBAAsB,mjCAuB5B,CAAC;AAER,eAAO,MAAM,wBAAwB,mjCAAyB,CAAC;AAE/D,eAAO,MAAM,cAAc,+0BAmBpB,CAAC;AAER,eAAO,MAAM,gBAAgB,+0BAAiB,CAAC;AAE/C,eAAO,MAAM,qBAAqB,ojBASuD,CAAC;AAE1F,eAAO,MAAM,sBAAsB,ojBAAwB,CAAC;AAE5D,eAAO,MAAM,qBAAqB,yKAG6E,CAAC;AAEhH,eAAO,MAAM,sBAAsB,yKAAwB,CAAC;AAE5D,eAAO,MAAM,oBAAoB,giBAgB1B,CAAC;AAER,eAAO,MAAM,sBAAsB,giBAAuB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper functions to lookup action/provider/evaluator 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, prompts/evaluators.json and regenerate.
|
|
7
|
+
*/
|
|
8
|
+
import { type ActionDoc, type EvaluatorDoc, 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
|
+
/**
|
|
36
|
+
* Get an evaluator spec by name from the core specs.
|
|
37
|
+
* @param name - The evaluator name
|
|
38
|
+
* @returns The evaluator spec or undefined if not found
|
|
39
|
+
*/
|
|
40
|
+
export declare function getEvaluatorSpec(name: string): EvaluatorDoc | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Get an evaluator spec by name, throwing if not found.
|
|
43
|
+
* @param name - The evaluator name
|
|
44
|
+
* @returns The evaluator spec
|
|
45
|
+
* @throws Error if the evaluator is not found
|
|
46
|
+
*/
|
|
47
|
+
export declare function requireEvaluatorSpec(name: string): EvaluatorDoc;
|
|
48
|
+
export type { ActionDoc, ProviderDoc, EvaluatorDoc };
|
|
49
|
+
//# sourceMappingURL=spec-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-helpers.d.ts","sourceRoot":"","sources":["../../../generated/specs/spec-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACN,KAAK,SAAS,EAOd,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,MAAM,SAAS,CAAC;AAsBjB;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAWzD;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;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAM/D;AAGD,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC"}
|