@elizaos/core 1.6.2-alpha.21 → 1.6.2-alpha.23
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/character.d.ts +15 -0
- package/dist/character.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/node/index.node.js +63 -42
- package/dist/node/index.node.js.map +5 -5
- package/package.json +2 -2
package/dist/character.d.ts
CHANGED
|
@@ -22,4 +22,19 @@ export declare function validateCharacterConfig(character: Character): {
|
|
|
22
22
|
* @returns Complete character with defaults
|
|
23
23
|
*/
|
|
24
24
|
export declare function mergeCharacterDefaults(char: Partial<Character>): Character;
|
|
25
|
+
/**
|
|
26
|
+
* Build ordered plugin list based on available environment variables
|
|
27
|
+
*
|
|
28
|
+
* Plugin loading order:
|
|
29
|
+
* 1. Core plugins (@elizaos/plugin-sql)
|
|
30
|
+
* 2. Text-only LLM plugins (no embedding support)
|
|
31
|
+
* 3. Embedding-capable LLM plugins
|
|
32
|
+
* 4. Platform plugins (Discord, Twitter, Telegram)
|
|
33
|
+
* 5. Bootstrap plugin (unless IGNORE_BOOTSTRAP is set)
|
|
34
|
+
* 6. Ollama fallback (only if no other LLM providers configured)
|
|
35
|
+
*
|
|
36
|
+
* @param env - Environment object to check for API keys (defaults to process.env)
|
|
37
|
+
* @returns Ordered array of plugin names
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildCharacterPlugins(env?: Record<string, string | undefined>): string[];
|
|
25
40
|
//# sourceMappingURL=character.d.ts.map
|
package/dist/character.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"character.d.ts","sourceRoot":"","sources":["../src/character.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAyB5E;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG;IAC7D,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAoBA;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAY1E"}
|
|
1
|
+
{"version":3,"file":"character.d.ts","sourceRoot":"","sources":["../src/character.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAyB5E;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG;IAC7D,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAoBA;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAY1E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,MAAM,EAAE,CA0CV"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,gBAAgB,CAAC;AAI/B,cAAc,eAAe,CAAC;AAG9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AAGzB,cAAc,WAAW,CAAC;AAG1B,eAAO,MAAM,SAAS,SAG+B,CAAC;AACtD,eAAO,MAAM,MAAM,SAG2B,CAAC;AAG/C,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,aAAa,CAAC;AAG5B,cAAc,qBAAqB,CAAC;AAGpC,cAAc,gBAAgB,CAAC;AAI/B,cAAc,eAAe,CAAC;AAG9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AAGzB,cAAc,WAAW,CAAC;AAG1B,eAAO,MAAM,SAAS,SAG+B,CAAC;AACtD,eAAO,MAAM,MAAM,SAG2B,CAAC;AAG/C,cAAc,uBAAuB,CAAC"}
|
package/dist/node/index.node.js
CHANGED
|
@@ -42568,6 +42568,67 @@ function formatActions(actions) {
|
|
|
42568
42568
|
class DatabaseAdapter {
|
|
42569
42569
|
db;
|
|
42570
42570
|
}
|
|
42571
|
+
// src/character.ts
|
|
42572
|
+
function parseCharacter(input) {
|
|
42573
|
+
if (typeof input === "string") {
|
|
42574
|
+
throw new Error(`Character path provided but must be loaded first: ${input}`);
|
|
42575
|
+
}
|
|
42576
|
+
if (typeof input === "object") {
|
|
42577
|
+
const validationResult = validateCharacter(input);
|
|
42578
|
+
if (!validationResult.success) {
|
|
42579
|
+
const errorDetails = validationResult.error?.issues ? validationResult.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ") : validationResult.error?.message || "Unknown validation error";
|
|
42580
|
+
throw new Error(`Character validation failed: ${errorDetails}`);
|
|
42581
|
+
}
|
|
42582
|
+
return validationResult.data;
|
|
42583
|
+
}
|
|
42584
|
+
throw new Error("Invalid character input format");
|
|
42585
|
+
}
|
|
42586
|
+
function validateCharacterConfig(character) {
|
|
42587
|
+
const validationResult = validateCharacter(character);
|
|
42588
|
+
if (validationResult.success) {
|
|
42589
|
+
return {
|
|
42590
|
+
isValid: true,
|
|
42591
|
+
errors: []
|
|
42592
|
+
};
|
|
42593
|
+
}
|
|
42594
|
+
const errors = validationResult.error?.issues ? validationResult.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`) : [validationResult.error?.message || "Unknown validation error"];
|
|
42595
|
+
return {
|
|
42596
|
+
isValid: false,
|
|
42597
|
+
errors
|
|
42598
|
+
};
|
|
42599
|
+
}
|
|
42600
|
+
function mergeCharacterDefaults(char) {
|
|
42601
|
+
const defaults = {
|
|
42602
|
+
settings: {},
|
|
42603
|
+
plugins: [],
|
|
42604
|
+
bio: []
|
|
42605
|
+
};
|
|
42606
|
+
return {
|
|
42607
|
+
...defaults,
|
|
42608
|
+
...char,
|
|
42609
|
+
name: char.name || "Unnamed Character"
|
|
42610
|
+
};
|
|
42611
|
+
}
|
|
42612
|
+
function buildCharacterPlugins(env2 = process.env) {
|
|
42613
|
+
const plugins = [
|
|
42614
|
+
"@elizaos/plugin-sql",
|
|
42615
|
+
...env2.ANTHROPIC_API_KEY?.trim() ? ["@elizaos/plugin-anthropic"] : [],
|
|
42616
|
+
...env2.OPENROUTER_API_KEY?.trim() ? ["@elizaos/plugin-openrouter"] : [],
|
|
42617
|
+
...env2.OPENAI_API_KEY?.trim() ? ["@elizaos/plugin-openai"] : [],
|
|
42618
|
+
...env2.GOOGLE_GENERATIVE_AI_API_KEY?.trim() ? ["@elizaos/plugin-google-genai"] : [],
|
|
42619
|
+
...env2.DISCORD_API_TOKEN?.trim() ? ["@elizaos/plugin-discord"] : [],
|
|
42620
|
+
...env2.TWITTER_API_KEY?.trim() && env2.TWITTER_API_SECRET_KEY?.trim() && env2.TWITTER_ACCESS_TOKEN?.trim() && env2.TWITTER_ACCESS_TOKEN_SECRET?.trim() ? ["@elizaos/plugin-twitter"] : [],
|
|
42621
|
+
...env2.TELEGRAM_BOT_TOKEN?.trim() ? ["@elizaos/plugin-telegram"] : [],
|
|
42622
|
+
...(() => {
|
|
42623
|
+
const ignore = env2.IGNORE_BOOTSTRAP?.trim().toLowerCase();
|
|
42624
|
+
const shouldIgnore = ignore === "true" || ignore === "1" || ignore === "yes";
|
|
42625
|
+
return shouldIgnore ? [] : ["@elizaos/plugin-bootstrap"];
|
|
42626
|
+
})(),
|
|
42627
|
+
...!env2.ANTHROPIC_API_KEY?.trim() && !env2.OPENROUTER_API_KEY?.trim() && !env2.OPENAI_API_KEY?.trim() && !env2.GOOGLE_GENERATIVE_AI_API_KEY?.trim() ? ["@elizaos/plugin-ollama"] : []
|
|
42628
|
+
];
|
|
42629
|
+
return plugins;
|
|
42630
|
+
}
|
|
42631
|
+
|
|
42571
42632
|
// src/memory.ts
|
|
42572
42633
|
function createMessageMemory(params) {
|
|
42573
42634
|
return {
|
|
@@ -46739,47 +46800,6 @@ Data: ${JSON.stringify(entity.metadata)}
|
|
|
46739
46800
|
return entityStrings.join(`
|
|
46740
46801
|
`);
|
|
46741
46802
|
}
|
|
46742
|
-
// src/character.ts
|
|
46743
|
-
function parseCharacter(input) {
|
|
46744
|
-
if (typeof input === "string") {
|
|
46745
|
-
throw new Error(`Character path provided but must be loaded first: ${input}`);
|
|
46746
|
-
}
|
|
46747
|
-
if (typeof input === "object") {
|
|
46748
|
-
const validationResult = validateCharacter(input);
|
|
46749
|
-
if (!validationResult.success) {
|
|
46750
|
-
const errorDetails = validationResult.error?.issues ? validationResult.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ") : validationResult.error?.message || "Unknown validation error";
|
|
46751
|
-
throw new Error(`Character validation failed: ${errorDetails}`);
|
|
46752
|
-
}
|
|
46753
|
-
return validationResult.data;
|
|
46754
|
-
}
|
|
46755
|
-
throw new Error("Invalid character input format");
|
|
46756
|
-
}
|
|
46757
|
-
function validateCharacterConfig(character) {
|
|
46758
|
-
const validationResult = validateCharacter(character);
|
|
46759
|
-
if (validationResult.success) {
|
|
46760
|
-
return {
|
|
46761
|
-
isValid: true,
|
|
46762
|
-
errors: []
|
|
46763
|
-
};
|
|
46764
|
-
}
|
|
46765
|
-
const errors = validationResult.error?.issues ? validationResult.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`) : [validationResult.error?.message || "Unknown validation error"];
|
|
46766
|
-
return {
|
|
46767
|
-
isValid: false,
|
|
46768
|
-
errors
|
|
46769
|
-
};
|
|
46770
|
-
}
|
|
46771
|
-
function mergeCharacterDefaults(char) {
|
|
46772
|
-
const defaults = {
|
|
46773
|
-
settings: {},
|
|
46774
|
-
plugins: [],
|
|
46775
|
-
bio: []
|
|
46776
|
-
};
|
|
46777
|
-
return {
|
|
46778
|
-
...defaults,
|
|
46779
|
-
...char,
|
|
46780
|
-
name: char.name || "Unnamed Character"
|
|
46781
|
-
};
|
|
46782
|
-
}
|
|
46783
46803
|
|
|
46784
46804
|
// src/index.node.ts
|
|
46785
46805
|
var isBrowser4 = false;
|
|
@@ -46914,6 +46934,7 @@ export {
|
|
|
46914
46934
|
clearSaltCache,
|
|
46915
46935
|
characterSchema,
|
|
46916
46936
|
byteLength,
|
|
46937
|
+
buildCharacterPlugins,
|
|
46917
46938
|
booleanFooter,
|
|
46918
46939
|
asUUID,
|
|
46919
46940
|
alloc,
|
|
@@ -46944,5 +46965,5 @@ export {
|
|
|
46944
46965
|
AgentRuntime
|
|
46945
46966
|
};
|
|
46946
46967
|
|
|
46947
|
-
//# debugId=
|
|
46968
|
+
//# debugId=5DD1578DC5F08BED64756E2164756E21
|
|
46948
46969
|
//# sourceMappingURL=index.node.js.map
|