@node9/proxy 1.54.0 → 1.55.1
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 +37 -6
- package/dist/cli.mjs +37 -6
- package/dist/index.js +14 -1
- package/dist/index.mjs +14 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4241,6 +4241,15 @@ function applyManagedEgress(local, managed, locked) {
|
|
|
4241
4241
|
locked.includes("egressMode")
|
|
4242
4242
|
);
|
|
4243
4243
|
}
|
|
4244
|
+
if (Array.isArray(managed.allow) && managed.allow.length > 0) {
|
|
4245
|
+
next.allow = [...managed.allow];
|
|
4246
|
+
}
|
|
4247
|
+
if (Array.isArray(managed.deny) && managed.deny.length > 0) {
|
|
4248
|
+
next.deny = [.../* @__PURE__ */ new Set([...local.deny ?? [], ...managed.deny])];
|
|
4249
|
+
}
|
|
4250
|
+
if (typeof managed.allowPrivate === "boolean") {
|
|
4251
|
+
next.allowPrivate = locked.includes("egressAllowPrivate") ? managed.allowPrivate : (local.allowPrivate ?? true) && managed.allowPrivate;
|
|
4252
|
+
}
|
|
4244
4253
|
return next;
|
|
4245
4254
|
}
|
|
4246
4255
|
function applyManagedDlp(local, managed, locked) {
|
|
@@ -4489,11 +4498,15 @@ function getConfig(cwd) {
|
|
|
4489
4498
|
);
|
|
4490
4499
|
}
|
|
4491
4500
|
if (mc.egress && typeof mc.egress === "object") {
|
|
4501
|
+
const hosts = (v) => Array.isArray(v) ? v.filter((h) => typeof h === "string") : void 0;
|
|
4492
4502
|
mergedPolicy.egress = applyManagedEgress(
|
|
4493
4503
|
mergedPolicy.egress,
|
|
4494
4504
|
{
|
|
4495
4505
|
enabled: typeof mc.egress.enabled === "boolean" ? mc.egress.enabled : void 0,
|
|
4496
|
-
mode: typeof mc.egress.mode === "string" ? mc.egress.mode : void 0
|
|
4506
|
+
mode: typeof mc.egress.mode === "string" ? mc.egress.mode : void 0,
|
|
4507
|
+
allow: hosts(mc.egress.allow),
|
|
4508
|
+
deny: hosts(mc.egress.deny),
|
|
4509
|
+
allowPrivate: typeof mc.egress.allowPrivate === "boolean" ? mc.egress.allowPrivate : void 0
|
|
4497
4510
|
},
|
|
4498
4511
|
locked
|
|
4499
4512
|
);
|
|
@@ -7850,6 +7863,11 @@ function fullPathCommand(subcommand) {
|
|
|
7850
7863
|
function toForwardSlashes(p) {
|
|
7851
7864
|
return p.replace(/\\/g, "/");
|
|
7852
7865
|
}
|
|
7866
|
+
function isNode9StatusLine(command) {
|
|
7867
|
+
if (!command) return false;
|
|
7868
|
+
const c = String(command).trim();
|
|
7869
|
+
return c.includes("node9") && /(^|\s)hud$/.test(c);
|
|
7870
|
+
}
|
|
7853
7871
|
function isStaleHookCommand(command) {
|
|
7854
7872
|
if (!command) return false;
|
|
7855
7873
|
const tokens = [];
|
|
@@ -8114,7 +8132,8 @@ async function setupClaude() {
|
|
|
8114
8132
|
const statusLineObj = { type: "command", command: hudCommand };
|
|
8115
8133
|
const existingStatusLine = settings.statusLine;
|
|
8116
8134
|
const existingStatusCommand = typeof existingStatusLine === "object" ? existingStatusLine?.command : existingStatusLine;
|
|
8117
|
-
|
|
8135
|
+
const isNode9OrEmpty = !existingStatusCommand || isNode9StatusLine(existingStatusCommand);
|
|
8136
|
+
if (isNode9OrEmpty && existingStatusCommand !== hudCommand) {
|
|
8118
8137
|
settings.statusLine = statusLineObj;
|
|
8119
8138
|
hooksChanged = true;
|
|
8120
8139
|
anythingChanged = true;
|
|
@@ -9022,13 +9041,15 @@ function setupHud() {
|
|
|
9022
9041
|
console.log(import_chalk.default.gray(" Restart Claude Code to activate."));
|
|
9023
9042
|
return;
|
|
9024
9043
|
}
|
|
9025
|
-
if (existing && existingCommand !== hudCommand) {
|
|
9044
|
+
if (existing && existingCommand !== hudCommand && !isNode9StatusLine(existingCommand)) {
|
|
9026
9045
|
console.log(
|
|
9027
9046
|
import_chalk.default.yellow(
|
|
9028
9047
|
` \u26A0\uFE0F statusLine is already set to: "${existingCommand}"
|
|
9029
|
-
|
|
9048
|
+
Leaving it as-is \u2014 node9 won't overwrite a statusLine you configured.
|
|
9049
|
+
Remove it from ~/.claude/settings.json first if you want the node9 HUD.`
|
|
9030
9050
|
)
|
|
9031
9051
|
);
|
|
9052
|
+
return;
|
|
9032
9053
|
}
|
|
9033
9054
|
settings.statusLine = statusLineObj;
|
|
9034
9055
|
writeJson(hooksPath, settings);
|
|
@@ -9046,7 +9067,7 @@ function teardownHud() {
|
|
|
9046
9067
|
}
|
|
9047
9068
|
const existing = settings.statusLine;
|
|
9048
9069
|
const existingCommand = typeof existing === "object" ? existing?.command : existing;
|
|
9049
|
-
if (!
|
|
9070
|
+
if (!isNode9StatusLine(existingCommand)) {
|
|
9050
9071
|
console.log(import_chalk.default.blue(" \u2139\uFE0F node9 HUD not found in ~/.claude/settings.json"));
|
|
9051
9072
|
return;
|
|
9052
9073
|
}
|
|
@@ -17049,7 +17070,17 @@ function extractManagedConfig(body) {
|
|
|
17049
17070
|
const e = {};
|
|
17050
17071
|
if (typeof mc.egress.enabled === "boolean") e.enabled = mc.egress.enabled;
|
|
17051
17072
|
if (typeof mc.egress.mode === "string") e.mode = mc.egress.mode;
|
|
17052
|
-
|
|
17073
|
+
const cleanHosts = (v) => Array.isArray(v) ? v.filter((h) => typeof h === "string") : [];
|
|
17074
|
+
const allow = cleanHosts(mc.egress.allow);
|
|
17075
|
+
const deny = cleanHosts(mc.egress.deny);
|
|
17076
|
+
if (allow.length) e.allow = allow;
|
|
17077
|
+
if (deny.length) e.deny = deny;
|
|
17078
|
+
if (typeof mc.egress.allowPrivate === "boolean") {
|
|
17079
|
+
e.allowPrivate = mc.egress.allowPrivate;
|
|
17080
|
+
}
|
|
17081
|
+
if (e.enabled !== void 0 || e.mode !== void 0 || e.allow !== void 0 || e.deny !== void 0 || e.allowPrivate !== void 0) {
|
|
17082
|
+
out.egress = e;
|
|
17083
|
+
}
|
|
17053
17084
|
}
|
|
17054
17085
|
if (mc.dlp && typeof mc.dlp === "object") {
|
|
17055
17086
|
const d = {};
|
package/dist/cli.mjs
CHANGED
|
@@ -4219,6 +4219,15 @@ function applyManagedEgress(local, managed, locked) {
|
|
|
4219
4219
|
locked.includes("egressMode")
|
|
4220
4220
|
);
|
|
4221
4221
|
}
|
|
4222
|
+
if (Array.isArray(managed.allow) && managed.allow.length > 0) {
|
|
4223
|
+
next.allow = [...managed.allow];
|
|
4224
|
+
}
|
|
4225
|
+
if (Array.isArray(managed.deny) && managed.deny.length > 0) {
|
|
4226
|
+
next.deny = [.../* @__PURE__ */ new Set([...local.deny ?? [], ...managed.deny])];
|
|
4227
|
+
}
|
|
4228
|
+
if (typeof managed.allowPrivate === "boolean") {
|
|
4229
|
+
next.allowPrivate = locked.includes("egressAllowPrivate") ? managed.allowPrivate : (local.allowPrivate ?? true) && managed.allowPrivate;
|
|
4230
|
+
}
|
|
4222
4231
|
return next;
|
|
4223
4232
|
}
|
|
4224
4233
|
function applyManagedDlp(local, managed, locked) {
|
|
@@ -4470,11 +4479,15 @@ function getConfig(cwd) {
|
|
|
4470
4479
|
);
|
|
4471
4480
|
}
|
|
4472
4481
|
if (mc.egress && typeof mc.egress === "object") {
|
|
4482
|
+
const hosts = (v) => Array.isArray(v) ? v.filter((h) => typeof h === "string") : void 0;
|
|
4473
4483
|
mergedPolicy.egress = applyManagedEgress(
|
|
4474
4484
|
mergedPolicy.egress,
|
|
4475
4485
|
{
|
|
4476
4486
|
enabled: typeof mc.egress.enabled === "boolean" ? mc.egress.enabled : void 0,
|
|
4477
|
-
mode: typeof mc.egress.mode === "string" ? mc.egress.mode : void 0
|
|
4487
|
+
mode: typeof mc.egress.mode === "string" ? mc.egress.mode : void 0,
|
|
4488
|
+
allow: hosts(mc.egress.allow),
|
|
4489
|
+
deny: hosts(mc.egress.deny),
|
|
4490
|
+
allowPrivate: typeof mc.egress.allowPrivate === "boolean" ? mc.egress.allowPrivate : void 0
|
|
4478
4491
|
},
|
|
4479
4492
|
locked
|
|
4480
4493
|
);
|
|
@@ -7832,6 +7845,11 @@ function fullPathCommand(subcommand) {
|
|
|
7832
7845
|
function toForwardSlashes(p) {
|
|
7833
7846
|
return p.replace(/\\/g, "/");
|
|
7834
7847
|
}
|
|
7848
|
+
function isNode9StatusLine(command) {
|
|
7849
|
+
if (!command) return false;
|
|
7850
|
+
const c = String(command).trim();
|
|
7851
|
+
return c.includes("node9") && /(^|\s)hud$/.test(c);
|
|
7852
|
+
}
|
|
7835
7853
|
function isStaleHookCommand(command) {
|
|
7836
7854
|
if (!command) return false;
|
|
7837
7855
|
const tokens = [];
|
|
@@ -8096,7 +8114,8 @@ async function setupClaude() {
|
|
|
8096
8114
|
const statusLineObj = { type: "command", command: hudCommand };
|
|
8097
8115
|
const existingStatusLine = settings.statusLine;
|
|
8098
8116
|
const existingStatusCommand = typeof existingStatusLine === "object" ? existingStatusLine?.command : existingStatusLine;
|
|
8099
|
-
|
|
8117
|
+
const isNode9OrEmpty = !existingStatusCommand || isNode9StatusLine(existingStatusCommand);
|
|
8118
|
+
if (isNode9OrEmpty && existingStatusCommand !== hudCommand) {
|
|
8100
8119
|
settings.statusLine = statusLineObj;
|
|
8101
8120
|
hooksChanged = true;
|
|
8102
8121
|
anythingChanged = true;
|
|
@@ -9004,13 +9023,15 @@ function setupHud() {
|
|
|
9004
9023
|
console.log(chalk.gray(" Restart Claude Code to activate."));
|
|
9005
9024
|
return;
|
|
9006
9025
|
}
|
|
9007
|
-
if (existing && existingCommand !== hudCommand) {
|
|
9026
|
+
if (existing && existingCommand !== hudCommand && !isNode9StatusLine(existingCommand)) {
|
|
9008
9027
|
console.log(
|
|
9009
9028
|
chalk.yellow(
|
|
9010
9029
|
` \u26A0\uFE0F statusLine is already set to: "${existingCommand}"
|
|
9011
|
-
|
|
9030
|
+
Leaving it as-is \u2014 node9 won't overwrite a statusLine you configured.
|
|
9031
|
+
Remove it from ~/.claude/settings.json first if you want the node9 HUD.`
|
|
9012
9032
|
)
|
|
9013
9033
|
);
|
|
9034
|
+
return;
|
|
9014
9035
|
}
|
|
9015
9036
|
settings.statusLine = statusLineObj;
|
|
9016
9037
|
writeJson(hooksPath, settings);
|
|
@@ -9028,7 +9049,7 @@ function teardownHud() {
|
|
|
9028
9049
|
}
|
|
9029
9050
|
const existing = settings.statusLine;
|
|
9030
9051
|
const existingCommand = typeof existing === "object" ? existing?.command : existing;
|
|
9031
|
-
if (!
|
|
9052
|
+
if (!isNode9StatusLine(existingCommand)) {
|
|
9032
9053
|
console.log(chalk.blue(" \u2139\uFE0F node9 HUD not found in ~/.claude/settings.json"));
|
|
9033
9054
|
return;
|
|
9034
9055
|
}
|
|
@@ -17023,7 +17044,17 @@ function extractManagedConfig(body) {
|
|
|
17023
17044
|
const e = {};
|
|
17024
17045
|
if (typeof mc.egress.enabled === "boolean") e.enabled = mc.egress.enabled;
|
|
17025
17046
|
if (typeof mc.egress.mode === "string") e.mode = mc.egress.mode;
|
|
17026
|
-
|
|
17047
|
+
const cleanHosts = (v) => Array.isArray(v) ? v.filter((h) => typeof h === "string") : [];
|
|
17048
|
+
const allow = cleanHosts(mc.egress.allow);
|
|
17049
|
+
const deny = cleanHosts(mc.egress.deny);
|
|
17050
|
+
if (allow.length) e.allow = allow;
|
|
17051
|
+
if (deny.length) e.deny = deny;
|
|
17052
|
+
if (typeof mc.egress.allowPrivate === "boolean") {
|
|
17053
|
+
e.allowPrivate = mc.egress.allowPrivate;
|
|
17054
|
+
}
|
|
17055
|
+
if (e.enabled !== void 0 || e.mode !== void 0 || e.allow !== void 0 || e.deny !== void 0 || e.allowPrivate !== void 0) {
|
|
17056
|
+
out.egress = e;
|
|
17057
|
+
}
|
|
17027
17058
|
}
|
|
17028
17059
|
if (mc.dlp && typeof mc.dlp === "object") {
|
|
17029
17060
|
const d = {};
|
package/dist/index.js
CHANGED
|
@@ -3528,6 +3528,15 @@ function applyManagedEgress(local, managed, locked) {
|
|
|
3528
3528
|
locked.includes("egressMode")
|
|
3529
3529
|
);
|
|
3530
3530
|
}
|
|
3531
|
+
if (Array.isArray(managed.allow) && managed.allow.length > 0) {
|
|
3532
|
+
next.allow = [...managed.allow];
|
|
3533
|
+
}
|
|
3534
|
+
if (Array.isArray(managed.deny) && managed.deny.length > 0) {
|
|
3535
|
+
next.deny = [.../* @__PURE__ */ new Set([...local.deny ?? [], ...managed.deny])];
|
|
3536
|
+
}
|
|
3537
|
+
if (typeof managed.allowPrivate === "boolean") {
|
|
3538
|
+
next.allowPrivate = locked.includes("egressAllowPrivate") ? managed.allowPrivate : (local.allowPrivate ?? true) && managed.allowPrivate;
|
|
3539
|
+
}
|
|
3531
3540
|
return next;
|
|
3532
3541
|
}
|
|
3533
3542
|
var DLP_PII_ORDER = ["off", "block"];
|
|
@@ -4015,11 +4024,15 @@ function getConfig(cwd) {
|
|
|
4015
4024
|
);
|
|
4016
4025
|
}
|
|
4017
4026
|
if (mc.egress && typeof mc.egress === "object") {
|
|
4027
|
+
const hosts = (v) => Array.isArray(v) ? v.filter((h) => typeof h === "string") : void 0;
|
|
4018
4028
|
mergedPolicy.egress = applyManagedEgress(
|
|
4019
4029
|
mergedPolicy.egress,
|
|
4020
4030
|
{
|
|
4021
4031
|
enabled: typeof mc.egress.enabled === "boolean" ? mc.egress.enabled : void 0,
|
|
4022
|
-
mode: typeof mc.egress.mode === "string" ? mc.egress.mode : void 0
|
|
4032
|
+
mode: typeof mc.egress.mode === "string" ? mc.egress.mode : void 0,
|
|
4033
|
+
allow: hosts(mc.egress.allow),
|
|
4034
|
+
deny: hosts(mc.egress.deny),
|
|
4035
|
+
allowPrivate: typeof mc.egress.allowPrivate === "boolean" ? mc.egress.allowPrivate : void 0
|
|
4023
4036
|
},
|
|
4024
4037
|
locked
|
|
4025
4038
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -3498,6 +3498,15 @@ function applyManagedEgress(local, managed, locked) {
|
|
|
3498
3498
|
locked.includes("egressMode")
|
|
3499
3499
|
);
|
|
3500
3500
|
}
|
|
3501
|
+
if (Array.isArray(managed.allow) && managed.allow.length > 0) {
|
|
3502
|
+
next.allow = [...managed.allow];
|
|
3503
|
+
}
|
|
3504
|
+
if (Array.isArray(managed.deny) && managed.deny.length > 0) {
|
|
3505
|
+
next.deny = [.../* @__PURE__ */ new Set([...local.deny ?? [], ...managed.deny])];
|
|
3506
|
+
}
|
|
3507
|
+
if (typeof managed.allowPrivate === "boolean") {
|
|
3508
|
+
next.allowPrivate = locked.includes("egressAllowPrivate") ? managed.allowPrivate : (local.allowPrivate ?? true) && managed.allowPrivate;
|
|
3509
|
+
}
|
|
3501
3510
|
return next;
|
|
3502
3511
|
}
|
|
3503
3512
|
var DLP_PII_ORDER = ["off", "block"];
|
|
@@ -3985,11 +3994,15 @@ function getConfig(cwd) {
|
|
|
3985
3994
|
);
|
|
3986
3995
|
}
|
|
3987
3996
|
if (mc.egress && typeof mc.egress === "object") {
|
|
3997
|
+
const hosts = (v) => Array.isArray(v) ? v.filter((h) => typeof h === "string") : void 0;
|
|
3988
3998
|
mergedPolicy.egress = applyManagedEgress(
|
|
3989
3999
|
mergedPolicy.egress,
|
|
3990
4000
|
{
|
|
3991
4001
|
enabled: typeof mc.egress.enabled === "boolean" ? mc.egress.enabled : void 0,
|
|
3992
|
-
mode: typeof mc.egress.mode === "string" ? mc.egress.mode : void 0
|
|
4002
|
+
mode: typeof mc.egress.mode === "string" ? mc.egress.mode : void 0,
|
|
4003
|
+
allow: hosts(mc.egress.allow),
|
|
4004
|
+
deny: hosts(mc.egress.deny),
|
|
4005
|
+
allowPrivate: typeof mc.egress.allowPrivate === "boolean" ? mc.egress.allowPrivate : void 0
|
|
3993
4006
|
},
|
|
3994
4007
|
locked
|
|
3995
4008
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node9/proxy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.55.1",
|
|
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",
|