@elizaos/core 1.6.3-alpha.1 → 1.6.3-alpha.11

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.
@@ -42290,15 +42290,10 @@ function byteLength(buffer) {
42290
42290
  return buffer.length;
42291
42291
  }
42292
42292
  function randomBytes(size) {
42293
- if (hasNativeBuffer()) {
42294
- try {
42295
- const crypto = __require("crypto");
42296
- return crypto.randomBytes(size);
42297
- } catch {}
42298
- }
42299
42293
  const bytes = new Uint8Array(size);
42300
- if (typeof globalThis !== "undefined" && globalThis.crypto && globalThis.crypto.getRandomValues) {
42301
- globalThis.crypto.getRandomValues(bytes);
42294
+ const cryptoGlobal = typeof globalThis !== "undefined" ? globalThis.crypto || globalThis.webcrypto : undefined;
42295
+ if (cryptoGlobal && typeof cryptoGlobal.getRandomValues === "function") {
42296
+ cryptoGlobal.getRandomValues(bytes);
42302
42297
  } else {
42303
42298
  for (let i = 0;i < size; i++) {
42304
42299
  bytes[i] = Math.floor(Math.random() * 256);
@@ -44980,8 +44975,8 @@ class AgentRuntime {
44980
44975
  const parentRunId = this.getCurrentRunId();
44981
44976
  const runId = this.createRunId();
44982
44977
  let actionPlan = null;
44978
+ const thought = responses[0]?.content?.thought || `Executing ${allActions.length} actions: ${allActions.join(", ")}`;
44983
44979
  if (hasMultipleActions) {
44984
- const thought = responses[0]?.content?.thought || `Executing ${allActions.length} actions: ${allActions.join(", ")}`;
44985
44980
  actionPlan = {
44986
44981
  runId,
44987
44982
  totalSteps: allActions.length,
@@ -45120,7 +45115,7 @@ class AgentRuntime {
45120
45115
  actionId,
45121
45116
  runId,
45122
45117
  type: "agent_action",
45123
- thought: actionPlan?.thought,
45118
+ thought,
45124
45119
  source: message.content?.source
45125
45120
  }
45126
45121
  });
@@ -45204,6 +45199,7 @@ class AgentRuntime {
45204
45199
  actionStatus: statusText,
45205
45200
  actionId,
45206
45201
  type: "agent_action",
45202
+ thought,
45207
45203
  actionResult,
45208
45204
  source: message.content?.source
45209
45205
  }
@@ -45344,6 +45340,10 @@ class AgentRuntime {
45344
45340
  }
45345
45341
  }
45346
45342
  }
45343
+ getActionResults(messageId) {
45344
+ const cachedState = this.stateCache?.get(`${messageId}_action_results`);
45345
+ return cachedState?.data?.actionResults || [];
45346
+ }
45347
45347
  async evaluate(message, state, didRespond, callback, responses) {
45348
45348
  try {
45349
45349
  const evaluatorPromises = this.evaluators.map(async (evaluator) => {
@@ -46562,8 +46562,51 @@ async function setDefaultSecretsFromEnv(character) {
46562
46562
  }
46563
46563
 
46564
46564
  // src/settings.ts
46565
- var import_crypto_browserify = __toESM(require_crypto_browserify(), 1);
46566
46565
  init_environment();
46566
+
46567
+ // src/utils/crypto-compat.ts
46568
+ function hasNodeCrypto() {
46569
+ try {
46570
+ return typeof process !== "undefined" && (process.versions?.node !== undefined || process.versions?.bun !== undefined);
46571
+ } catch {
46572
+ return false;
46573
+ }
46574
+ }
46575
+ function getCryptoModule() {
46576
+ if (hasNodeCrypto()) {
46577
+ return __require("crypto");
46578
+ }
46579
+ return require_crypto_browserify();
46580
+ }
46581
+ function createHash(algorithm) {
46582
+ const crypto = getCryptoModule();
46583
+ const hash = crypto.createHash(algorithm);
46584
+ return {
46585
+ update(data2) {
46586
+ hash.update(data2);
46587
+ return this;
46588
+ },
46589
+ digest() {
46590
+ return new Uint8Array(hash.digest());
46591
+ }
46592
+ };
46593
+ }
46594
+ function createCipheriv(algorithm, key, iv) {
46595
+ if (algorithm !== "aes-256-cbc") {
46596
+ throw new Error(`Unsupported algorithm: ${algorithm}. Only 'aes-256-cbc' is currently supported.`);
46597
+ }
46598
+ const crypto = getCryptoModule();
46599
+ return crypto.createCipheriv(algorithm, key, iv);
46600
+ }
46601
+ function createDecipheriv(algorithm, key, iv) {
46602
+ if (algorithm !== "aes-256-cbc") {
46603
+ throw new Error(`Unsupported algorithm: ${algorithm}. Only 'aes-256-cbc' is currently supported.`);
46604
+ }
46605
+ const crypto = getCryptoModule();
46606
+ return crypto.createDecipheriv(algorithm, key, iv);
46607
+ }
46608
+
46609
+ // src/settings.ts
46567
46610
  function createSettingFromConfig(configSetting) {
46568
46611
  return {
46569
46612
  name: configSetting.name,
@@ -46628,9 +46671,9 @@ function encryptStringValue(value, salt) {
46628
46671
  }
46629
46672
  } catch (e) {}
46630
46673
  }
46631
- const key = import_crypto_browserify.default.createHash("sha256").update(salt).digest().slice(0, 32);
46674
+ const key = createHash("sha256").update(salt).digest().slice(0, 32);
46632
46675
  const iv = BufferUtils.randomBytes(16);
46633
- const cipher = import_crypto_browserify.default.createCipheriv("aes-256-cbc", key, iv);
46676
+ const cipher = createCipheriv("aes-256-cbc", key, iv);
46634
46677
  let encrypted = cipher.update(value, "utf8", "hex");
46635
46678
  encrypted += cipher.final("hex");
46636
46679
  return `${BufferUtils.toHex(iv)}:${encrypted}`;
@@ -46659,8 +46702,8 @@ function decryptStringValue(value, salt) {
46659
46702
  }
46660
46703
  return value;
46661
46704
  }
46662
- const key = import_crypto_browserify.default.createHash("sha256").update(salt).digest().slice(0, 32);
46663
- const decipher = import_crypto_browserify.default.createDecipheriv("aes-256-cbc", key, iv);
46705
+ const key = createHash("sha256").update(salt).digest().slice(0, 32);
46706
+ const decipher = createDecipheriv("aes-256-cbc", key, iv);
46664
46707
  let decrypted = decipher.update(encrypted, "hex", "utf8");
46665
46708
  decrypted += decipher.final("utf8");
46666
46709
  return decrypted;
@@ -47711,5 +47754,5 @@ export {
47711
47754
  AgentRuntime
47712
47755
  };
47713
47756
 
47714
- //# debugId=738C38AE1C103AEB64756E2164756E21
47757
+ //# debugId=9B89E2D616BB564964756E2164756E21
47715
47758
  //# sourceMappingURL=index.node.js.map