@node9/proxy 1.16.0 → 1.17.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/index.js CHANGED
@@ -4133,15 +4133,17 @@ async function authorizeHeadless(toolName, args, meta, options) {
4133
4133
  if (!options?.calledFromDaemon) {
4134
4134
  const actId = (0, import_crypto3.randomUUID)();
4135
4135
  const actTs = Date.now();
4136
+ const stripAnsi = (s) => s.replace(/\x1b(?:\[[0-9;?]*[a-zA-Z]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[@-_])/g, "");
4137
+ const sanitizedAgent = meta?.agent ? stripAnsi(meta.agent).slice(0, 80) : void 0;
4138
+ const sanitizedMcpServer = meta?.mcpServer ? stripAnsi(meta.mcpServer).slice(0, 40) : void 0;
4136
4139
  const socketOk = await notifyActivity({
4137
4140
  id: actId,
4138
4141
  ts: actTs,
4139
4142
  tool: toolName,
4140
4143
  args,
4141
4144
  status: "pending",
4142
- // Strip ANSI escape sequences — agent name comes from caller-supplied metadata
4143
- // and may be displayed in a terminal (node9 tail/watch), enabling injection.
4144
- agent: meta?.agent ? meta.agent.replace(/\x1b(?:\[[0-9;?]*[a-zA-Z]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[@-_])/g, "").slice(0, 80) : void 0
4145
+ agent: sanitizedAgent,
4146
+ mcpServer: sanitizedMcpServer
4145
4147
  });
4146
4148
  const result = await _authorizeHeadlessCore(toolName, args, meta, {
4147
4149
  ...options,
@@ -4159,7 +4161,9 @@ async function authorizeHeadless(toolName, args, meta, options) {
4159
4161
  status: result.approved ? "allow" : result.blockedByLabel?.includes("DLP") ? "dlp" : result.blockedByLabel?.includes("Taint") ? "taint" : "block",
4160
4162
  label: result.blockedByLabel,
4161
4163
  ruleHit: result.ruleHit,
4162
- observeWouldBlock: result.observeWouldBlock
4164
+ observeWouldBlock: result.observeWouldBlock,
4165
+ agent: sanitizedAgent,
4166
+ mcpServer: sanitizedMcpServer
4163
4167
  });
4164
4168
  }
4165
4169
  return result;
package/dist/index.mjs CHANGED
@@ -4103,15 +4103,17 @@ async function authorizeHeadless(toolName, args, meta, options) {
4103
4103
  if (!options?.calledFromDaemon) {
4104
4104
  const actId = randomUUID();
4105
4105
  const actTs = Date.now();
4106
+ const stripAnsi = (s) => s.replace(/\x1b(?:\[[0-9;?]*[a-zA-Z]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[@-_])/g, "");
4107
+ const sanitizedAgent = meta?.agent ? stripAnsi(meta.agent).slice(0, 80) : void 0;
4108
+ const sanitizedMcpServer = meta?.mcpServer ? stripAnsi(meta.mcpServer).slice(0, 40) : void 0;
4106
4109
  const socketOk = await notifyActivity({
4107
4110
  id: actId,
4108
4111
  ts: actTs,
4109
4112
  tool: toolName,
4110
4113
  args,
4111
4114
  status: "pending",
4112
- // Strip ANSI escape sequences — agent name comes from caller-supplied metadata
4113
- // and may be displayed in a terminal (node9 tail/watch), enabling injection.
4114
- agent: meta?.agent ? meta.agent.replace(/\x1b(?:\[[0-9;?]*[a-zA-Z]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[@-_])/g, "").slice(0, 80) : void 0
4115
+ agent: sanitizedAgent,
4116
+ mcpServer: sanitizedMcpServer
4115
4117
  });
4116
4118
  const result = await _authorizeHeadlessCore(toolName, args, meta, {
4117
4119
  ...options,
@@ -4129,7 +4131,9 @@ async function authorizeHeadless(toolName, args, meta, options) {
4129
4131
  status: result.approved ? "allow" : result.blockedByLabel?.includes("DLP") ? "dlp" : result.blockedByLabel?.includes("Taint") ? "taint" : "block",
4130
4132
  label: result.blockedByLabel,
4131
4133
  ruleHit: result.ruleHit,
4132
- observeWouldBlock: result.observeWouldBlock
4134
+ observeWouldBlock: result.observeWouldBlock,
4135
+ agent: sanitizedAgent,
4136
+ mcpServer: sanitizedMcpServer
4133
4137
  });
4134
4138
  }
4135
4139
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node9/proxy",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
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",