@node9/proxy 2.43.1 → 2.45.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/scan-ink.mjs CHANGED
@@ -2346,6 +2346,10 @@ var CHECK_TEXT = {
2346
2346
  };
2347
2347
  var LEVELS = ["audit", "soft", "standard", "strict", "block-all"];
2348
2348
  var MODE_VALUES = ["observe", ...LEVELS];
2349
+ function levelOf(mode) {
2350
+ if (mode === "observe") return "audit";
2351
+ return LEVELS.includes(mode ?? "") ? mode : "standard";
2352
+ }
2349
2353
  var STRICT = {
2350
2354
  "commands.sql-ddl": "block",
2351
2355
  // The agent disarming a check on its own work (node9Firewall#413 part 2).
@@ -7819,7 +7823,7 @@ function BlockedPanel({
7819
7823
  const origins = rules.map((r) => originForRule(r.name, summary.sections, enabled));
7820
7824
  const anyNeeds = origins.some((o) => o.startsWith("needs shield:"));
7821
7825
  const recordOnly = summary.policy?.recordOnly === true;
7822
- const footer = recordOnly ? `\u2192 ${summary.policy?.mode} mode: these were logged, not stopped \xB7 nothing here was enforced` : enabled.size === 0 ? "\u2192 install node9 + enable shields above" : anyNeeds ? "\u2192 \u2713 marks rules from enabled shields \xB7 enable the rest above" : "\u2192 \u2713 all these rules come from enabled shields";
7826
+ const footer = recordOnly ? `\u2192 ${levelOf(summary.policy?.mode)} mode: these were logged, not stopped \xB7 nothing here was enforced` : enabled.size === 0 ? "\u2192 install node9 + enable shields above" : anyNeeds ? "\u2192 \u2713 marks rules from enabled shields \xB7 enable the rest above" : "\u2192 \u2713 all these rules come from enabled shields";
7823
7827
  return /* @__PURE__ */ jsxs7(Box7, { borderStyle: "round", borderColor: "red", paddingX: 1, flexDirection: "column", width, children: [
7824
7828
  /* @__PURE__ */ jsxs7(Text7, { bold: true, color: "red", children: [
7825
7829
  recordOnly ? "LOGGED ONLY (not enforced)" : "WOULD HAVE BLOCKED",
@@ -7956,9 +7960,10 @@ function AgentLoopsPanel({ loopFindings, width }) {
7956
7960
  import { Box as Box11, Text as Text11 } from "ink";
7957
7961
 
7958
7962
  // src/protection.ts
7959
- var PROTECTIVE_SHIELD_DISCOUNTS = {
7960
- "project-jail": 0.7
7961
- };
7963
+ var PROTECTIVE_SHIELDS = /* @__PURE__ */ new Set(["project-jail"]);
7964
+ function isProtectiveShield(name) {
7965
+ return PROTECTIVE_SHIELDS.has(name);
7966
+ }
7962
7967
 
7963
7968
  // src/cli/render/ink/panels/ShieldsPanel.tsx
7964
7969
  import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
@@ -7966,8 +7971,8 @@ function ShieldsPanel({ summary, width, enabledShields = [] }) {
7966
7971
  const enabled = new Set(enabledShields);
7967
7972
  const impacts = rollupByShield(summary.sections);
7968
7973
  const ranked = [...impacts].sort((a, b) => {
7969
- const aDiscount = PROTECTIVE_SHIELD_DISCOUNTS[a.shieldName] ?? 0;
7970
- const bDiscount = PROTECTIVE_SHIELD_DISCOUNTS[b.shieldName] ?? 0;
7974
+ const aDiscount = isProtectiveShield(a.shieldName) ? 1 : 0;
7975
+ const bDiscount = isProtectiveShield(b.shieldName) ? 1 : 0;
7971
7976
  if (aDiscount !== bDiscount) return bDiscount - aDiscount;
7972
7977
  return b.totalCatches - a.totalCatches;
7973
7978
  });
@@ -7977,15 +7982,13 @@ function ShieldsPanel({ summary, width, enabledShields = [] }) {
7977
7982
  const zeroHitBuiltins = zeroHitAll.filter((name) => !enabled.has(name));
7978
7983
  const zeroHitEnabled = zeroHitAll.filter((name) => enabled.has(name));
7979
7984
  const topRec = hitShields.find(
7980
- (r) => (PROTECTIVE_SHIELD_DISCOUNTS[r.shieldName] ?? 0) > 0 && !enabled.has(r.shieldName)
7981
- );
7982
- const allCovered = !topRec && hitShields.some(
7983
- (r) => (PROTECTIVE_SHIELD_DISCOUNTS[r.shieldName] ?? 0) > 0 && enabled.has(r.shieldName)
7985
+ (r) => isProtectiveShield(r.shieldName) && !enabled.has(r.shieldName)
7984
7986
  );
7987
+ const allCovered = !topRec && hitShields.some((r) => isProtectiveShield(r.shieldName) && enabled.has(r.shieldName));
7985
7988
  return /* @__PURE__ */ jsxs11(Box11, { borderStyle: "round", borderColor: "cyan", paddingX: 1, flexDirection: "column", width, children: [
7986
7989
  /* @__PURE__ */ jsx11(Text11, { bold: true, color: "cyan", children: "SHIELDS" }),
7987
7990
  hitShields.map((impact) => {
7988
- const discount = PROTECTIVE_SHIELD_DISCOUNTS[impact.shieldName] ?? 0;
7991
+ const discount = isProtectiveShield(impact.shieldName) ? 1 : 0;
7989
7992
  const isOn = enabled.has(impact.shieldName);
7990
7993
  const noun = `op${impact.totalCatches !== 1 ? "s" : ""}`;
7991
7994
  return /* @__PURE__ */ jsxs11(Box11, { children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node9/proxy",
3
- "version": "2.43.1",
3
+ "version": "2.45.0",
4
4
  "description": "Access control for AI agents. Set what Claude Code, Codex, Gemini, Cursor and any MCP server are allowed to do, review risky actions before they run, and keep every action on the record.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",