@node9/proxy 1.48.0 → 1.49.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
@@ -4216,6 +4216,23 @@ var init_shields = __esm({
4216
4216
  }
4217
4217
  });
4218
4218
 
4219
+ // src/config/managed.ts
4220
+ function modeRank(mode) {
4221
+ return MODE_ORDER.indexOf(mode);
4222
+ }
4223
+ function resolveManagedMode(local, cloud, locked) {
4224
+ if (modeRank(cloud) === -1) return local;
4225
+ if (locked) return cloud;
4226
+ return modeRank(local) > modeRank(cloud) ? local : cloud;
4227
+ }
4228
+ var MODE_ORDER;
4229
+ var init_managed = __esm({
4230
+ "src/config/managed.ts"() {
4231
+ "use strict";
4232
+ MODE_ORDER = ["observe", "audit", "standard", "strict"];
4233
+ }
4234
+ });
4235
+
4219
4236
  // src/config/index.ts
4220
4237
  function _resetConfigCache() {
4221
4238
  cachedConfig = null;
@@ -4426,6 +4443,13 @@ function getConfig(cwd) {
4426
4443
  if (Array.isArray(raw.shields)) {
4427
4444
  cloudManagedShields = raw.shields.filter((s) => typeof s === "string");
4428
4445
  }
4446
+ if (raw.managedConfig && typeof raw.managedConfig === "object") {
4447
+ const mc = raw.managedConfig;
4448
+ if (typeof mc.mode === "string") {
4449
+ const locked = Array.isArray(mc.locked) && mc.locked.includes("mode");
4450
+ mergedSettings.mode = resolveManagedMode(mergedSettings.mode, mc.mode, locked);
4451
+ }
4452
+ }
4429
4453
  if (raw.panicMode === true) {
4430
4454
  mergedSettings.panicMode = true;
4431
4455
  }
@@ -4537,6 +4561,7 @@ var init_config = __esm({
4537
4561
  import_os3 = __toESM(require("os"));
4538
4562
  init_config_schema();
4539
4563
  init_shields();
4564
+ init_managed();
4540
4565
  DANGEROUS_WORDS = [
4541
4566
  "mkfs",
4542
4567
  // formats/wipes a filesystem partition
@@ -16890,6 +16915,15 @@ function extractRules(body) {
16890
16915
  function extractShields(body) {
16891
16916
  return Array.isArray(body.shields) ? body.shields.filter((s) => typeof s === "string") : [];
16892
16917
  }
16918
+ function extractManagedConfig(body) {
16919
+ const mc = body.managedConfig;
16920
+ if (!mc || typeof mc !== "object") return void 0;
16921
+ const out = {
16922
+ locked: Array.isArray(mc.locked) ? mc.locked.filter((f) => typeof f === "string") : []
16923
+ };
16924
+ if (typeof mc.mode === "string") out.mode = mc.mode;
16925
+ return out.mode !== void 0 ? out : void 0;
16926
+ }
16893
16927
  function writeCache2(cache) {
16894
16928
  const dir = import_path31.default.dirname(rulesCacheFile());
16895
16929
  if (!import_fs32.default.existsSync(dir)) import_fs32.default.mkdirSync(dir, { recursive: true });
@@ -16910,7 +16944,8 @@ async function syncOnce() {
16910
16944
  shadowMode: result.body.shadowMode,
16911
16945
  syncIntervalHours: result.body.syncIntervalHours,
16912
16946
  workspaceId: result.body.workspaceId,
16913
- shields: extractShields(result.body)
16947
+ shields: extractShields(result.body),
16948
+ managedConfig: extractManagedConfig(result.body)
16914
16949
  };
16915
16950
  writeCache2(cache);
16916
16951
  }
@@ -17083,7 +17118,8 @@ async function runCloudSync() {
17083
17118
  shadowMode: result.body.shadowMode,
17084
17119
  syncIntervalHours: result.body.syncIntervalHours,
17085
17120
  workspaceId: result.body.workspaceId,
17086
- shields: extractShields(result.body)
17121
+ shields: extractShields(result.body),
17122
+ managedConfig: extractManagedConfig(result.body)
17087
17123
  };
17088
17124
  writeCache2(cache);
17089
17125
  maybePushBlast();
package/dist/cli.mjs CHANGED
@@ -4194,6 +4194,23 @@ var init_shields = __esm({
4194
4194
  }
4195
4195
  });
4196
4196
 
4197
+ // src/config/managed.ts
4198
+ function modeRank(mode) {
4199
+ return MODE_ORDER.indexOf(mode);
4200
+ }
4201
+ function resolveManagedMode(local, cloud, locked) {
4202
+ if (modeRank(cloud) === -1) return local;
4203
+ if (locked) return cloud;
4204
+ return modeRank(local) > modeRank(cloud) ? local : cloud;
4205
+ }
4206
+ var MODE_ORDER;
4207
+ var init_managed = __esm({
4208
+ "src/config/managed.ts"() {
4209
+ "use strict";
4210
+ MODE_ORDER = ["observe", "audit", "standard", "strict"];
4211
+ }
4212
+ });
4213
+
4197
4214
  // src/config/index.ts
4198
4215
  import fs3 from "fs";
4199
4216
  import path3 from "path";
@@ -4407,6 +4424,13 @@ function getConfig(cwd) {
4407
4424
  if (Array.isArray(raw.shields)) {
4408
4425
  cloudManagedShields = raw.shields.filter((s) => typeof s === "string");
4409
4426
  }
4427
+ if (raw.managedConfig && typeof raw.managedConfig === "object") {
4428
+ const mc = raw.managedConfig;
4429
+ if (typeof mc.mode === "string") {
4430
+ const locked = Array.isArray(mc.locked) && mc.locked.includes("mode");
4431
+ mergedSettings.mode = resolveManagedMode(mergedSettings.mode, mc.mode, locked);
4432
+ }
4433
+ }
4410
4434
  if (raw.panicMode === true) {
4411
4435
  mergedSettings.panicMode = true;
4412
4436
  }
@@ -4515,6 +4539,7 @@ var init_config = __esm({
4515
4539
  "use strict";
4516
4540
  init_config_schema();
4517
4541
  init_shields();
4542
+ init_managed();
4518
4543
  DANGEROUS_WORDS = [
4519
4544
  "mkfs",
4520
4545
  // formats/wipes a filesystem partition
@@ -16864,6 +16889,15 @@ function extractRules(body) {
16864
16889
  function extractShields(body) {
16865
16890
  return Array.isArray(body.shields) ? body.shields.filter((s) => typeof s === "string") : [];
16866
16891
  }
16892
+ function extractManagedConfig(body) {
16893
+ const mc = body.managedConfig;
16894
+ if (!mc || typeof mc !== "object") return void 0;
16895
+ const out = {
16896
+ locked: Array.isArray(mc.locked) ? mc.locked.filter((f) => typeof f === "string") : []
16897
+ };
16898
+ if (typeof mc.mode === "string") out.mode = mc.mode;
16899
+ return out.mode !== void 0 ? out : void 0;
16900
+ }
16867
16901
  function writeCache2(cache) {
16868
16902
  const dir = path31.dirname(rulesCacheFile());
16869
16903
  if (!fs32.existsSync(dir)) fs32.mkdirSync(dir, { recursive: true });
@@ -16884,7 +16918,8 @@ async function syncOnce() {
16884
16918
  shadowMode: result.body.shadowMode,
16885
16919
  syncIntervalHours: result.body.syncIntervalHours,
16886
16920
  workspaceId: result.body.workspaceId,
16887
- shields: extractShields(result.body)
16921
+ shields: extractShields(result.body),
16922
+ managedConfig: extractManagedConfig(result.body)
16888
16923
  };
16889
16924
  writeCache2(cache);
16890
16925
  }
@@ -17057,7 +17092,8 @@ async function runCloudSync() {
17057
17092
  shadowMode: result.body.shadowMode,
17058
17093
  syncIntervalHours: result.body.syncIntervalHours,
17059
17094
  workspaceId: result.body.workspaceId,
17060
- shields: extractShields(result.body)
17095
+ shields: extractShields(result.body),
17096
+ managedConfig: extractManagedConfig(result.body)
17061
17097
  };
17062
17098
  writeCache2(cache);
17063
17099
  maybePushBlast();
@@ -2412,6 +2412,13 @@ var init_shields = __esm({
2412
2412
  }
2413
2413
  });
2414
2414
 
2415
+ // src/config/managed.ts
2416
+ var init_managed = __esm({
2417
+ "src/config/managed.ts"() {
2418
+ "use strict";
2419
+ }
2420
+ });
2421
+
2415
2422
  // src/config/index.ts
2416
2423
  var DANGEROUS_WORDS, DEFAULT_CONFIG;
2417
2424
  var init_config = __esm({
@@ -2419,6 +2426,7 @@ var init_config = __esm({
2419
2426
  "use strict";
2420
2427
  init_config_schema();
2421
2428
  init_shields();
2429
+ init_managed();
2422
2430
  DANGEROUS_WORDS = [
2423
2431
  "mkfs",
2424
2432
  // formats/wipes a filesystem partition
package/dist/index.js CHANGED
@@ -3501,6 +3501,17 @@ function readShieldOverrides() {
3501
3501
  return readShieldsFile().overrides ?? {};
3502
3502
  }
3503
3503
 
3504
+ // src/config/managed.ts
3505
+ var MODE_ORDER = ["observe", "audit", "standard", "strict"];
3506
+ function modeRank(mode) {
3507
+ return MODE_ORDER.indexOf(mode);
3508
+ }
3509
+ function resolveManagedMode(local, cloud, locked) {
3510
+ if (modeRank(cloud) === -1) return local;
3511
+ if (locked) return cloud;
3512
+ return modeRank(local) > modeRank(cloud) ? local : cloud;
3513
+ }
3514
+
3504
3515
  // src/config/index.ts
3505
3516
  var DANGEROUS_WORDS = [
3506
3517
  "mkfs",
@@ -3958,6 +3969,13 @@ function getConfig(cwd) {
3958
3969
  if (Array.isArray(raw.shields)) {
3959
3970
  cloudManagedShields = raw.shields.filter((s) => typeof s === "string");
3960
3971
  }
3972
+ if (raw.managedConfig && typeof raw.managedConfig === "object") {
3973
+ const mc = raw.managedConfig;
3974
+ if (typeof mc.mode === "string") {
3975
+ const locked = Array.isArray(mc.locked) && mc.locked.includes("mode");
3976
+ mergedSettings.mode = resolveManagedMode(mergedSettings.mode, mc.mode, locked);
3977
+ }
3978
+ }
3961
3979
  if (raw.panicMode === true) {
3962
3980
  mergedSettings.panicMode = true;
3963
3981
  }
package/dist/index.mjs CHANGED
@@ -3471,6 +3471,17 @@ function readShieldOverrides() {
3471
3471
  return readShieldsFile().overrides ?? {};
3472
3472
  }
3473
3473
 
3474
+ // src/config/managed.ts
3475
+ var MODE_ORDER = ["observe", "audit", "standard", "strict"];
3476
+ function modeRank(mode) {
3477
+ return MODE_ORDER.indexOf(mode);
3478
+ }
3479
+ function resolveManagedMode(local, cloud, locked) {
3480
+ if (modeRank(cloud) === -1) return local;
3481
+ if (locked) return cloud;
3482
+ return modeRank(local) > modeRank(cloud) ? local : cloud;
3483
+ }
3484
+
3474
3485
  // src/config/index.ts
3475
3486
  var DANGEROUS_WORDS = [
3476
3487
  "mkfs",
@@ -3928,6 +3939,13 @@ function getConfig(cwd) {
3928
3939
  if (Array.isArray(raw.shields)) {
3929
3940
  cloudManagedShields = raw.shields.filter((s) => typeof s === "string");
3930
3941
  }
3942
+ if (raw.managedConfig && typeof raw.managedConfig === "object") {
3943
+ const mc = raw.managedConfig;
3944
+ if (typeof mc.mode === "string") {
3945
+ const locked = Array.isArray(mc.locked) && mc.locked.includes("mode");
3946
+ mergedSettings.mode = resolveManagedMode(mergedSettings.mode, mc.mode, locked);
3947
+ }
3948
+ }
3931
3949
  if (raw.panicMode === true) {
3932
3950
  mergedSettings.panicMode = true;
3933
3951
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node9/proxy",
3
- "version": "1.48.0",
3
+ "version": "1.49.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",