@elizaos/core 1.6.2-alpha.4 → 1.6.2-alpha.6

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