@mastra/redis 1.4.12-alpha.0 → 1.4.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.
@@ -3,7 +3,7 @@ name: mastra-redis
3
3
  description: Documentation for @mastra/redis. Use when working with @mastra/redis APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/redis"
6
- version: "1.4.12-alpha.0"
6
+ version: "1.4.12"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.12-alpha.0",
2
+ "version": "1.4.12",
3
3
  "package": "@mastra/redis",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -5,7 +5,7 @@ let _mastra_core_storage = require("@mastra/core/storage");
5
5
  let _mastra_core_evals = require("@mastra/core/evals");
6
6
  let redis = require("redis");
7
7
  let _mastra_core_cache = require("@mastra/core/cache");
8
- //#region src/storage/domains/utils.ts
8
+ // src/storage/domains/utils.ts
9
9
  /**
10
10
  * Generate a Redis key from table name and key parts.
11
11
  *
@@ -49,8 +49,7 @@ function processRecord(tableName, record) {
49
49
  processedRecord
50
50
  };
51
51
  }
52
- //#endregion
53
- //#region src/storage/db/index.ts
52
+ // src/storage/db/index.ts
54
53
  var RedisDB = class {
55
54
  client;
56
55
  constructor({ client }) {
@@ -130,8 +129,7 @@ var RedisDB = class {
130
129
  }
131
130
  }
132
131
  };
133
- //#endregion
134
- //#region src/storage/domains/run-fencing.ts
132
+ // src/storage/domains/run-fencing.ts
135
133
  /**
136
134
  * A claim expires after this long without a claim, renewal or release, and a
137
135
  * fence this long after it was retired. A running execution renews every few
@@ -361,8 +359,7 @@ function writeBatch(client, check) {
361
359
  async function assertRunFence(client, check) {
362
360
  if (check) await new FencedWriteBatch(client, check).exec();
363
361
  }
364
- //#endregion
365
- //#region src/storage/domains/memory/index.ts
362
+ // src/storage/domains/memory/index.ts
366
363
  var StoreMemoryRedis = class extends _mastra_core_storage.MemoryStorage {
367
364
  supportsPartialThreadUpdate = true;
368
365
  client;
@@ -1293,8 +1290,7 @@ function getMessageScore(message) {
1293
1290
  const index = typeof message._index === "number" ? message._index : 0;
1294
1291
  return createdAtScore * 1e3 + index;
1295
1292
  }
1296
- //#endregion
1297
- //#region src/storage/domains/scores/index.ts
1293
+ // src/storage/domains/scores/index.ts
1298
1294
  /** Returns true when a row matches the multi-tenant scope filters (or none provided). */
1299
1295
  function matchesTenancy(row, filters) {
1300
1296
  if (filters?.organizationId !== void 0 && row.organizationId !== filters.organizationId) return false;
@@ -1444,8 +1440,7 @@ var ScoresRedis = class extends _mastra_core_storage.ScoresStorage {
1444
1440
  };
1445
1441
  }
1446
1442
  };
1447
- //#endregion
1448
- //#region src/storage/domains/workflows/index.ts
1443
+ // src/storage/domains/workflows/index.ts
1449
1444
  function parseWorkflowRun(row) {
1450
1445
  let parsedSnapshot = row.snapshot;
1451
1446
  if (typeof parsedSnapshot === "string") try {
@@ -1813,16 +1808,14 @@ var WorkflowsRedis = class extends _mastra_core_storage.WorkflowsStorage {
1813
1808
  }
1814
1809
  }
1815
1810
  };
1816
- //#endregion
1817
- //#region src/storage/utils.ts
1811
+ // src/storage/utils.ts
1818
1812
  function isClientConfig(config) {
1819
1813
  return "client" in config;
1820
1814
  }
1821
1815
  function isConnectionStringConfig(config) {
1822
1816
  return "connectionString" in config;
1823
1817
  }
1824
- //#endregion
1825
- //#region src/storage/store.ts
1818
+ // src/storage/store.ts
1826
1819
  /**
1827
1820
  * Redis storage adapter for Mastra.
1828
1821
  *
@@ -1932,8 +1925,7 @@ var RedisStore = class extends _mastra_core_storage.MastraStorage {
1932
1925
  return `redis://${config.host}:${config.port || 6379}/${config.db || 0}`;
1933
1926
  }
1934
1927
  };
1935
- //#endregion
1936
- //#region src/cache.ts
1928
+ // src/cache.ts
1937
1929
  const defaultSetWithExpiry = (client, key, value, seconds) => {
1938
1930
  return client.set(key, value, "EX", seconds);
1939
1931
  };
@@ -2127,7 +2119,6 @@ const nodeRedisPreset = {
2127
2119
  arguments: args
2128
2120
  })
2129
2121
  };
2130
- //#endregion
2131
2122
  exports.LIST_PUSH_INDEXED_SCRIPT = LIST_PUSH_INDEXED_SCRIPT;
2132
2123
  exports.RedisServerCache = RedisServerCache;
2133
2124
  exports.RedisStore = RedisStore;