@cfio/cohort-sync 0.4.5 → 0.4.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/index.js CHANGED
@@ -89,6 +89,7 @@ var init_keychain = __esm({
89
89
 
90
90
  // src/hooks.ts
91
91
  import fs2 from "node:fs";
92
+ import os2 from "node:os";
92
93
  import path2 from "node:path";
93
94
 
94
95
  // ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
@@ -7633,14 +7634,14 @@ var require_node_gyp_build = __commonJS({
7633
7634
  "../common/temp/node_modules/.pnpm/node-gyp-build@4.8.4/node_modules/node-gyp-build/node-gyp-build.js"(exports, module) {
7634
7635
  var fs3 = __require("fs");
7635
7636
  var path3 = __require("path");
7636
- var os2 = __require("os");
7637
+ var os3 = __require("os");
7637
7638
  var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
7638
7639
  var vars = process.config && process.config.variables || {};
7639
7640
  var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
7640
7641
  var abi = process.versions.modules;
7641
7642
  var runtime = isElectron() ? "electron" : isNwjs() ? "node-webkit" : "node";
7642
- var arch = process.env.npm_config_arch || os2.arch();
7643
- var platform = process.env.npm_config_platform || os2.platform();
7643
+ var arch = process.env.npm_config_arch || os3.arch();
7644
+ var platform = process.env.npm_config_platform || os3.platform();
7644
7645
  var libc = process.env.LIBC || (isAlpine(platform) ? "musl" : "glibc");
7645
7646
  var armv = process.env.ARM_VERSION || (arch === "arm64" ? "8" : vars.arm_version) || "";
7646
7647
  var uv = (process.versions.uv || "").split(".")[0];
@@ -11917,6 +11918,10 @@ function getChannelAgent(channelId) {
11917
11918
  }
11918
11919
 
11919
11920
  // src/sync.ts
11921
+ var cronStorePath = null;
11922
+ function setCronStorePath(p) {
11923
+ cronStorePath = p;
11924
+ }
11920
11925
  function extractJson(raw) {
11921
11926
  const jsonStart = raw.search(/[\[{]/);
11922
11927
  const jsonEndBracket = raw.lastIndexOf("]");
@@ -11950,8 +11955,7 @@ function fetchSkills(logger) {
11950
11955
  }
11951
11956
  function fetchCronJobs(logger) {
11952
11957
  try {
11953
- const storePath = path.join(os.homedir(), ".openclaw", "cron", "jobs.json");
11954
- logger.info(`cohort-sync: reading cron store from ${storePath} (homedir=${os.homedir()})`);
11958
+ const storePath = cronStorePath ?? path.join(os.homedir(), ".openclaw", "cron", "jobs.json");
11955
11959
  if (!fs.existsSync(storePath)) {
11956
11960
  logger.warn(`cohort-sync: cron store not found at ${storePath}`);
11957
11961
  return null;
@@ -12850,15 +12854,9 @@ function registerHooks(api, cfg) {
12850
12854
  agentIds: (config?.agents?.list ?? []).map((a) => a.id),
12851
12855
  agentMessageProviders: (config?.agents?.list ?? []).map((a) => ({ id: a.id, mp: a.messageProvider }))
12852
12856
  });
12853
- diag("CONFIG_DUMP", {
12854
- configKeys: config ? Object.keys(config) : [],
12855
- cronKeys: config?.cron ? Object.keys(config.cron) : [],
12856
- hasCronService: typeof config?.cron?.list === "function",
12857
- hasCronJobs: !!config?.cron?.jobs,
12858
- cronStorePath: config?.cron?.storePath ?? null,
12859
- apiKeys: api ? Object.keys(api).filter((k) => typeof api[k] !== "function") : [],
12860
- apiMethods: api ? Object.keys(api).filter((k) => typeof api[k] === "function") : []
12861
- });
12857
+ const cronPath = path2.join(os2.homedir(), ".openclaw", "cron", "jobs.json");
12858
+ setCronStorePath(cronPath);
12859
+ diag("CRON_STORE_PATH", { cronPath, exists: fs2.existsSync(cronPath) });
12862
12860
  setConvexUrl(cfg);
12863
12861
  setLogger(logger);
12864
12862
  restoreFromHotReload(logger);
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfio/cohort-sync",
3
- "version": "0.4.5",
3
+ "version": "0.4.8",
4
4
  "description": "Syncs agent status and skills to 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.4.5",
3
+ "version": "0.4.8",
4
4
  "description": "Syncs agent status and skills to Cohort dashboard",
5
5
  "license": "MIT",
6
6
  "homepage": "https://docs.cohort.bot/gateway",