@elizaos/plugin-bootstrap 1.6.5-alpha.10 → 1.6.5-alpha.13
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 +23 -21
- package/dist/index.js.map +8 -8
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -391,10 +391,10 @@ var choiceAction = {
|
|
|
391
391
|
throw new Error("State is required for validating the action");
|
|
392
392
|
}
|
|
393
393
|
const room = state.data.room ?? await runtime.getRoom(message.roomId);
|
|
394
|
-
if (!room || !room.
|
|
394
|
+
if (!room || !room.messageServerId) {
|
|
395
395
|
return false;
|
|
396
396
|
}
|
|
397
|
-
const userRole = await getUserServerRole(runtime, message.entityId, room.
|
|
397
|
+
const userRole = await getUserServerRole(runtime, message.entityId, room.messageServerId);
|
|
398
398
|
if (userRole !== "OWNER" && userRole !== "ADMIN") {
|
|
399
399
|
return false;
|
|
400
400
|
}
|
|
@@ -404,7 +404,7 @@ var choiceAction = {
|
|
|
404
404
|
tags: ["AWAITING_CHOICE"]
|
|
405
405
|
});
|
|
406
406
|
const room2 = state.data.room ?? await runtime.getRoom(message.roomId);
|
|
407
|
-
const userRole2 = await getUserServerRole(runtime, message.entityId, room2.
|
|
407
|
+
const userRole2 = await getUserServerRole(runtime, message.entityId, room2.messageServerId);
|
|
408
408
|
if (userRole2 !== "OWNER" && userRole2 !== "ADMIN") {
|
|
409
409
|
return false;
|
|
410
410
|
}
|
|
@@ -3292,10 +3292,10 @@ var updateSettingsAction = {
|
|
|
3292
3292
|
const world = worlds.find((world2) => world2.metadata?.settings);
|
|
3293
3293
|
const worldSettings = world?.metadata?.settings;
|
|
3294
3294
|
if (!worldSettings) {
|
|
3295
|
-
logger8.error(`No settings state found for server ${world?.
|
|
3295
|
+
logger8.error(`No settings state found for server ${world?.messageServerId}`);
|
|
3296
3296
|
return false;
|
|
3297
3297
|
}
|
|
3298
|
-
logger8.debug(`Found valid settings state for server ${world.
|
|
3298
|
+
logger8.debug(`Found valid settings state for server ${world.messageServerId}`);
|
|
3299
3299
|
return true;
|
|
3300
3300
|
} catch (error) {
|
|
3301
3301
|
logger8.error(`Error validating settings action: ${error}`);
|
|
@@ -3376,7 +3376,7 @@ var updateSettingsAction = {
|
|
|
3376
3376
|
success: false
|
|
3377
3377
|
};
|
|
3378
3378
|
}
|
|
3379
|
-
const serverId = serverOwnership?.
|
|
3379
|
+
const serverId = serverOwnership?.messageServerId;
|
|
3380
3380
|
logger8.info(`Using server ID: ${serverId}`);
|
|
3381
3381
|
if (!serverId) {
|
|
3382
3382
|
logger8.error(`No server ID found for user ${message.entityId} in handler`);
|
|
@@ -6198,7 +6198,7 @@ var roleProvider = {
|
|
|
6198
6198
|
text: "No access to role information in DMs, the role provider is only available in group scenarios."
|
|
6199
6199
|
};
|
|
6200
6200
|
}
|
|
6201
|
-
const serverId = room.
|
|
6201
|
+
const serverId = room.messageServerId;
|
|
6202
6202
|
if (!serverId) {
|
|
6203
6203
|
throw new Error("No server ID found");
|
|
6204
6204
|
}
|
|
@@ -6455,12 +6455,14 @@ var settingsProvider = {
|
|
|
6455
6455
|
logger18.error("No world found for user during onboarding");
|
|
6456
6456
|
throw new Error("No server ownership found for onboarding");
|
|
6457
6457
|
}
|
|
6458
|
-
serverId = world.
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6458
|
+
serverId = world.messageServerId;
|
|
6459
|
+
if (serverId) {
|
|
6460
|
+
try {
|
|
6461
|
+
worldSettings = await getWorldSettings2(runtime, serverId);
|
|
6462
|
+
} catch (error) {
|
|
6463
|
+
logger18.error(`Error fetching world settings: ${error}`);
|
|
6464
|
+
throw new Error(`Failed to retrieve settings for server ${serverId}`);
|
|
6465
|
+
}
|
|
6464
6466
|
}
|
|
6465
6467
|
} else {
|
|
6466
6468
|
try {
|
|
@@ -6469,7 +6471,7 @@ var settingsProvider = {
|
|
|
6469
6471
|
logger18.error(`No world found for room ${room.worldId}`);
|
|
6470
6472
|
throw new Error(`No world found for room ${room.worldId}`);
|
|
6471
6473
|
}
|
|
6472
|
-
serverId = world.
|
|
6474
|
+
serverId = world.messageServerId;
|
|
6473
6475
|
if (serverId) {
|
|
6474
6476
|
worldSettings = await getWorldSettings2(runtime, serverId);
|
|
6475
6477
|
} else {
|
|
@@ -6674,7 +6676,7 @@ var worldProvider = {
|
|
|
6674
6676
|
world: {
|
|
6675
6677
|
id: world.id,
|
|
6676
6678
|
name: world.name,
|
|
6677
|
-
serverId: world.
|
|
6679
|
+
serverId: world.messageServerId,
|
|
6678
6680
|
metadata: world.metadata || {},
|
|
6679
6681
|
currentRoom: {
|
|
6680
6682
|
id: currentRoom.id,
|
|
@@ -7330,7 +7332,7 @@ var postGeneratedHandler = async ({
|
|
|
7330
7332
|
id: worldId,
|
|
7331
7333
|
name: `${runtime.character.name}'s Feed`,
|
|
7332
7334
|
agentId: runtime.agentId,
|
|
7333
|
-
|
|
7335
|
+
messageServerId: userId
|
|
7334
7336
|
});
|
|
7335
7337
|
await runtime.ensureRoomExists({
|
|
7336
7338
|
id: roomId,
|
|
@@ -7338,7 +7340,7 @@ var postGeneratedHandler = async ({
|
|
|
7338
7340
|
source,
|
|
7339
7341
|
type: ChannelType9.FEED,
|
|
7340
7342
|
channelId: `${userId}-home`,
|
|
7341
|
-
|
|
7343
|
+
messageServerId: userId,
|
|
7342
7344
|
worldId
|
|
7343
7345
|
});
|
|
7344
7346
|
const message = {
|
|
@@ -7468,7 +7470,7 @@ $2`);
|
|
|
7468
7470
|
await callback?.(message2.content);
|
|
7469
7471
|
}
|
|
7470
7472
|
};
|
|
7471
|
-
var syncSingleUser = async (entityId, runtime,
|
|
7473
|
+
var syncSingleUser = async (entityId, runtime, messageServerId, channelId, type, source) => {
|
|
7472
7474
|
try {
|
|
7473
7475
|
const entity = await runtime.getEntityById(entityId);
|
|
7474
7476
|
runtime.logger.info(`[Bootstrap] Syncing user: ${entity?.metadata?.username || entityId}`);
|
|
@@ -7477,7 +7479,7 @@ var syncSingleUser = async (entityId, runtime, serverId, channelId, type, source
|
|
|
7477
7479
|
return;
|
|
7478
7480
|
}
|
|
7479
7481
|
const roomId = createUniqueUuid3(runtime, channelId);
|
|
7480
|
-
const worldId = createUniqueUuid3(runtime,
|
|
7482
|
+
const worldId = createUniqueUuid3(runtime, messageServerId);
|
|
7481
7483
|
const worldMetadata = type === ChannelType9.DM ? {
|
|
7482
7484
|
ownership: {
|
|
7483
7485
|
ownerId: entityId
|
|
@@ -7494,7 +7496,7 @@ var syncSingleUser = async (entityId, runtime, serverId, channelId, type, source
|
|
|
7494
7496
|
name: entity?.metadata?.name || entity?.metadata?.username || `User${entityId}`,
|
|
7495
7497
|
source,
|
|
7496
7498
|
channelId,
|
|
7497
|
-
|
|
7499
|
+
messageServerId,
|
|
7498
7500
|
type,
|
|
7499
7501
|
worldId,
|
|
7500
7502
|
metadata: worldMetadata
|
|
@@ -7837,5 +7839,5 @@ export {
|
|
|
7837
7839
|
actionStateProvider
|
|
7838
7840
|
};
|
|
7839
7841
|
|
|
7840
|
-
//# debugId=
|
|
7842
|
+
//# debugId=A1F3C5FB2CD01D1F64756E2164756E21
|
|
7841
7843
|
//# sourceMappingURL=index.js.map
|