@elizaos/core 1.0.0-beta.14 → 1.0.0-beta.16
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 -2
- package/dist/runtime.d.ts +3 -1
- package/dist/types.d.ts +2 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1285,6 +1285,7 @@ var AgentRuntime = class {
|
|
|
1285
1285
|
runtimeLogger;
|
|
1286
1286
|
knowledgeProcessingSemaphore = new Semaphore(10);
|
|
1287
1287
|
settings;
|
|
1288
|
+
servicesInitQueue = /* @__PURE__ */ new Set();
|
|
1288
1289
|
constructor(opts) {
|
|
1289
1290
|
this.agentId = opts.character?.id ?? opts?.agentId ?? stringToUuid(opts.character?.name ?? uuidv4());
|
|
1290
1291
|
this.character = opts.character;
|
|
@@ -1373,7 +1374,9 @@ var AgentRuntime = class {
|
|
|
1373
1374
|
}
|
|
1374
1375
|
}
|
|
1375
1376
|
if (plugin.services) {
|
|
1376
|
-
|
|
1377
|
+
plugin.services.forEach((service) => {
|
|
1378
|
+
this.servicesInitQueue.add(service);
|
|
1379
|
+
});
|
|
1377
1380
|
}
|
|
1378
1381
|
}
|
|
1379
1382
|
getAllServices() {
|
|
@@ -1481,6 +1484,9 @@ var AgentRuntime = class {
|
|
|
1481
1484
|
);
|
|
1482
1485
|
await this.processCharacterKnowledge(stringKnowledge);
|
|
1483
1486
|
}
|
|
1487
|
+
for (const service of this.servicesInitQueue) {
|
|
1488
|
+
await this.registerService(service);
|
|
1489
|
+
}
|
|
1484
1490
|
}
|
|
1485
1491
|
async handleProcessingError(error, context) {
|
|
1486
1492
|
this.runtimeLogger.error(`Error ${context}:`, error?.message || error || "Unknown error");
|
|
@@ -1826,7 +1832,8 @@ var AgentRuntime = class {
|
|
|
1826
1832
|
type,
|
|
1827
1833
|
channelId,
|
|
1828
1834
|
serverId,
|
|
1829
|
-
worldId
|
|
1835
|
+
worldId,
|
|
1836
|
+
userId
|
|
1830
1837
|
}) {
|
|
1831
1838
|
if (entityId === this.agentId) {
|
|
1832
1839
|
throw new Error("Agent should not connect to itself");
|
|
@@ -1837,6 +1844,7 @@ var AgentRuntime = class {
|
|
|
1837
1844
|
const names3 = [name, userName].filter(Boolean);
|
|
1838
1845
|
const metadata = {
|
|
1839
1846
|
[source]: {
|
|
1847
|
+
id: userId,
|
|
1840
1848
|
name,
|
|
1841
1849
|
userName
|
|
1842
1850
|
}
|
|
@@ -2510,6 +2518,10 @@ function encryptStringValue(value, salt) {
|
|
|
2510
2518
|
logger.debug("Attempted to encrypt undefined or null value");
|
|
2511
2519
|
return value;
|
|
2512
2520
|
}
|
|
2521
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
2522
|
+
logger.debug("Value is a boolean or number, returning as is");
|
|
2523
|
+
return value;
|
|
2524
|
+
}
|
|
2513
2525
|
const parts = value.split(":");
|
|
2514
2526
|
if (parts.length === 2) {
|
|
2515
2527
|
try {
|
|
@@ -2538,6 +2550,10 @@ function decryptStringValue(value, salt) {
|
|
|
2538
2550
|
logger.debug("Attempted to decrypt undefined or null value");
|
|
2539
2551
|
return value;
|
|
2540
2552
|
}
|
|
2553
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
2554
|
+
logger.debug("Value is a boolean or number, returning as is");
|
|
2555
|
+
return value;
|
|
2556
|
+
}
|
|
2541
2557
|
const parts = value.split(":");
|
|
2542
2558
|
if (parts.length !== 2) {
|
|
2543
2559
|
logger.debug(
|
package/dist/runtime.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export declare class AgentRuntime implements IAgentRuntime {
|
|
|
52
52
|
private runtimeLogger;
|
|
53
53
|
private knowledgeProcessingSemaphore;
|
|
54
54
|
private settings;
|
|
55
|
+
private servicesInitQueue;
|
|
55
56
|
constructor(opts: {
|
|
56
57
|
conversationLength?: number;
|
|
57
58
|
agentId?: UUID;
|
|
@@ -126,7 +127,7 @@ export declare class AgentRuntime implements IAgentRuntime {
|
|
|
126
127
|
* @returns The results of the evaluation.
|
|
127
128
|
*/
|
|
128
129
|
evaluate(message: Memory, state: State, didRespond?: boolean, callback?: HandlerCallback, responses?: Memory[]): Promise<Evaluator[]>;
|
|
129
|
-
ensureConnection({ entityId, roomId, userName, name, source, type, channelId, serverId, worldId, }: {
|
|
130
|
+
ensureConnection({ entityId, roomId, userName, name, source, type, channelId, serverId, worldId, userId, }: {
|
|
130
131
|
entityId: UUID;
|
|
131
132
|
roomId: UUID;
|
|
132
133
|
userName?: string;
|
|
@@ -136,6 +137,7 @@ export declare class AgentRuntime implements IAgentRuntime {
|
|
|
136
137
|
channelId?: string;
|
|
137
138
|
serverId?: string;
|
|
138
139
|
worldId?: UUID;
|
|
140
|
+
userId?: UUID;
|
|
139
141
|
}): Promise<void>;
|
|
140
142
|
/**
|
|
141
143
|
* Ensures a participant is added to a room, checking that the entity exists first
|
package/dist/types.d.ts
CHANGED
|
@@ -782,7 +782,7 @@ export interface IAgentRuntime extends IDatabaseAdapter {
|
|
|
782
782
|
registerProvider(provider: Provider): void;
|
|
783
783
|
registerAction(action: Action): void;
|
|
784
784
|
registerEvaluator(evaluator: Evaluator): void;
|
|
785
|
-
ensureConnection({ entityId, roomId, userName, name, source, channelId, serverId, type, worldId, }: {
|
|
785
|
+
ensureConnection({ entityId, roomId, userName, name, source, channelId, serverId, type, worldId, userId, }: {
|
|
786
786
|
entityId: UUID;
|
|
787
787
|
roomId: UUID;
|
|
788
788
|
userName?: string;
|
|
@@ -792,6 +792,7 @@ export interface IAgentRuntime extends IDatabaseAdapter {
|
|
|
792
792
|
serverId?: string;
|
|
793
793
|
type: ChannelType;
|
|
794
794
|
worldId?: UUID;
|
|
795
|
+
userId?: UUID;
|
|
795
796
|
}): Promise<void>;
|
|
796
797
|
ensureParticipantInRoom(entityId: UUID, roomId: UUID): Promise<void>;
|
|
797
798
|
ensureWorldExists(world: World): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/core",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "2e45ccd9535c11f9778e8268fb6c048aa4f52d7c"
|
|
80
80
|
}
|