@elizaos/plugin-bootstrap 1.7.0 → 1.7.1-alpha.10
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 +16 -11
- package/dist/index.js.map +6 -6
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1983,10 +1983,16 @@ var updateRoleAction = {
|
|
|
1983
1983
|
name: "UPDATE_ROLE",
|
|
1984
1984
|
similes: ["CHANGE_ROLE", "SET_PERMISSIONS", "ASSIGN_ROLE", "MAKE_ADMIN"],
|
|
1985
1985
|
description: "Assigns a role (Admin, Owner, None) to a user or list of users in a channel.",
|
|
1986
|
-
validate: async (
|
|
1986
|
+
validate: async (runtime, message, state) => {
|
|
1987
1987
|
const channelType = message.content.channelType;
|
|
1988
|
-
|
|
1989
|
-
|
|
1988
|
+
if (channelType !== ChannelType.GROUP && channelType !== ChannelType.WORLD) {
|
|
1989
|
+
return false;
|
|
1990
|
+
}
|
|
1991
|
+
const room = state?.data?.room ?? await runtime.getRoom(message.roomId);
|
|
1992
|
+
if (!room || !room.messageServerId) {
|
|
1993
|
+
return false;
|
|
1994
|
+
}
|
|
1995
|
+
return true;
|
|
1990
1996
|
},
|
|
1991
1997
|
handler: async (runtime, message, state, _options, callback) => {
|
|
1992
1998
|
if (!state) {
|
|
@@ -2006,7 +2012,6 @@ var updateRoleAction = {
|
|
|
2006
2012
|
};
|
|
2007
2013
|
}
|
|
2008
2014
|
const { roomId } = message;
|
|
2009
|
-
const serverId = message.content.serverId;
|
|
2010
2015
|
const worldId = runtime.getSetting("WORLD_ID");
|
|
2011
2016
|
let world = null;
|
|
2012
2017
|
if (worldId) {
|
|
@@ -2149,7 +2154,7 @@ IMPORTANT: Your response must ONLY contain the <response></response> XML block a
|
|
|
2149
2154
|
if (worldUpdated) {
|
|
2150
2155
|
try {
|
|
2151
2156
|
await runtime.updateWorld(world);
|
|
2152
|
-
logger6.info({ src: "plugin:bootstrap:action:update_role", agentId: runtime.agentId,
|
|
2157
|
+
logger6.info({ src: "plugin:bootstrap:action:update_role", agentId: runtime.agentId, messageServerId: world.messageServerId }, "Updated roles in world metadata");
|
|
2153
2158
|
} catch (error) {
|
|
2154
2159
|
logger6.error({
|
|
2155
2160
|
src: "plugin:bootstrap:action:update_role",
|
|
@@ -2186,7 +2191,7 @@ IMPORTANT: Your response must ONLY contain the <response></response> XML block a
|
|
|
2186
2191
|
successfulUpdates,
|
|
2187
2192
|
failedUpdates,
|
|
2188
2193
|
worldId: world.id,
|
|
2189
|
-
|
|
2194
|
+
messageServerId: world.messageServerId
|
|
2190
2195
|
},
|
|
2191
2196
|
success: true
|
|
2192
2197
|
};
|
|
@@ -3422,14 +3427,14 @@ var updateSettingsAction = {
|
|
|
3422
3427
|
logger8.error({
|
|
3423
3428
|
src: "plugin:bootstrap:action:settings",
|
|
3424
3429
|
agentId: runtime.agentId,
|
|
3425
|
-
|
|
3430
|
+
messageServerId: world?.messageServerId
|
|
3426
3431
|
}, "No settings state found for server");
|
|
3427
3432
|
return false;
|
|
3428
3433
|
}
|
|
3429
3434
|
logger8.debug({
|
|
3430
3435
|
src: "plugin:bootstrap:action:settings",
|
|
3431
3436
|
agentId: runtime.agentId,
|
|
3432
|
-
|
|
3437
|
+
messageServerId: world.messageServerId
|
|
3433
3438
|
}, "Found valid settings state for server");
|
|
3434
3439
|
return true;
|
|
3435
3440
|
} catch (error) {
|
|
@@ -6738,7 +6743,7 @@ var settingsProvider = {
|
|
|
6738
6743
|
};
|
|
6739
6744
|
}
|
|
6740
6745
|
if (!worldSettings) {
|
|
6741
|
-
logger14.info({ src: "plugin:bootstrap:provider:settings", agentId: runtime.agentId, serverId }, "No settings state found for server");
|
|
6746
|
+
logger14.info({ src: "plugin:bootstrap:provider:settings", agentId: runtime.agentId, messageServerId: serverId }, "No settings state found for server");
|
|
6742
6747
|
return isOnboarding ? {
|
|
6743
6748
|
data: {
|
|
6744
6749
|
settings: []
|
|
@@ -6947,7 +6952,7 @@ var worldProvider = {
|
|
|
6947
6952
|
world: {
|
|
6948
6953
|
id: world.id,
|
|
6949
6954
|
name: world.name,
|
|
6950
|
-
|
|
6955
|
+
messageServerId: world.messageServerId,
|
|
6951
6956
|
metadata: world.metadata || {},
|
|
6952
6957
|
currentRoom: {
|
|
6953
6958
|
id: currentRoom.id,
|
|
@@ -8368,5 +8373,5 @@ export {
|
|
|
8368
8373
|
actionStateProvider
|
|
8369
8374
|
};
|
|
8370
8375
|
|
|
8371
|
-
//# debugId=
|
|
8376
|
+
//# debugId=E9A672F1CC5A46B264756E2164756E21
|
|
8372
8377
|
//# sourceMappingURL=index.js.map
|