@node9/proxy 1.0.9 → 1.0.11

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
@@ -850,7 +850,7 @@ var DEFAULT_CONFIG = {
850
850
  {
851
851
  name: "review-git-push",
852
852
  tool: "bash",
853
- conditions: [{ field: "command", op: "matches", value: "^\\s*git push\\b", flags: "i" }],
853
+ conditions: [{ field: "command", op: "matches", value: "^\\s*git\\s+push\\b", flags: "i" }],
854
854
  conditionMode: "all",
855
855
  verdict: "review",
856
856
  reason: "git push sends changes to a shared remote"
@@ -1855,6 +1855,7 @@ function getConfig() {
1855
1855
  ignorePaths: [...DEFAULT_CONFIG.policy.snapshot.ignorePaths]
1856
1856
  }
1857
1857
  };
1858
+ const mergedEnvironments = { ...DEFAULT_CONFIG.environments };
1858
1859
  const applyLayer = (source) => {
1859
1860
  if (!source) return;
1860
1861
  const s = source.settings || {};
@@ -1880,6 +1881,17 @@ function getConfig() {
1880
1881
  if (s2.onlyPaths) mergedPolicy.snapshot.onlyPaths.push(...s2.onlyPaths);
1881
1882
  if (s2.ignorePaths) mergedPolicy.snapshot.ignorePaths.push(...s2.ignorePaths);
1882
1883
  }
1884
+ const envs = source.environments || {};
1885
+ for (const [envName, envConfig] of Object.entries(envs)) {
1886
+ if (envConfig && typeof envConfig === "object") {
1887
+ const ec = envConfig;
1888
+ mergedEnvironments[envName] = {
1889
+ ...mergedEnvironments[envName],
1890
+ // Validate field types before merging — do not blindly spread user input
1891
+ ...typeof ec.requireApproval === "boolean" ? { requireApproval: ec.requireApproval } : {}
1892
+ };
1893
+ }
1894
+ }
1883
1895
  };
1884
1896
  applyLayer(globalConfig);
1885
1897
  applyLayer(projectConfig);
@@ -1893,7 +1905,7 @@ function getConfig() {
1893
1905
  cachedConfig = {
1894
1906
  settings: mergedSettings,
1895
1907
  policy: mergedPolicy,
1896
- environments: {}
1908
+ environments: mergedEnvironments
1897
1909
  };
1898
1910
  return cachedConfig;
1899
1911
  }
@@ -1914,6 +1926,29 @@ function tryLoadConfig(filePath) {
1914
1926
  );
1915
1927
  return null;
1916
1928
  }
1929
+ const SUPPORTED_VERSION = "1.0";
1930
+ const SUPPORTED_MAJOR = SUPPORTED_VERSION.split(".")[0];
1931
+ const fileVersion = raw?.version;
1932
+ if (fileVersion !== void 0) {
1933
+ const vStr = String(fileVersion);
1934
+ const fileMajor = vStr.split(".")[0];
1935
+ if (fileMajor !== SUPPORTED_MAJOR) {
1936
+ process.stderr.write(
1937
+ `
1938
+ \u274C Node9: Config at ${filePath} has version "${vStr}" \u2014 major version is incompatible with this release (expected "${SUPPORTED_VERSION}"). Config will not be loaded.
1939
+
1940
+ `
1941
+ );
1942
+ return null;
1943
+ } else if (vStr !== SUPPORTED_VERSION) {
1944
+ process.stderr.write(
1945
+ `
1946
+ \u26A0\uFE0F Node9: Config at ${filePath} declares version "${vStr}" \u2014 expected "${SUPPORTED_VERSION}". Continuing with best-effort parsing.
1947
+
1948
+ `
1949
+ );
1950
+ }
1951
+ }
1917
1952
  const { sanitized, error } = sanitizeConfig(raw);
1918
1953
  if (error) {
1919
1954
  process.stderr.write(
package/dist/cli.mjs CHANGED
@@ -827,7 +827,7 @@ var DEFAULT_CONFIG = {
827
827
  {
828
828
  name: "review-git-push",
829
829
  tool: "bash",
830
- conditions: [{ field: "command", op: "matches", value: "^\\s*git push\\b", flags: "i" }],
830
+ conditions: [{ field: "command", op: "matches", value: "^\\s*git\\s+push\\b", flags: "i" }],
831
831
  conditionMode: "all",
832
832
  verdict: "review",
833
833
  reason: "git push sends changes to a shared remote"
@@ -1832,6 +1832,7 @@ function getConfig() {
1832
1832
  ignorePaths: [...DEFAULT_CONFIG.policy.snapshot.ignorePaths]
1833
1833
  }
1834
1834
  };
1835
+ const mergedEnvironments = { ...DEFAULT_CONFIG.environments };
1835
1836
  const applyLayer = (source) => {
1836
1837
  if (!source) return;
1837
1838
  const s = source.settings || {};
@@ -1857,6 +1858,17 @@ function getConfig() {
1857
1858
  if (s2.onlyPaths) mergedPolicy.snapshot.onlyPaths.push(...s2.onlyPaths);
1858
1859
  if (s2.ignorePaths) mergedPolicy.snapshot.ignorePaths.push(...s2.ignorePaths);
1859
1860
  }
1861
+ const envs = source.environments || {};
1862
+ for (const [envName, envConfig] of Object.entries(envs)) {
1863
+ if (envConfig && typeof envConfig === "object") {
1864
+ const ec = envConfig;
1865
+ mergedEnvironments[envName] = {
1866
+ ...mergedEnvironments[envName],
1867
+ // Validate field types before merging — do not blindly spread user input
1868
+ ...typeof ec.requireApproval === "boolean" ? { requireApproval: ec.requireApproval } : {}
1869
+ };
1870
+ }
1871
+ }
1860
1872
  };
1861
1873
  applyLayer(globalConfig);
1862
1874
  applyLayer(projectConfig);
@@ -1870,7 +1882,7 @@ function getConfig() {
1870
1882
  cachedConfig = {
1871
1883
  settings: mergedSettings,
1872
1884
  policy: mergedPolicy,
1873
- environments: {}
1885
+ environments: mergedEnvironments
1874
1886
  };
1875
1887
  return cachedConfig;
1876
1888
  }
@@ -1891,6 +1903,29 @@ function tryLoadConfig(filePath) {
1891
1903
  );
1892
1904
  return null;
1893
1905
  }
1906
+ const SUPPORTED_VERSION = "1.0";
1907
+ const SUPPORTED_MAJOR = SUPPORTED_VERSION.split(".")[0];
1908
+ const fileVersion = raw?.version;
1909
+ if (fileVersion !== void 0) {
1910
+ const vStr = String(fileVersion);
1911
+ const fileMajor = vStr.split(".")[0];
1912
+ if (fileMajor !== SUPPORTED_MAJOR) {
1913
+ process.stderr.write(
1914
+ `
1915
+ \u274C Node9: Config at ${filePath} has version "${vStr}" \u2014 major version is incompatible with this release (expected "${SUPPORTED_VERSION}"). Config will not be loaded.
1916
+
1917
+ `
1918
+ );
1919
+ return null;
1920
+ } else if (vStr !== SUPPORTED_VERSION) {
1921
+ process.stderr.write(
1922
+ `
1923
+ \u26A0\uFE0F Node9: Config at ${filePath} declares version "${vStr}" \u2014 expected "${SUPPORTED_VERSION}". Continuing with best-effort parsing.
1924
+
1925
+ `
1926
+ );
1927
+ }
1928
+ }
1894
1929
  const { sanitized, error } = sanitizeConfig(raw);
1895
1930
  if (error) {
1896
1931
  process.stderr.write(
package/dist/index.js CHANGED
@@ -836,7 +836,7 @@ var DEFAULT_CONFIG = {
836
836
  {
837
837
  name: "review-git-push",
838
838
  tool: "bash",
839
- conditions: [{ field: "command", op: "matches", value: "^\\s*git push\\b", flags: "i" }],
839
+ conditions: [{ field: "command", op: "matches", value: "^\\s*git\\s+push\\b", flags: "i" }],
840
840
  conditionMode: "all",
841
841
  verdict: "review",
842
842
  reason: "git push sends changes to a shared remote"
@@ -1514,6 +1514,7 @@ function getConfig() {
1514
1514
  ignorePaths: [...DEFAULT_CONFIG.policy.snapshot.ignorePaths]
1515
1515
  }
1516
1516
  };
1517
+ const mergedEnvironments = { ...DEFAULT_CONFIG.environments };
1517
1518
  const applyLayer = (source) => {
1518
1519
  if (!source) return;
1519
1520
  const s = source.settings || {};
@@ -1539,6 +1540,17 @@ function getConfig() {
1539
1540
  if (s2.onlyPaths) mergedPolicy.snapshot.onlyPaths.push(...s2.onlyPaths);
1540
1541
  if (s2.ignorePaths) mergedPolicy.snapshot.ignorePaths.push(...s2.ignorePaths);
1541
1542
  }
1543
+ const envs = source.environments || {};
1544
+ for (const [envName, envConfig] of Object.entries(envs)) {
1545
+ if (envConfig && typeof envConfig === "object") {
1546
+ const ec = envConfig;
1547
+ mergedEnvironments[envName] = {
1548
+ ...mergedEnvironments[envName],
1549
+ // Validate field types before merging — do not blindly spread user input
1550
+ ...typeof ec.requireApproval === "boolean" ? { requireApproval: ec.requireApproval } : {}
1551
+ };
1552
+ }
1553
+ }
1542
1554
  };
1543
1555
  applyLayer(globalConfig);
1544
1556
  applyLayer(projectConfig);
@@ -1552,7 +1564,7 @@ function getConfig() {
1552
1564
  cachedConfig = {
1553
1565
  settings: mergedSettings,
1554
1566
  policy: mergedPolicy,
1555
- environments: {}
1567
+ environments: mergedEnvironments
1556
1568
  };
1557
1569
  return cachedConfig;
1558
1570
  }
@@ -1573,6 +1585,29 @@ function tryLoadConfig(filePath) {
1573
1585
  );
1574
1586
  return null;
1575
1587
  }
1588
+ const SUPPORTED_VERSION = "1.0";
1589
+ const SUPPORTED_MAJOR = SUPPORTED_VERSION.split(".")[0];
1590
+ const fileVersion = raw?.version;
1591
+ if (fileVersion !== void 0) {
1592
+ const vStr = String(fileVersion);
1593
+ const fileMajor = vStr.split(".")[0];
1594
+ if (fileMajor !== SUPPORTED_MAJOR) {
1595
+ process.stderr.write(
1596
+ `
1597
+ \u274C Node9: Config at ${filePath} has version "${vStr}" \u2014 major version is incompatible with this release (expected "${SUPPORTED_VERSION}"). Config will not be loaded.
1598
+
1599
+ `
1600
+ );
1601
+ return null;
1602
+ } else if (vStr !== SUPPORTED_VERSION) {
1603
+ process.stderr.write(
1604
+ `
1605
+ \u26A0\uFE0F Node9: Config at ${filePath} declares version "${vStr}" \u2014 expected "${SUPPORTED_VERSION}". Continuing with best-effort parsing.
1606
+
1607
+ `
1608
+ );
1609
+ }
1610
+ }
1576
1611
  const { sanitized, error } = sanitizeConfig(raw);
1577
1612
  if (error) {
1578
1613
  process.stderr.write(
package/dist/index.mjs CHANGED
@@ -800,7 +800,7 @@ var DEFAULT_CONFIG = {
800
800
  {
801
801
  name: "review-git-push",
802
802
  tool: "bash",
803
- conditions: [{ field: "command", op: "matches", value: "^\\s*git push\\b", flags: "i" }],
803
+ conditions: [{ field: "command", op: "matches", value: "^\\s*git\\s+push\\b", flags: "i" }],
804
804
  conditionMode: "all",
805
805
  verdict: "review",
806
806
  reason: "git push sends changes to a shared remote"
@@ -1478,6 +1478,7 @@ function getConfig() {
1478
1478
  ignorePaths: [...DEFAULT_CONFIG.policy.snapshot.ignorePaths]
1479
1479
  }
1480
1480
  };
1481
+ const mergedEnvironments = { ...DEFAULT_CONFIG.environments };
1481
1482
  const applyLayer = (source) => {
1482
1483
  if (!source) return;
1483
1484
  const s = source.settings || {};
@@ -1503,6 +1504,17 @@ function getConfig() {
1503
1504
  if (s2.onlyPaths) mergedPolicy.snapshot.onlyPaths.push(...s2.onlyPaths);
1504
1505
  if (s2.ignorePaths) mergedPolicy.snapshot.ignorePaths.push(...s2.ignorePaths);
1505
1506
  }
1507
+ const envs = source.environments || {};
1508
+ for (const [envName, envConfig] of Object.entries(envs)) {
1509
+ if (envConfig && typeof envConfig === "object") {
1510
+ const ec = envConfig;
1511
+ mergedEnvironments[envName] = {
1512
+ ...mergedEnvironments[envName],
1513
+ // Validate field types before merging — do not blindly spread user input
1514
+ ...typeof ec.requireApproval === "boolean" ? { requireApproval: ec.requireApproval } : {}
1515
+ };
1516
+ }
1517
+ }
1506
1518
  };
1507
1519
  applyLayer(globalConfig);
1508
1520
  applyLayer(projectConfig);
@@ -1516,7 +1528,7 @@ function getConfig() {
1516
1528
  cachedConfig = {
1517
1529
  settings: mergedSettings,
1518
1530
  policy: mergedPolicy,
1519
- environments: {}
1531
+ environments: mergedEnvironments
1520
1532
  };
1521
1533
  return cachedConfig;
1522
1534
  }
@@ -1537,6 +1549,29 @@ function tryLoadConfig(filePath) {
1537
1549
  );
1538
1550
  return null;
1539
1551
  }
1552
+ const SUPPORTED_VERSION = "1.0";
1553
+ const SUPPORTED_MAJOR = SUPPORTED_VERSION.split(".")[0];
1554
+ const fileVersion = raw?.version;
1555
+ if (fileVersion !== void 0) {
1556
+ const vStr = String(fileVersion);
1557
+ const fileMajor = vStr.split(".")[0];
1558
+ if (fileMajor !== SUPPORTED_MAJOR) {
1559
+ process.stderr.write(
1560
+ `
1561
+ \u274C Node9: Config at ${filePath} has version "${vStr}" \u2014 major version is incompatible with this release (expected "${SUPPORTED_VERSION}"). Config will not be loaded.
1562
+
1563
+ `
1564
+ );
1565
+ return null;
1566
+ } else if (vStr !== SUPPORTED_VERSION) {
1567
+ process.stderr.write(
1568
+ `
1569
+ \u26A0\uFE0F Node9: Config at ${filePath} declares version "${vStr}" \u2014 expected "${SUPPORTED_VERSION}". Continuing with best-effort parsing.
1570
+
1571
+ `
1572
+ );
1573
+ }
1574
+ }
1540
1575
  const { sanitized, error } = sanitizeConfig(raw);
1541
1576
  if (error) {
1542
1577
  process.stderr.write(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node9/proxy",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "The Sudo Command for AI Agents. Execution Security for Claude Code & MCP.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",