@elizaos/core 1.0.0-alpha.19 → 1.0.0-alpha.20
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 +18 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -11683,6 +11683,24 @@ var AgentRuntime = class {
|
|
|
11683
11683
|
if (!this.plugins.some((p) => p.name === plugin.name)) {
|
|
11684
11684
|
this.plugins.push(plugin);
|
|
11685
11685
|
}
|
|
11686
|
+
if (plugin.init) {
|
|
11687
|
+
try {
|
|
11688
|
+
await plugin.init(plugin.config || {}, this);
|
|
11689
|
+
} catch (error) {
|
|
11690
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
11691
|
+
if (errorMessage.includes("API key") || errorMessage.includes("environment variables") || errorMessage.includes("Invalid plugin configuration")) {
|
|
11692
|
+
console.warn(
|
|
11693
|
+
`Plugin ${plugin.name} requires configuration. ${errorMessage}`
|
|
11694
|
+
);
|
|
11695
|
+
console.warn(
|
|
11696
|
+
"Please check your environment variables and ensure all required API keys are set."
|
|
11697
|
+
);
|
|
11698
|
+
console.warn("You can set these in your .eliza/.env file.");
|
|
11699
|
+
} else {
|
|
11700
|
+
throw error;
|
|
11701
|
+
}
|
|
11702
|
+
}
|
|
11703
|
+
}
|
|
11686
11704
|
if (plugin.adapter) {
|
|
11687
11705
|
this.registerDatabaseAdapter(plugin.adapter);
|
|
11688
11706
|
}
|
|
@@ -11726,9 +11744,6 @@ var AgentRuntime = class {
|
|
|
11726
11744
|
plugin.services.map((service) => this.registerService(service))
|
|
11727
11745
|
);
|
|
11728
11746
|
}
|
|
11729
|
-
if (plugin.init) {
|
|
11730
|
-
await plugin.init(plugin.config, this);
|
|
11731
|
-
}
|
|
11732
11747
|
}
|
|
11733
11748
|
getAllServices() {
|
|
11734
11749
|
return this.services;
|