@elizaos/core 1.0.0-alpha.57 → 1.0.0-alpha.59

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.
@@ -1,3 +1,14 @@
1
- import { type Plugin } from "./types";
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[]>;
2
13
  export declare const bootstrapPlugin: Plugin;
3
14
  export default bootstrapPlugin;
@@ -1,4 +1,4 @@
1
- import type { Agent, Component, Entity, IDatabaseAdapter, Memory, Participant, Relationship, Room, Task, UUID, World } from "./types";
1
+ import type { Agent, Component, Entity, IDatabaseAdapter, Log, Memory, Participant, Relationship, Room, Task, UUID, World } from "./types";
2
2
  /**
3
3
  * An abstract class representing a database adapter for managing various entities
4
4
  * like entities, memories, entities, goals, and rooms.
@@ -132,6 +132,24 @@ export declare abstract class DatabaseAdapter<DB = unknown> implements IDatabase
132
132
  roomId: UUID;
133
133
  type: string;
134
134
  }): Promise<void>;
135
+ /**
136
+ * Retrieves logs based on the specified parameters.
137
+ * @param params An object containing parameters for the log retrieval.
138
+ * @returns A Promise that resolves to an array of Log objects.
139
+ */
140
+ abstract getLogs(params: {
141
+ entityId: UUID;
142
+ roomId?: UUID;
143
+ type?: string;
144
+ count?: number;
145
+ offset?: number;
146
+ }): Promise<Log[]>;
147
+ /**
148
+ * Deletes a log from the database.
149
+ * @param logId The UUID of the log to delete.
150
+ * @returns A Promise that resolves when the log has been deleted.
151
+ */
152
+ abstract deleteLog(logId: UUID): Promise<void>;
135
153
  /**
136
154
  * Searches for memories based on embeddings and other specified parameters.
137
155
  * @param params An object containing parameters for the memory search.
@@ -156,17 +174,16 @@ export declare abstract class DatabaseAdapter<DB = unknown> implements IDatabase
156
174
  /**
157
175
  * Removes a specific memory from the database.
158
176
  * @param memoryId The UUID of the memory to remove.
159
- * @param tableName The table from which the memory should be removed.
160
177
  * @returns A Promise that resolves when the memory has been removed.
161
178
  */
162
- abstract removeMemory(memoryId: UUID, tableName: string): Promise<void>;
179
+ abstract deleteMemory(memoryId: UUID): Promise<void>;
163
180
  /**
164
181
  * Removes all memories associated with a specific room.
165
182
  * @param roomId The UUID of the room whose memories should be removed.
166
183
  * @param tableName The table from which the memories should be removed.
167
184
  * @returns A Promise that resolves when all memories have been removed.
168
185
  */
169
- abstract removeAllMemories(roomId: UUID, tableName: string): Promise<void>;
186
+ abstract deleteAllMemories(roomId: UUID, tableName: string): Promise<void>;
170
187
  /**
171
188
  * Counts the number of memories in a specific room.
172
189
  * @param roomId The UUID of the room for which to count memories.
package/dist/index.d.ts CHANGED
@@ -5,7 +5,6 @@ export * from "./entities";
5
5
  export * from "./environment";
6
6
  export * from "./import";
7
7
  export * from "./logger";
8
- export * from "./memory";
9
8
  export * from "./prompts";
10
9
  export * from "./roles";
11
10
  export * from "./runtime";