@alfe.ai/openclaw-chat 0.0.29 → 0.0.31

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
@@ -517,6 +517,8 @@ function validateAttachmentUrl(input, opts = {}) {
517
517
  * ← onAgentEvent streaming ← (real-time deltas)
518
518
  * ← deliver() callback ← (final response)
519
519
  */
520
+ const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
521
+ const pkg = require$1("../package.json");
520
522
  let dispatchInbound = null;
521
523
  /**
522
524
  * Resolve OpenClaw SDK functions from the running process.
@@ -527,7 +529,7 @@ let dispatchInbound = null;
527
529
  * the global modules path from process.execPath.
528
530
  */
529
531
  function resolveOpenClawSdk(log) {
530
- const anchors = [require.main?.filename, process.argv[1]].filter(Boolean);
532
+ const anchors = [require$1.main?.filename, process.argv[1]].filter(Boolean);
531
533
  for (const anchor of anchors) try {
532
534
  const channelInbound = (0, node_module.createRequire)(anchor)("openclaw/plugin-sdk/channel-inbound");
533
535
  if (channelInbound.dispatchInboundDirectDmWithRuntime) {
@@ -642,6 +644,13 @@ async function handleAgentRequest(request, log) {
642
644
  const sessionId = conversationId ?? legacySessionKey;
643
645
  if (!await getSession(sessionId)) await createSession(sessionId, "", "alfe", tenantId, userId);
644
646
  await addMessage(sessionId, "user", message, userId ?? senderId, displayName ?? senderId);
647
+ if (metricsClient && userId) metricsClient.recordActivity({
648
+ userId,
649
+ channel: "alfe",
650
+ role: "user"
651
+ }).catch((err) => {
652
+ log.warn(`Metrics report failed: ${err instanceof Error ? err.message : String(err)}`);
653
+ });
645
654
  let resolvedOpenClawKey = null;
646
655
  const unsubscribe = runtime.events.onAgentEvent((evt) => {
647
656
  if (!evt.sessionKey) return;
@@ -807,7 +816,7 @@ const plugin = {
807
816
  id: "@alfe.ai/openclaw-chat",
808
817
  name: "Alfe Chat Plugin",
809
818
  description: "Chat conversation channel — web widget and mobile app share unified chat sessions",
810
- version: "0.0.8",
819
+ version: pkg.version,
811
820
  activate(api) {
812
821
  const log = api.logger;
813
822
  const alreadyActivated = globalThis.__alfeChatPluginActivated === true;
package/dist/plugin2.js CHANGED
@@ -6,9 +6,6 @@ import { ChatServiceClient, resolveAlfeChat } from "@alfe.ai/chat";
6
6
  import { resolveConfig } from "@alfe.ai/config";
7
7
  import { AgentApiClient } from "@alfe.ai/agent-api-client";
8
8
  import { existsSync } from "node:fs";
9
- //#region \0rolldown/runtime.js
10
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
11
- //#endregion
12
9
  //#region src/alfe-channel.ts
13
10
  const CHANNEL_ID = "alfe";
14
11
  const DEFAULT_ACCOUNT_ID = "default";
@@ -520,6 +517,8 @@ function validateAttachmentUrl(input, opts = {}) {
520
517
  * ← onAgentEvent streaming ← (real-time deltas)
521
518
  * ← deliver() callback ← (final response)
522
519
  */
520
+ const require = createRequire(import.meta.url);
521
+ const pkg = require("../package.json");
523
522
  let dispatchInbound = null;
524
523
  /**
525
524
  * Resolve OpenClaw SDK functions from the running process.
@@ -530,7 +529,7 @@ let dispatchInbound = null;
530
529
  * the global modules path from process.execPath.
531
530
  */
532
531
  function resolveOpenClawSdk(log) {
533
- const anchors = [__require.main?.filename, process.argv[1]].filter(Boolean);
532
+ const anchors = [require.main?.filename, process.argv[1]].filter(Boolean);
534
533
  for (const anchor of anchors) try {
535
534
  const channelInbound = createRequire(anchor)("openclaw/plugin-sdk/channel-inbound");
536
535
  if (channelInbound.dispatchInboundDirectDmWithRuntime) {
@@ -645,6 +644,13 @@ async function handleAgentRequest(request, log) {
645
644
  const sessionId = conversationId ?? legacySessionKey;
646
645
  if (!await getSession(sessionId)) await createSession(sessionId, "", "alfe", tenantId, userId);
647
646
  await addMessage(sessionId, "user", message, userId ?? senderId, displayName ?? senderId);
647
+ if (metricsClient && userId) metricsClient.recordActivity({
648
+ userId,
649
+ channel: "alfe",
650
+ role: "user"
651
+ }).catch((err) => {
652
+ log.warn(`Metrics report failed: ${err instanceof Error ? err.message : String(err)}`);
653
+ });
648
654
  let resolvedOpenClawKey = null;
649
655
  const unsubscribe = runtime.events.onAgentEvent((evt) => {
650
656
  if (!evt.sessionKey) return;
@@ -810,7 +816,7 @@ const plugin = {
810
816
  id: "@alfe.ai/openclaw-chat",
811
817
  name: "Alfe Chat Plugin",
812
818
  description: "Chat conversation channel — web widget and mobile app share unified chat sessions",
813
- version: "0.0.8",
819
+ version: pkg.version,
814
820
  activate(api) {
815
821
  const log = api.logger;
816
822
  const alreadyActivated = globalThis.__alfeChatPluginActivated === true;
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "id": "@alfe.ai/openclaw-chat",
3
3
  "name": "Alfe Chat Plugin",
4
- "version": "0.0.21",
5
4
  "description": "Chat conversation channel — web widget and mobile app share unified chat sessions",
6
5
  "entry": "./dist/plugin.js",
7
6
  "configSchema": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/openclaw-chat",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "description": "OpenClaw chat plugin for Alfe — web widget and mobile app channels",
5
5
  "type": "module",
6
6
  "main": "./dist/plugin.js",
@@ -27,7 +27,7 @@
27
27
  "openclaw.plugin.json"
28
28
  ],
29
29
  "dependencies": {
30
- "@alfe.ai/agent-api-client": "^0.0.10",
30
+ "@alfe.ai/agent-api-client": "^0.0.11",
31
31
  "@alfe.ai/chat": "^0.0.8",
32
32
  "@alfe.ai/config": "^0.0.8"
33
33
  },