@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.
Files changed (46) hide show
  1. package/LICENSE +1 -1
  2. package/dist/audioUtils.d.ts +23 -0
  3. package/dist/import.d.ts +6 -0
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +438 -5905
  6. package/dist/roles.d.ts +5 -1
  7. package/dist/runtime.d.ts +3 -16
  8. package/dist/settings.d.ts +80 -1
  9. package/dist/types.d.ts +25 -5
  10. package/dist/uuid.d.ts +6 -0
  11. package/package.json +6 -2
  12. package/dist/actions/choice.d.ts +0 -13
  13. package/dist/actions/followRoom.d.ts +0 -20
  14. package/dist/actions/ignore.d.ts +0 -13
  15. package/dist/actions/muteRoom.d.ts +0 -22
  16. package/dist/actions/none.d.ts +0 -9
  17. package/dist/actions/reply.d.ts +0 -15
  18. package/dist/actions/roles.d.ts +0 -13
  19. package/dist/actions/sendMessage.d.ts +0 -14
  20. package/dist/actions/settings.d.ts +0 -21
  21. package/dist/actions/unfollowRoom.d.ts +0 -12
  22. package/dist/actions/unmuteRoom.d.ts +0 -18
  23. package/dist/actions/updateEntity.d.ts +0 -42
  24. package/dist/bootstrap.d.ts +0 -14
  25. package/dist/evaluators/reflection.d.ts +0 -2
  26. package/dist/providers/actions.d.ts +0 -14
  27. package/dist/providers/anxiety.d.ts +0 -9
  28. package/dist/providers/attachments.d.ts +0 -8
  29. package/dist/providers/capabilities.d.ts +0 -13
  30. package/dist/providers/character.d.ts +0 -9
  31. package/dist/providers/choice.d.ts +0 -10
  32. package/dist/providers/entities.d.ts +0 -2
  33. package/dist/providers/evaluators.d.ts +0 -26
  34. package/dist/providers/facts.d.ts +0 -10
  35. package/dist/providers/knowledge.d.ts +0 -13
  36. package/dist/providers/providers.d.ts +0 -6
  37. package/dist/providers/recentMessages.d.ts +0 -13
  38. package/dist/providers/relationships.d.ts +0 -14
  39. package/dist/providers/roles.d.ts +0 -14
  40. package/dist/providers/settings.d.ts +0 -6
  41. package/dist/providers/shouldRespond.d.ts +0 -6
  42. package/dist/providers/time.d.ts +0 -11
  43. package/dist/services/index.d.ts +0 -1
  44. package/dist/services/scenario.d.ts +0 -106
  45. package/dist/services/task.d.ts +0 -72
  46. package/dist/services/websocket.d.ts +0 -73
@@ -1,13 +0,0 @@
1
- import type { Provider } from '../types';
2
- /**
3
- * Represents a knowledge provider that retrieves knowledge from the knowledge base.
4
- * @type {Provider}
5
- * @property {string} name - The name of the knowledge provider.
6
- * @property {string} description - The description of the knowledge provider.
7
- * @property {boolean} dynamic - Indicates if the knowledge provider is dynamic or static.
8
- * @property {Function} get - Asynchronously retrieves knowledge from the knowledge base.
9
- * @param {IAgentRuntime} runtime - The agent runtime object.
10
- * @param {Memory} message - The message containing the query for knowledge retrieval.
11
- * @returns {Object} An object containing the retrieved knowledge data, values, and text.
12
- */
13
- export declare const knowledgeProvider: Provider;
@@ -1,6 +0,0 @@
1
- import type { Provider } from '../types';
2
- /**
3
- * Provider for retrieving list of all data providers available for the agent to use.
4
- * @type { Provider }
5
- */
6
- export declare const providersProvider: Provider;
@@ -1,13 +0,0 @@
1
- import { type Provider } from '../types';
2
- /**
3
- * A provider object that retrieves recent messages, interactions, and memories based on a given message.
4
- * @typedef {object} Provider
5
- * @property {string} name - The name of the provider ("RECENT_MESSAGES").
6
- * @property {string} description - A description of the provider's purpose ("Recent messages, interactions and other memories").
7
- * @property {number} position - The position of the provider (100).
8
- * @property {Function} get - Asynchronous function that retrieves recent messages, interactions, and memories.
9
- * @param {IAgentRuntime} runtime - The runtime context for the agent.
10
- * @param {Memory} message - The message to retrieve data from.
11
- * @returns {object} An object containing data, values, and text sections.
12
- */
13
- export declare const recentMessagesProvider: Provider;
@@ -1,14 +0,0 @@
1
- import type { Provider } from '../types';
2
- /**
3
- * Provider for fetching relationships data.
4
- *
5
- * @type {Provider}
6
- * @property {string} name - The name of the provider ("RELATIONSHIPS").
7
- * @property {string} description - Description of the provider.
8
- * @property {Function} get - Asynchronous function to fetch relationships data.
9
- * @param {IAgentRuntime} runtime - The agent runtime object.
10
- * @param {Memory} message - The message object containing entity ID.
11
- * @returns {Promise<Object>} Object containing relationships data or error message.
12
- */
13
- declare const relationshipsProvider: Provider;
14
- export { relationshipsProvider };
@@ -1,14 +0,0 @@
1
- import { type Provider } from '../types';
2
- /**
3
- * Role provider that retrieves roles in the server based on the provided runtime, message, and state.
4
- * * @type { Provider }
5
- * @property { string } name - The name of the role provider.
6
- * @property { string } description - A brief description of the role provider.
7
- * @property { Function } get - Asynchronous function that retrieves and processes roles in the server.
8
- * @param { IAgentRuntime } runtime - The agent runtime object.
9
- * @param { Memory } message - The message memory object.
10
- * @param { State } state - The state object.
11
- * @returns {Promise<ProviderResult>} The result containing roles data, values, and text.
12
- */
13
- export declare const roleProvider: Provider;
14
- export default roleProvider;
@@ -1,6 +0,0 @@
1
- import { type Provider } from '../types';
2
- /**
3
- * Creates an settings provider with the given configuration
4
- * Updated to use world metadata instead of cache
5
- */
6
- export declare const settingsProvider: Provider;
@@ -1,6 +0,0 @@
1
- import type { Provider } from '../types';
2
- /**
3
- * Represents a provider that generates response examples for the agent.
4
- * @type {Provider}
5
- */
6
- export declare const shouldRespondProvider: Provider;
@@ -1,11 +0,0 @@
1
- import type { Provider } from '../types';
2
- /**
3
- * Time provider function that retrieves the current date and time in UTC
4
- * for use in time-based operations or responses.
5
- *
6
- * @param _runtime - The runtime environment of the bot agent.
7
- * @param _message - The memory object containing message data.
8
- * @returns An object containing the current date and time data, human-readable date and time string,
9
- * and a text response with the current date and time information.
10
- */
11
- export declare const timeProvider: Provider;
@@ -1 +0,0 @@
1
- export * from './websocket';
@@ -1,106 +0,0 @@
1
- import { type IAgentRuntime, Service, type UUID } from '../types';
2
- interface ActionTracker {
3
- actionId: UUID;
4
- actionName: string;
5
- startTime: number;
6
- completed: boolean;
7
- error?: Error;
8
- }
9
- interface EvaluatorTracker {
10
- evaluatorId: UUID;
11
- evaluatorName: string;
12
- startTime: number;
13
- completed: boolean;
14
- error?: Error;
15
- }
16
- /**
17
- * Represents a service that allows the agent to interact in a scenario testing environment.
18
- * The agent can create rooms, send messages, and communicate with other agents in a live interactive testing environment.
19
- * @extends Service
20
- */
21
- export declare class ScenarioService extends Service {
22
- protected runtime: IAgentRuntime;
23
- static serviceType: string;
24
- capabilityDescription: string;
25
- private messageHandlers;
26
- private worlds;
27
- private activeActions;
28
- private activeEvaluators;
29
- /**
30
- * Constructor for creating a new instance of the class.
31
- *
32
- * @param runtime - The IAgentRuntime instance to be passed to the constructor.
33
- */
34
- constructor(runtime: IAgentRuntime);
35
- private setupEventListeners;
36
- /**
37
- * Start the scenario service with the given runtime.
38
- * @param {IAgentRuntime} runtime - The agent runtime
39
- * @returns {Promise<ScenarioService>} - The started scenario service
40
- */
41
- static start(runtime: IAgentRuntime): Promise<ScenarioService>;
42
- /**
43
- * Stops the Scenario service associated with the given runtime.
44
- *
45
- * @param {IAgentRuntime} runtime The runtime to stop the service for.
46
- * @throws {Error} When the Scenario service is not found.
47
- */
48
- static stop(runtime: IAgentRuntime): Promise<void>;
49
- /**
50
- * Asynchronously stops the current process by clearing all message handlers and worlds.
51
- */
52
- stop(): Promise<void>;
53
- /**
54
- * Creates a new world with the specified name and owner.
55
- * @param name The name of the world
56
- * @param ownerName The name of the world owner
57
- * @returns The created world's ID
58
- */
59
- createWorld(name: string, ownerName: string): Promise<UUID>;
60
- /**
61
- * Creates a room in the specified world.
62
- * @param worldId The ID of the world to create the room in
63
- * @param name The name of the room
64
- * @returns The created room's ID
65
- */
66
- createRoom(worldId: UUID, name: string): Promise<UUID>;
67
- /**
68
- * Adds a participant to a room
69
- * @param worldId The world ID
70
- * @param roomId The room ID
71
- * @param participantId The participant's ID
72
- */
73
- addParticipant(worldId: UUID, roomId: UUID, participantId: UUID): Promise<void>;
74
- /**
75
- * Sends a message in a specific room
76
- * @param sender The runtime of the sending agent
77
- * @param worldId The world ID
78
- * @param roomId The room ID
79
- * @param text The message text
80
- */
81
- sendMessage(sender: IAgentRuntime, worldId: UUID, roomId: UUID, text: string): Promise<void>;
82
- /**
83
- * Waits for all active actions and evaluators to complete
84
- * @param timeout Maximum time to wait in milliseconds
85
- * @returns True if all completed successfully, false if timeout occurred
86
- */
87
- waitForCompletion(timeout?: number): Promise<boolean>;
88
- /**
89
- * Gets the current state of all active actions and evaluators
90
- */
91
- getActiveState(): {
92
- actions: ActionTracker[];
93
- evaluators: EvaluatorTracker[];
94
- };
95
- /**
96
- * Cleans up the scenario state
97
- */
98
- cleanup(): Promise<void>;
99
- }
100
- /**
101
- * Asynchronously starts the specified scenario for the given list of agent runtimes.
102
- * @param {IAgentRuntime[]} members - The list of agent runtimes participating in the scenario.
103
- * @returns {Promise<void>} - A promise that resolves when all scenarios have been executed.
104
- */
105
- export declare function startScenario(members: IAgentRuntime[]): Promise<void>;
106
- export {};
@@ -1,72 +0,0 @@
1
- import { type IAgentRuntime, Service, type ServiceTypeName } from '../types';
2
- /**
3
- * TaskService class representing a service that schedules and executes tasks.
4
- * @extends Service
5
- * @property {NodeJS.Timeout|null} timer - Timer for executing tasks
6
- * @property {number} TICK_INTERVAL - Interval in milliseconds to check for tasks
7
- * @property {ServiceTypeName} serviceType - Service type of TASK
8
- * @property {string} capabilityDescription - Description of the service's capability
9
- * @static
10
- * @method start - Static method to start the TaskService
11
- * @method createTestTasks - Method to create test tasks
12
- * @method startTimer - Private method to start the timer for checking tasks
13
- * @method validateTasks - Private method to validate tasks
14
- * @method checkTasks - Private method to check tasks and execute them
15
- * @method executeTask - Private method to execute a task
16
- * @static
17
- * @method stop - Static method to stop the TaskService
18
- * @method stop - Method to stop the TaskService
19
- */
20
- export declare class TaskService extends Service {
21
- private timer;
22
- private readonly TICK_INTERVAL;
23
- static serviceType: ServiceTypeName;
24
- capabilityDescription: string;
25
- /**
26
- * Start the TaskService with the given runtime.
27
- * @param {IAgentRuntime} runtime - The runtime for the TaskService.
28
- * @returns {Promise<TaskService>} A promise that resolves with the TaskService instance.
29
- */
30
- static start(runtime: IAgentRuntime): Promise<TaskService>;
31
- /**
32
- * Asynchronously creates test tasks by registering task workers for repeating and one-time tasks,
33
- * validates the tasks, executes the tasks, and creates the tasks if they do not already exist.
34
- */
35
- createTestTasks(): Promise<void>;
36
- /**
37
- * Starts a timer that runs a function to check tasks at a specified interval.
38
- */
39
- private startTimer;
40
- /**
41
- * Validates an array of Task objects.
42
- * Skips tasks without IDs or if no worker is found for the task.
43
- * If a worker has a `validate` function, it will run the validation using the `runtime`, `Memory`, and `State` parameters.
44
- * If the validation fails, the task will be skipped and the error will be logged.
45
- * @param {Task[]} tasks - An array of Task objects to validate.
46
- * @returns {Promise<Task[]>} - A Promise that resolves with an array of validated Task objects.
47
- */
48
- private validateTasks;
49
- /**
50
- * Asynchronous method that checks tasks with "queue" tag, validates and sorts them, then executes them based on interval and tags.
51
- *
52
- * @returns {Promise<void>} Promise that resolves once all tasks are checked and executed
53
- */
54
- private checkTasks;
55
- /**
56
- * Executes a given task asynchronously.
57
- *
58
- * @param {Task} task - The task to be executed.
59
- */
60
- private executeTask;
61
- /**
62
- * Stops the TASK service in the given agent runtime.
63
- *
64
- * @param {IAgentRuntime} runtime - The agent runtime containing the service.
65
- * @returns {Promise<void>} - A promise that resolves once the service has been stopped.
66
- */
67
- static stop(runtime: IAgentRuntime): Promise<void>;
68
- /**
69
- * Stops the timer if it is currently running.
70
- */
71
- stop(): Promise<void>;
72
- }
@@ -1,73 +0,0 @@
1
- import type { SOCKET_MESSAGE_TYPE } from '../types';
2
- /**
3
- * Base interface for a service provider
4
- */
5
- export interface IServiceProvider {
6
- readonly name: string;
7
- }
8
- /**
9
- * Base interface for WebSocket messages
10
- */
11
- export interface WebSocketMessage {
12
- type: SOCKET_MESSAGE_TYPE | string;
13
- payload: any;
14
- }
15
- /**
16
- * Text message payload format
17
- */
18
- export interface TextMessagePayload {
19
- entityId: string;
20
- userName?: string;
21
- text: string;
22
- roomId: string;
23
- source?: string;
24
- worldId?: string;
25
- }
26
- /**
27
- * Options for sending a text message via WebSocket
28
- */
29
- export interface WebSocketMessageOptions {
30
- entityId: string;
31
- userName?: string;
32
- text: string;
33
- roomId: string;
34
- source?: string;
35
- worldId?: string;
36
- }
37
- /**
38
- * Interface for WebSocket service implementations
39
- */
40
- export interface IWebSocketService extends IServiceProvider {
41
- /**
42
- * Connect to the WebSocket server
43
- */
44
- connect(): Promise<void>;
45
- /**
46
- * Join a room on the WebSocket server
47
- */
48
- joinRoom(roomId: string): void;
49
- /**
50
- * Send a message to the WebSocket server
51
- */
52
- sendMessage(message: WebSocketMessage): Promise<void>;
53
- /**
54
- * Send a text message to a room
55
- */
56
- sendTextMessage(options: WebSocketMessageOptions): void;
57
- /**
58
- * Disconnect from the WebSocket server
59
- */
60
- disconnect(): void;
61
- /**
62
- * Check if connected to the WebSocket server
63
- */
64
- isConnected(): boolean;
65
- /**
66
- * Register a message handler
67
- */
68
- onMessage(handler: (message: WebSocketMessage) => void): void;
69
- /**
70
- * Register a text message handler
71
- */
72
- onTextMessage(handler: (payload: TextMessagePayload) => void): void;
73
- }