@node9/proxy 1.52.0 → 1.53.0

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/cli.js CHANGED
@@ -16946,6 +16946,23 @@ function readCachedEtag() {
16946
16946
  return void 0;
16947
16947
  }
16948
16948
  }
16949
+ function readCachedSyncIntervalHours() {
16950
+ try {
16951
+ const raw = JSON.parse(import_fs32.default.readFileSync(rulesCacheFile(), "utf-8"));
16952
+ return typeof raw.syncIntervalHours === "number" ? raw.syncIntervalHours : void 0;
16953
+ } catch {
16954
+ return void 0;
16955
+ }
16956
+ }
16957
+ function pickSyncIntervalMs(cloudHours, localSettings) {
16958
+ if (typeof cloudHours === "number" && Number.isFinite(cloudHours)) {
16959
+ return resolveSyncIntervalMs({ cloudSyncIntervalHours: cloudHours });
16960
+ }
16961
+ return resolveSyncIntervalMs(localSettings);
16962
+ }
16963
+ function effectiveSyncIntervalMs() {
16964
+ return pickSyncIntervalMs(readCachedSyncIntervalHours(), getConfig().settings);
16965
+ }
16949
16966
  function fetchCloudPolicy(apiKey, apiUrl, ifNoneMatch) {
16950
16967
  const parsed = new URL(apiUrl);
16951
16968
  const headers = {
@@ -17255,11 +17272,14 @@ function getCloudRules() {
17255
17272
  }
17256
17273
  }
17257
17274
  function startCloudSync() {
17258
- const intervalMs = resolveSyncIntervalMs(getConfig().settings);
17259
- const initial = setTimeout(() => void syncOnce(), 3e4);
17260
- initial.unref();
17261
- const recurring = setInterval(() => void syncOnce(), intervalMs);
17262
- recurring.unref();
17275
+ const scheduleNext = (ms) => {
17276
+ const t = setTimeout(() => {
17277
+ void syncOnce().catch(() => {
17278
+ }).finally(() => scheduleNext(effectiveSyncIntervalMs()));
17279
+ }, ms);
17280
+ t.unref();
17281
+ };
17282
+ scheduleNext(3e4);
17263
17283
  }
17264
17284
  function startForensicBroadcast() {
17265
17285
  const tick = async () => {
package/dist/cli.mjs CHANGED
@@ -16920,6 +16920,23 @@ function readCachedEtag() {
16920
16920
  return void 0;
16921
16921
  }
16922
16922
  }
16923
+ function readCachedSyncIntervalHours() {
16924
+ try {
16925
+ const raw = JSON.parse(fs33.readFileSync(rulesCacheFile(), "utf-8"));
16926
+ return typeof raw.syncIntervalHours === "number" ? raw.syncIntervalHours : void 0;
16927
+ } catch {
16928
+ return void 0;
16929
+ }
16930
+ }
16931
+ function pickSyncIntervalMs(cloudHours, localSettings) {
16932
+ if (typeof cloudHours === "number" && Number.isFinite(cloudHours)) {
16933
+ return resolveSyncIntervalMs({ cloudSyncIntervalHours: cloudHours });
16934
+ }
16935
+ return resolveSyncIntervalMs(localSettings);
16936
+ }
16937
+ function effectiveSyncIntervalMs() {
16938
+ return pickSyncIntervalMs(readCachedSyncIntervalHours(), getConfig().settings);
16939
+ }
16923
16940
  function fetchCloudPolicy(apiKey, apiUrl, ifNoneMatch) {
16924
16941
  const parsed = new URL(apiUrl);
16925
16942
  const headers = {
@@ -17229,11 +17246,14 @@ function getCloudRules() {
17229
17246
  }
17230
17247
  }
17231
17248
  function startCloudSync() {
17232
- const intervalMs = resolveSyncIntervalMs(getConfig().settings);
17233
- const initial = setTimeout(() => void syncOnce(), 3e4);
17234
- initial.unref();
17235
- const recurring = setInterval(() => void syncOnce(), intervalMs);
17236
- recurring.unref();
17249
+ const scheduleNext = (ms) => {
17250
+ const t = setTimeout(() => {
17251
+ void syncOnce().catch(() => {
17252
+ }).finally(() => scheduleNext(effectiveSyncIntervalMs()));
17253
+ }, ms);
17254
+ t.unref();
17255
+ };
17256
+ scheduleNext(3e4);
17237
17257
  }
17238
17258
  function startForensicBroadcast() {
17239
17259
  const tick = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node9/proxy",
3
- "version": "1.52.0",
3
+ "version": "1.53.0",
4
4
  "description": "The Sudo Command for AI Agents. Execution Security for Claude Code, Codex, Gemini, Cursor, Opencode, Pi, and any MCP server.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",