@node9/proxy 1.46.0 → 1.47.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
@@ -337,6 +337,11 @@ var init_config_schema = __esm({
337
337
  // must run them from the CLI. node9's threat model is the agent itself.
338
338
  mcpAllowWeakening: import_zod.z.boolean().optional(),
339
339
  cloudSyncIntervalHours: import_zod.z.number().positive().optional(),
340
+ // Seconds-granular override for the cloud policy sync cadence. Wins over
341
+ // cloudSyncIntervalHours when set. Lets you opt into fast apply (e.g. 20)
342
+ // for an incident; clamped to a 15s floor so it can't hammer the API.
343
+ // Unset → falls back to hours, then the 5h default.
344
+ cloudSyncIntervalSeconds: import_zod.z.number().positive().optional(),
340
345
  // Outbox shipper (audit.log → SaaS batch ingest). enabled defaults
341
346
  // to true; set false to fall back to local-only auditing.
342
347
  shipper: import_zod.z.object({
@@ -16777,6 +16782,11 @@ function buildSessionDeltas(findings, toolCallsBySession) {
16777
16782
  signals
16778
16783
  }));
16779
16784
  }
16785
+ function resolveSyncIntervalMs(settings) {
16786
+ const rawSeconds = settings.cloudSyncIntervalSeconds ?? (settings.cloudSyncIntervalHours ?? DEFAULT_INTERVAL_HOURS) * 3600;
16787
+ const clamped = Math.min(Math.max(rawSeconds, MIN_INTERVAL_SECONDS), MAX_INTERVAL_SECONDS);
16788
+ return clamped * 1e3;
16789
+ }
16780
16790
  function readCredentials() {
16781
16791
  if (process.env.NODE9_API_KEY) {
16782
16792
  return {
@@ -17099,9 +17109,7 @@ function getCloudRules() {
17099
17109
  }
17100
17110
  }
17101
17111
  function startCloudSync() {
17102
- const rawHours = getConfig().settings.cloudSyncIntervalHours ?? DEFAULT_INTERVAL_HOURS;
17103
- const intervalHours = Math.max(rawHours, MIN_INTERVAL_HOURS);
17104
- const intervalMs = intervalHours * 60 * 60 * 1e3;
17112
+ const intervalMs = resolveSyncIntervalMs(getConfig().settings);
17105
17113
  const initial = setTimeout(() => void syncOnce(), 3e4);
17106
17114
  initial.unref();
17107
17115
  const recurring = setInterval(() => void syncOnce(), intervalMs);
@@ -17126,7 +17134,7 @@ function startForensicBroadcast() {
17126
17134
  const recurring = setInterval(() => void tick(), FORENSIC_BROADCAST_INTERVAL_MS);
17127
17135
  recurring.unref();
17128
17136
  }
17129
- var import_fs32, import_https4, import_os29, import_path31, FINDING_TO_SIGNAL3, rulesCacheFile, DEFAULT_API_URL, DEFAULT_INTERVAL_HOURS, MIN_INTERVAL_HOURS, FORENSIC_BROADCAST_INTERVAL_MS, FORENSIC_INITIAL_DELAY_MS, forensicBroadcastOffsets;
17137
+ var import_fs32, import_https4, import_os29, import_path31, FINDING_TO_SIGNAL3, rulesCacheFile, DEFAULT_API_URL, DEFAULT_INTERVAL_HOURS, MIN_INTERVAL_SECONDS, MAX_INTERVAL_SECONDS, FORENSIC_BROADCAST_INTERVAL_MS, FORENSIC_INITIAL_DELAY_MS, forensicBroadcastOffsets;
17130
17138
  var init_sync = __esm({
17131
17139
  "src/daemon/sync.ts"() {
17132
17140
  "use strict";
@@ -17160,7 +17168,8 @@ var init_sync = __esm({
17160
17168
  rulesCacheFile = () => import_path31.default.join(import_os29.default.homedir(), ".node9", "rules-cache.json");
17161
17169
  DEFAULT_API_URL = "https://api.node9.ai/api/v1/intercept/policies/sync";
17162
17170
  DEFAULT_INTERVAL_HOURS = 5;
17163
- MIN_INTERVAL_HOURS = 1;
17171
+ MIN_INTERVAL_SECONDS = 15;
17172
+ MAX_INTERVAL_SECONDS = 24 * 60 * 60;
17164
17173
  FORENSIC_BROADCAST_INTERVAL_MS = 3e4;
17165
17174
  FORENSIC_INITIAL_DELAY_MS = 5e3;
17166
17175
  forensicBroadcastOffsets = /* @__PURE__ */ new Map();
package/dist/cli.mjs CHANGED
@@ -315,6 +315,11 @@ var init_config_schema = __esm({
315
315
  // must run them from the CLI. node9's threat model is the agent itself.
316
316
  mcpAllowWeakening: z.boolean().optional(),
317
317
  cloudSyncIntervalHours: z.number().positive().optional(),
318
+ // Seconds-granular override for the cloud policy sync cadence. Wins over
319
+ // cloudSyncIntervalHours when set. Lets you opt into fast apply (e.g. 20)
320
+ // for an incident; clamped to a 15s floor so it can't hammer the API.
321
+ // Unset → falls back to hours, then the 5h default.
322
+ cloudSyncIntervalSeconds: z.number().positive().optional(),
318
323
  // Outbox shipper (audit.log → SaaS batch ingest). enabled defaults
319
324
  // to true; set false to fall back to local-only auditing.
320
325
  shipper: z.object({
@@ -16751,6 +16756,11 @@ function buildSessionDeltas(findings, toolCallsBySession) {
16751
16756
  signals
16752
16757
  }));
16753
16758
  }
16759
+ function resolveSyncIntervalMs(settings) {
16760
+ const rawSeconds = settings.cloudSyncIntervalSeconds ?? (settings.cloudSyncIntervalHours ?? DEFAULT_INTERVAL_HOURS) * 3600;
16761
+ const clamped = Math.min(Math.max(rawSeconds, MIN_INTERVAL_SECONDS), MAX_INTERVAL_SECONDS);
16762
+ return clamped * 1e3;
16763
+ }
16754
16764
  function readCredentials() {
16755
16765
  if (process.env.NODE9_API_KEY) {
16756
16766
  return {
@@ -17073,9 +17083,7 @@ function getCloudRules() {
17073
17083
  }
17074
17084
  }
17075
17085
  function startCloudSync() {
17076
- const rawHours = getConfig().settings.cloudSyncIntervalHours ?? DEFAULT_INTERVAL_HOURS;
17077
- const intervalHours = Math.max(rawHours, MIN_INTERVAL_HOURS);
17078
- const intervalMs = intervalHours * 60 * 60 * 1e3;
17086
+ const intervalMs = resolveSyncIntervalMs(getConfig().settings);
17079
17087
  const initial = setTimeout(() => void syncOnce(), 3e4);
17080
17088
  initial.unref();
17081
17089
  const recurring = setInterval(() => void syncOnce(), intervalMs);
@@ -17100,7 +17108,7 @@ function startForensicBroadcast() {
17100
17108
  const recurring = setInterval(() => void tick(), FORENSIC_BROADCAST_INTERVAL_MS);
17101
17109
  recurring.unref();
17102
17110
  }
17103
- var FINDING_TO_SIGNAL3, rulesCacheFile, DEFAULT_API_URL, DEFAULT_INTERVAL_HOURS, MIN_INTERVAL_HOURS, FORENSIC_BROADCAST_INTERVAL_MS, FORENSIC_INITIAL_DELAY_MS, forensicBroadcastOffsets;
17111
+ var FINDING_TO_SIGNAL3, rulesCacheFile, DEFAULT_API_URL, DEFAULT_INTERVAL_HOURS, MIN_INTERVAL_SECONDS, MAX_INTERVAL_SECONDS, FORENSIC_BROADCAST_INTERVAL_MS, FORENSIC_INITIAL_DELAY_MS, forensicBroadcastOffsets;
17104
17112
  var init_sync = __esm({
17105
17113
  "src/daemon/sync.ts"() {
17106
17114
  "use strict";
@@ -17130,7 +17138,8 @@ var init_sync = __esm({
17130
17138
  rulesCacheFile = () => path31.join(os29.homedir(), ".node9", "rules-cache.json");
17131
17139
  DEFAULT_API_URL = "https://api.node9.ai/api/v1/intercept/policies/sync";
17132
17140
  DEFAULT_INTERVAL_HOURS = 5;
17133
- MIN_INTERVAL_HOURS = 1;
17141
+ MIN_INTERVAL_SECONDS = 15;
17142
+ MAX_INTERVAL_SECONDS = 24 * 60 * 60;
17134
17143
  FORENSIC_BROADCAST_INTERVAL_MS = 3e4;
17135
17144
  FORENSIC_INITIAL_DELAY_MS = 5e3;
17136
17145
  forensicBroadcastOffsets = /* @__PURE__ */ new Map();
@@ -2280,6 +2280,11 @@ var init_config_schema = __esm({
2280
2280
  // must run them from the CLI. node9's threat model is the agent itself.
2281
2281
  mcpAllowWeakening: z.boolean().optional(),
2282
2282
  cloudSyncIntervalHours: z.number().positive().optional(),
2283
+ // Seconds-granular override for the cloud policy sync cadence. Wins over
2284
+ // cloudSyncIntervalHours when set. Lets you opt into fast apply (e.g. 20)
2285
+ // for an incident; clamped to a 15s floor so it can't hammer the API.
2286
+ // Unset → falls back to hours, then the 5h default.
2287
+ cloudSyncIntervalSeconds: z.number().positive().optional(),
2283
2288
  // Outbox shipper (audit.log → SaaS batch ingest). enabled defaults
2284
2289
  // to true; set false to fall back to local-only auditing.
2285
2290
  shipper: z.object({
package/dist/index.js CHANGED
@@ -322,6 +322,11 @@ var ConfigFileSchema = import_zod.z.object({
322
322
  // must run them from the CLI. node9's threat model is the agent itself.
323
323
  mcpAllowWeakening: import_zod.z.boolean().optional(),
324
324
  cloudSyncIntervalHours: import_zod.z.number().positive().optional(),
325
+ // Seconds-granular override for the cloud policy sync cadence. Wins over
326
+ // cloudSyncIntervalHours when set. Lets you opt into fast apply (e.g. 20)
327
+ // for an incident; clamped to a 15s floor so it can't hammer the API.
328
+ // Unset → falls back to hours, then the 5h default.
329
+ cloudSyncIntervalSeconds: import_zod.z.number().positive().optional(),
325
330
  // Outbox shipper (audit.log → SaaS batch ingest). enabled defaults
326
331
  // to true; set false to fall back to local-only auditing.
327
332
  shipper: import_zod.z.object({
package/dist/index.mjs CHANGED
@@ -292,6 +292,11 @@ var ConfigFileSchema = z.object({
292
292
  // must run them from the CLI. node9's threat model is the agent itself.
293
293
  mcpAllowWeakening: z.boolean().optional(),
294
294
  cloudSyncIntervalHours: z.number().positive().optional(),
295
+ // Seconds-granular override for the cloud policy sync cadence. Wins over
296
+ // cloudSyncIntervalHours when set. Lets you opt into fast apply (e.g. 20)
297
+ // for an incident; clamped to a 15s floor so it can't hammer the API.
298
+ // Unset → falls back to hours, then the 5h default.
299
+ cloudSyncIntervalSeconds: z.number().positive().optional(),
295
300
  // Outbox shipper (audit.log → SaaS batch ingest). enabled defaults
296
301
  // to true; set false to fall back to local-only auditing.
297
302
  shipper: z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node9/proxy",
3
- "version": "1.46.0",
3
+ "version": "1.47.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",