@elizaos/server 1.6.2-alpha.20 → 1.6.2-alpha.21

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
@@ -23638,7 +23638,6 @@ import express9 from "express";
23638
23638
  import {
23639
23639
  validateUuid,
23640
23640
  logger,
23641
- stringToUuid,
23642
23641
  getSalt,
23643
23642
  encryptObjectValues,
23644
23643
  encryptStringValue
@@ -23745,7 +23744,10 @@ function createAgentCrudRouter(elizaOS, serverInstance) {
23745
23744
  character.settings.secrets = encryptObjectValues(character.settings.secrets, salt);
23746
23745
  }
23747
23746
  const ensureAgentExists = async (character2) => {
23748
- const agentId = stringToUuid(character2.name);
23747
+ if (!character2.id) {
23748
+ throw new Error("Character must have an ID");
23749
+ }
23750
+ const agentId = character2.id;
23749
23751
  let agent2 = await db.getAgent(agentId);
23750
23752
  if (!agent2) {
23751
23753
  await db.createAgent({ ...character2, id: agentId });
@@ -24647,9 +24649,9 @@ function createAgentMemoryRouter(elizaOS) {
24647
24649
  const router = express7.Router();
24648
24650
  router.get("/:agentId/rooms/:roomId/memories", async (req, res) => {
24649
24651
  const agentId = validateUuid7(req.params.agentId);
24650
- const roomId = validateUuid7(req.params.roomId);
24651
- if (!agentId || !roomId) {
24652
- return sendError(res, 400, "INVALID_ID", "Invalid agent ID or room ID format");
24652
+ const channelId = validateUuid7(req.params.roomId);
24653
+ if (!agentId || !channelId) {
24654
+ return sendError(res, 400, "INVALID_ID", "Invalid agent ID or channel ID format");
24653
24655
  }
24654
24656
  const runtime = elizaOS.getAgent(agentId);
24655
24657
  if (!runtime) {
@@ -24660,6 +24662,8 @@ function createAgentMemoryRouter(elizaOS) {
24660
24662
  const before = req.query.before ? Number.parseInt(req.query.before, 10) : Date.now();
24661
24663
  const includeEmbedding = req.query.includeEmbedding === "true";
24662
24664
  const tableName = req.query.tableName || "messages";
24665
+ const roomId = createUniqueUuid2(runtime, channelId);
24666
+ logger6.info(`[ROOM MEMORIES] Converting channelId ${channelId} to roomId ${roomId} for agent ${agentId}`);
24663
24667
  const memories = await runtime.getMemories({
24664
24668
  tableName,
24665
24669
  roomId,
@@ -28856,7 +28860,7 @@ import express30 from "express";
28856
28860
  // package.json
28857
28861
  var package_default = {
28858
28862
  name: "@elizaos/server",
28859
- version: "1.6.2-alpha.20",
28863
+ version: "1.6.2-alpha.21",
28860
28864
  description: "ElizaOS Server - Core server infrastructure for ElizaOS agents",
28861
28865
  publishConfig: {
28862
28866
  access: "public",
@@ -30176,7 +30180,8 @@ import {
30176
30180
  logger as logger29,
30177
30181
  parseAndValidateCharacter,
30178
30182
  validateCharacter,
30179
- getCharactersDir
30183
+ getCharactersDir,
30184
+ stringToUuid
30180
30185
  } from "@elizaos/core";
30181
30186
  var __filename2 = fileURLToPath(import.meta.url);
30182
30187
  var __dirname2 = path6.dirname(__filename2);
@@ -30226,10 +30231,21 @@ async function jsonToCharacter(character) {
30226
30231
  throw new Error("Validation succeeded but no data was returned");
30227
30232
  }
30228
30233
  const validatedCharacter = validationResult.data;
30229
- const characterId = validatedCharacter.id || validatedCharacter.name;
30230
- const characterPrefix = `CHARACTER.${characterId.toUpperCase().replace(/ /g, "_")}.`;
30231
- const characterSettings = Object.entries(process.env).filter(([key]) => key.startsWith(characterPrefix)).reduce((settings, [key, value]) => {
30232
- const settingKey = key.slice(characterPrefix.length);
30234
+ if (!validatedCharacter.id) {
30235
+ if (!validatedCharacter.name) {
30236
+ throw new Error("Character must have either an id or a name to generate a deterministic ID");
30237
+ }
30238
+ validatedCharacter.id = stringToUuid(validatedCharacter.name);
30239
+ }
30240
+ const namePrefixes = validatedCharacter.name ? [
30241
+ `CHARACTER.${validatedCharacter.name.toUpperCase().replace(/[^A-Z0-9]/g, "_")}.`,
30242
+ `${validatedCharacter.name.toUpperCase().replace(/[^A-Z0-9]/g, "_")}_`
30243
+ ] : [];
30244
+ const idPrefix = `CHARACTER.${validatedCharacter.id.toUpperCase().replace(/-/g, "_")}.`;
30245
+ const allPrefixes = [...namePrefixes, idPrefix];
30246
+ const characterSettings = Object.entries(process.env).filter(([key]) => allPrefixes.some((prefix) => key.startsWith(prefix))).reduce((settings, [key, value]) => {
30247
+ const matchedPrefix = allPrefixes.find((prefix) => key.startsWith(prefix));
30248
+ const settingKey = matchedPrefix ? key.slice(matchedPrefix.length) : key;
30233
30249
  return { ...settings, [settingKey]: value };
30234
30250
  }, {});
30235
30251
  if (Object.keys(characterSettings).length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/server",
3
- "version": "1.6.2-alpha.20",
3
+ "version": "1.6.2-alpha.21",
4
4
  "description": "ElizaOS Server - Core server infrastructure for ElizaOS agents",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -44,7 +44,7 @@
44
44
  "dev": "bun run build.ts --watch"
45
45
  },
46
46
  "devDependencies": {
47
- "@elizaos/client": "1.6.2-alpha.20",
47
+ "@elizaos/client": "1.6.2-alpha.21",
48
48
  "@types/node": "^24.0.1",
49
49
  "prettier": "3.6.2",
50
50
  "tsx": "4.20.6",
@@ -52,10 +52,10 @@
52
52
  "which": "^5.0.0",
53
53
  "ws": "^8.18.0"
54
54
  },
55
- "gitHead": "77764bea01dfd2266dce86c9416ac690c52a1b5a",
55
+ "gitHead": "167fbae273e74d5eb75642a0486ab754d8e1fabf",
56
56
  "dependencies": {
57
- "@elizaos/core": "1.6.2-alpha.20",
58
- "@elizaos/plugin-sql": "1.6.2-alpha.20",
57
+ "@elizaos/core": "1.6.2-alpha.21",
58
+ "@elizaos/plugin-sql": "1.6.2-alpha.21",
59
59
  "@sentry/node": "^10.16.0",
60
60
  "@types/express": "^5.0.2",
61
61
  "@types/helmet": "^4.0.0",