@cup319/mmpl 2.8.0 → 2.8.1

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.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/index.js CHANGED
@@ -21887,7 +21887,7 @@ async function main() {
21887
21887
  const createMcpServer = () => {
21888
21888
  const server = new McpServer({
21889
21889
  name: "MMPL",
21890
- version: "2.8.0"
21890
+ version: "2.8.1"
21891
21891
  });
21892
21892
  registerMemoryWrite(server, deps);
21893
21893
  registerMemorySearch(server, deps);
@@ -21911,10 +21911,13 @@ async function main() {
21911
21911
  void embeddingService.ready().catch((err) => {
21912
21912
  console.error("[startup] embedding service init failed:", err);
21913
21913
  });
21914
- console.error(`MMPL (Memory Palace) MCP Server v2.8.0 listening on http://${httpHost}:${httpPort}${httpPath}`);
21915
- const gracefulShutdown = async (signal) => {
21914
+ console.error(`MMPL (Memory Palace) MCP Server v2.8.1 listening on http://${httpHost}:${httpPort}${httpPath}`);
21915
+ let shuttingDown = false;
21916
+ const gracefulShutdown = async (reason) => {
21917
+ if (shuttingDown) return;
21918
+ shuttingDown = true;
21916
21919
  console.error(`
21917
- [shutdown] Received ${signal}, gracefully shutting down...`);
21920
+ [shutdown] Triggered by ${reason}, gracefully shutting down...`);
21918
21921
  try {
21919
21922
  pipeline2.stop();
21920
21923
  console.error("[shutdown] PipelineManager stopped");
@@ -21936,21 +21939,31 @@ async function main() {
21936
21939
  console.error("[shutdown] Clean shutdown complete");
21937
21940
  process.exit(0);
21938
21941
  };
21942
+ const armForceExitTimer = (reason) => {
21943
+ setTimeout(() => {
21944
+ console.error(`[shutdown] Timed out after 5s (${reason}), forcing exit`);
21945
+ process.exit(0);
21946
+ }, 5e3);
21947
+ };
21939
21948
  if (process.platform !== "win32") {
21940
21949
  process.on("SIGTERM", () => {
21941
- const timeout = setTimeout(() => {
21942
- console.error("[shutdown] Timed out after 10s, forcing exit");
21943
- process.exit(0);
21944
- }, 1e4);
21945
- gracefulShutdown("SIGTERM").finally(() => clearTimeout(timeout));
21950
+ armForceExitTimer("SIGTERM");
21951
+ gracefulShutdown("SIGTERM");
21946
21952
  });
21947
21953
  }
21948
21954
  process.on("SIGINT", () => {
21949
- const timeout = setTimeout(() => {
21950
- console.error("[shutdown] Timed out after 10s, forcing exit");
21951
- process.exit(0);
21952
- }, 1e4);
21953
- gracefulShutdown("SIGINT").finally(() => clearTimeout(timeout));
21955
+ armForceExitTimer("SIGINT");
21956
+ gracefulShutdown("SIGINT");
21957
+ });
21958
+ process.on("uncaughtException", (err) => {
21959
+ console.error("[shutdown] uncaughtException:", err);
21960
+ armForceExitTimer("uncaughtException");
21961
+ gracefulShutdown("uncaughtException");
21962
+ });
21963
+ process.on("unhandledRejection", (reason) => {
21964
+ console.error("[shutdown] unhandledRejection:", reason);
21965
+ armForceExitTimer("unhandledRejection");
21966
+ gracefulShutdown("unhandledRejection");
21954
21967
  });
21955
21968
  const providerStatus = embeddingService.getProviderStatus();
21956
21969
  console.error(` Embedding: ${providerStatus.active} (\u7EF4\u5EA6: ${embeddingService.dimension}, \u53EF\u7528: ${embeddingService.available ? "\u2705" : "\u274C"})`);