@elizaos/core 1.0.0-beta.1 → 1.0.0-beta.13
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/LICENSE +1 -1
- package/dist/audioUtils.d.ts +23 -0
- package/dist/import.d.ts +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +438 -5905
- package/dist/roles.d.ts +5 -1
- package/dist/runtime.d.ts +3 -16
- package/dist/settings.d.ts +80 -1
- package/dist/types.d.ts +25 -5
- package/dist/uuid.d.ts +6 -0
- package/package.json +6 -2
- package/dist/actions/choice.d.ts +0 -13
- package/dist/actions/followRoom.d.ts +0 -20
- package/dist/actions/ignore.d.ts +0 -13
- package/dist/actions/muteRoom.d.ts +0 -22
- package/dist/actions/none.d.ts +0 -9
- package/dist/actions/reply.d.ts +0 -15
- package/dist/actions/roles.d.ts +0 -13
- package/dist/actions/sendMessage.d.ts +0 -14
- package/dist/actions/settings.d.ts +0 -21
- package/dist/actions/unfollowRoom.d.ts +0 -12
- package/dist/actions/unmuteRoom.d.ts +0 -18
- package/dist/actions/updateEntity.d.ts +0 -42
- package/dist/bootstrap.d.ts +0 -14
- package/dist/evaluators/reflection.d.ts +0 -2
- package/dist/providers/actions.d.ts +0 -14
- package/dist/providers/anxiety.d.ts +0 -9
- package/dist/providers/attachments.d.ts +0 -8
- package/dist/providers/capabilities.d.ts +0 -13
- package/dist/providers/character.d.ts +0 -9
- package/dist/providers/choice.d.ts +0 -10
- package/dist/providers/entities.d.ts +0 -2
- package/dist/providers/evaluators.d.ts +0 -26
- package/dist/providers/facts.d.ts +0 -10
- package/dist/providers/knowledge.d.ts +0 -13
- package/dist/providers/providers.d.ts +0 -6
- package/dist/providers/recentMessages.d.ts +0 -13
- package/dist/providers/relationships.d.ts +0 -14
- package/dist/providers/roles.d.ts +0 -14
- package/dist/providers/settings.d.ts +0 -6
- package/dist/providers/shouldRespond.d.ts +0 -6
- package/dist/providers/time.d.ts +0 -11
- package/dist/services/index.d.ts +0 -1
- package/dist/services/scenario.d.ts +0 -106
- package/dist/services/task.d.ts +0 -72
- package/dist/services/websocket.d.ts +0 -73
package/dist/roles.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import { type IAgentRuntime, Role, type World } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Represents the state of server ownership, including a mapping of server IDs to their respective World objects.
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* Interface representing the ownership state of servers.
|
|
7
|
+
* @property {Object.<string, World>} servers - The servers and their corresponding worlds, where the key is the server ID and the value is the World object.
|
|
8
|
+
*/
|
|
5
9
|
export interface ServerOwnershipState {
|
|
6
10
|
servers: {
|
|
7
11
|
[serverId: string]: World;
|
|
@@ -22,4 +26,4 @@ export declare function getUserServerRole(runtime: IAgentRuntime, entityId: stri
|
|
|
22
26
|
/**
|
|
23
27
|
* Finds a server where the given user is the owner
|
|
24
28
|
*/
|
|
25
|
-
export declare function
|
|
29
|
+
export declare function findWorldsForOwner(runtime: IAgentRuntime, entityId: string): Promise<World[] | null>;
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
import { ChannelType } from './types';
|
|
2
|
-
import type { Action, Agent, Character, Component, Entity, Evaluator, HandlerCallback, IAgentRuntime, IDatabaseAdapter, KnowledgeItem, Log, Memory, MemoryMetadata, ModelParamsMap, ModelResultMap, ModelTypeName, Participant, Plugin, Provider, Relationship, Room, Route, Service, ServiceTypeName, State, Task, TaskWorker, UUID, World } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Interface for settings object with key-value pairs.
|
|
5
|
-
*/
|
|
6
|
-
interface Settings {
|
|
7
|
-
[key: string]: string | undefined;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Loads environment variables from the nearest .env file in Node.js
|
|
11
|
-
* or returns configured settings in browser
|
|
12
|
-
* @returns {Settings} Environment variables object
|
|
13
|
-
*/
|
|
14
|
-
export declare function loadEnvConfig(): Settings;
|
|
2
|
+
import type { Action, Agent, Character, Component, Entity, Evaluator, HandlerCallback, IAgentRuntime, IDatabaseAdapter, KnowledgeItem, Log, Memory, MemoryMetadata, ModelParamsMap, ModelResultMap, ModelTypeName, Participant, Plugin, Provider, Relationship, Room, Route, RuntimeSettings, Service, ServiceTypeName, State, Task, TaskWorker, UUID, World } from './types';
|
|
15
3
|
export declare class Semaphore {
|
|
16
4
|
private permits;
|
|
17
5
|
private waiting;
|
|
@@ -71,10 +59,10 @@ export declare class AgentRuntime implements IAgentRuntime {
|
|
|
71
59
|
plugins?: Plugin[];
|
|
72
60
|
fetch?: typeof fetch;
|
|
73
61
|
adapter?: IDatabaseAdapter;
|
|
62
|
+
settings?: RuntimeSettings;
|
|
74
63
|
events?: {
|
|
75
64
|
[key: string]: ((params: any) => void)[];
|
|
76
65
|
};
|
|
77
|
-
ignoreBootstrap?: boolean;
|
|
78
66
|
});
|
|
79
67
|
/**
|
|
80
68
|
* Registers a plugin with the runtime and initializes its components
|
|
@@ -168,7 +156,7 @@ export declare class AgentRuntime implements IAgentRuntime {
|
|
|
168
156
|
* @returns The room ID of the room between the agent and the user.
|
|
169
157
|
* @throws An error if the room cannot be created.
|
|
170
158
|
*/
|
|
171
|
-
ensureRoomExists({ id, name, source, type, channelId, serverId, worldId }: Room): Promise<void>;
|
|
159
|
+
ensureRoomExists({ id, name, source, type, channelId, serverId, worldId, metadata }: Room): Promise<void>;
|
|
172
160
|
/**
|
|
173
161
|
* Composes the agent's state by gathering data from enabled providers.
|
|
174
162
|
* @param message - The message to use as context for state composition
|
|
@@ -325,4 +313,3 @@ export declare class AgentRuntime implements IAgentRuntime {
|
|
|
325
313
|
off(event: string, callback: (data: any) => void): void;
|
|
326
314
|
emit(event: string, data: any): void;
|
|
327
315
|
}
|
|
328
|
-
export {};
|
package/dist/settings.d.ts
CHANGED
|
@@ -1,4 +1,54 @@
|
|
|
1
|
-
import type { IAgentRuntime, OnboardingConfig, World, WorldSettings } from './types';
|
|
1
|
+
import type { Character, IAgentRuntime, OnboardingConfig, Setting, World, WorldSettings } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new Setting object based on provided config settings.
|
|
4
|
+
* @param {Omit<Setting, "value">} configSetting - The configuration settings for the new Setting object.
|
|
5
|
+
* @returns {Setting} - The newly created Setting object.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Creates a Setting object from a configSetting object by omitting the 'value' property.
|
|
9
|
+
*
|
|
10
|
+
* @param {Omit<Setting, 'value'>} configSetting - The configSetting object to create the Setting from.
|
|
11
|
+
* @returns {Setting} A new Setting object created from the provided configSetting object.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createSettingFromConfig(configSetting: Omit<Setting, 'value'>): Setting;
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves the salt based on env variable SECRET_SALT
|
|
16
|
+
*
|
|
17
|
+
* @returns {string} The salt for the agent.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getSalt(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Common encryption function for string values
|
|
22
|
+
* @param {string} value - The string value to encrypt
|
|
23
|
+
* @param {string} salt - The salt to use for encryption
|
|
24
|
+
* @returns {string} - The encrypted value in 'iv:encrypted' format
|
|
25
|
+
*/
|
|
26
|
+
export declare function encryptStringValue(value: string, salt: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Common decryption function for string values
|
|
29
|
+
* @param {string} value - The encrypted value in 'iv:encrypted' format
|
|
30
|
+
* @param {string} salt - The salt to use for decryption
|
|
31
|
+
* @returns {string} - The decrypted string value
|
|
32
|
+
*/
|
|
33
|
+
export declare function decryptStringValue(value: string, salt: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Applies salt to the value of a setting
|
|
36
|
+
* Only applies to secret settings with string values
|
|
37
|
+
*/
|
|
38
|
+
export declare function saltSettingValue(setting: Setting, salt: string): Setting;
|
|
39
|
+
/**
|
|
40
|
+
* Removes salt from the value of a setting
|
|
41
|
+
* Only applies to secret settings with string values
|
|
42
|
+
*/
|
|
43
|
+
export declare function unsaltSettingValue(setting: Setting, salt: string): Setting;
|
|
44
|
+
/**
|
|
45
|
+
* Applies salt to all settings in a WorldSettings object
|
|
46
|
+
*/
|
|
47
|
+
export declare function saltWorldSettings(worldSettings: WorldSettings, salt: string): WorldSettings;
|
|
48
|
+
/**
|
|
49
|
+
* Removes salt from all settings in a WorldSettings object
|
|
50
|
+
*/
|
|
51
|
+
export declare function unsaltWorldSettings(worldSettings: WorldSettings, salt: string): WorldSettings;
|
|
2
52
|
/**
|
|
3
53
|
* Updates settings state in world metadata
|
|
4
54
|
*/
|
|
@@ -11,3 +61,32 @@ export declare function getWorldSettings(runtime: IAgentRuntime, serverId: strin
|
|
|
11
61
|
* Initializes settings configuration for a server
|
|
12
62
|
*/
|
|
13
63
|
export declare function initializeOnboarding(runtime: IAgentRuntime, world: World, config: OnboardingConfig): Promise<WorldSettings | null>;
|
|
64
|
+
/**
|
|
65
|
+
* Encrypts sensitive data in a Character object
|
|
66
|
+
* @param {Character} character - The character object to encrypt secrets for
|
|
67
|
+
* @param {IAgentRuntime} runtime - The runtime information needed for salt generation
|
|
68
|
+
* @returns {Character} - A copy of the character with encrypted secrets
|
|
69
|
+
*/
|
|
70
|
+
export declare function encryptedCharacter(character: Character): Character;
|
|
71
|
+
/**
|
|
72
|
+
* Decrypts sensitive data in a Character object
|
|
73
|
+
* @param {Character} character - The character object with encrypted secrets
|
|
74
|
+
* @param {IAgentRuntime} runtime - The runtime information needed for salt generation
|
|
75
|
+
* @returns {Character} - A copy of the character with decrypted secrets
|
|
76
|
+
*/
|
|
77
|
+
export declare function decryptedCharacter(character: Character, runtime: IAgentRuntime): Character;
|
|
78
|
+
/**
|
|
79
|
+
* Helper function to encrypt all string values in an object
|
|
80
|
+
* @param {Record<string, any>} obj - Object with values to encrypt
|
|
81
|
+
* @param {string} salt - The salt to use for encryption
|
|
82
|
+
* @returns {Record<string, any>} - Object with encrypted values
|
|
83
|
+
*/
|
|
84
|
+
export declare function encryptObjectValues(obj: Record<string, any>, salt: string): Record<string, any>;
|
|
85
|
+
/**
|
|
86
|
+
* Helper function to decrypt all string values in an object
|
|
87
|
+
* @param {Record<string, any>} obj - Object with encrypted values
|
|
88
|
+
* @param {string} salt - The salt to use for decryption
|
|
89
|
+
* @returns {Record<string, any>} - Object with decrypted values
|
|
90
|
+
*/
|
|
91
|
+
export declare function decryptObjectValues(obj: Record<string, any>, salt: string): Record<string, any>;
|
|
92
|
+
export { decryptStringValue as decryptSecret };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { Readable } from 'node:stream';
|
|
2
1
|
/**
|
|
3
2
|
* Type definition for a Universally Unique Identifier (UUID) using a specific format.
|
|
4
3
|
* @typedef {`${string}-${string}-${string}-${string}-${string}`} UUID
|
|
5
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* Defines a custom type UUID representing a universally unique identifier
|
|
7
|
+
*/
|
|
6
8
|
export type UUID = `${string}-${string}-${string}-${string}-${string}`;
|
|
7
9
|
/**
|
|
8
10
|
* Helper function to safely cast a string to strongly typed UUID
|
|
@@ -749,9 +751,6 @@ export interface UnifiedSearchOptions extends UnifiedMemoryOptions {
|
|
|
749
751
|
embedding: number[];
|
|
750
752
|
similarity?: number;
|
|
751
753
|
}
|
|
752
|
-
export type CacheOptions = {
|
|
753
|
-
expires?: number;
|
|
754
|
-
};
|
|
755
754
|
export interface IAgentRuntime extends IDatabaseAdapter {
|
|
756
755
|
agentId: UUID;
|
|
757
756
|
character: Character;
|
|
@@ -817,6 +816,15 @@ export interface IAgentRuntime extends IDatabaseAdapter {
|
|
|
817
816
|
stop(): Promise<void>;
|
|
818
817
|
addEmbeddingToMemory(memory: Memory): Promise<Memory>;
|
|
819
818
|
}
|
|
819
|
+
/**
|
|
820
|
+
* Interface for settings object with key-value pairs.
|
|
821
|
+
*/
|
|
822
|
+
/**
|
|
823
|
+
* Interface representing settings with string key-value pairs.
|
|
824
|
+
*/
|
|
825
|
+
export interface RuntimeSettings {
|
|
826
|
+
[key: string]: string | undefined;
|
|
827
|
+
}
|
|
820
828
|
export type KnowledgeItem = {
|
|
821
829
|
id: UUID;
|
|
822
830
|
content: Content;
|
|
@@ -1157,7 +1165,7 @@ export interface ModelResultMap {
|
|
|
1157
1165
|
description: string;
|
|
1158
1166
|
};
|
|
1159
1167
|
[ModelType.TRANSCRIPTION]: string;
|
|
1160
|
-
[ModelType.TEXT_TO_SPEECH]:
|
|
1168
|
+
[ModelType.TEXT_TO_SPEECH]: any | Buffer;
|
|
1161
1169
|
[ModelType.AUDIO]: any;
|
|
1162
1170
|
[ModelType.VIDEO]: any;
|
|
1163
1171
|
[ModelType.OBJECT_SMALL]: any;
|
|
@@ -1205,6 +1213,7 @@ export declare enum PlatformPrefix {
|
|
|
1205
1213
|
export interface EventPayload {
|
|
1206
1214
|
runtime: IAgentRuntime;
|
|
1207
1215
|
source: string;
|
|
1216
|
+
onComplete?: () => void;
|
|
1208
1217
|
}
|
|
1209
1218
|
/**
|
|
1210
1219
|
* Payload for world-related events
|
|
@@ -1234,6 +1243,7 @@ export interface EntityPayload extends EventPayload {
|
|
|
1234
1243
|
export interface MessagePayload extends EventPayload {
|
|
1235
1244
|
message: Memory;
|
|
1236
1245
|
callback?: HandlerCallback;
|
|
1246
|
+
onComplete?: () => void;
|
|
1237
1247
|
}
|
|
1238
1248
|
/**
|
|
1239
1249
|
* Payload for events that are invoked without a message
|
|
@@ -1243,6 +1253,7 @@ export interface InvokePayload extends EventPayload {
|
|
|
1243
1253
|
userId: string;
|
|
1244
1254
|
roomId: UUID;
|
|
1245
1255
|
callback?: HandlerCallback;
|
|
1256
|
+
source: string;
|
|
1246
1257
|
}
|
|
1247
1258
|
/**
|
|
1248
1259
|
* Run event payload type
|
|
@@ -1289,6 +1300,7 @@ export type MessageReceivedHandlerParams = {
|
|
|
1289
1300
|
runtime: IAgentRuntime;
|
|
1290
1301
|
message: Memory;
|
|
1291
1302
|
callback: HandlerCallback;
|
|
1303
|
+
onComplete?: () => void;
|
|
1292
1304
|
};
|
|
1293
1305
|
/**
|
|
1294
1306
|
* Maps event types to their corresponding payload types
|
|
@@ -1475,3 +1487,11 @@ export type DbConnection = unknown;
|
|
|
1475
1487
|
export type MetadataObject = Record<string, unknown>;
|
|
1476
1488
|
export type ModelHandler = (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<unknown>;
|
|
1477
1489
|
export type ServiceConfig = Record<string, unknown>;
|
|
1490
|
+
export declare const VECTOR_DIMS: {
|
|
1491
|
+
readonly SMALL: 384;
|
|
1492
|
+
readonly MEDIUM: 512;
|
|
1493
|
+
readonly LARGE: 768;
|
|
1494
|
+
readonly XL: 1024;
|
|
1495
|
+
readonly XXL: 1536;
|
|
1496
|
+
readonly XXXL: 3072;
|
|
1497
|
+
};
|
package/dist/uuid.d.ts
CHANGED
|
@@ -7,6 +7,12 @@ export declare const uuidSchema: z.ZodType<UUID>;
|
|
|
7
7
|
* @param {unknown} value - The value to validate.
|
|
8
8
|
* @returns {UUID | null} Returns the validated UUID value or null if validation fails.
|
|
9
9
|
*/
|
|
10
|
+
/**
|
|
11
|
+
* Validate if the given value is a valid UUID.
|
|
12
|
+
*
|
|
13
|
+
* @param {unknown} value - The value to be validated.
|
|
14
|
+
* @returns {UUID | null} The validated UUID value or null if validation fails.
|
|
15
|
+
*/
|
|
10
16
|
export declare function validateUuid(value: unknown): UUID | null;
|
|
11
17
|
/**
|
|
12
18
|
* Converts a string or number to a UUID.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/core",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -58,6 +58,9 @@
|
|
|
58
58
|
"typescript": "5.8.2"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
+
"@types/hapi__shot": "^6.0.0",
|
|
62
|
+
"buffer": "^6.0.3",
|
|
63
|
+
"crypto-browserify": "^3.12.1",
|
|
61
64
|
"dotenv": "16.4.5",
|
|
62
65
|
"events": "^3.3.0",
|
|
63
66
|
"glob": "11.0.0",
|
|
@@ -66,11 +69,12 @@
|
|
|
66
69
|
"langchain": "^0.3.15",
|
|
67
70
|
"pino": "^9.6.0",
|
|
68
71
|
"pino-pretty": "^13.0.0",
|
|
72
|
+
"stream-browserify": "^3.0.0",
|
|
69
73
|
"unique-names-generator": "4.7.1",
|
|
70
74
|
"uuid": "11.0.3"
|
|
71
75
|
},
|
|
72
76
|
"publishConfig": {
|
|
73
77
|
"access": "public"
|
|
74
78
|
},
|
|
75
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "a55cfb2543a43da6b4c5351edffbd3f752808bfc"
|
|
76
80
|
}
|
package/dist/actions/choice.d.ts
DELETED
|
@@ -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;
|
package/dist/actions/ignore.d.ts
DELETED
|
@@ -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;
|
package/dist/actions/none.d.ts
DELETED
|
@@ -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;
|
package/dist/actions/reply.d.ts
DELETED
|
@@ -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;
|
package/dist/actions/roles.d.ts
DELETED
|
@@ -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;
|
package/dist/bootstrap.d.ts
DELETED
|
@@ -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,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,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;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type Provider } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Function to get key facts that the agent knows.
|
|
4
|
-
* @param {IAgentRuntime} runtime - The runtime environment for the agent.
|
|
5
|
-
* @param {Memory} message - The message object containing relevant information.
|
|
6
|
-
* @param {State} [_state] - Optional state information.
|
|
7
|
-
* @returns {Object} An object containing values, data, and text related to the key facts.
|
|
8
|
-
*/
|
|
9
|
-
declare const factsProvider: Provider;
|
|
10
|
-
export { factsProvider };
|