@node9/proxy 1.49.0 → 1.50.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 +48 -9
- package/dist/cli.mjs +48 -9
- package/dist/index.js +40 -7
- package/dist/index.mjs +40 -7
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4217,19 +4217,38 @@ var init_shields = __esm({
|
|
|
4217
4217
|
});
|
|
4218
4218
|
|
|
4219
4219
|
// src/config/managed.ts
|
|
4220
|
-
function
|
|
4221
|
-
return
|
|
4220
|
+
function rankIn(order, value) {
|
|
4221
|
+
return order.indexOf(value);
|
|
4222
4222
|
}
|
|
4223
|
-
function
|
|
4224
|
-
if (
|
|
4223
|
+
function resolveByOrder(order, local, cloud, locked) {
|
|
4224
|
+
if (rankIn(order, cloud) === -1) return local;
|
|
4225
4225
|
if (locked) return cloud;
|
|
4226
|
-
return
|
|
4226
|
+
return rankIn(order, local) > rankIn(order, cloud) ? local : cloud;
|
|
4227
|
+
}
|
|
4228
|
+
function resolveManagedMode(local, cloud, locked) {
|
|
4229
|
+
return resolveByOrder(MODE_ORDER, local, cloud, locked);
|
|
4230
|
+
}
|
|
4231
|
+
function applyManagedEgress(local, managed, locked) {
|
|
4232
|
+
const next = { ...local };
|
|
4233
|
+
if (typeof managed.enabled === "boolean") {
|
|
4234
|
+
next.enabled = locked.includes("egressEnabled") ? managed.enabled : local.enabled || managed.enabled;
|
|
4235
|
+
}
|
|
4236
|
+
if (typeof managed.mode === "string") {
|
|
4237
|
+
next.mode = resolveByOrder(
|
|
4238
|
+
EGRESS_MODE_ORDER,
|
|
4239
|
+
local.mode,
|
|
4240
|
+
managed.mode,
|
|
4241
|
+
locked.includes("egressMode")
|
|
4242
|
+
);
|
|
4243
|
+
}
|
|
4244
|
+
return next;
|
|
4227
4245
|
}
|
|
4228
|
-
var MODE_ORDER;
|
|
4246
|
+
var MODE_ORDER, EGRESS_MODE_ORDER;
|
|
4229
4247
|
var init_managed = __esm({
|
|
4230
4248
|
"src/config/managed.ts"() {
|
|
4231
4249
|
"use strict";
|
|
4232
4250
|
MODE_ORDER = ["observe", "audit", "standard", "strict"];
|
|
4251
|
+
EGRESS_MODE_ORDER = ["off", "review", "block"];
|
|
4233
4252
|
}
|
|
4234
4253
|
});
|
|
4235
4254
|
|
|
@@ -4445,9 +4464,23 @@ function getConfig(cwd) {
|
|
|
4445
4464
|
}
|
|
4446
4465
|
if (raw.managedConfig && typeof raw.managedConfig === "object") {
|
|
4447
4466
|
const mc = raw.managedConfig;
|
|
4467
|
+
const locked = Array.isArray(mc.locked) ? mc.locked.filter((f) => typeof f === "string") : [];
|
|
4448
4468
|
if (typeof mc.mode === "string") {
|
|
4449
|
-
|
|
4450
|
-
|
|
4469
|
+
mergedSettings.mode = resolveManagedMode(
|
|
4470
|
+
mergedSettings.mode,
|
|
4471
|
+
mc.mode,
|
|
4472
|
+
locked.includes("mode")
|
|
4473
|
+
);
|
|
4474
|
+
}
|
|
4475
|
+
if (mc.egress && typeof mc.egress === "object") {
|
|
4476
|
+
mergedPolicy.egress = applyManagedEgress(
|
|
4477
|
+
mergedPolicy.egress,
|
|
4478
|
+
{
|
|
4479
|
+
enabled: typeof mc.egress.enabled === "boolean" ? mc.egress.enabled : void 0,
|
|
4480
|
+
mode: typeof mc.egress.mode === "string" ? mc.egress.mode : void 0
|
|
4481
|
+
},
|
|
4482
|
+
locked
|
|
4483
|
+
);
|
|
4451
4484
|
}
|
|
4452
4485
|
}
|
|
4453
4486
|
if (raw.panicMode === true) {
|
|
@@ -16922,7 +16955,13 @@ function extractManagedConfig(body) {
|
|
|
16922
16955
|
locked: Array.isArray(mc.locked) ? mc.locked.filter((f) => typeof f === "string") : []
|
|
16923
16956
|
};
|
|
16924
16957
|
if (typeof mc.mode === "string") out.mode = mc.mode;
|
|
16925
|
-
|
|
16958
|
+
if (mc.egress && typeof mc.egress === "object") {
|
|
16959
|
+
const e = {};
|
|
16960
|
+
if (typeof mc.egress.enabled === "boolean") e.enabled = mc.egress.enabled;
|
|
16961
|
+
if (typeof mc.egress.mode === "string") e.mode = mc.egress.mode;
|
|
16962
|
+
if (e.enabled !== void 0 || e.mode !== void 0) out.egress = e;
|
|
16963
|
+
}
|
|
16964
|
+
return out.mode !== void 0 || out.egress !== void 0 ? out : void 0;
|
|
16926
16965
|
}
|
|
16927
16966
|
function writeCache2(cache) {
|
|
16928
16967
|
const dir = import_path31.default.dirname(rulesCacheFile());
|
package/dist/cli.mjs
CHANGED
|
@@ -4195,19 +4195,38 @@ var init_shields = __esm({
|
|
|
4195
4195
|
});
|
|
4196
4196
|
|
|
4197
4197
|
// src/config/managed.ts
|
|
4198
|
-
function
|
|
4199
|
-
return
|
|
4198
|
+
function rankIn(order, value) {
|
|
4199
|
+
return order.indexOf(value);
|
|
4200
4200
|
}
|
|
4201
|
-
function
|
|
4202
|
-
if (
|
|
4201
|
+
function resolveByOrder(order, local, cloud, locked) {
|
|
4202
|
+
if (rankIn(order, cloud) === -1) return local;
|
|
4203
4203
|
if (locked) return cloud;
|
|
4204
|
-
return
|
|
4204
|
+
return rankIn(order, local) > rankIn(order, cloud) ? local : cloud;
|
|
4205
|
+
}
|
|
4206
|
+
function resolveManagedMode(local, cloud, locked) {
|
|
4207
|
+
return resolveByOrder(MODE_ORDER, local, cloud, locked);
|
|
4208
|
+
}
|
|
4209
|
+
function applyManagedEgress(local, managed, locked) {
|
|
4210
|
+
const next = { ...local };
|
|
4211
|
+
if (typeof managed.enabled === "boolean") {
|
|
4212
|
+
next.enabled = locked.includes("egressEnabled") ? managed.enabled : local.enabled || managed.enabled;
|
|
4213
|
+
}
|
|
4214
|
+
if (typeof managed.mode === "string") {
|
|
4215
|
+
next.mode = resolveByOrder(
|
|
4216
|
+
EGRESS_MODE_ORDER,
|
|
4217
|
+
local.mode,
|
|
4218
|
+
managed.mode,
|
|
4219
|
+
locked.includes("egressMode")
|
|
4220
|
+
);
|
|
4221
|
+
}
|
|
4222
|
+
return next;
|
|
4205
4223
|
}
|
|
4206
|
-
var MODE_ORDER;
|
|
4224
|
+
var MODE_ORDER, EGRESS_MODE_ORDER;
|
|
4207
4225
|
var init_managed = __esm({
|
|
4208
4226
|
"src/config/managed.ts"() {
|
|
4209
4227
|
"use strict";
|
|
4210
4228
|
MODE_ORDER = ["observe", "audit", "standard", "strict"];
|
|
4229
|
+
EGRESS_MODE_ORDER = ["off", "review", "block"];
|
|
4211
4230
|
}
|
|
4212
4231
|
});
|
|
4213
4232
|
|
|
@@ -4426,9 +4445,23 @@ function getConfig(cwd) {
|
|
|
4426
4445
|
}
|
|
4427
4446
|
if (raw.managedConfig && typeof raw.managedConfig === "object") {
|
|
4428
4447
|
const mc = raw.managedConfig;
|
|
4448
|
+
const locked = Array.isArray(mc.locked) ? mc.locked.filter((f) => typeof f === "string") : [];
|
|
4429
4449
|
if (typeof mc.mode === "string") {
|
|
4430
|
-
|
|
4431
|
-
|
|
4450
|
+
mergedSettings.mode = resolveManagedMode(
|
|
4451
|
+
mergedSettings.mode,
|
|
4452
|
+
mc.mode,
|
|
4453
|
+
locked.includes("mode")
|
|
4454
|
+
);
|
|
4455
|
+
}
|
|
4456
|
+
if (mc.egress && typeof mc.egress === "object") {
|
|
4457
|
+
mergedPolicy.egress = applyManagedEgress(
|
|
4458
|
+
mergedPolicy.egress,
|
|
4459
|
+
{
|
|
4460
|
+
enabled: typeof mc.egress.enabled === "boolean" ? mc.egress.enabled : void 0,
|
|
4461
|
+
mode: typeof mc.egress.mode === "string" ? mc.egress.mode : void 0
|
|
4462
|
+
},
|
|
4463
|
+
locked
|
|
4464
|
+
);
|
|
4432
4465
|
}
|
|
4433
4466
|
}
|
|
4434
4467
|
if (raw.panicMode === true) {
|
|
@@ -16896,7 +16929,13 @@ function extractManagedConfig(body) {
|
|
|
16896
16929
|
locked: Array.isArray(mc.locked) ? mc.locked.filter((f) => typeof f === "string") : []
|
|
16897
16930
|
};
|
|
16898
16931
|
if (typeof mc.mode === "string") out.mode = mc.mode;
|
|
16899
|
-
|
|
16932
|
+
if (mc.egress && typeof mc.egress === "object") {
|
|
16933
|
+
const e = {};
|
|
16934
|
+
if (typeof mc.egress.enabled === "boolean") e.enabled = mc.egress.enabled;
|
|
16935
|
+
if (typeof mc.egress.mode === "string") e.mode = mc.egress.mode;
|
|
16936
|
+
if (e.enabled !== void 0 || e.mode !== void 0) out.egress = e;
|
|
16937
|
+
}
|
|
16938
|
+
return out.mode !== void 0 || out.egress !== void 0 ? out : void 0;
|
|
16900
16939
|
}
|
|
16901
16940
|
function writeCache2(cache) {
|
|
16902
16941
|
const dir = path31.dirname(rulesCacheFile());
|
package/dist/index.js
CHANGED
|
@@ -3503,13 +3503,32 @@ function readShieldOverrides() {
|
|
|
3503
3503
|
|
|
3504
3504
|
// src/config/managed.ts
|
|
3505
3505
|
var MODE_ORDER = ["observe", "audit", "standard", "strict"];
|
|
3506
|
-
|
|
3507
|
-
|
|
3506
|
+
var EGRESS_MODE_ORDER = ["off", "review", "block"];
|
|
3507
|
+
function rankIn(order, value) {
|
|
3508
|
+
return order.indexOf(value);
|
|
3508
3509
|
}
|
|
3509
|
-
function
|
|
3510
|
-
if (
|
|
3510
|
+
function resolveByOrder(order, local, cloud, locked) {
|
|
3511
|
+
if (rankIn(order, cloud) === -1) return local;
|
|
3511
3512
|
if (locked) return cloud;
|
|
3512
|
-
return
|
|
3513
|
+
return rankIn(order, local) > rankIn(order, cloud) ? local : cloud;
|
|
3514
|
+
}
|
|
3515
|
+
function resolveManagedMode(local, cloud, locked) {
|
|
3516
|
+
return resolveByOrder(MODE_ORDER, local, cloud, locked);
|
|
3517
|
+
}
|
|
3518
|
+
function applyManagedEgress(local, managed, locked) {
|
|
3519
|
+
const next = { ...local };
|
|
3520
|
+
if (typeof managed.enabled === "boolean") {
|
|
3521
|
+
next.enabled = locked.includes("egressEnabled") ? managed.enabled : local.enabled || managed.enabled;
|
|
3522
|
+
}
|
|
3523
|
+
if (typeof managed.mode === "string") {
|
|
3524
|
+
next.mode = resolveByOrder(
|
|
3525
|
+
EGRESS_MODE_ORDER,
|
|
3526
|
+
local.mode,
|
|
3527
|
+
managed.mode,
|
|
3528
|
+
locked.includes("egressMode")
|
|
3529
|
+
);
|
|
3530
|
+
}
|
|
3531
|
+
return next;
|
|
3513
3532
|
}
|
|
3514
3533
|
|
|
3515
3534
|
// src/config/index.ts
|
|
@@ -3971,9 +3990,23 @@ function getConfig(cwd) {
|
|
|
3971
3990
|
}
|
|
3972
3991
|
if (raw.managedConfig && typeof raw.managedConfig === "object") {
|
|
3973
3992
|
const mc = raw.managedConfig;
|
|
3993
|
+
const locked = Array.isArray(mc.locked) ? mc.locked.filter((f) => typeof f === "string") : [];
|
|
3974
3994
|
if (typeof mc.mode === "string") {
|
|
3975
|
-
|
|
3976
|
-
|
|
3995
|
+
mergedSettings.mode = resolveManagedMode(
|
|
3996
|
+
mergedSettings.mode,
|
|
3997
|
+
mc.mode,
|
|
3998
|
+
locked.includes("mode")
|
|
3999
|
+
);
|
|
4000
|
+
}
|
|
4001
|
+
if (mc.egress && typeof mc.egress === "object") {
|
|
4002
|
+
mergedPolicy.egress = applyManagedEgress(
|
|
4003
|
+
mergedPolicy.egress,
|
|
4004
|
+
{
|
|
4005
|
+
enabled: typeof mc.egress.enabled === "boolean" ? mc.egress.enabled : void 0,
|
|
4006
|
+
mode: typeof mc.egress.mode === "string" ? mc.egress.mode : void 0
|
|
4007
|
+
},
|
|
4008
|
+
locked
|
|
4009
|
+
);
|
|
3977
4010
|
}
|
|
3978
4011
|
}
|
|
3979
4012
|
if (raw.panicMode === true) {
|
package/dist/index.mjs
CHANGED
|
@@ -3473,13 +3473,32 @@ function readShieldOverrides() {
|
|
|
3473
3473
|
|
|
3474
3474
|
// src/config/managed.ts
|
|
3475
3475
|
var MODE_ORDER = ["observe", "audit", "standard", "strict"];
|
|
3476
|
-
|
|
3477
|
-
|
|
3476
|
+
var EGRESS_MODE_ORDER = ["off", "review", "block"];
|
|
3477
|
+
function rankIn(order, value) {
|
|
3478
|
+
return order.indexOf(value);
|
|
3478
3479
|
}
|
|
3479
|
-
function
|
|
3480
|
-
if (
|
|
3480
|
+
function resolveByOrder(order, local, cloud, locked) {
|
|
3481
|
+
if (rankIn(order, cloud) === -1) return local;
|
|
3481
3482
|
if (locked) return cloud;
|
|
3482
|
-
return
|
|
3483
|
+
return rankIn(order, local) > rankIn(order, cloud) ? local : cloud;
|
|
3484
|
+
}
|
|
3485
|
+
function resolveManagedMode(local, cloud, locked) {
|
|
3486
|
+
return resolveByOrder(MODE_ORDER, local, cloud, locked);
|
|
3487
|
+
}
|
|
3488
|
+
function applyManagedEgress(local, managed, locked) {
|
|
3489
|
+
const next = { ...local };
|
|
3490
|
+
if (typeof managed.enabled === "boolean") {
|
|
3491
|
+
next.enabled = locked.includes("egressEnabled") ? managed.enabled : local.enabled || managed.enabled;
|
|
3492
|
+
}
|
|
3493
|
+
if (typeof managed.mode === "string") {
|
|
3494
|
+
next.mode = resolveByOrder(
|
|
3495
|
+
EGRESS_MODE_ORDER,
|
|
3496
|
+
local.mode,
|
|
3497
|
+
managed.mode,
|
|
3498
|
+
locked.includes("egressMode")
|
|
3499
|
+
);
|
|
3500
|
+
}
|
|
3501
|
+
return next;
|
|
3483
3502
|
}
|
|
3484
3503
|
|
|
3485
3504
|
// src/config/index.ts
|
|
@@ -3941,9 +3960,23 @@ function getConfig(cwd) {
|
|
|
3941
3960
|
}
|
|
3942
3961
|
if (raw.managedConfig && typeof raw.managedConfig === "object") {
|
|
3943
3962
|
const mc = raw.managedConfig;
|
|
3963
|
+
const locked = Array.isArray(mc.locked) ? mc.locked.filter((f) => typeof f === "string") : [];
|
|
3944
3964
|
if (typeof mc.mode === "string") {
|
|
3945
|
-
|
|
3946
|
-
|
|
3965
|
+
mergedSettings.mode = resolveManagedMode(
|
|
3966
|
+
mergedSettings.mode,
|
|
3967
|
+
mc.mode,
|
|
3968
|
+
locked.includes("mode")
|
|
3969
|
+
);
|
|
3970
|
+
}
|
|
3971
|
+
if (mc.egress && typeof mc.egress === "object") {
|
|
3972
|
+
mergedPolicy.egress = applyManagedEgress(
|
|
3973
|
+
mergedPolicy.egress,
|
|
3974
|
+
{
|
|
3975
|
+
enabled: typeof mc.egress.enabled === "boolean" ? mc.egress.enabled : void 0,
|
|
3976
|
+
mode: typeof mc.egress.mode === "string" ? mc.egress.mode : void 0
|
|
3977
|
+
},
|
|
3978
|
+
locked
|
|
3979
|
+
);
|
|
3947
3980
|
}
|
|
3948
3981
|
}
|
|
3949
3982
|
if (raw.panicMode === true) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node9/proxy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.50.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",
|