@cfio/cohort-sync 0.11.3 → 0.11.4

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/index.js CHANGED
@@ -12046,13 +12046,14 @@ async function startNotificationSubscription(port, cfg, hooksToken, logger, gwCl
12046
12046
  );
12047
12047
  }
12048
12048
  const sourceMap = resolvedNameMap ?? cfg.agentNameMap ?? { main: "main" };
12049
- const reverseNameMap = {};
12049
+ const subscriptionTargets = /* @__PURE__ */ new Map();
12050
12050
  for (const [openclawId, cohortName] of Object.entries(sourceMap)) {
12051
- reverseNameMap[cohortName] = openclawId;
12051
+ subscriptionTargets.set(cohortName, openclawId);
12052
+ if (openclawId !== cohortName) {
12053
+ subscriptionTargets.set(openclawId, openclawId);
12054
+ }
12052
12055
  }
12053
- const agentNames = Array.from(new Set(Object.values(sourceMap)));
12054
- for (const agentName of agentNames) {
12055
- const openclawAgentId = reverseNameMap[agentName] ?? agentName;
12056
+ for (const [agentName, openclawAgentId] of subscriptionTargets) {
12056
12057
  logger.info(`cohort-sync: subscribing to notifications for agent "${agentName}" (openclawId: "${openclawAgentId}")`);
12057
12058
  let processing = false;
12058
12059
  const apiKeyHash = hashApiKey(cfg.apiKey);
@@ -13333,7 +13334,7 @@ function dumpCtx(ctx) {
13333
13334
  function dumpEvent(event) {
13334
13335
  return dumpCtx(event);
13335
13336
  }
13336
- var PLUGIN_VERSION = true ? "0.11.3" : "unknown";
13337
+ var PLUGIN_VERSION = true ? "0.11.4" : "unknown";
13337
13338
  function resolveGatewayToken(api) {
13338
13339
  const token = api.config?.gateway?.auth?.token;
13339
13340
  return typeof token === "string" ? token : null;
@@ -55,5 +55,5 @@
55
55
  }
56
56
  }
57
57
  },
58
- "version": "0.11.3"
58
+ "version": "0.11.4"
59
59
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfio/cohort-sync",
3
- "version": "0.11.3",
3
+ "version": "0.11.4",
4
4
  "description": "OpenClaw plugin — syncs agent telemetry, sessions, and activity to the Cohort dashboard",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfio/cohort-sync",
3
- "version": "0.11.3",
3
+ "version": "0.11.4",
4
4
  "description": "OpenClaw plugin — syncs agent telemetry, sessions, and activity to the Cohort dashboard",
5
5
  "license": "MIT",
6
6
  "homepage": "https://docs.cohort.bot/gateway",