@elizaos/plugin-bootstrap 1.0.11 → 1.0.12

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
@@ -119,11 +119,17 @@ function v4(options, buf, offset) {
119
119
  return native_default.randomUUID();
120
120
  }
121
121
  options = options || {};
122
- const rnds = options.random || (options.rng || rng)();
122
+ const rnds = options.random ?? options.rng?.() ?? rng();
123
+ if (rnds.length < 16) {
124
+ throw new Error("Random bytes length must be >= 16");
125
+ }
123
126
  rnds[6] = rnds[6] & 15 | 64;
124
127
  rnds[8] = rnds[8] & 63 | 128;
125
128
  if (buf) {
126
129
  offset = offset || 0;
130
+ if (offset < 0 || offset + 16 > buf.length) {
131
+ throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
132
+ }
127
133
  for (let i2 = 0; i2 < 16; ++i2) {
128
134
  buf[offset + i2] = rnds[i2];
129
135
  }
@@ -205,7 +211,7 @@ var choiceAction = {
205
211
  return false;
206
212
  }
207
213
  },
208
- handler: async (runtime, message, state, _options, callback, responses) => {
214
+ handler: async (runtime, message, _state, _options, callback, _responses) => {
209
215
  const pendingTasks = await runtime.getTasks({
210
216
  roomId: message.roomId,
211
217
  tags: ["AWAITING_CHOICE"]
@@ -1440,7 +1446,7 @@ var updateRoleAction = {
1440
1446
  name: "UPDATE_ROLE",
1441
1447
  similes: ["CHANGE_ROLE", "SET_PERMISSIONS", "ASSIGN_ROLE", "MAKE_ADMIN"],
1442
1448
  description: "Assigns a role (Admin, Owner, None) to a user or list of users in a channel.",
1443
- validate: async (runtime, message, state) => {
1449
+ validate: async (_runtime, message, _state) => {
1444
1450
  const channelType = message.content.channelType;
1445
1451
  const serverId = message.content.serverId;
1446
1452
  return (
@@ -2146,7 +2152,7 @@ async function processSettingUpdates(runtime, serverId, worldSettings, updates)
2146
2152
  };
2147
2153
  }
2148
2154
  }
2149
- async function handleOnboardingComplete(runtime, worldSettings, state, callback) {
2155
+ async function handleOnboardingComplete(runtime, worldSettings, _state, callback) {
2150
2156
  try {
2151
2157
  const prompt = composePrompt3({
2152
2158
  state: {
@@ -3141,7 +3147,6 @@ var updateEntityAction = {
3141
3147
  await callback(response.content);
3142
3148
  }
3143
3149
  const sourceEntityId = message.entityId;
3144
- const _roomId = message.roomId;
3145
3150
  const agentId = runtime.agentId;
3146
3151
  const room = state.data.room ?? await runtime.getRoom(message.roomId);
3147
3152
  const worldId = room.worldId;
@@ -3298,7 +3303,7 @@ var relationshipSchema = z.object({
3298
3303
  interactions: z.number()
3299
3304
  }).optional()
3300
3305
  });
3301
- var reflectionSchema = z.object({
3306
+ z.object({
3302
3307
  // reflection: z.string(),
3303
3308
  facts: z.array(
3304
3309
  z.object({
@@ -4031,7 +4036,7 @@ var characterProvider = {
4031
4036
  import { logger as logger11 } from "@elizaos/core";
4032
4037
  var choiceProvider = {
4033
4038
  name: "CHOICE",
4034
- get: async (runtime, message) => {
4039
+ get: async (runtime, message, _state) => {
4035
4040
  try {
4036
4041
  const pendingTasks = await runtime.getTasks({
4037
4042
  roomId: message.roomId,
@@ -4341,7 +4346,7 @@ import { addHeader as addHeader7 } from "@elizaos/core";
4341
4346
  var providersProvider = {
4342
4347
  name: "PROVIDERS",
4343
4348
  description: "List of all data providers the agent can use to get additional information",
4344
- get: async (runtime, _message) => {
4349
+ get: async (runtime, _message, _state) => {
4345
4350
  const dynamicProviders = runtime.providers.filter((provider) => provider.dynamic === true);
4346
4351
  const providerDescriptions = dynamicProviders.map((provider) => {
4347
4352
  return `- **${provider.name}**: ${provider.description || "No description available"}`;
@@ -4683,7 +4688,8 @@ var roleProvider = {
4683
4688
  },
4684
4689
  values: {
4685
4690
  roles: "No role information available for this server."
4686
- }
4691
+ },
4692
+ text: "No role information available for this server."
4687
4693
  };
4688
4694
  }
4689
4695
  logger14.info(`Found ${Object.keys(roles).length} roles`);
@@ -6061,8 +6067,7 @@ var handleServerSync = async ({
6061
6067
  };
6062
6068
  var controlMessageHandler = async ({
6063
6069
  runtime,
6064
- message,
6065
- source
6070
+ message
6066
6071
  }) => {
6067
6072
  try {
6068
6073
  logger18.debug(