@cfio/cohort-sync 0.31.8 → 0.31.9
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 +10 -4
- package/dist/openclaw.plugin.json +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13730,11 +13730,15 @@ function dumpEvent(event) {
|
|
|
13730
13730
|
function positiveNumber(value) {
|
|
13731
13731
|
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
|
|
13732
13732
|
}
|
|
13733
|
-
var PLUGIN_VERSION = true ? "0.31.
|
|
13733
|
+
var PLUGIN_VERSION = true ? "0.31.9" : "unknown";
|
|
13734
13734
|
function resolveGatewayToken(api) {
|
|
13735
13735
|
const token2 = api.config?.gateway?.auth?.token;
|
|
13736
13736
|
return typeof token2 === "string" ? token2 : null;
|
|
13737
13737
|
}
|
|
13738
|
+
function resolveHooksToken(api) {
|
|
13739
|
+
const token2 = api.config?.hooks?.token;
|
|
13740
|
+
return typeof token2 === "string" ? token2 : null;
|
|
13741
|
+
}
|
|
13738
13742
|
function registerCronEventHandlers(client2, cfg, resolveAgentName, cronTimestampTracker, logger) {
|
|
13739
13743
|
if (client2.availableEvents.has("cron")) {
|
|
13740
13744
|
let debounceTimer = null;
|
|
@@ -13918,6 +13922,7 @@ async function handleGatewayStart(event, state) {
|
|
|
13918
13922
|
logger.debug("cohort-sync: gateway start: bridge after seed", { bridge: Object.fromEntries(getChannelAgentBridge()) });
|
|
13919
13923
|
state.gatewayPort = event.port;
|
|
13920
13924
|
const token2 = resolveGatewayToken(api);
|
|
13925
|
+
const hooksToken = resolveHooksToken(api);
|
|
13921
13926
|
if (token2) {
|
|
13922
13927
|
state.gatewayToken = token2;
|
|
13923
13928
|
logger.debug("cohort-sync: gateway client connecting", { port: event.port, hasToken: true });
|
|
@@ -13935,7 +13940,7 @@ async function handleGatewayStart(event, state) {
|
|
|
13935
13940
|
state.resolveAgentName,
|
|
13936
13941
|
state.persistentGwClient,
|
|
13937
13942
|
state.cronTimestampTracker,
|
|
13938
|
-
{ port: state.gatewayPort, hooksToken
|
|
13943
|
+
{ port: state.gatewayPort, hooksToken }
|
|
13939
13944
|
);
|
|
13940
13945
|
state.commandUnsubscriber = unsub;
|
|
13941
13946
|
} catch (err) {
|
|
@@ -13988,7 +13993,7 @@ async function handleGatewayStart(event, state) {
|
|
|
13988
13993
|
await startNotificationSubscription(
|
|
13989
13994
|
event.port,
|
|
13990
13995
|
cfg,
|
|
13991
|
-
|
|
13996
|
+
hooksToken ?? void 0,
|
|
13992
13997
|
logger,
|
|
13993
13998
|
state.persistentGwClient,
|
|
13994
13999
|
resolvedNameMap
|
|
@@ -14580,6 +14585,7 @@ function initializeHookState(api, cfg) {
|
|
|
14580
14585
|
});
|
|
14581
14586
|
const gatewayPort = api.config?.gateway?.port ?? null;
|
|
14582
14587
|
const gatewayToken = resolveGatewayToken(api);
|
|
14588
|
+
const hooksToken = resolveHooksToken(api);
|
|
14583
14589
|
const cronTimestampTracker = new CronTimestampTracker();
|
|
14584
14590
|
const cronRunStarts = /* @__PURE__ */ new Map();
|
|
14585
14591
|
let persistentGwClient = null;
|
|
@@ -14595,7 +14601,7 @@ function initializeHookState(api, cfg) {
|
|
|
14595
14601
|
resolveAgentName,
|
|
14596
14602
|
persistentGwClient,
|
|
14597
14603
|
cronTimestampTracker,
|
|
14598
|
-
{ port: gatewayPort, hooksToken
|
|
14604
|
+
{ port: gatewayPort, hooksToken }
|
|
14599
14605
|
);
|
|
14600
14606
|
setToolRuntime({
|
|
14601
14607
|
apiKey: cfg.apiKey,
|
package/dist/package.json
CHANGED
package/package.json
CHANGED