@elizaos/core 1.0.0-beta.6 → 1.0.0-beta.61

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 (54) hide show
  1. package/LICENSE +1 -1
  2. package/dist/actions.d.ts +2 -8
  3. package/dist/database.d.ts +27 -9
  4. package/dist/index.d.ts +5 -3
  5. package/dist/index.js +32959 -7083
  6. package/dist/instrumentation/index.d.ts +2 -0
  7. package/dist/instrumentation/service.d.ts +20 -0
  8. package/dist/instrumentation/types.d.ts +16 -0
  9. package/dist/prompts.d.ts +3 -200
  10. package/dist/roles.d.ts +5 -1
  11. package/dist/runtime.d.ts +95 -44
  12. package/dist/search.d.ts +316 -0
  13. package/dist/sentry/instrument.d.ts +2 -0
  14. package/dist/settings.d.ts +79 -1
  15. package/dist/types.d.ts +502 -78
  16. package/dist/utils.d.ts +231 -0
  17. package/package.json +18 -4
  18. package/dist/actions/choice.d.ts +0 -13
  19. package/dist/actions/followRoom.d.ts +0 -20
  20. package/dist/actions/ignore.d.ts +0 -13
  21. package/dist/actions/muteRoom.d.ts +0 -22
  22. package/dist/actions/none.d.ts +0 -9
  23. package/dist/actions/reply.d.ts +0 -15
  24. package/dist/actions/roles.d.ts +0 -13
  25. package/dist/actions/sendMessage.d.ts +0 -14
  26. package/dist/actions/settings.d.ts +0 -21
  27. package/dist/actions/unfollowRoom.d.ts +0 -12
  28. package/dist/actions/unmuteRoom.d.ts +0 -18
  29. package/dist/actions/updateEntity.d.ts +0 -42
  30. package/dist/bootstrap.d.ts +0 -14
  31. package/dist/evaluators/reflection.d.ts +0 -2
  32. package/dist/import.d.ts +0 -9
  33. package/dist/providers/actions.d.ts +0 -14
  34. package/dist/providers/anxiety.d.ts +0 -9
  35. package/dist/providers/attachments.d.ts +0 -8
  36. package/dist/providers/capabilities.d.ts +0 -13
  37. package/dist/providers/character.d.ts +0 -9
  38. package/dist/providers/choice.d.ts +0 -10
  39. package/dist/providers/entities.d.ts +0 -2
  40. package/dist/providers/evaluators.d.ts +0 -26
  41. package/dist/providers/facts.d.ts +0 -10
  42. package/dist/providers/knowledge.d.ts +0 -13
  43. package/dist/providers/providers.d.ts +0 -6
  44. package/dist/providers/recentMessages.d.ts +0 -13
  45. package/dist/providers/relationships.d.ts +0 -14
  46. package/dist/providers/roles.d.ts +0 -14
  47. package/dist/providers/settings.d.ts +0 -6
  48. package/dist/providers/shouldRespond.d.ts +0 -6
  49. package/dist/providers/time.d.ts +0 -11
  50. package/dist/services/index.d.ts +0 -1
  51. package/dist/services/scenario.d.ts +0 -106
  52. package/dist/services/task.d.ts +0 -72
  53. package/dist/services/websocket.d.ts +0 -73
  54. package/dist/uuid.d.ts +0 -18
@@ -0,0 +1,231 @@
1
+ import { Buffer } from 'buffer';
2
+ import type { Entity, IAgentRuntime, Memory, State, TemplateType } from './types';
3
+ import { UUID } from './types';
4
+ declare const Readable: any;
5
+ /**
6
+ * Generates a WAV file header based on the provided audio parameters.
7
+ * @param {number} audioLength - The length of the audio data in bytes.
8
+ * @param {number} sampleRate - The sample rate of the audio.
9
+ * @param {number} [channelCount=1] - The number of channels (default is 1).
10
+ * @param {number} [bitsPerSample=16] - The number of bits per sample (default is 16).
11
+ * @returns {Buffer} The WAV file header as a Buffer object.
12
+ */
13
+ declare function getWavHeader(audioLength: number, sampleRate: number, channelCount?: number, bitsPerSample?: number): Buffer;
14
+ /**
15
+ * Prepends a WAV header to a readable stream of audio data.
16
+ *
17
+ * @param {Readable} readable - The readable stream containing the audio data.
18
+ * @param {number} audioLength - The length of the audio data in seconds.
19
+ * @param {number} sampleRate - The sample rate of the audio data.
20
+ * @param {number} [channelCount=1] - The number of channels in the audio data (default is 1).
21
+ * @param {number} [bitsPerSample=16] - The number of bits per sample in the audio data (default is 16).
22
+ * @returns {Readable} A new readable stream with the WAV header prepended to the audio data.
23
+ */
24
+ declare function prependWavHeader(readable: typeof Readable, audioLength: number, sampleRate: number, channelCount?: number, bitsPerSample?: number): typeof Readable;
25
+ export { getWavHeader, prependWavHeader };
26
+ /**
27
+ * Convert all double-brace bindings in a Handlebars template
28
+ * to triple-brace bindings, so the output is NOT HTML-escaped.
29
+ *
30
+ * - Ignores block/partial/comment tags that start with # / ! >.
31
+ * - Ignores the else keyword.
32
+ * - Ignores bindings that are already triple-braced.
33
+ *
34
+ * @param tpl Handlebars template source
35
+ * @return Transformed template
36
+ */
37
+ export declare function upgradeDoubleToTriple(tpl: any): any;
38
+ /**
39
+ * Composes a context string by replacing placeholders in a template with corresponding values from the state.
40
+ *
41
+ * This function takes a template string with placeholders in the format `{{placeholder}}` and a state object.
42
+ * It replaces each placeholder with the value from the state object that matches the placeholder's name.
43
+ * If a matching key is not found in the state object for a given placeholder, the placeholder is replaced with an empty string.
44
+ *
45
+ * @param {Object} params - The parameters for composing the context.
46
+ * @param {State} params.state - The state object containing values to replace the placeholders in the template.
47
+ * @param {TemplateType} params.template - The template string or function containing placeholders to be replaced with state values.
48
+ * @returns {string} The composed context string with placeholders replaced by corresponding state values.
49
+ *
50
+ * @example
51
+ * // Given a state object and a template
52
+ * const state = { userName: "Alice", userAge: 30 };
53
+ * const template = "Hello, {{userName}}! You are {{userAge}} years old";
54
+ *
55
+ * // Composing the context with simple string replacement will result in:
56
+ * // "Hello, Alice! You are 30 years old."
57
+ * const contextSimple = composePromptFromState({ state, template });
58
+ *
59
+ * // Using composePromptFromState with a template function for dynamic template
60
+ * const template = ({ state }) => {
61
+ * const tone = Math.random() > 0.5 ? "kind" : "rude";
62
+ * return `Hello, {{userName}}! You are {{userAge}} years old. Be ${tone}`;
63
+ * };
64
+ * const contextSimple = composePromptFromState({ state, template });
65
+ */
66
+ /**
67
+ * Function to compose a prompt using a provided template and state.
68
+ * It compiles the template (upgrading double braces to triple braces for non-HTML escaping)
69
+ * and then populates it with values from the state. Additionally, it processes the
70
+ * resulting string with `composeRandomUser` to replace placeholders like `{{nameX}}`.
71
+ *
72
+ * @param {Object} options - Object containing state and template information.
73
+ * @param {State} options.state - The state object containing values to fill the template.
74
+ * @param {TemplateType} options.template - The template string or function to be used for composing the prompt.
75
+ * @returns {string} The composed prompt output, with state values and random user names populated.
76
+ */
77
+ export declare const composePrompt: ({ state, template, }: {
78
+ state: {
79
+ [key: string]: string;
80
+ };
81
+ template: TemplateType;
82
+ }) => string;
83
+ /**
84
+ * Function to compose a prompt using a provided template and state.
85
+ *
86
+ * @param {Object} options - Object containing state and template information.
87
+ * @param {State} options.state - The state object containing values to fill the template.
88
+ * @param {TemplateType} options.template - The template to be used for composing the prompt.
89
+ * @returns {string} The composed prompt output.
90
+ */
91
+ export declare const composePromptFromState: ({ state, template, }: {
92
+ state: State;
93
+ template: TemplateType;
94
+ }) => string;
95
+ /**
96
+ * Adds a header to a body of text.
97
+ *
98
+ * This function takes a header string and a body string and returns a new string with the header prepended to the body.
99
+ * If the body string is empty, the header is returned as is.
100
+ *
101
+ * @param {string} header - The header to add to the body.
102
+ * @param {string} body - The body to which to add the header.
103
+ * @returns {string} The body with the header prepended.
104
+ *
105
+ * @example
106
+ * // Given a header and a body
107
+ * const header = "Header";
108
+ * const body = "Body";
109
+ *
110
+ * // Adding the header to the body will result in:
111
+ * // "Header\nBody"
112
+ * const text = addHeader(header, body);
113
+ */
114
+ export declare const addHeader: (header: string, body: string) => string;
115
+ /**
116
+ * Generates a string with random user names populated in a template.
117
+ *
118
+ * This function generates random user names and populates placeholders
119
+ * in the provided template with these names. Placeholders in the template should follow the format `{{userX}}`
120
+ * where `X` is the position of the user (e.g., `{{name1}}`, `{{name2}}`).
121
+ *
122
+ * @param {string} template - The template string containing placeholders for random user names.
123
+ * @param {number} length - The number of random user names to generate.
124
+ * @returns {string} The template string with placeholders replaced by random user names.
125
+ *
126
+ * @example
127
+ * // Given a template and a length
128
+ * const template = "Hello, {{name1}}! Meet {{name2}} and {{name3}}.";
129
+ * const length = 3;
130
+ *
131
+ * // Composing the random user string will result in:
132
+ * // "Hello, John! Meet Alice and Bob."
133
+ * const result = composeRandomUser(template, length);
134
+ */
135
+ export declare const composeRandomUser: (template: string, length: number) => string;
136
+ export declare const formatPosts: ({ messages, entities, conversationHeader, }: {
137
+ messages: Memory[];
138
+ entities: Entity[];
139
+ conversationHeader?: boolean;
140
+ }) => string;
141
+ /**
142
+ * Format messages into a string
143
+ * @param {Object} params - The formatting parameters
144
+ * @param {Memory[]} params.messages - List of messages to format
145
+ * @param {Entity[]} params.entities - List of entities for name resolution
146
+ * @returns {string} Formatted message string with timestamps and user information
147
+ */
148
+ export declare const formatMessages: ({ messages, entities, }: {
149
+ messages: Memory[];
150
+ entities: Entity[];
151
+ }) => string;
152
+ export declare const formatTimestamp: (messageDate: number) => string;
153
+ /**
154
+ * Parses key-value pairs from a simple XML structure within a given text.
155
+ * It looks for an XML block (e.g., <response>...</response>) and extracts
156
+ * text content from direct child elements (e.g., <key>value</key>).
157
+ *
158
+ * Note: This uses regex and is suitable for simple, predictable XML structures.
159
+ * For complex XML, a proper parsing library is recommended.
160
+ *
161
+ * @param text - The input text containing the XML structure.
162
+ * @returns An object with key-value pairs extracted from the XML, or null if parsing fails.
163
+ */
164
+ export declare function parseKeyValueXml(text: string): Record<string, any> | null;
165
+ /**
166
+ * Parses a JSON object from a given text. The function looks for a JSON block wrapped in triple backticks
167
+ * with `json` language identifier, and if not found, it searches for an object pattern within the text.
168
+ * It then attempts to parse the JSON string into a JavaScript object. If parsing is successful and the result
169
+ * is an object (but not an array), it returns the object; otherwise, it tries to parse an array if the result
170
+ * is an array, or returns null if parsing is unsuccessful or the result is neither an object nor an array.
171
+ *
172
+ * @param text - The input text from which to extract and parse the JSON object.
173
+ * @returns An object parsed from the JSON string if successful; otherwise, null or the result of parsing an array.
174
+ */
175
+ export declare function parseJSONObjectFromText(text: string): Record<string, any> | null;
176
+ /**
177
+ * Normalizes a JSON-like string by correcting formatting issues:
178
+ * - Removes extra spaces after '{' and before '}'.
179
+ * - Wraps unquoted values in double quotes.
180
+ * - Converts single-quoted values to double-quoted.
181
+ * - Ensures consistency in key-value formatting.
182
+ * - Normalizes mixed adjacent quote pairs.
183
+ *
184
+ * This is useful for cleaning up improperly formatted JSON strings
185
+ * before parsing them into valid JSON.
186
+ *
187
+ * @param str - The JSON-like string to normalize.
188
+ * @returns A properly formatted JSON string.
189
+ */
190
+ export declare const normalizeJsonString: (str: string) => string;
191
+ export type ActionResponse = {
192
+ like: boolean;
193
+ retweet: boolean;
194
+ quote?: boolean;
195
+ reply?: boolean;
196
+ };
197
+ /**
198
+ * Truncate text to fit within the character limit, ensuring it ends at a complete sentence.
199
+ */
200
+ export declare function truncateToCompleteSentence(text: string, maxLength: number): string;
201
+ export declare function splitChunks(content: string, chunkSize?: number, bleed?: number): Promise<string[]>;
202
+ /**
203
+ * Trims the provided text prompt to a specified token limit using a tokenizer model and type.
204
+ */
205
+ export declare function trimTokens(prompt: string, maxTokens: number, runtime: IAgentRuntime): Promise<string>;
206
+ export declare function safeReplacer(): (key: string, value: any) => any;
207
+ /**
208
+ * Parses a string to determine its boolean equivalent.
209
+ *
210
+ * Recognized affirmative values: "YES", "Y", "TRUE", "T", "1", "ON", "ENABLE"
211
+ * Recognized negative values: "NO", "N", "FALSE", "F", "0", "OFF", "DISABLE"
212
+ *
213
+ * @param {string | undefined | null} value - The input text to parse
214
+ * @returns {boolean} - Returns `true` for affirmative inputs, `false` for negative or unrecognized inputs
215
+ */
216
+ export declare function parseBooleanFromText(value: string | undefined | null): boolean;
217
+ /**
218
+ * Validates a UUID value.
219
+ *
220
+ * @param {unknown} value - The value to validate.
221
+ * @returns {UUID | null} Returns the validated UUID value or null if validation fails.
222
+ */
223
+ export declare function validateUuid(value: unknown): UUID | null;
224
+ /**
225
+ * Converts a string or number to a UUID.
226
+ *
227
+ * @param {string | number} target - The string or number to convert to a UUID.
228
+ * @returns {UUID} The UUID generated from the input target.
229
+ * @throws {TypeError} Throws an error if the input target is not a string.
230
+ */
231
+ export declare function stringToUuid(target: string | number): UUID;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/core",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.61",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -41,7 +41,7 @@
41
41
  "@rollup/plugin-terser": "0.1.0",
42
42
  "@rollup/plugin-typescript": "11.1.6",
43
43
  "@types/mocha": "10.0.10",
44
- "@types/node": "^22.13.9",
44
+ "@types/node": "^22.15.3",
45
45
  "@types/uuid": "10.0.0",
46
46
  "@typescript-eslint/eslint-plugin": "8.26.0",
47
47
  "@typescript-eslint/parser": "8.26.0",
@@ -58,6 +58,17 @@
58
58
  "typescript": "5.8.2"
59
59
  },
60
60
  "dependencies": {
61
+ "@opentelemetry/api": "^1.9.0",
62
+ "@opentelemetry/exporter-trace-otlp-http": "^0.53.0",
63
+ "@opentelemetry/instrumentation": "^0.201.0",
64
+ "@opentelemetry/instrumentation-pg": "^0.52.0",
65
+ "@opentelemetry/resources": "^2.0.1",
66
+ "@opentelemetry/sdk-metrics": "^1.26.0",
67
+ "@opentelemetry/sdk-node": "^0.53.0",
68
+ "@opentelemetry/sdk-trace-node": "^2.0.1",
69
+ "@opentelemetry/semantic-conventions": "^1.33.0",
70
+ "buffer": "^6.0.3",
71
+ "crypto-browserify": "^3.12.1",
61
72
  "dotenv": "16.4.5",
62
73
  "events": "^3.3.0",
63
74
  "glob": "11.0.0",
@@ -66,11 +77,14 @@
66
77
  "langchain": "^0.3.15",
67
78
  "pino": "^9.6.0",
68
79
  "pino-pretty": "^13.0.0",
80
+ "stream-browserify": "^3.0.0",
69
81
  "unique-names-generator": "4.7.1",
70
- "uuid": "11.0.3"
82
+ "uuid": "11.0.3",
83
+ "vitest": "^3.1.3",
84
+ "zod": "^3.24.4"
71
85
  },
72
86
  "publishConfig": {
73
87
  "access": "public"
74
88
  },
75
- "gitHead": "6ef747c2f7c011513d35e729986318ac5316c6a1"
89
+ "gitHead": "b27e2146d8c3ed5c2e883403bdb1f59aaae2679d"
76
90
  }
@@ -1,13 +0,0 @@
1
- import { type Action } from '../types';
2
- /**
3
- * Represents an action that allows selecting an option for a pending task that has multiple options.
4
- * @type {Action}
5
- * @property {string} name - The name of the action
6
- * @property {string[]} similes - Similar words or phrases for the action
7
- * @property {string} description - A brief description of the action
8
- * @property {Function} validate - Asynchronous function to validate the action
9
- * @property {Function} handler - Asynchronous function to handle the action
10
- * @property {ActionExample[][]} examples - Examples demonstrating the usage of the action
11
- */
12
- export declare const choiceAction: Action;
13
- export default choiceAction;
@@ -1,20 +0,0 @@
1
- import { type Action } from '../types';
2
- /**
3
- * Template for deciding if {{agentName}} should start following a room.
4
- * The decision is based on various criteria, including recent messages and user interactions.
5
- * Respond with YES if:
6
- * - The user has directly asked {{agentName}} to follow the conversation
7
- * - The conversation topic is engaging and {{agentName}}'s input would add value
8
- * - {{agentName}} has unique insights to contribute and users seem receptive
9
- * Otherwise, respond with NO.
10
- */
11
- export declare const shouldFollowTemplate = "# Task: Decide if {{agentName}} should start following this room, i.e. eagerly participating without explicit mentions.\n\n{{recentMessages}}\n\nShould {{agentName}} start following this room, eagerly participating without explicit mentions?\nRespond with YES if:\n- The user has directly asked {{agentName}} to follow the conversation or participate more actively\n- The conversation topic is highly engaging and {{agentName}}'s input would add significant value\n- {{agentName}} has unique insights to contribute and the users seem receptive\n\nOtherwise, respond with NO.\nRespond with only a YES or a NO.";
12
- /**
13
- * Action for following a room with great interest.
14
- * Similes: FOLLOW_CHAT, FOLLOW_CHANNEL, FOLLOW_CONVERSATION, FOLLOW_THREAD
15
- * Description: Start following this channel with great interest, chiming in without needing to be explicitly mentioned. Only do this if explicitly asked to.
16
- * @param {IAgentRuntime} runtime - The current agent runtime.
17
- * @param {Memory} message - The message memory.
18
- * @returns {Promise<boolean>} - Promise that resolves to a boolean indicating if the room should be followed.
19
- */
20
- export declare const followRoomAction: Action;
@@ -1,13 +0,0 @@
1
- import type { Action } from '../types';
2
- /**
3
- * Action representing the IGNORE action. This action is used when ignoring the user in a conversation.
4
- *
5
- * @type {Action}
6
- * @property {string} name - The name of the action, which is "IGNORE".
7
- * @property {string[]} similes - An array of related similes for the action.
8
- * @property {Function} validate - Asynchronous function that validates the action.
9
- * @property {string} description - Description of when to use the IGNORE action in a conversation.
10
- * @property {Function} handler - Asynchronous function that handles the action logic.
11
- * @property {ActionExample[][]} examples - Array of examples demonstrating the usage of the IGNORE action.
12
- */
13
- export declare const ignoreAction: Action;
@@ -1,22 +0,0 @@
1
- import { type Action } from '../types';
2
- /**
3
- * Template string for deciding if the agent should mute a room and stop responding unless explicitly mentioned.
4
- *
5
- * @type {string}
6
- */
7
- export declare const shouldMuteTemplate = "# Task: Decide if {{agentName}} should mute this room and stop responding unless explicitly mentioned.\n\n{{recentMessages}}\n\nShould {{agentName}} mute this room and stop responding unless explicitly mentioned?\n\nRespond with YES if:\n- The user is being aggressive, rude, or inappropriate\n- The user has directly asked {{agentName}} to stop responding or be quiet\n- {{agentName}}'s responses are not well-received or are annoying the user(s)\n\nOtherwise, respond with NO.\nRespond with only a YES or a NO.";
8
- /**
9
- * Action for muting a room, ignoring all messages unless explicitly mentioned.
10
- * Only do this if explicitly asked to, or if you're annoying people.
11
- *
12
- * @name MUTE_ROOM
13
- * @type {Action}
14
- *
15
- * @property {string} name - The name of the action
16
- * @property {string[]} similes - Similar actions related to muting a room
17
- * @property {string} description - Description of the action
18
- * @property {Function} validate - Validation function to check if the room is not already muted
19
- * @property {Function} handler - Handler function to handle muting the room
20
- * @property {ActionExample[][]} examples - Examples of using the action
21
- */
22
- export declare const muteRoomAction: Action;
@@ -1,9 +0,0 @@
1
- import type { Action } from '../types';
2
- /**
3
- * Represents the none action.
4
- *
5
- * This action responds but performs no additional action. It is the default if the agent is speaking and not doing anything additional.
6
- *
7
- * @type {Action}
8
- */
9
- export declare const noneAction: Action;
@@ -1,15 +0,0 @@
1
- import { type Action } from '../types';
2
- /**
3
- * Represents an action that allows the agent to reply to the current conversation with a generated message.
4
- *
5
- * This action can be used as an acknowledgement at the beginning of a chain of actions, or as a final response at the end of a chain of actions.
6
- *
7
- * @typedef {Object} replyAction
8
- * @property {string} name - The name of the action ("REPLY").
9
- * @property {string[]} similes - An array of similes for the action.
10
- * @property {string} description - A description of the action and its usage.
11
- * @property {Function} validate - An asynchronous function for validating the action runtime.
12
- * @property {Function} handler - An asynchronous function for handling the action logic.
13
- * @property {ActionExample[][]} examples - An array of example scenarios for the action.
14
- */
15
- export declare const replyAction: Action;
@@ -1,13 +0,0 @@
1
- import { type Action } from '../types';
2
- /**
3
- * Represents an action to update the role of a user within a server.
4
- * @typedef {Object} Action
5
- * @property {string} name - The name of the action.
6
- * @property {string[]} similes - The similar actions that can be performed.
7
- * @property {string} description - A description of the action and its purpose.
8
- * @property {Function} validate - A function to validate the action before execution.
9
- * @property {Function} handler - A function to handle the execution of the action.
10
- * @property {ActionExample[][]} examples - Examples demonstrating how the action can be used.
11
- */
12
- declare const updateRoleAction: Action;
13
- export default updateRoleAction;
@@ -1,14 +0,0 @@
1
- import { type Action } from '../types';
2
- /**
3
- * Represents an action to send a message to a user or room.
4
- *
5
- * @typedef {Action} sendMessageAction
6
- * @property {string} name - The name of the action.
7
- * @property {string[]} similes - Additional names for the action.
8
- * @property {string} description - Description of the action.
9
- * @property {function} validate - Asynchronous function to validate if the action can be executed.
10
- * @property {function} handler - Asynchronous function to handle the action execution.
11
- * @property {ActionExample[][]} examples - Examples demonstrating the usage of the action.
12
- */
13
- export declare const sendMessageAction: Action;
14
- export default sendMessageAction;
@@ -1,21 +0,0 @@
1
- import { type Action, type IAgentRuntime, type WorldSettings } from '../types';
2
- /**
3
- * Gets settings state from world metadata
4
- */
5
- /**
6
- * Retrieves the settings for a specific world from the database.
7
- * @param {IAgentRuntime} runtime - The Agent Runtime instance.
8
- * @param {string} serverId - The ID of the server.
9
- * @returns {Promise<WorldSettings | null>} The settings of the world, or null if not found.
10
- */
11
- export declare function getWorldSettings(runtime: IAgentRuntime, serverId: string): Promise<WorldSettings | null>;
12
- /**
13
- * Updates settings state in world metadata
14
- */
15
- export declare function updateWorldSettings(runtime: IAgentRuntime, serverId: string, worldSettings: WorldSettings): Promise<boolean>;
16
- /**
17
- * Enhanced settings action with improved state management and logging
18
- * Updated to use world metadata instead of cache
19
- */
20
- declare const updateSettingsAction: Action;
21
- export default updateSettingsAction;
@@ -1,12 +0,0 @@
1
- import { type Action } from '../types';
2
- /**
3
- * Action for unfollowing a room.
4
- *
5
- * - Name: UNFOLLOW_ROOM
6
- * - Similes: ["UNFOLLOW_CHAT", "UNFOLLOW_CONVERSATION", "UNFOLLOW_ROOM", "UNFOLLOW_THREAD"]
7
- * - Description: Stop following this channel. You can still respond if explicitly mentioned, but you won't automatically chime in anymore. Unfollow if you're annoying people or have been asked to.
8
- * - Validate function checks if the room state is "FOLLOWED".
9
- * - Handler function handles the unfollowing logic based on user input.
10
- * - Examples provide sample interactions for unfollowing a room.
11
- */
12
- export declare const unfollowRoomAction: Action;
@@ -1,18 +0,0 @@
1
- import { type Action } from '../types';
2
- /**
3
- * Template for determining if an agent should unmute a previously muted room.
4
- * * @type { string }
5
- */
6
- export declare const shouldUnmuteTemplate = "# Task: Decide if {{agentName}} should unmute this previously muted room and start considering it for responses again.\n\n{{recentMessages}}\n\nShould {{agentName}} unmute this previously muted room and start considering it for responses again?\nRespond with YES if:\n- The user has explicitly asked {{agentName}} to start responding again\n- The user seems to want to re-engage with {{agentName}} in a respectful manner\n- The tone of the conversation has improved and {{agentName}}'s input would be welcome\n\nOtherwise, respond with NO.\nRespond with only a YES or a NO.";
7
- /**
8
- * Action to unmute a room, allowing the agent to consider responding to messages again.
9
- *
10
- * @name UNMUTE_ROOM
11
- * @similes ["UNMUTE_CHAT", "UNMUTE_CONVERSATION", "UNMUTE_ROOM", "UNMUTE_THREAD"]
12
- * @description Unmutes a room, allowing the agent to consider responding to messages again.
13
- *
14
- * @param {IAgentRuntime} runtime - The agent runtime to access runtime functionalities.
15
- * @param {Memory} message - The message containing information about the room.
16
- * @returns {Promise<boolean>} A boolean value indicating if the room was successfully unmuted.
17
- */
18
- export declare const unmuteRoomAction: Action;
@@ -1,42 +0,0 @@
1
- import { type Action } from '../types';
2
- /**
3
- * Action for updating contact details for a user entity.
4
- *
5
- * @name UPDATE_ENTITY
6
- * @description Add or edit contact details for a user entity (like twitter, discord, email address, etc.)
7
- *
8
- * @param {IAgentRuntime} _runtime - The runtime environment.
9
- * @param {Memory} _message - The message data.
10
- * @param {State} _state - The current state.
11
- * @returns {Promise<boolean>} Returns a promise indicating if validation was successful.
12
- *
13
- * @param {IAgentRuntime} runtime - The runtime environment.
14
- * @param {Memory} message - The message data.
15
- * @param {State} state - The current state.
16
- * @param {any} _options - Additional options.
17
- * @param {HandlerCallback} callback - The callback function.
18
- * @param {Memory[]} responses - Array of responses.
19
- * @returns {Promise<void>} Promise that resolves after handling the update entity action.
20
- *
21
- * @example
22
- * [
23
- * [
24
- * {
25
- * name: "{{name1}}",
26
- * content: {
27
- * text: "Please update my telegram username to @dev_guru",
28
- * },
29
- * },
30
- * {
31
- * name: "{{name2}}",
32
- * content: {
33
- * text: "I've updated your telegram information.",
34
- * actions: ["UPDATE_ENTITY"],
35
- * },
36
- * },
37
- * ],
38
- * ...
39
- * ]
40
- */
41
- export declare const updateEntityAction: Action;
42
- export default updateEntityAction;
@@ -1,14 +0,0 @@
1
- import { type Media, type Plugin } from './types';
2
- type MediaData = {
3
- data: Buffer;
4
- mediaType: string;
5
- };
6
- /**
7
- * Fetches media data from a list of attachments, supporting both HTTP URLs and local file paths.
8
- *
9
- * @param attachments Array of Media objects containing URLs or file paths to fetch media from
10
- * @returns Promise that resolves with an array of MediaData objects containing the fetched media data and content type
11
- */
12
- export declare function fetchMediaData(attachments: Media[]): Promise<MediaData[]>;
13
- export declare const bootstrapPlugin: Plugin;
14
- export default bootstrapPlugin;
@@ -1,2 +0,0 @@
1
- import { type Evaluator } from '../types';
2
- export declare const reflectionEvaluator: Evaluator;
package/dist/import.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export declare const dynamicImport: (specifier: string) => Promise<any>;
2
- export declare const registerDynamicImport: (specifier: string, module: any) => void;
3
- /**
4
- * Handles importing of plugins asynchronously.
5
- *
6
- * @param {string[]} plugins - An array of strings representing the plugins to import.
7
- * @returns {Promise<Function[]>} - A Promise that resolves to an array of imported plugins functions.
8
- */
9
- export declare function handlePluginImporting(plugins: string[]): Promise<any[]>;
@@ -1,14 +0,0 @@
1
- import type { Provider } from '../types';
2
- /**
3
- * A provider object that fetches possible response actions based on the provided runtime, message, and state.
4
- * @type {Provider}
5
- * @property {string} name - The name of the provider ("ACTIONS").
6
- * @property {string} description - The description of the provider ("Possible response actions").
7
- * @property {number} position - The position of the provider (-1).
8
- * @property {Function} get - Asynchronous function that retrieves actions that validate for the given message.
9
- * @param {IAgentRuntime} runtime - The runtime object.
10
- * @param {Memory} message - The message memory.
11
- * @param {State} state - The state object.
12
- * @returns {Object} An object containing the actions data, values, and combined text sections.
13
- */
14
- export declare const actionsProvider: Provider;
@@ -1,9 +0,0 @@
1
- import type { Provider } from '../types';
2
- /**
3
- * Represents an anxiety provider that provides examples and guidance for an AI roleplaying as a character.
4
- * The anxiety provider offers suggestions on how to reduce verbosity and eagerness in responses based on the channel type.
5
- * Randomly selects and returns three anxiety examples for the AI to follow.
6
- *
7
- * @type {Provider}
8
- */
9
- export declare const anxietyProvider: Provider;
@@ -1,8 +0,0 @@
1
- import type { Provider } from '../types';
2
- /**
3
- * Provides a list of attachments in the current conversation.
4
- * @param {IAgentRuntime} runtime - The agent runtime object.
5
- * @param {Memory} message - The message memory object.
6
- * @returns {Object} The attachments values, data, and text.
7
- */
8
- export declare const attachmentsProvider: Provider;
@@ -1,13 +0,0 @@
1
- import type { Provider } from '../types';
2
- /**
3
- * Provider that collects capability descriptions from all registered services
4
- */
5
- /**
6
- * Provides capabilities information for the agent.
7
- *
8
- * @param {IAgentRuntime} runtime - The agent runtime instance.
9
- * @param {Memory} _message - The memory message object.
10
- * @returns {Promise<ProviderResult>} The provider result object containing capabilities information.
11
- */
12
- export declare const capabilitiesProvider: Provider;
13
- export default capabilitiesProvider;
@@ -1,9 +0,0 @@
1
- import { type Provider } from '../types';
2
- /**
3
- * Character provider object.
4
- * @typedef {Object} Provider
5
- * @property {string} name - The name of the provider ("CHARACTER").
6
- * @property {string} description - Description of the character information.
7
- * @property {Function} get - Async function to get character information.
8
- */
9
- export declare const characterProvider: Provider;
@@ -1,10 +0,0 @@
1
- import type { Provider } from '../types';
2
- /**
3
- * Choice provider function that retrieves all pending tasks with options for a specific room
4
- *
5
- * @param {IAgentRuntime} runtime - The runtime object for the agent
6
- * @param {Memory} message - The message memory object
7
- * @returns {Promise<ProviderResult>} A promise that resolves with the provider result containing the pending tasks with options
8
- */
9
- export declare const choiceProvider: Provider;
10
- export default choiceProvider;
@@ -1,2 +0,0 @@
1
- import type { Provider } from '../types';
2
- export declare const entitiesProvider: Provider;
@@ -1,26 +0,0 @@
1
- import type { Evaluator, Provider } from '../types';
2
- /**
3
- * Formats the names of evaluators into a comma-separated list, each enclosed in single quotes.
4
- * @param evaluators - An array of evaluator objects.
5
- * @returns A string that concatenates the names of all evaluators, each enclosed in single quotes and separated by commas.
6
- */
7
- /**
8
- * Formats the names of the evaluators in the provided array.
9
- *
10
- * @param {Evaluator[]} evaluators - Array of evaluators.
11
- * @returns {string} - Formatted string of evaluator names.
12
- */
13
- export declare function formatEvaluatorNames(evaluators: Evaluator[]): string;
14
- /**
15
- * Formats evaluator examples into a readable string, replacing placeholders with generated names.
16
- * @param evaluators - An array of evaluator objects, each containing examples to format.
17
- * @returns A string that presents each evaluator example in a structured format, including context, messages, and outcomes, with placeholders replaced by generated names.
18
- */
19
- export declare function formatEvaluatorExamples(evaluators: Evaluator[]): string;
20
- /**
21
- * Formats evaluator details into a string, including both the name and description of each evaluator.
22
- * @param evaluators - An array of evaluator objects.
23
- * @returns A string that concatenates the name and description of each evaluator, separated by a colon and a newline character.
24
- */
25
- export declare function formatEvaluators(evaluators: Evaluator[]): string;
26
- export declare const evaluatorsProvider: Provider;