@kya-os/agentshield-nextjs 0.1.43 → 0.1.45

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.mjs CHANGED
@@ -1727,7 +1727,12 @@ async function createStorageAdapter(config) {
1727
1727
  }
1728
1728
  if (config.type === "redis" && config.redis) {
1729
1729
  try {
1730
- const { Redis } = await import('@upstash/redis');
1730
+ const redisModuleName = "@upstash/redis";
1731
+ const redisModule = await import(
1732
+ /* webpackIgnore: true */
1733
+ redisModuleName
1734
+ );
1735
+ const Redis = redisModule.Redis;
1731
1736
  const redis = new Redis({
1732
1737
  url: config.redis.url,
1733
1738
  token: config.redis.token
@@ -1735,8 +1740,8 @@ async function createStorageAdapter(config) {
1735
1740
  return new RedisStorageAdapter(redis, config.ttl);
1736
1741
  } catch (error) {
1737
1742
  console.warn(
1738
- "[AgentShield] Failed to initialize Redis storage, falling back to memory:",
1739
- error
1743
+ "[AgentShield] Redis storage requires @upstash/redis package. Install with: npm install @upstash/redis",
1744
+ "\nFalling back to memory storage."
1740
1745
  );
1741
1746
  return new MemoryStorageAdapter();
1742
1747
  }