@node9/proxy 1.53.0 → 1.55.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 +58 -17
- package/dist/cli.mjs +58 -17
- 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
|
);
|
|
@@ -8640,10 +8653,27 @@ function claudeDesktopConfigPath(homeDir2 = import_os12.default.homedir()) {
|
|
|
8640
8653
|
}
|
|
8641
8654
|
return null;
|
|
8642
8655
|
}
|
|
8643
|
-
function
|
|
8656
|
+
function opencodeConfigDir(home = import_os12.default.homedir()) {
|
|
8657
|
+
const xdg = process.env.XDG_CONFIG_HOME;
|
|
8658
|
+
const base = xdg && import_path15.default.isAbsolute(xdg) ? xdg : import_path15.default.join(home, ".config");
|
|
8659
|
+
return import_path15.default.join(base, "opencode");
|
|
8660
|
+
}
|
|
8661
|
+
function commonBinDirs(home) {
|
|
8662
|
+
return [
|
|
8663
|
+
import_path15.default.join(home, ".local", "bin"),
|
|
8664
|
+
import_path15.default.join(home, ".bun", "bin"),
|
|
8665
|
+
import_path15.default.join(home, ".npm-global", "bin"),
|
|
8666
|
+
"/usr/local/bin",
|
|
8667
|
+
"/opt/homebrew/bin"
|
|
8668
|
+
];
|
|
8669
|
+
}
|
|
8670
|
+
function binaryInPath(binary, home = import_os12.default.homedir()) {
|
|
8644
8671
|
const pathEnv = process.env.PATH ?? "";
|
|
8645
|
-
|
|
8646
|
-
|
|
8672
|
+
const dirs = [...pathEnv.split(import_path15.default.delimiter), ...commonBinDirs(home)];
|
|
8673
|
+
const seen = /* @__PURE__ */ new Set();
|
|
8674
|
+
for (const dir of dirs) {
|
|
8675
|
+
if (!dir || seen.has(dir)) continue;
|
|
8676
|
+
seen.add(dir);
|
|
8647
8677
|
try {
|
|
8648
8678
|
import_fs13.default.accessSync(import_path15.default.join(dir, binary), import_fs13.default.constants.X_OK);
|
|
8649
8679
|
return true;
|
|
@@ -8677,35 +8707,36 @@ function detectAgents(homeDir2 = import_os12.default.homedir()) {
|
|
|
8677
8707
|
// creates ~/.gemini/settings.json on first run; agy does not touch
|
|
8678
8708
|
// it (it uses antigravity-cli/settings.json) — that file is the
|
|
8679
8709
|
// legacy-CLI discriminator.
|
|
8680
|
-
gemini: exists2(import_path15.default.join(homeDir2, ".gemini", "settings.json")) || binaryInPath("gemini"),
|
|
8710
|
+
gemini: exists2(import_path15.default.join(homeDir2, ".gemini", "settings.json")) || binaryInPath("gemini", homeDir2),
|
|
8681
8711
|
// agy creates ~/.gemini/antigravity-cli/ on first launch; the IDE
|
|
8682
8712
|
// creates antigravity-ide/. PATH fallback covers installed-but-
|
|
8683
8713
|
// never-launched (same class as opencode #186).
|
|
8684
|
-
antigravity: exists2(import_path15.default.join(homeDir2, ".gemini", "antigravity-cli")) || exists2(import_path15.default.join(homeDir2, ".gemini", "antigravity-ide")) || binaryInPath("agy"),
|
|
8714
|
+
antigravity: exists2(import_path15.default.join(homeDir2, ".gemini", "antigravity-cli")) || exists2(import_path15.default.join(homeDir2, ".gemini", "antigravity-ide")) || binaryInPath("agy", homeDir2),
|
|
8685
8715
|
// GitHub Copilot CLI creates ~/.copilot on first launch; PATH
|
|
8686
8716
|
// fallback covers installed-but-never-launched (same as opencode #186).
|
|
8687
|
-
copilot: exists2(import_path15.default.join(homeDir2, ".copilot")) || binaryInPath("copilot"),
|
|
8717
|
+
copilot: exists2(import_path15.default.join(homeDir2, ".copilot")) || binaryInPath("copilot", homeDir2),
|
|
8688
8718
|
cursor: exists2(import_path15.default.join(homeDir2, ".cursor")),
|
|
8689
8719
|
codex: exists2(import_path15.default.join(homeDir2, ".codex")),
|
|
8690
8720
|
windsurf: exists2(import_path15.default.join(homeDir2, ".codeium", "windsurf")),
|
|
8691
8721
|
vscode: exists2(import_path15.default.join(homeDir2, ".vscode")),
|
|
8692
8722
|
claudeDesktop: desktopPath !== null && exists2(import_path15.default.dirname(desktopPath)),
|
|
8693
|
-
// Opencode creates
|
|
8694
|
-
//
|
|
8695
|
-
|
|
8723
|
+
// Opencode creates its config dir lazily on first launch — fall back to a
|
|
8724
|
+
// PATH lookup so installed-but-never-launched CLIs are still wired. Config
|
|
8725
|
+
// dir honors $XDG_CONFIG_HOME via opencodeConfigDir (#186, custom-XDG).
|
|
8726
|
+
opencode: exists2(opencodeConfigDir(homeDir2)) || binaryInPath("opencode", homeDir2),
|
|
8696
8727
|
// Pi (https://pi.dev): config dir is ~/.pi/agent (CONFIG_DIR_NAME=".pi"
|
|
8697
8728
|
// + agentDir, verified against opensources/pi-main/packages/coding-agent/
|
|
8698
8729
|
// src/config.ts:449,475). The Bun-compiled binary path may create this
|
|
8699
8730
|
// dir lazily on first launch — same class of bug as opencode's #186
|
|
8700
8731
|
// (design R6) — so fall back to PATH lookup for installed-but-never-
|
|
8701
8732
|
// launched pi.
|
|
8702
|
-
pi: exists2(import_path15.default.join(homeDir2, ".pi", "agent")) || binaryInPath("pi"),
|
|
8733
|
+
pi: exists2(import_path15.default.join(homeDir2, ".pi", "agent")) || binaryInPath("pi", homeDir2),
|
|
8703
8734
|
// Hermes Agent (https://github.com/NousResearch/hermes-agent): home dir
|
|
8704
8735
|
// is $HERMES_HOME (default ~/.hermes) per hermes_constants.py:30. config.yaml
|
|
8705
8736
|
// appears after `hermes setup` has run; the directory alone exists from
|
|
8706
8737
|
// install time. PATH fallback covers the rare case where the user blew
|
|
8707
8738
|
// away ~/.hermes but kept the binary.
|
|
8708
|
-
hermes: exists2(hermesHomeDir(homeDir2)) || binaryInPath("hermes")
|
|
8739
|
+
hermes: exists2(hermesHomeDir(homeDir2)) || binaryInPath("hermes", homeDir2)
|
|
8709
8740
|
};
|
|
8710
8741
|
}
|
|
8711
8742
|
async function setupCursor() {
|
|
@@ -9358,7 +9389,7 @@ function node9Version() {
|
|
|
9358
9389
|
async function setupOpencode() {
|
|
9359
9390
|
seedMcpPinsIfMissing();
|
|
9360
9391
|
const homeDir2 = import_os12.default.homedir();
|
|
9361
|
-
const configDir =
|
|
9392
|
+
const configDir = opencodeConfigDir(homeDir2);
|
|
9362
9393
|
const pluginsDir = import_path15.default.join(configDir, "plugins");
|
|
9363
9394
|
const configPath = import_path15.default.join(configDir, "opencode.json");
|
|
9364
9395
|
const pluginPath = import_path15.default.join(pluginsDir, OPENCODE_PLUGIN_NAME);
|
|
@@ -9426,7 +9457,7 @@ async function setupOpencode() {
|
|
|
9426
9457
|
}
|
|
9427
9458
|
function teardownOpencode() {
|
|
9428
9459
|
const homeDir2 = import_os12.default.homedir();
|
|
9429
|
-
const configDir =
|
|
9460
|
+
const configDir = opencodeConfigDir(homeDir2);
|
|
9430
9461
|
const pluginsDir = import_path15.default.join(configDir, "plugins");
|
|
9431
9462
|
const configPath = import_path15.default.join(configDir, "opencode.json");
|
|
9432
9463
|
const pluginPath = import_path15.default.join(pluginsDir, OPENCODE_PLUGIN_NAME);
|
|
@@ -10068,8 +10099,8 @@ var init_agent_wiring = __esm({
|
|
|
10068
10099
|
setupCommand: "node9 agents add opencode",
|
|
10069
10100
|
hookFormat: "flat",
|
|
10070
10101
|
hookEvents: [],
|
|
10071
|
-
shimFile: (h) => import_path16.default.join(h, "
|
|
10072
|
-
present: (h) => exists(
|
|
10102
|
+
shimFile: (h) => import_path16.default.join(opencodeConfigDir(h), "plugins", "node9.js"),
|
|
10103
|
+
present: (h) => exists(opencodeConfigDir(h)) || exists(import_path16.default.join(opencodeConfigDir(h), "plugins", "node9.js"))
|
|
10073
10104
|
},
|
|
10074
10105
|
{
|
|
10075
10106
|
id: "pi",
|
|
@@ -17031,7 +17062,17 @@ function extractManagedConfig(body) {
|
|
|
17031
17062
|
const e = {};
|
|
17032
17063
|
if (typeof mc.egress.enabled === "boolean") e.enabled = mc.egress.enabled;
|
|
17033
17064
|
if (typeof mc.egress.mode === "string") e.mode = mc.egress.mode;
|
|
17034
|
-
|
|
17065
|
+
const cleanHosts = (v) => Array.isArray(v) ? v.filter((h) => typeof h === "string") : [];
|
|
17066
|
+
const allow = cleanHosts(mc.egress.allow);
|
|
17067
|
+
const deny = cleanHosts(mc.egress.deny);
|
|
17068
|
+
if (allow.length) e.allow = allow;
|
|
17069
|
+
if (deny.length) e.deny = deny;
|
|
17070
|
+
if (typeof mc.egress.allowPrivate === "boolean") {
|
|
17071
|
+
e.allowPrivate = mc.egress.allowPrivate;
|
|
17072
|
+
}
|
|
17073
|
+
if (e.enabled !== void 0 || e.mode !== void 0 || e.allow !== void 0 || e.deny !== void 0 || e.allowPrivate !== void 0) {
|
|
17074
|
+
out.egress = e;
|
|
17075
|
+
}
|
|
17035
17076
|
}
|
|
17036
17077
|
if (mc.dlp && typeof mc.dlp === "object") {
|
|
17037
17078
|
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
|
);
|
|
@@ -8622,10 +8635,27 @@ function claudeDesktopConfigPath(homeDir2 = os12.homedir()) {
|
|
|
8622
8635
|
}
|
|
8623
8636
|
return null;
|
|
8624
8637
|
}
|
|
8625
|
-
function
|
|
8638
|
+
function opencodeConfigDir(home = os12.homedir()) {
|
|
8639
|
+
const xdg = process.env.XDG_CONFIG_HOME;
|
|
8640
|
+
const base = xdg && path15.isAbsolute(xdg) ? xdg : path15.join(home, ".config");
|
|
8641
|
+
return path15.join(base, "opencode");
|
|
8642
|
+
}
|
|
8643
|
+
function commonBinDirs(home) {
|
|
8644
|
+
return [
|
|
8645
|
+
path15.join(home, ".local", "bin"),
|
|
8646
|
+
path15.join(home, ".bun", "bin"),
|
|
8647
|
+
path15.join(home, ".npm-global", "bin"),
|
|
8648
|
+
"/usr/local/bin",
|
|
8649
|
+
"/opt/homebrew/bin"
|
|
8650
|
+
];
|
|
8651
|
+
}
|
|
8652
|
+
function binaryInPath(binary, home = os12.homedir()) {
|
|
8626
8653
|
const pathEnv = process.env.PATH ?? "";
|
|
8627
|
-
|
|
8628
|
-
|
|
8654
|
+
const dirs = [...pathEnv.split(path15.delimiter), ...commonBinDirs(home)];
|
|
8655
|
+
const seen = /* @__PURE__ */ new Set();
|
|
8656
|
+
for (const dir of dirs) {
|
|
8657
|
+
if (!dir || seen.has(dir)) continue;
|
|
8658
|
+
seen.add(dir);
|
|
8629
8659
|
try {
|
|
8630
8660
|
fs13.accessSync(path15.join(dir, binary), fs13.constants.X_OK);
|
|
8631
8661
|
return true;
|
|
@@ -8659,35 +8689,36 @@ function detectAgents(homeDir2 = os12.homedir()) {
|
|
|
8659
8689
|
// creates ~/.gemini/settings.json on first run; agy does not touch
|
|
8660
8690
|
// it (it uses antigravity-cli/settings.json) — that file is the
|
|
8661
8691
|
// legacy-CLI discriminator.
|
|
8662
|
-
gemini: exists2(path15.join(homeDir2, ".gemini", "settings.json")) || binaryInPath("gemini"),
|
|
8692
|
+
gemini: exists2(path15.join(homeDir2, ".gemini", "settings.json")) || binaryInPath("gemini", homeDir2),
|
|
8663
8693
|
// agy creates ~/.gemini/antigravity-cli/ on first launch; the IDE
|
|
8664
8694
|
// creates antigravity-ide/. PATH fallback covers installed-but-
|
|
8665
8695
|
// never-launched (same class as opencode #186).
|
|
8666
|
-
antigravity: exists2(path15.join(homeDir2, ".gemini", "antigravity-cli")) || exists2(path15.join(homeDir2, ".gemini", "antigravity-ide")) || binaryInPath("agy"),
|
|
8696
|
+
antigravity: exists2(path15.join(homeDir2, ".gemini", "antigravity-cli")) || exists2(path15.join(homeDir2, ".gemini", "antigravity-ide")) || binaryInPath("agy", homeDir2),
|
|
8667
8697
|
// GitHub Copilot CLI creates ~/.copilot on first launch; PATH
|
|
8668
8698
|
// fallback covers installed-but-never-launched (same as opencode #186).
|
|
8669
|
-
copilot: exists2(path15.join(homeDir2, ".copilot")) || binaryInPath("copilot"),
|
|
8699
|
+
copilot: exists2(path15.join(homeDir2, ".copilot")) || binaryInPath("copilot", homeDir2),
|
|
8670
8700
|
cursor: exists2(path15.join(homeDir2, ".cursor")),
|
|
8671
8701
|
codex: exists2(path15.join(homeDir2, ".codex")),
|
|
8672
8702
|
windsurf: exists2(path15.join(homeDir2, ".codeium", "windsurf")),
|
|
8673
8703
|
vscode: exists2(path15.join(homeDir2, ".vscode")),
|
|
8674
8704
|
claudeDesktop: desktopPath !== null && exists2(path15.dirname(desktopPath)),
|
|
8675
|
-
// Opencode creates
|
|
8676
|
-
//
|
|
8677
|
-
|
|
8705
|
+
// Opencode creates its config dir lazily on first launch — fall back to a
|
|
8706
|
+
// PATH lookup so installed-but-never-launched CLIs are still wired. Config
|
|
8707
|
+
// dir honors $XDG_CONFIG_HOME via opencodeConfigDir (#186, custom-XDG).
|
|
8708
|
+
opencode: exists2(opencodeConfigDir(homeDir2)) || binaryInPath("opencode", homeDir2),
|
|
8678
8709
|
// Pi (https://pi.dev): config dir is ~/.pi/agent (CONFIG_DIR_NAME=".pi"
|
|
8679
8710
|
// + agentDir, verified against opensources/pi-main/packages/coding-agent/
|
|
8680
8711
|
// src/config.ts:449,475). The Bun-compiled binary path may create this
|
|
8681
8712
|
// dir lazily on first launch — same class of bug as opencode's #186
|
|
8682
8713
|
// (design R6) — so fall back to PATH lookup for installed-but-never-
|
|
8683
8714
|
// launched pi.
|
|
8684
|
-
pi: exists2(path15.join(homeDir2, ".pi", "agent")) || binaryInPath("pi"),
|
|
8715
|
+
pi: exists2(path15.join(homeDir2, ".pi", "agent")) || binaryInPath("pi", homeDir2),
|
|
8685
8716
|
// Hermes Agent (https://github.com/NousResearch/hermes-agent): home dir
|
|
8686
8717
|
// is $HERMES_HOME (default ~/.hermes) per hermes_constants.py:30. config.yaml
|
|
8687
8718
|
// appears after `hermes setup` has run; the directory alone exists from
|
|
8688
8719
|
// install time. PATH fallback covers the rare case where the user blew
|
|
8689
8720
|
// away ~/.hermes but kept the binary.
|
|
8690
|
-
hermes: exists2(hermesHomeDir(homeDir2)) || binaryInPath("hermes")
|
|
8721
|
+
hermes: exists2(hermesHomeDir(homeDir2)) || binaryInPath("hermes", homeDir2)
|
|
8691
8722
|
};
|
|
8692
8723
|
}
|
|
8693
8724
|
async function setupCursor() {
|
|
@@ -9340,7 +9371,7 @@ function node9Version() {
|
|
|
9340
9371
|
async function setupOpencode() {
|
|
9341
9372
|
seedMcpPinsIfMissing();
|
|
9342
9373
|
const homeDir2 = os12.homedir();
|
|
9343
|
-
const configDir =
|
|
9374
|
+
const configDir = opencodeConfigDir(homeDir2);
|
|
9344
9375
|
const pluginsDir = path15.join(configDir, "plugins");
|
|
9345
9376
|
const configPath = path15.join(configDir, "opencode.json");
|
|
9346
9377
|
const pluginPath = path15.join(pluginsDir, OPENCODE_PLUGIN_NAME);
|
|
@@ -9408,7 +9439,7 @@ async function setupOpencode() {
|
|
|
9408
9439
|
}
|
|
9409
9440
|
function teardownOpencode() {
|
|
9410
9441
|
const homeDir2 = os12.homedir();
|
|
9411
|
-
const configDir =
|
|
9442
|
+
const configDir = opencodeConfigDir(homeDir2);
|
|
9412
9443
|
const pluginsDir = path15.join(configDir, "plugins");
|
|
9413
9444
|
const configPath = path15.join(configDir, "opencode.json");
|
|
9414
9445
|
const pluginPath = path15.join(pluginsDir, OPENCODE_PLUGIN_NAME);
|
|
@@ -10043,8 +10074,8 @@ var init_agent_wiring = __esm({
|
|
|
10043
10074
|
setupCommand: "node9 agents add opencode",
|
|
10044
10075
|
hookFormat: "flat",
|
|
10045
10076
|
hookEvents: [],
|
|
10046
|
-
shimFile: (h) => path16.join(h, "
|
|
10047
|
-
present: (h) => exists(
|
|
10077
|
+
shimFile: (h) => path16.join(opencodeConfigDir(h), "plugins", "node9.js"),
|
|
10078
|
+
present: (h) => exists(opencodeConfigDir(h)) || exists(path16.join(opencodeConfigDir(h), "plugins", "node9.js"))
|
|
10048
10079
|
},
|
|
10049
10080
|
{
|
|
10050
10081
|
id: "pi",
|
|
@@ -17005,7 +17036,17 @@ function extractManagedConfig(body) {
|
|
|
17005
17036
|
const e = {};
|
|
17006
17037
|
if (typeof mc.egress.enabled === "boolean") e.enabled = mc.egress.enabled;
|
|
17007
17038
|
if (typeof mc.egress.mode === "string") e.mode = mc.egress.mode;
|
|
17008
|
-
|
|
17039
|
+
const cleanHosts = (v) => Array.isArray(v) ? v.filter((h) => typeof h === "string") : [];
|
|
17040
|
+
const allow = cleanHosts(mc.egress.allow);
|
|
17041
|
+
const deny = cleanHosts(mc.egress.deny);
|
|
17042
|
+
if (allow.length) e.allow = allow;
|
|
17043
|
+
if (deny.length) e.deny = deny;
|
|
17044
|
+
if (typeof mc.egress.allowPrivate === "boolean") {
|
|
17045
|
+
e.allowPrivate = mc.egress.allowPrivate;
|
|
17046
|
+
}
|
|
17047
|
+
if (e.enabled !== void 0 || e.mode !== void 0 || e.allow !== void 0 || e.deny !== void 0 || e.allowPrivate !== void 0) {
|
|
17048
|
+
out.egress = e;
|
|
17049
|
+
}
|
|
17009
17050
|
}
|
|
17010
17051
|
if (mc.dlp && typeof mc.dlp === "object") {
|
|
17011
17052
|
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.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",
|