@cfio/cohort-sync 0.30.0 → 0.31.1

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
@@ -11811,7 +11811,9 @@ async function executeCommand(cmd, gwClient, cfg, resolveAgentName, logger, cron
11811
11811
  const patch = {};
11812
11812
  if (cmd.payload?.name) patch.name = cmd.payload.name;
11813
11813
  if (cmd.payload?.schedule) patch.schedule = cmd.payload.schedule;
11814
- if (cmd.payload?.message) patch.payload = { kind: "agentTurn", message: cmd.payload.message };
11814
+ if (cmd.payload?.message !== void 0) {
11815
+ patch.payload = { kind: "agentTurn", message: cmd.payload.message };
11816
+ }
11815
11817
  if (cmd.payload?.agentId) patch.agentId = reverseResolveAgentName(cmd.payload.agentId, nameMap);
11816
11818
  await gwClient.request("cron.update", {
11817
11819
  jobId: cmd.payload?.jobId,
@@ -13559,7 +13561,7 @@ function dumpCtx(ctx) {
13559
13561
  function dumpEvent(event) {
13560
13562
  return dumpCtx(event);
13561
13563
  }
13562
- var PLUGIN_VERSION = true ? "0.30.0" : "unknown";
13564
+ var PLUGIN_VERSION = true ? "0.31.1" : "unknown";
13563
13565
  function resolveGatewayToken(api) {
13564
13566
  const token = api.config?.gateway?.auth?.token;
13565
13567
  return typeof token === "string" ? token : null;
@@ -13713,6 +13715,19 @@ async function handleGatewayStart(event, state) {
13713
13715
  }
13714
13716
  } catch {
13715
13717
  }
13718
+ const UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
13719
+ if (state.updateCheckInterval) clearInterval(state.updateCheckInterval);
13720
+ state.updateCheckInterval = setInterval(async () => {
13721
+ try {
13722
+ const latest = await checkForUpdate(PLUGIN_VERSION, logger);
13723
+ if (latest) state.latestPluginVersion = latest;
13724
+ } catch {
13725
+ }
13726
+ }, UPDATE_CHECK_INTERVAL_MS);
13727
+ if (typeof state.updateCheckInterval.unref === "function") {
13728
+ state.updateCheckInterval.unref();
13729
+ }
13730
+ logger.debug("cohort-sync: update check interval scheduled (24h)");
13716
13731
  try {
13717
13732
  const agentList = (config?.agents?.list ?? []).map((a) => ({
13718
13733
  id: a.id,
@@ -14290,6 +14305,10 @@ function registerHookHandlers(api, logger, getState) {
14290
14305
  clearInterval(state.keepaliveInterval);
14291
14306
  state.keepaliveInterval = null;
14292
14307
  }
14308
+ if (state.updateCheckInterval) {
14309
+ clearInterval(state.updateCheckInterval);
14310
+ state.updateCheckInterval = null;
14311
+ }
14293
14312
  if (state.channelsUnsubscriber) {
14294
14313
  try {
14295
14314
  state.channelsUnsubscriber();
@@ -14450,7 +14469,8 @@ function initializeHookState(api, cfg) {
14450
14469
  commandUnsubscriber: commandUnsub,
14451
14470
  channelsUnsubscriber: null,
14452
14471
  api,
14453
- latestPluginVersion: null
14472
+ latestPluginVersion: null,
14473
+ updateCheckInterval: null
14454
14474
  };
14455
14475
  }
14456
14476
 
@@ -72,5 +72,5 @@
72
72
  }
73
73
  }
74
74
  },
75
- "version": "0.30.0"
75
+ "version": "0.31.1"
76
76
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfio/cohort-sync",
3
- "version": "0.30.0",
3
+ "version": "0.31.1",
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.30.0",
3
+ "version": "0.31.1",
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",