@cfio/cohort-sync 0.4.5 → 0.4.6
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 +15 -9
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11917,6 +11917,10 @@ function getChannelAgent(channelId) {
|
|
|
11917
11917
|
}
|
|
11918
11918
|
|
|
11919
11919
|
// src/sync.ts
|
|
11920
|
+
var cronStorePath = null;
|
|
11921
|
+
function setCronStorePath(p) {
|
|
11922
|
+
cronStorePath = p;
|
|
11923
|
+
}
|
|
11920
11924
|
function extractJson(raw) {
|
|
11921
11925
|
const jsonStart = raw.search(/[\[{]/);
|
|
11922
11926
|
const jsonEndBracket = raw.lastIndexOf("]");
|
|
@@ -11950,8 +11954,7 @@ function fetchSkills(logger) {
|
|
|
11950
11954
|
}
|
|
11951
11955
|
function fetchCronJobs(logger) {
|
|
11952
11956
|
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()})`);
|
|
11957
|
+
const storePath = cronStorePath ?? path.join(os.homedir(), ".openclaw", "cron", "jobs.json");
|
|
11955
11958
|
if (!fs.existsSync(storePath)) {
|
|
11956
11959
|
logger.warn(`cohort-sync: cron store not found at ${storePath}`);
|
|
11957
11960
|
return null;
|
|
@@ -12850,15 +12853,18 @@ function registerHooks(api, cfg) {
|
|
|
12850
12853
|
agentIds: (config?.agents?.list ?? []).map((a) => a.id),
|
|
12851
12854
|
agentMessageProviders: (config?.agents?.list ?? []).map((a) => ({ id: a.id, mp: a.messageProvider }))
|
|
12852
12855
|
});
|
|
12856
|
+
const resolvedCronPath = typeof api.resolvePath === "function" ? api.resolvePath("cron/jobs.json") : null;
|
|
12857
|
+
const runtimeKeys = api.runtime ? Object.keys(api.runtime) : [];
|
|
12858
|
+
const runtimeMethods = api.runtime ? Object.keys(api.runtime).filter((k) => typeof api.runtime[k] === "function") : [];
|
|
12853
12859
|
diag("CONFIG_DUMP", {
|
|
12854
|
-
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
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") : []
|
|
12860
|
+
resolvedCronPath,
|
|
12861
|
+
cronPathExists: resolvedCronPath ? fs2.existsSync(resolvedCronPath) : false,
|
|
12862
|
+
runtimeKeys,
|
|
12863
|
+
runtimeMethods
|
|
12861
12864
|
});
|
|
12865
|
+
if (resolvedCronPath && typeof resolvedCronPath === "string") {
|
|
12866
|
+
setCronStorePath(resolvedCronPath);
|
|
12867
|
+
}
|
|
12862
12868
|
setConvexUrl(cfg);
|
|
12863
12869
|
setLogger(logger);
|
|
12864
12870
|
restoreFromHotReload(logger);
|
package/dist/package.json
CHANGED