@elizaos/core 1.0.0-alpha.2 → 1.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -540,6 +540,8 @@ interface Agent extends Character {
|
|
|
540
540
|
interface IDatabaseAdapter {
|
|
541
541
|
/** Database instance */
|
|
542
542
|
db: any;
|
|
543
|
+
/** Initialize database connection */
|
|
544
|
+
init(): Promise<void>;
|
|
543
545
|
/** Close database connection */
|
|
544
546
|
close(): Promise<void>;
|
|
545
547
|
getAgent(agentId: UUID): Promise<Agent | null>;
|
|
@@ -1034,6 +1036,11 @@ declare abstract class DatabaseAdapter<DB = unknown> implements IDatabaseAdapter
|
|
|
1034
1036
|
* The database instance.
|
|
1035
1037
|
*/
|
|
1036
1038
|
db: DB;
|
|
1039
|
+
/**
|
|
1040
|
+
* Initialize the database adapter.
|
|
1041
|
+
* @returns A Promise that resolves when initialization is complete.
|
|
1042
|
+
*/
|
|
1043
|
+
abstract init(): Promise<void>;
|
|
1037
1044
|
/**
|
|
1038
1045
|
* Optional close method for the database adapter.
|
|
1039
1046
|
* @returns A Promise that resolves when closing is complete.
|
package/dist/index.js
CHANGED
|
@@ -11386,6 +11386,7 @@ var AgentRuntime = class {
|
|
|
11386
11386
|
}
|
|
11387
11387
|
async initialize() {
|
|
11388
11388
|
try {
|
|
11389
|
+
await this.getDatabaseAdapter().init();
|
|
11389
11390
|
await this.getDatabaseAdapter().ensureAgentExists(
|
|
11390
11391
|
this.character
|
|
11391
11392
|
);
|