@alfe.ai/openclaw-database 0.0.14 → 0.0.16

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 {
@@ -511,6 +518,7 @@ const plugin = {
511
518
  else startDatabaseService();
512
519
  },
513
520
  async deactivate(api) {
521
+ g[ACTIVATED_KEY] = false;
514
522
  api.logger.info("Database plugin deactivating...");
515
523
  if (mongoClient) {
516
524
  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 {
@@ -511,6 +518,7 @@ const plugin = {
511
518
  else startDatabaseService();
512
519
  },
513
520
  async deactivate(api) {
521
+ g[ACTIVATED_KEY] = false;
514
522
  api.logger.info("Database plugin deactivating...");
515
523
  if (mongoClient) {
516
524
  await mongoClient.close();
@@ -3,6 +3,27 @@
3
3
  "name": "Alfe Database",
4
4
  "description": "MongoDB database access for agents — query, insert, update, delete, and manage collections",
5
5
  "entry": "./dist/plugin.js",
6
+ "activation": { "onStartup": false },
7
+ "contracts": {
8
+ "tools": [
9
+ "db_aggregate",
10
+ "db_collection_schema",
11
+ "db_collection_stats",
12
+ "db_count",
13
+ "db_create_collection",
14
+ "db_create_index",
15
+ "db_delete",
16
+ "db_drop_collection",
17
+ "db_drop_index",
18
+ "db_find",
19
+ "db_find_one",
20
+ "db_insert",
21
+ "db_list_collections",
22
+ "db_list_databases",
23
+ "db_list_indexes",
24
+ "db_update"
25
+ ]
26
+ },
6
27
  "configSchema": {
7
28
  "type": "object",
8
29
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/openclaw-database",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "OpenClaw database plugin — MongoDB access for agents via MCP tools",
5
5
  "type": "module",
6
6
  "main": "./dist/plugin.js",