@elizaos/core 1.6.2-alpha.3 → 1.6.2-alpha.5
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/node/index.node.js
CHANGED
|
@@ -41990,63 +41990,72 @@ function getLocalServerUrl(path) {
|
|
|
41990
41990
|
}
|
|
41991
41991
|
// src/schemas/character.ts
|
|
41992
41992
|
import { z as z3 } from "zod";
|
|
41993
|
-
var uuidSchema2 = z3.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, "Invalid UUID format");
|
|
41993
|
+
var uuidSchema2 = z3.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, "Invalid UUID format").describe("Unique identifier for the character in UUID format");
|
|
41994
|
+
var mediaSchema = z3.object({
|
|
41995
|
+
id: z3.string().describe("Unique identifier for the media"),
|
|
41996
|
+
url: z3.string().describe("URL of the media file"),
|
|
41997
|
+
title: z3.string().optional().describe("Media title"),
|
|
41998
|
+
source: z3.string().optional().describe("Media source"),
|
|
41999
|
+
description: z3.string().optional().describe("Media description"),
|
|
42000
|
+
text: z3.string().optional().describe("Text content associated with the media"),
|
|
42001
|
+
contentType: z3.nativeEnum(ContentType).optional().describe("Type of media content")
|
|
42002
|
+
}).loose().describe("Media attachment with URL and metadata");
|
|
41994
42003
|
var contentSchema = z3.object({
|
|
41995
|
-
text: z3.string().optional(),
|
|
41996
|
-
thought: z3.string().optional(),
|
|
41997
|
-
actions: z3.array(z3.string()).optional(),
|
|
41998
|
-
providers: z3.array(z3.string()).optional(),
|
|
41999
|
-
source: z3.string().optional(),
|
|
42000
|
-
target: z3.string().optional(),
|
|
42001
|
-
url: z3.string().optional(),
|
|
42002
|
-
inReplyTo: uuidSchema2.optional(),
|
|
42003
|
-
attachments: z3.array(
|
|
42004
|
-
channelType: z3.
|
|
42005
|
-
}).
|
|
42004
|
+
text: z3.string().optional().describe("The main text content of the message"),
|
|
42005
|
+
thought: z3.string().optional().describe("Internal thought process or reasoning"),
|
|
42006
|
+
actions: z3.array(z3.string()).optional().describe("Actions to be taken in response"),
|
|
42007
|
+
providers: z3.array(z3.string()).optional().describe("Data providers to use (e.g., KNOWLEDGE)"),
|
|
42008
|
+
source: z3.string().optional().describe("Source of the content"),
|
|
42009
|
+
target: z3.string().optional().describe("Target of the content"),
|
|
42010
|
+
url: z3.string().optional().describe("Related URL"),
|
|
42011
|
+
inReplyTo: uuidSchema2.optional().describe("UUID of message this is replying to"),
|
|
42012
|
+
attachments: z3.array(mediaSchema).optional().describe("Array of media attachments (images, videos, documents, etc.)"),
|
|
42013
|
+
channelType: z3.enum(ChannelType).optional().describe("Type of channel this content is for")
|
|
42014
|
+
}).catchall(z3.unknown()).describe("Content structure for messages in conversation examples");
|
|
42006
42015
|
var messageExampleSchema = z3.object({
|
|
42007
|
-
name: z3.string(),
|
|
42016
|
+
name: z3.string().describe("Name of the speaker (can use {{name1}} placeholder for dynamic names)"),
|
|
42008
42017
|
content: contentSchema
|
|
42009
|
-
});
|
|
42018
|
+
}).describe("A single message in a conversation example");
|
|
42010
42019
|
var directoryItemSchema = z3.object({
|
|
42011
|
-
directory: z3.string(),
|
|
42012
|
-
shared: z3.boolean().optional()
|
|
42013
|
-
});
|
|
42020
|
+
directory: z3.string().describe("Path to a directory containing knowledge files"),
|
|
42021
|
+
shared: z3.boolean().optional().describe("Whether this knowledge is shared across characters")
|
|
42022
|
+
}).describe("Directory-based knowledge source");
|
|
42014
42023
|
var knowledgeItemSchema = z3.union([
|
|
42015
|
-
z3.string(),
|
|
42024
|
+
z3.string().describe("File path to a knowledge document"),
|
|
42016
42025
|
z3.object({
|
|
42017
|
-
path: z3.string(),
|
|
42018
|
-
shared: z3.boolean().optional()
|
|
42026
|
+
path: z3.string().describe("Path to a knowledge file"),
|
|
42027
|
+
shared: z3.boolean().optional().describe("Whether this knowledge is shared across characters")
|
|
42019
42028
|
}),
|
|
42020
42029
|
directoryItemSchema
|
|
42021
|
-
]);
|
|
42030
|
+
]).describe("Knowledge source - can be a file path, file object, or directory");
|
|
42022
42031
|
var templateTypeSchema = z3.union([
|
|
42023
|
-
z3.string(),
|
|
42032
|
+
z3.string().describe("Template string with placeholders"),
|
|
42024
42033
|
z3.function().optional()
|
|
42025
|
-
]);
|
|
42034
|
+
]).describe("Template for generating text - can be a string template or function");
|
|
42026
42035
|
var styleSchema = z3.object({
|
|
42027
|
-
all: z3.array(z3.string()).optional(),
|
|
42028
|
-
chat: z3.array(z3.string()).optional(),
|
|
42029
|
-
post: z3.array(z3.string()).optional()
|
|
42030
|
-
}).optional();
|
|
42031
|
-
var settingsSchema = z3.record(z3.string(), z3.union([z3.string(), z3.boolean(), z3.number(), z3.any()])).optional();
|
|
42032
|
-
var secretsSchema = z3.record(z3.string(), z3.union([z3.string(), z3.boolean(), z3.number()])).optional();
|
|
42036
|
+
all: z3.array(z3.string()).optional().describe("Style guidelines applied to all types of responses"),
|
|
42037
|
+
chat: z3.array(z3.string()).optional().describe("Style guidelines specific to chat/conversation responses"),
|
|
42038
|
+
post: z3.array(z3.string()).optional().describe("Style guidelines specific to social media posts")
|
|
42039
|
+
}).optional().describe("Style configuration defining how the character communicates across different contexts");
|
|
42040
|
+
var settingsSchema = z3.record(z3.string(), z3.union([z3.string(), z3.boolean(), z3.number(), z3.object({}).loose(), z3.array(z3.any())])).optional().describe("Character-specific settings like avatar URL, preferences, and configuration");
|
|
42041
|
+
var secretsSchema = z3.record(z3.string(), z3.union([z3.string(), z3.boolean(), z3.number()])).optional().describe("Secret values and API keys (should not be committed to version control)");
|
|
42033
42042
|
var characterSchema = z3.object({
|
|
42034
|
-
id: uuidSchema2.optional(),
|
|
42035
|
-
name: z3.string().min(1, "Character name is required"),
|
|
42036
|
-
username: z3.string().optional(),
|
|
42037
|
-
system: z3.string().optional(),
|
|
42038
|
-
templates: z3.record(z3.string(), templateTypeSchema).optional(),
|
|
42039
|
-
bio: z3.union([z3.string(), z3.array(z3.string())]),
|
|
42040
|
-
messageExamples: z3.array(z3.array(messageExampleSchema)).optional(),
|
|
42041
|
-
postExamples: z3.array(z3.string()).optional(),
|
|
42042
|
-
topics: z3.array(z3.string()).optional(),
|
|
42043
|
-
adjectives: z3.array(z3.string()).optional(),
|
|
42044
|
-
knowledge: z3.array(knowledgeItemSchema).optional(),
|
|
42045
|
-
plugins: z3.array(z3.string()).optional(),
|
|
42043
|
+
id: uuidSchema2.optional().describe("Unique identifier for the character"),
|
|
42044
|
+
name: z3.string().min(1, "Character name is required").describe('The name of the character (e.g., "Eliza")'),
|
|
42045
|
+
username: z3.string().optional().describe("Username for the character on various platforms"),
|
|
42046
|
+
system: z3.string().optional().describe("System prompt that defines the character's core behavior and response style"),
|
|
42047
|
+
templates: z3.record(z3.string(), templateTypeSchema).optional().describe("Custom templates for generating different types of content"),
|
|
42048
|
+
bio: z3.union([z3.string(), z3.array(z3.string())]).describe("Character biography - can be a single string or array of biographical points"),
|
|
42049
|
+
messageExamples: z3.array(z3.array(messageExampleSchema)).optional().describe("Example conversations showing how the character responds in different scenarios"),
|
|
42050
|
+
postExamples: z3.array(z3.string()).optional().describe("Example social media posts demonstrating the character's voice and topics"),
|
|
42051
|
+
topics: z3.array(z3.string()).optional().describe("Topics the character is knowledgeable about and engages with"),
|
|
42052
|
+
adjectives: z3.array(z3.string()).optional().describe("Adjectives that describe the character's personality and traits"),
|
|
42053
|
+
knowledge: z3.array(knowledgeItemSchema).optional().describe("Knowledge sources (files, directories) the character can reference"),
|
|
42054
|
+
plugins: z3.array(z3.string()).optional().describe('List of plugin package names to load (e.g., ["@elizaos/plugin-sql", "@elizaos/plugin-bootstrap"] - these are commonly required)'),
|
|
42046
42055
|
settings: settingsSchema,
|
|
42047
42056
|
secrets: secretsSchema,
|
|
42048
42057
|
style: styleSchema
|
|
42049
|
-
}).strict();
|
|
42058
|
+
}).strict().describe("Complete character definition including personality, behavior, and capabilities");
|
|
42050
42059
|
function validateCharacter(data2) {
|
|
42051
42060
|
const result = characterSchema.safeParse(data2);
|
|
42052
42061
|
if (result.success) {
|
|
@@ -46274,6 +46283,7 @@ export {
|
|
|
46274
46283
|
waitForServerReady,
|
|
46275
46284
|
validateUuid,
|
|
46276
46285
|
validateCharacter,
|
|
46286
|
+
uuidSchema2 as uuidSchema,
|
|
46277
46287
|
updateWorldSettings,
|
|
46278
46288
|
unsaltWorldSettings,
|
|
46279
46289
|
unsaltSettingValue,
|
|
@@ -46281,11 +46291,15 @@ export {
|
|
|
46281
46291
|
trimTokens,
|
|
46282
46292
|
toString2 as toString,
|
|
46283
46293
|
toHex,
|
|
46294
|
+
templateTypeSchema,
|
|
46295
|
+
styleSchema,
|
|
46284
46296
|
stringToUuid,
|
|
46285
46297
|
splitChunks,
|
|
46286
46298
|
slice,
|
|
46287
46299
|
shouldRespondTemplate,
|
|
46300
|
+
settingsSchema,
|
|
46288
46301
|
setEnv,
|
|
46302
|
+
secretsSchema,
|
|
46289
46303
|
saltWorldSettings,
|
|
46290
46304
|
saltSettingValue,
|
|
46291
46305
|
safeReplacer,
|
|
@@ -46303,7 +46317,10 @@ export {
|
|
|
46303
46317
|
multiStepSummaryTemplate,
|
|
46304
46318
|
multiStepDecisionTemplate,
|
|
46305
46319
|
messageHandlerTemplate,
|
|
46320
|
+
messageExampleSchema,
|
|
46321
|
+
mediaSchema,
|
|
46306
46322
|
logger,
|
|
46323
|
+
knowledgeItemSchema,
|
|
46307
46324
|
isValidCharacter,
|
|
46308
46325
|
isNode3 as isNode,
|
|
46309
46326
|
isMessageMetadata,
|
|
@@ -46355,6 +46372,7 @@ export {
|
|
|
46355
46372
|
encryptStringValue,
|
|
46356
46373
|
encryptObjectValues,
|
|
46357
46374
|
elizaLogger,
|
|
46375
|
+
directoryItemSchema,
|
|
46358
46376
|
detectEnvironment,
|
|
46359
46377
|
defineService,
|
|
46360
46378
|
decryptedCharacter,
|
|
@@ -46369,6 +46387,7 @@ export {
|
|
|
46369
46387
|
createService,
|
|
46370
46388
|
createMessageMemory,
|
|
46371
46389
|
createLogger,
|
|
46390
|
+
contentSchema,
|
|
46372
46391
|
concat2 as concat,
|
|
46373
46392
|
composePromptFromState,
|
|
46374
46393
|
composePrompt,
|
|
@@ -46406,5 +46425,5 @@ export {
|
|
|
46406
46425
|
AgentRuntime
|
|
46407
46426
|
};
|
|
46408
46427
|
|
|
46409
|
-
//# debugId=
|
|
46428
|
+
//# debugId=4565BB023F48EE3264756E2164756E21
|
|
46410
46429
|
//# sourceMappingURL=index.node.js.map
|