@frontmcp/plugin-dashboard 1.8.5 → 1.8.6

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/esm/index.mjs CHANGED
@@ -2704,25 +2704,29 @@ function getRedisClass() {
2704
2704
  const msg = error instanceof Error ? error.message : String(error);
2705
2705
  if (msg.includes("Dynamic require") || msg.includes("require is not defined")) {
2706
2706
  throw new Error(
2707
- `Failed to load ioredis: ${msg}. This typically happens with ESM bundlers (esbuild, Vite). Ensure your bundler externalizes ioredis or use CJS mode.`
2707
+ `Failed to load ioredis: ${msg}. This typically happens with ESM bundlers (esbuild, Vite). Ensure your bundler externalizes ioredis or use CJS mode.`,
2708
+ { cause: error }
2708
2709
  );
2709
2710
  }
2710
- throw new Error("ioredis is required for Redis storage adapter. Install it with: npm install ioredis");
2711
+ throw new Error("ioredis is required for Redis storage adapter. Install it with: npm install ioredis", {
2712
+ cause: error
2713
+ });
2711
2714
  }
2712
2715
  }
2713
2716
  var RedisStorageAdapter;
2714
2717
  var init_redis = __esm({
2715
2718
  "libs/utils/src/storage/adapters/redis.ts"() {
2716
2719
  "use strict";
2717
- init_base();
2718
2720
  init_errors();
2719
2721
  init_utils();
2722
+ init_base();
2720
2723
  RedisStorageAdapter = class extends BaseStorageAdapter {
2721
2724
  backendName = "redis";
2722
2725
  client;
2723
2726
  subscriber;
2724
2727
  options;
2725
2728
  ownsClient;
2729
+ connecting;
2726
2730
  keyPrefix;
2727
2731
  subscriptionHandlers = /* @__PURE__ */ new Map();
2728
2732
  constructor(options = {}) {
@@ -2752,21 +2756,42 @@ var init_redis = __esm({
2752
2756
  // ============================================
2753
2757
  async connect() {
2754
2758
  if (this.connected) return;
2759
+ this.connecting ??= this.openConnection().finally(() => {
2760
+ this.connecting = void 0;
2761
+ });
2762
+ return this.connecting;
2763
+ }
2764
+ async openConnection() {
2765
+ let socketError;
2766
+ const recordSocketError = (error) => {
2767
+ socketError = error;
2768
+ };
2769
+ let client;
2755
2770
  try {
2756
2771
  if (this.options.client) {
2757
- this.client = this.options.client;
2772
+ client = this.options.client;
2758
2773
  } else {
2759
2774
  const RedisClass = getRedisClass();
2760
2775
  if (this.options.url) {
2761
- this.client = new RedisClass(this.options.url, this.buildRedisOptions());
2776
+ client = new RedisClass(this.options.url, this.buildRedisOptions());
2762
2777
  } else {
2763
- this.client = new RedisClass(this.buildRedisOptions());
2778
+ client = new RedisClass(this.buildRedisOptions());
2764
2779
  }
2780
+ client.on("error", recordSocketError);
2765
2781
  }
2766
- await this.client.ping();
2782
+ await client.ping();
2783
+ this.client = client;
2767
2784
  this.connected = true;
2785
+ if (this.ownsClient) client.removeListener("error", recordSocketError);
2768
2786
  } catch (e) {
2769
- throw new StorageConnectionError("Failed to connect to Redis", e instanceof Error ? e : void 0, "redis");
2787
+ if (this.ownsClient && client) {
2788
+ try {
2789
+ client.disconnect();
2790
+ } catch {
2791
+ }
2792
+ }
2793
+ const cause = socketError ?? (e instanceof Error ? e : void 0);
2794
+ throw new StorageConnectionError("Failed to connect to Redis", cause, "redis");
2770
2795
  }
2771
2796
  }
2772
2797
  async disconnect() {
package/esm/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/plugin-dashboard",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "description": "Dashboard plugin for FrontMCP - visual monitoring and introspection of MCP servers",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "license": "Apache-2.0",
@@ -47,12 +47,12 @@
47
47
  }
48
48
  },
49
49
  "dependencies": {
50
- "@frontmcp/sdk": "1.8.5"
50
+ "@frontmcp/sdk": "1.8.6"
51
51
  },
52
52
  "devDependencies": {
53
53
  "reflect-metadata": "^0.2.2"
54
54
  },
55
55
  "peerDependencies": {
56
- "@frontmcp/lazy-zod": "1.8.5"
56
+ "@frontmcp/lazy-zod": "1.8.6"
57
57
  }
58
58
  }
package/index.js CHANGED
@@ -2716,25 +2716,29 @@ function getRedisClass() {
2716
2716
  const msg = error instanceof Error ? error.message : String(error);
2717
2717
  if (msg.includes("Dynamic require") || msg.includes("require is not defined")) {
2718
2718
  throw new Error(
2719
- `Failed to load ioredis: ${msg}. This typically happens with ESM bundlers (esbuild, Vite). Ensure your bundler externalizes ioredis or use CJS mode.`
2719
+ `Failed to load ioredis: ${msg}. This typically happens with ESM bundlers (esbuild, Vite). Ensure your bundler externalizes ioredis or use CJS mode.`,
2720
+ { cause: error }
2720
2721
  );
2721
2722
  }
2722
- throw new Error("ioredis is required for Redis storage adapter. Install it with: npm install ioredis");
2723
+ throw new Error("ioredis is required for Redis storage adapter. Install it with: npm install ioredis", {
2724
+ cause: error
2725
+ });
2723
2726
  }
2724
2727
  }
2725
2728
  var RedisStorageAdapter;
2726
2729
  var init_redis = __esm({
2727
2730
  "libs/utils/src/storage/adapters/redis.ts"() {
2728
2731
  "use strict";
2729
- init_base();
2730
2732
  init_errors();
2731
2733
  init_utils();
2734
+ init_base();
2732
2735
  RedisStorageAdapter = class extends BaseStorageAdapter {
2733
2736
  backendName = "redis";
2734
2737
  client;
2735
2738
  subscriber;
2736
2739
  options;
2737
2740
  ownsClient;
2741
+ connecting;
2738
2742
  keyPrefix;
2739
2743
  subscriptionHandlers = /* @__PURE__ */ new Map();
2740
2744
  constructor(options = {}) {
@@ -2764,21 +2768,42 @@ var init_redis = __esm({
2764
2768
  // ============================================
2765
2769
  async connect() {
2766
2770
  if (this.connected) return;
2771
+ this.connecting ??= this.openConnection().finally(() => {
2772
+ this.connecting = void 0;
2773
+ });
2774
+ return this.connecting;
2775
+ }
2776
+ async openConnection() {
2777
+ let socketError;
2778
+ const recordSocketError = (error) => {
2779
+ socketError = error;
2780
+ };
2781
+ let client;
2767
2782
  try {
2768
2783
  if (this.options.client) {
2769
- this.client = this.options.client;
2784
+ client = this.options.client;
2770
2785
  } else {
2771
2786
  const RedisClass = getRedisClass();
2772
2787
  if (this.options.url) {
2773
- this.client = new RedisClass(this.options.url, this.buildRedisOptions());
2788
+ client = new RedisClass(this.options.url, this.buildRedisOptions());
2774
2789
  } else {
2775
- this.client = new RedisClass(this.buildRedisOptions());
2790
+ client = new RedisClass(this.buildRedisOptions());
2776
2791
  }
2792
+ client.on("error", recordSocketError);
2777
2793
  }
2778
- await this.client.ping();
2794
+ await client.ping();
2795
+ this.client = client;
2779
2796
  this.connected = true;
2797
+ if (this.ownsClient) client.removeListener("error", recordSocketError);
2780
2798
  } catch (e) {
2781
- throw new StorageConnectionError("Failed to connect to Redis", e instanceof Error ? e : void 0, "redis");
2799
+ if (this.ownsClient && client) {
2800
+ try {
2801
+ client.disconnect();
2802
+ } catch {
2803
+ }
2804
+ }
2805
+ const cause = socketError ?? (e instanceof Error ? e : void 0);
2806
+ throw new StorageConnectionError("Failed to connect to Redis", cause, "redis");
2782
2807
  }
2783
2808
  }
2784
2809
  async disconnect() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/plugin-dashboard",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "description": "Dashboard plugin for FrontMCP - visual monitoring and introspection of MCP servers",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "license": "Apache-2.0",
@@ -47,12 +47,12 @@
47
47
  }
48
48
  },
49
49
  "dependencies": {
50
- "@frontmcp/sdk": "1.8.5"
50
+ "@frontmcp/sdk": "1.8.6"
51
51
  },
52
52
  "devDependencies": {
53
53
  "reflect-metadata": "^0.2.2"
54
54
  },
55
55
  "peerDependencies": {
56
- "@frontmcp/lazy-zod": "1.8.5"
56
+ "@frontmcp/lazy-zod": "1.8.6"
57
57
  }
58
58
  }