up-mcp-bridge 1.0.1 → 1.0.2

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.
@@ -18043,7 +18043,7 @@ var Client = class extends Protocol {
18043
18043
  };
18044
18044
 
18045
18045
  // package.json
18046
- var version2 = "1.0.0";
18046
+ var version2 = "1.0.1";
18047
18047
 
18048
18048
  // node_modules/pkce-challenge/dist/index.node.js
18049
18049
  var crypto;
@@ -21033,17 +21033,28 @@ async function parseCommandLineArgs(args, usage) {
21033
21033
  };
21034
21034
  }
21035
21035
  function setupSignalHandlers(cleanup) {
21036
- process.on("SIGINT", async () => {
21037
- log("\nShutting down...");
21038
- await cleanup();
21039
- process.exit(0);
21040
- });
21036
+ let isShuttingDown = false;
21037
+ const gracefulShutdown = async (signal) => {
21038
+ if (isShuttingDown) {
21039
+ log(`[Shutdown] Already shutting down, ignoring ${signal}`);
21040
+ return;
21041
+ }
21042
+ isShuttingDown = true;
21043
+ log(`[Shutdown] Received ${signal}, cleaning up...`);
21044
+ try {
21045
+ await cleanup();
21046
+ log("[Shutdown] Cleanup complete, exiting with code 0");
21047
+ process.exit(0);
21048
+ } catch (error2) {
21049
+ log("[Shutdown] Error during cleanup:", error2);
21050
+ process.exit(1);
21051
+ }
21052
+ };
21053
+ process.on("SIGINT", () => gracefulShutdown("SIGINT"));
21054
+ process.on("SIGTERM", () => gracefulShutdown("SIGTERM"));
21041
21055
  process.stdin.resume();
21042
- process.stdin.on("end", async () => {
21043
- log("\nShutting down...");
21044
- await cleanup();
21045
- process.exit(0);
21046
- });
21056
+ process.stdin.on("end", () => gracefulShutdown("stdin-end"));
21057
+ process.stdin.on("close", () => gracefulShutdown("stdin-close"));
21047
21058
  }
21048
21059
  function getServerUrlHash(serverUrl, authorizeResource, headers) {
21049
21060
  const parts = [serverUrl];
package/dist/client.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  parseCommandLineArgs,
13
13
  setupSignalHandlers,
14
14
  version
15
- } from "./chunk-7F6PRZCR.js";
15
+ } from "./chunk-3OI3JDYP.js";
16
16
 
17
17
  // src/client.ts
18
18
  import { EventEmitter } from "events";
package/dist/proxy.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  mcpProxy,
11
11
  parseCommandLineArgs,
12
12
  setupSignalHandlers
13
- } from "./chunk-7F6PRZCR.js";
13
+ } from "./chunk-3OI3JDYP.js";
14
14
 
15
15
  // src/proxy.ts
16
16
  import { EventEmitter } from "events";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "up-mcp-bridge",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Remote proxy for MCP with auto-reconnect support. Fork of mcp-remote with transparent server restart handling.",
5
5
  "keywords": [
6
6
  "mcp",