@elizaos/core 1.0.0-alpha.41 → 1.0.0-alpha.43

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.js CHANGED
@@ -11379,6 +11379,7 @@ var AgentRuntime = class {
11379
11379
  plugins.push(bootstrapPlugin);
11380
11380
  }
11381
11381
  this.plugins = plugins;
11382
+ console.log(`Plugins: ${this.plugins}`);
11382
11383
  }
11383
11384
  #conversationLength;
11384
11385
  /**
@@ -11386,32 +11387,18 @@ var AgentRuntime = class {
11386
11387
  * @param plugin The plugin to register
11387
11388
  */
11388
11389
  async registerPlugin(plugin) {
11390
+ console.log(`Registering plugin ${plugin.name}`);
11389
11391
  if (!plugin) {
11390
11392
  throw new Error("*** registerPlugin plugin is undefined");
11391
11393
  }
11392
11394
  if (!this.plugins.some((p) => p.name === plugin.name)) {
11393
11395
  this.plugins.push(plugin);
11394
11396
  }
11395
- if (plugin.init) {
11396
- try {
11397
- await plugin.init(plugin.config || {}, this);
11398
- } catch (error) {
11399
- const errorMessage = error instanceof Error ? error.message : String(error);
11400
- if (errorMessage.includes("API key") || errorMessage.includes("environment variables") || errorMessage.includes("Invalid plugin configuration")) {
11401
- console.warn(
11402
- `Plugin ${plugin.name} requires configuration. ${errorMessage}`
11403
- );
11404
- console.warn(
11405
- "Please check your environment variables and ensure all required API keys are set."
11406
- );
11407
- console.warn("You can set these in your .eliza/.env file.");
11408
- } else {
11409
- throw error;
11410
- }
11411
- }
11412
- }
11413
11397
  if (plugin.adapter) {
11398
+ console.log(`Registering plugin adapter ${plugin.name}`);
11414
11399
  this.registerDatabaseAdapter(plugin.adapter);
11400
+ } else {
11401
+ console.log(`No adapter found for plugin ${plugin.name}`);
11415
11402
  }
11416
11403
  if (plugin.actions) {
11417
11404
  for (const action of plugin.actions) {
@@ -11453,6 +11440,25 @@ var AgentRuntime = class {
11453
11440
  plugin.services.map((service) => this.registerService(service))
11454
11441
  );
11455
11442
  }
11443
+ if (plugin.init) {
11444
+ try {
11445
+ await plugin.init(plugin.config || {}, this);
11446
+ console.log(`Plugin ${plugin.name} initialized`);
11447
+ } catch (error) {
11448
+ const errorMessage = error instanceof Error ? error.message : String(error);
11449
+ if (errorMessage.includes("API key") || errorMessage.includes("environment variables") || errorMessage.includes("Invalid plugin configuration")) {
11450
+ console.warn(
11451
+ `Plugin ${plugin.name} requires configuration. ${errorMessage}`
11452
+ );
11453
+ console.warn(
11454
+ "Please check your environment variables and ensure all required API keys are set."
11455
+ );
11456
+ console.warn("You can set these in your .eliza/.env file.");
11457
+ } else {
11458
+ throw error;
11459
+ }
11460
+ }
11461
+ }
11456
11462
  }
11457
11463
  getAllServices() {
11458
11464
  return this.services;
@@ -11474,14 +11480,14 @@ var AgentRuntime = class {
11474
11480
  for (const plugin of characterPlugins) {
11475
11481
  if (plugin && !registeredPluginNames.has(plugin.name)) {
11476
11482
  registeredPluginNames.add(plugin.name);
11477
- pluginRegistrationPromises.push(this.registerPlugin(plugin));
11483
+ pluginRegistrationPromises.push(await this.registerPlugin(plugin));
11478
11484
  }
11479
11485
  }
11480
11486
  }
11481
11487
  for (const plugin of [...this.plugins]) {
11482
11488
  if (plugin && !registeredPluginNames.has(plugin.name)) {
11483
11489
  registeredPluginNames.add(plugin.name);
11484
- pluginRegistrationPromises.push(this.registerPlugin(plugin));
11490
+ pluginRegistrationPromises.push(await this.registerPlugin(plugin));
11485
11491
  }
11486
11492
  }
11487
11493
  await this.adapter.init();