@alfe.ai/openclaw-database 0.0.15 → 0.0.17

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/plugin2.cjs CHANGED
@@ -463,12 +463,19 @@ function ensureInitialized(client) {
463
463
  });
464
464
  return initPromise;
465
465
  }
466
+ const ACTIVATED_KEY = "__alfeDatabasePluginActivated";
467
+ const g = globalThis;
466
468
  const plugin = {
467
469
  id: "@alfe.ai/openclaw-database",
468
470
  name: "Alfe Database",
469
471
  version: pkg.version,
470
472
  activate(api) {
471
473
  const log = api.logger;
474
+ if (g[ACTIVATED_KEY] === true) {
475
+ log.debug("Database plugin already activated — skipping duplicate");
476
+ return;
477
+ }
478
+ g[ACTIVATED_KEY] = true;
472
479
  log.info("Database plugin activating...");
473
480
  let client;
474
481
  try {
@@ -478,6 +485,7 @@ const plugin = {
478
485
  apiUrl: config.apiUrl
479
486
  });
480
487
  } catch (err) {
488
+ g[ACTIVATED_KEY] = false;
481
489
  log.error(`Database plugin: failed to resolve config — ${err instanceof Error ? err.message : String(err)}`);
482
490
  return;
483
491
  }
@@ -511,6 +519,7 @@ const plugin = {
511
519
  else startDatabaseService();
512
520
  },
513
521
  async deactivate(api) {
522
+ g[ACTIVATED_KEY] = false;
514
523
  api.logger.info("Database plugin deactivating...");
515
524
  if (mongoClient) {
516
525
  await mongoClient.close();
package/dist/plugin2.js CHANGED
@@ -463,12 +463,19 @@ function ensureInitialized(client) {
463
463
  });
464
464
  return initPromise;
465
465
  }
466
+ const ACTIVATED_KEY = "__alfeDatabasePluginActivated";
467
+ const g = globalThis;
466
468
  const plugin = {
467
469
  id: "@alfe.ai/openclaw-database",
468
470
  name: "Alfe Database",
469
471
  version: pkg.version,
470
472
  activate(api) {
471
473
  const log = api.logger;
474
+ if (g[ACTIVATED_KEY] === true) {
475
+ log.debug("Database plugin already activated — skipping duplicate");
476
+ return;
477
+ }
478
+ g[ACTIVATED_KEY] = true;
472
479
  log.info("Database plugin activating...");
473
480
  let client;
474
481
  try {
@@ -478,6 +485,7 @@ const plugin = {
478
485
  apiUrl: config.apiUrl
479
486
  });
480
487
  } catch (err) {
488
+ g[ACTIVATED_KEY] = false;
481
489
  log.error(`Database plugin: failed to resolve config — ${err instanceof Error ? err.message : String(err)}`);
482
490
  return;
483
491
  }
@@ -511,6 +519,7 @@ const plugin = {
511
519
  else startDatabaseService();
512
520
  },
513
521
  async deactivate(api) {
522
+ g[ACTIVATED_KEY] = false;
514
523
  api.logger.info("Database plugin deactivating...");
515
524
  if (mongoClient) {
516
525
  await mongoClient.close();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/openclaw-database",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "OpenClaw database plugin — MongoDB access for agents via MCP tools",
5
5
  "type": "module",
6
6
  "main": "./dist/plugin.js",
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "dependencies": {
30
30
  "mongodb": "^6.12.0",
31
- "@alfe.ai/agent-api-client": "0.1.1",
31
+ "@alfe.ai/agent-api-client": "0.1.2",
32
32
  "@alfe.ai/config": "0.0.8"
33
33
  },
34
34
  "license": "UNLICENSED",