@node9/proxy 1.56.0 → 1.57.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.
Files changed (3) hide show
  1. package/dist/cli.js +44 -12
  2. package/dist/cli.mjs +44 -12
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -16908,7 +16908,7 @@ function deriveHeadline(allFindings) {
16908
16908
  }
16909
16909
  let action;
16910
16910
  if (notWired) {
16911
- action = "Run `node9 init` \u2014 node9 is not in-path yet, so nothing here is enforced.";
16911
+ action = "Install node9 and put it in-path: `npm i -g node9-ai && node9 init` \u2014 nothing here is enforced until you do.";
16912
16912
  } else if (observeOnly) {
16913
16913
  action = "Switch node9 to enforcing mode \u2014 right now it is only watching, not blocking.";
16914
16914
  } else if (egressOpen) {
@@ -17039,7 +17039,10 @@ async function runPosture(opts = {}) {
17039
17039
  passedCategories,
17040
17040
  erroredCategories
17041
17041
  } = await runChecks(POSTURE_CHECKS, ctx);
17042
- await annotateCoverage(rawFindings, ctx);
17042
+ try {
17043
+ await annotateCoverage(rawFindings, ctx);
17044
+ } catch {
17045
+ }
17043
17046
  const findings = dropEnforcementRedundant(rawFindings);
17044
17047
  const { score, tier } = scorePosture(findings, POSTURE_CHECKS.length);
17045
17048
  return {
@@ -17493,8 +17496,21 @@ function resolveEntryStatus(e, tools, env, now) {
17493
17496
  if (e.state === "node9-self") return { ...base, connection: "node9-self" };
17494
17497
  if (e.state === "remote") return { ...base, connection: "remote" };
17495
17498
  if (e.state === "ungoverned") return { ...base, connection: "ungoverned" };
17499
+ const connectedRow = (serverKey2, connected2) => {
17500
+ const lastSeenAt = connected2.lastSeenAt;
17501
+ const stale = typeof lastSeenAt === "number" && now - lastSeenAt > STALE_MS;
17502
+ return {
17503
+ ...base,
17504
+ connection: stale ? "stale" : "connected",
17505
+ lastSeenAt,
17506
+ connectedTools: connected2.tools.length,
17507
+ serverKey: serverKey2
17508
+ };
17509
+ };
17496
17510
  const upstream = upstreamOf(e);
17497
17511
  if (!upstream) return { ...base, connection: "pending-launch" };
17512
+ const stamped = Object.entries(tools).find(([, cfg]) => cfg.name === e.name);
17513
+ if (stamped) return connectedRow(stamped[0], stamped[1]);
17498
17514
  const { resolved, missing } = substituteEnv(upstream, env);
17499
17515
  if (missing.length > 0) {
17500
17516
  return { ...base, connection: "unlaunchable", missingEnv: missing };
@@ -17502,15 +17518,7 @@ function resolveEntryStatus(e, tools, env, now) {
17502
17518
  const serverKey = getServerKey(resolved);
17503
17519
  const connected = tools[serverKey];
17504
17520
  if (!connected) return { ...base, connection: "pending-launch", serverKey };
17505
- const lastSeenAt = connected.lastSeenAt;
17506
- const stale = typeof lastSeenAt === "number" && now - lastSeenAt > STALE_MS;
17507
- return {
17508
- ...base,
17509
- connection: stale ? "stale" : "connected",
17510
- lastSeenAt,
17511
- connectedTools: connected.tools.length,
17512
- serverKey
17513
- };
17521
+ return connectedRow(serverKey, connected);
17514
17522
  }
17515
17523
  function resolveMcpStatus(home, env = process.env, now = Date.now()) {
17516
17524
  const tools = readMcpToolsConfig();
@@ -18585,9 +18593,30 @@ function reportToCloud(e, autoWrapped, creds) {
18585
18593
  }
18586
18594
  function runMcpReconcile() {
18587
18595
  const autoWrap = getConfig().settings.mcpAutoWrap === true;
18596
+ const inv = inventoryMcp();
18597
+ for (const e of inv) {
18598
+ if (e.state !== "gatewayed" || e.format === "toml") continue;
18599
+ if (e.args.includes("--config-name")) continue;
18600
+ const orig = fromGateway(e.raw);
18601
+ if (!orig) continue;
18602
+ try {
18603
+ writeMcpEntry(e.mcpFile, e.format, e.name, toGateway(orig, e.name));
18604
+ appendToLog(HOOK_DEBUG_LOG, {
18605
+ event: "mcp-config-name-refreshed",
18606
+ agent: e.agent,
18607
+ name: e.name
18608
+ });
18609
+ } catch (err2) {
18610
+ appendToLog(HOOK_DEBUG_LOG, {
18611
+ event: "mcp-config-name-refresh-failed",
18612
+ name: e.name,
18613
+ error: err2?.message
18614
+ });
18615
+ }
18616
+ }
18588
18617
  const baseline = loadBaseline();
18589
18618
  const creds = getCredentials();
18590
- const fresh = inventoryMcp().filter((e) => e.state === "ungoverned" && !baseline.has(idKey(e)));
18619
+ const fresh = inv.filter((e) => e.state === "ungoverned" && !baseline.has(idKey(e)));
18591
18620
  if (fresh.length === 0) return;
18592
18621
  const wrappedAgents = /* @__PURE__ */ new Set();
18593
18622
  let wrappedCount = 0;
@@ -18659,6 +18688,7 @@ var init_mcp_reconciler = __esm({
18659
18688
  init_native();
18660
18689
  init_config();
18661
18690
  init_cloud();
18691
+ init_audit();
18662
18692
  BASELINE_FILE2 = import_path36.default.join(import_os35.default.homedir(), ".node9", "mcp-baseline.json");
18663
18693
  BASELINE_CAP = 500;
18664
18694
  DEFAULT_INTERVAL_MIN = 60;
@@ -21571,6 +21601,7 @@ var import_child_process7 = require("child_process");
21571
21601
  var import_path43 = __toESM(require("path"));
21572
21602
  var import_os41 = __toESM(require("os"));
21573
21603
  init_orchestrator();
21604
+ init_state();
21574
21605
  init_daemon();
21575
21606
  init_config();
21576
21607
  init_policy();
@@ -22289,6 +22320,7 @@ RAW: ${raw}
22289
22320
  }
22290
22321
  }
22291
22322
  if (!prompt) process.exit(0);
22323
+ if (process.env.NODE9_PAUSED === "1" || checkPause().paused) process.exit(0);
22292
22324
  const dlpMatch = scanArgs({ prompt });
22293
22325
  if (!dlpMatch) process.exit(0);
22294
22326
  const agent2 = agentOverride ?? detectAiAgent(payload);
package/dist/cli.mjs CHANGED
@@ -16880,7 +16880,7 @@ function deriveHeadline(allFindings) {
16880
16880
  }
16881
16881
  let action;
16882
16882
  if (notWired) {
16883
- action = "Run `node9 init` \u2014 node9 is not in-path yet, so nothing here is enforced.";
16883
+ action = "Install node9 and put it in-path: `npm i -g node9-ai && node9 init` \u2014 nothing here is enforced until you do.";
16884
16884
  } else if (observeOnly) {
16885
16885
  action = "Switch node9 to enforcing mode \u2014 right now it is only watching, not blocking.";
16886
16886
  } else if (egressOpen) {
@@ -17012,7 +17012,10 @@ async function runPosture(opts = {}) {
17012
17012
  passedCategories,
17013
17013
  erroredCategories
17014
17014
  } = await runChecks(POSTURE_CHECKS, ctx);
17015
- await annotateCoverage(rawFindings, ctx);
17015
+ try {
17016
+ await annotateCoverage(rawFindings, ctx);
17017
+ } catch {
17018
+ }
17016
17019
  const findings = dropEnforcementRedundant(rawFindings);
17017
17020
  const { score, tier } = scorePosture(findings, POSTURE_CHECKS.length);
17018
17021
  return {
@@ -17462,8 +17465,21 @@ function resolveEntryStatus(e, tools, env, now) {
17462
17465
  if (e.state === "node9-self") return { ...base, connection: "node9-self" };
17463
17466
  if (e.state === "remote") return { ...base, connection: "remote" };
17464
17467
  if (e.state === "ungoverned") return { ...base, connection: "ungoverned" };
17468
+ const connectedRow = (serverKey2, connected2) => {
17469
+ const lastSeenAt = connected2.lastSeenAt;
17470
+ const stale = typeof lastSeenAt === "number" && now - lastSeenAt > STALE_MS;
17471
+ return {
17472
+ ...base,
17473
+ connection: stale ? "stale" : "connected",
17474
+ lastSeenAt,
17475
+ connectedTools: connected2.tools.length,
17476
+ serverKey: serverKey2
17477
+ };
17478
+ };
17465
17479
  const upstream = upstreamOf(e);
17466
17480
  if (!upstream) return { ...base, connection: "pending-launch" };
17481
+ const stamped = Object.entries(tools).find(([, cfg]) => cfg.name === e.name);
17482
+ if (stamped) return connectedRow(stamped[0], stamped[1]);
17467
17483
  const { resolved, missing } = substituteEnv(upstream, env);
17468
17484
  if (missing.length > 0) {
17469
17485
  return { ...base, connection: "unlaunchable", missingEnv: missing };
@@ -17471,15 +17487,7 @@ function resolveEntryStatus(e, tools, env, now) {
17471
17487
  const serverKey = getServerKey(resolved);
17472
17488
  const connected = tools[serverKey];
17473
17489
  if (!connected) return { ...base, connection: "pending-launch", serverKey };
17474
- const lastSeenAt = connected.lastSeenAt;
17475
- const stale = typeof lastSeenAt === "number" && now - lastSeenAt > STALE_MS;
17476
- return {
17477
- ...base,
17478
- connection: stale ? "stale" : "connected",
17479
- lastSeenAt,
17480
- connectedTools: connected.tools.length,
17481
- serverKey
17482
- };
17490
+ return connectedRow(serverKey, connected);
17483
17491
  }
17484
17492
  function resolveMcpStatus(home, env = process.env, now = Date.now()) {
17485
17493
  const tools = readMcpToolsConfig();
@@ -18557,9 +18565,30 @@ function reportToCloud(e, autoWrapped, creds) {
18557
18565
  }
18558
18566
  function runMcpReconcile() {
18559
18567
  const autoWrap = getConfig().settings.mcpAutoWrap === true;
18568
+ const inv = inventoryMcp();
18569
+ for (const e of inv) {
18570
+ if (e.state !== "gatewayed" || e.format === "toml") continue;
18571
+ if (e.args.includes("--config-name")) continue;
18572
+ const orig = fromGateway(e.raw);
18573
+ if (!orig) continue;
18574
+ try {
18575
+ writeMcpEntry(e.mcpFile, e.format, e.name, toGateway(orig, e.name));
18576
+ appendToLog(HOOK_DEBUG_LOG, {
18577
+ event: "mcp-config-name-refreshed",
18578
+ agent: e.agent,
18579
+ name: e.name
18580
+ });
18581
+ } catch (err2) {
18582
+ appendToLog(HOOK_DEBUG_LOG, {
18583
+ event: "mcp-config-name-refresh-failed",
18584
+ name: e.name,
18585
+ error: err2?.message
18586
+ });
18587
+ }
18588
+ }
18560
18589
  const baseline = loadBaseline();
18561
18590
  const creds = getCredentials();
18562
- const fresh = inventoryMcp().filter((e) => e.state === "ungoverned" && !baseline.has(idKey(e)));
18591
+ const fresh = inv.filter((e) => e.state === "ungoverned" && !baseline.has(idKey(e)));
18563
18592
  if (fresh.length === 0) return;
18564
18593
  const wrappedAgents = /* @__PURE__ */ new Set();
18565
18594
  let wrappedCount = 0;
@@ -18627,6 +18656,7 @@ var init_mcp_reconciler = __esm({
18627
18656
  init_native();
18628
18657
  init_config();
18629
18658
  init_cloud();
18659
+ init_audit();
18630
18660
  BASELINE_FILE2 = path37.join(os36.homedir(), ".node9", "mcp-baseline.json");
18631
18661
  BASELINE_CAP = 500;
18632
18662
  DEFAULT_INTERVAL_MIN = 60;
@@ -21533,6 +21563,7 @@ async function autoStartDaemonAndWait() {
21533
21563
 
21534
21564
  // src/cli/commands/check.ts
21535
21565
  init_orchestrator();
21566
+ init_state();
21536
21567
  init_daemon();
21537
21568
  init_config();
21538
21569
  init_policy();
@@ -22256,6 +22287,7 @@ RAW: ${raw}
22256
22287
  }
22257
22288
  }
22258
22289
  if (!prompt) process.exit(0);
22290
+ if (process.env.NODE9_PAUSED === "1" || checkPause().paused) process.exit(0);
22259
22291
  const dlpMatch = scanArgs({ prompt });
22260
22292
  if (!dlpMatch) process.exit(0);
22261
22293
  const agent2 = agentOverride ?? detectAiAgent(payload);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node9/proxy",
3
- "version": "1.56.0",
3
+ "version": "1.57.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",