@elizaos/plugin-bootstrap 1.7.1-alpha.9 → 1.7.1
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 +24 -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,11 @@ 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({
|
|
2157
|
+
logger6.info({
|
|
2158
|
+
src: "plugin:bootstrap:action:update_role",
|
|
2159
|
+
agentId: runtime.agentId,
|
|
2160
|
+
messageServerId: world.messageServerId
|
|
2161
|
+
}, "Updated roles in world metadata");
|
|
2153
2162
|
} catch (error) {
|
|
2154
2163
|
logger6.error({
|
|
2155
2164
|
src: "plugin:bootstrap:action:update_role",
|
|
@@ -2186,7 +2195,7 @@ IMPORTANT: Your response must ONLY contain the <response></response> XML block a
|
|
|
2186
2195
|
successfulUpdates,
|
|
2187
2196
|
failedUpdates,
|
|
2188
2197
|
worldId: world.id,
|
|
2189
|
-
|
|
2198
|
+
messageServerId: world.messageServerId
|
|
2190
2199
|
},
|
|
2191
2200
|
success: true
|
|
2192
2201
|
};
|
|
@@ -3422,14 +3431,14 @@ var updateSettingsAction = {
|
|
|
3422
3431
|
logger8.error({
|
|
3423
3432
|
src: "plugin:bootstrap:action:settings",
|
|
3424
3433
|
agentId: runtime.agentId,
|
|
3425
|
-
|
|
3434
|
+
messageServerId: world?.messageServerId
|
|
3426
3435
|
}, "No settings state found for server");
|
|
3427
3436
|
return false;
|
|
3428
3437
|
}
|
|
3429
3438
|
logger8.debug({
|
|
3430
3439
|
src: "plugin:bootstrap:action:settings",
|
|
3431
3440
|
agentId: runtime.agentId,
|
|
3432
|
-
|
|
3441
|
+
messageServerId: world.messageServerId
|
|
3433
3442
|
}, "Found valid settings state for server");
|
|
3434
3443
|
return true;
|
|
3435
3444
|
} catch (error) {
|
|
@@ -6738,7 +6747,11 @@ var settingsProvider = {
|
|
|
6738
6747
|
};
|
|
6739
6748
|
}
|
|
6740
6749
|
if (!worldSettings) {
|
|
6741
|
-
logger14.info({
|
|
6750
|
+
logger14.info({
|
|
6751
|
+
src: "plugin:bootstrap:provider:settings",
|
|
6752
|
+
agentId: runtime.agentId,
|
|
6753
|
+
messageServerId: serverId
|
|
6754
|
+
}, "No settings state found for server");
|
|
6742
6755
|
return isOnboarding ? {
|
|
6743
6756
|
data: {
|
|
6744
6757
|
settings: []
|
|
@@ -6947,7 +6960,7 @@ var worldProvider = {
|
|
|
6947
6960
|
world: {
|
|
6948
6961
|
id: world.id,
|
|
6949
6962
|
name: world.name,
|
|
6950
|
-
|
|
6963
|
+
messageServerId: world.messageServerId,
|
|
6951
6964
|
metadata: world.metadata || {},
|
|
6952
6965
|
currentRoom: {
|
|
6953
6966
|
id: currentRoom.id,
|
|
@@ -8368,5 +8381,5 @@ export {
|
|
|
8368
8381
|
actionStateProvider
|
|
8369
8382
|
};
|
|
8370
8383
|
|
|
8371
|
-
//# debugId=
|
|
8384
|
+
//# debugId=F28D3384C77B385164756E2164756E21
|
|
8372
8385
|
//# sourceMappingURL=index.js.map
|