@alfe.ai/openclaw-metrics 0.0.7 → 0.0.8

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/plugin.cjs CHANGED
@@ -17,6 +17,15 @@ const plugin = {
17
17
  id: "@alfe.ai/openclaw-metrics",
18
18
  activate(api) {
19
19
  const log = api.logger;
20
+ if (!api.runtime) {
21
+ log.debug("Management command context — skipping metrics init");
22
+ return;
23
+ }
24
+ if (globalThis.__alfeMetricsPluginActivated === true) {
25
+ log.debug("Alfe Metrics plugin already activated — skipping duplicate");
26
+ return;
27
+ }
28
+ globalThis.__alfeMetricsPluginActivated = true;
20
29
  log.info("Alfe Metrics plugin activating...");
21
30
  try {
22
31
  const cfg = (0, _alfe_ai_config.resolveConfig)();
@@ -56,6 +65,7 @@ const plugin = {
56
65
  deactivate(api) {
57
66
  const log = api.logger;
58
67
  client = null;
68
+ globalThis.__alfeMetricsPluginActivated = false;
59
69
  log.info("Alfe Metrics plugin deactivated");
60
70
  }
61
71
  };
package/dist/plugin.d.cts CHANGED
@@ -18,6 +18,7 @@ interface PluginLogger {
18
18
  }
19
19
  interface PluginApi {
20
20
  logger: PluginLogger;
21
+ runtime?: unknown;
21
22
  on(event: string, handler: (...args: unknown[]) => void | Promise<void>): void;
22
23
  }
23
24
  declare const plugin: {
package/dist/plugin.d.ts CHANGED
@@ -18,6 +18,7 @@ interface PluginLogger {
18
18
  }
19
19
  interface PluginApi {
20
20
  logger: PluginLogger;
21
+ runtime?: unknown;
21
22
  on(event: string, handler: (...args: unknown[]) => void | Promise<void>): void;
22
23
  }
23
24
  declare const plugin: {
package/dist/plugin.js CHANGED
@@ -17,6 +17,15 @@ const plugin = {
17
17
  id: "@alfe.ai/openclaw-metrics",
18
18
  activate(api) {
19
19
  const log = api.logger;
20
+ if (!api.runtime) {
21
+ log.debug("Management command context — skipping metrics init");
22
+ return;
23
+ }
24
+ if (globalThis.__alfeMetricsPluginActivated === true) {
25
+ log.debug("Alfe Metrics plugin already activated — skipping duplicate");
26
+ return;
27
+ }
28
+ globalThis.__alfeMetricsPluginActivated = true;
20
29
  log.info("Alfe Metrics plugin activating...");
21
30
  try {
22
31
  const cfg = resolveConfig();
@@ -56,6 +65,7 @@ const plugin = {
56
65
  deactivate(api) {
57
66
  const log = api.logger;
58
67
  client = null;
68
+ globalThis.__alfeMetricsPluginActivated = false;
59
69
  log.info("Alfe Metrics plugin deactivated");
60
70
  }
61
71
  };
@@ -1,5 +1,9 @@
1
1
  {
2
2
  "id": "@alfe.ai/openclaw-metrics",
3
+ "name": "Alfe Metrics",
4
+ "version": "0.0.7",
5
+ "description": "Per-user activity tracking across all channels",
6
+ "entry": "./dist/plugin.js",
3
7
  "configSchema": {
4
8
  "type": "object",
5
9
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/openclaw-metrics",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "OpenClaw metrics plugin for Alfe — per-user activity tracking",
5
5
  "type": "module",
6
6
  "main": "./dist/plugin.js",