fullcourtdefense-cli 1.1.12 → 1.1.13

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/README.md CHANGED
@@ -167,6 +167,8 @@ Local scans run from the customer machine or VPN and only send captured text out
167
167
  | `--mcp-api-key <key>` | HTTP/SSE MCP API-key auth | API key value. | prompt |
168
168
  | `--progress <mode>` | MCP | Console progress: `verbose`, `compact`, or `silent`. | `verbose` |
169
169
  | `--server-name <name>` | MCP gateway installers | MCP server name to write into the client config. | `agentguard-gateway` |
170
+ | `--developer-name <name>` | MCP gateway installers | Runtime identity used for user-scoped Action Policies. Auto-detected from `FCD_DEVELOPER_NAME`, git email, npm username, or OS username. | auto |
171
+ | `--agent-name <name>` | MCP gateway installers | Runtime agent name shown in AI Users. Auto-generated from runtime identity plus client, e.g. `boaz.lautman-claude-desktop`. | auto |
170
172
  | `--scope <scope>` | Claude Code gateway installer | Claude Code MCP scope: `local`, `project`, or `user`. | `local` |
171
173
  | `--config-path <path>` | Claude Desktop gateway installer | Override path to `claude_desktop_config.json`. | OS default |
172
174
 
@@ -328,6 +330,8 @@ Claude Desktop install:
328
330
  fullcourtdefense install-claude-desktop-mcp-gateway --shield-id "sh_..." --shield-key "shsk_..." --mcp-command npm --mcp-args "run mcp"
329
331
  ```
330
332
 
333
+ The gateway auto-detects runtime identity when `--developer-name` is omitted. Detection order is `FCD_DEVELOPER_NAME`, `FULLCOURTDEFENSE_DEVELOPER_NAME`, `AGENTGUARD_DEVELOPER_NAME`, `USER_EMAIL`, `git config user.email`, `npm whoami`, then OS username. Use `--developer-name` only when you want to override the detected employee/runtime identity.
334
+
331
335
  Direct gateway run for debugging:
332
336
 
333
337
  ```powershell
@@ -80,19 +80,55 @@ function normalizeAgentClient(value, fallback) {
80
80
  return value;
81
81
  return fallback;
82
82
  }
83
+ function firstNonEmpty(...values) {
84
+ return values.map(value => value?.trim()).find(Boolean);
85
+ }
86
+ function commandOutput(command, args) {
87
+ try {
88
+ const result = (0, child_process_1.spawnSync)(command, args, {
89
+ encoding: 'utf8',
90
+ shell: process.platform === 'win32',
91
+ stdio: ['ignore', 'pipe', 'ignore'],
92
+ });
93
+ if (result.status !== 0)
94
+ return undefined;
95
+ return result.stdout?.trim() || undefined;
96
+ }
97
+ catch {
98
+ return undefined;
99
+ }
100
+ }
101
+ function safeIdentityPart(value) {
102
+ return value
103
+ .trim()
104
+ .replace(/@.*$/, '')
105
+ .replace(/[^a-zA-Z0-9._-]+/g, '-')
106
+ .replace(/^-+|-+$/g, '')
107
+ .toLowerCase() || 'local-user';
108
+ }
109
+ function detectedDeveloperName(args) {
110
+ return firstNonEmpty(args.developerName, process.env.FCD_DEVELOPER_NAME, process.env.FULLCOURTDEFENSE_DEVELOPER_NAME, process.env.AGENTGUARD_DEVELOPER_NAME, process.env.USER_EMAIL, commandOutput('git', ['config', '--get', 'user.email']), commandOutput('npm', ['whoami']), safeUserName()) || 'unknown';
111
+ }
112
+ function defaultAgentName(agentClient, developerName, defaults) {
113
+ if (defaults.agentName)
114
+ return defaults.agentName;
115
+ const prefix = defaults.agentNamePrefix || agentClient;
116
+ return `${safeIdentityPart(developerName)}-${prefix}`;
117
+ }
83
118
  function resolveGatewayConfig(args, config, defaults = {}) {
84
119
  const home = loadHomeShield();
85
120
  const shieldId = args.shieldId || process.env.FCD_SHIELD_ID || process.env.FULLCOURTDEFENSE_SHIELD_ID || process.env.AGENTGUARD_SHIELD_ID || config.shieldId || home.shieldId;
86
121
  if (!shieldId)
87
122
  throw new Error('Missing Shield ID. Pass --shield-id or run fullcourtdefense configure.');
88
123
  const agentClient = normalizeAgentClient(args.agentClient || process.env.FCD_AGENT_CLIENT, defaults.agentClient || 'cursor');
124
+ const developerName = detectedDeveloperName(args);
89
125
  return {
90
126
  shieldId,
91
127
  shieldKey: args.shieldKey || process.env.FCD_SHIELD_KEY || process.env.FULLCOURTDEFENSE_SHIELD_KEY || process.env.AGENTGUARD_SHIELD_KEY || config.shieldKey || home.shieldKey,
92
128
  apiUrl: (args.apiUrl || process.env.FCD_API_URL || process.env.FULLCOURTDEFENSE_API_URL || config.apiUrl || home.apiUrl || DEFAULT_API_URL).replace(/\/$/, ''),
93
- agentName: args.agentName || process.env.FCD_AGENT_NAME || defaults.agentName || 'cursor-local-agent',
129
+ agentName: args.agentName || process.env.FCD_AGENT_NAME || defaultAgentName(agentClient, developerName, defaults),
94
130
  agentClient,
95
- developerName: args.developerName || process.env.FCD_DEVELOPER_NAME || process.env.USER_EMAIL || safeUserName(),
131
+ developerName,
96
132
  environment: args.environment || process.env.FCD_ENVIRONMENT || 'developer-workstation',
97
133
  userObjective: args.userObjective || process.env.FCD_USER_OBJECTIVE || defaults.userObjective || 'Developer requested this action from Cursor.',
98
134
  authority: args.authority || process.env.FCD_AUTHORITY || 'developer',
@@ -613,7 +649,7 @@ function normalizeClaudeCodeScope(scope) {
613
649
  async function installCursorMcpGatewayCommand(args, config) {
614
650
  const gatewayConfig = resolveGatewayConfig(args, config, {
615
651
  agentClient: 'cursor',
616
- agentName: 'cursor-local-agent',
652
+ agentNamePrefix: 'cursor',
617
653
  userObjective: 'Developer requested this action from Cursor.',
618
654
  });
619
655
  const projectScope = args.project === 'true';
@@ -635,7 +671,7 @@ async function installCursorMcpGatewayCommand(args, config) {
635
671
  async function installClaudeCodeMcpGatewayCommand(args, config) {
636
672
  const gatewayConfig = resolveGatewayConfig(args, config, {
637
673
  agentClient: 'claude-code',
638
- agentName: 'claude-code-local-agent',
674
+ agentNamePrefix: 'claude-code',
639
675
  userObjective: 'Developer requested this action from Claude Code.',
640
676
  });
641
677
  const scope = normalizeClaudeCodeScope(args.scope);
@@ -680,7 +716,7 @@ async function installClaudeCodeMcpGatewayCommand(args, config) {
680
716
  async function installClaudeDesktopMcpGatewayCommand(args, config) {
681
717
  const gatewayConfig = resolveGatewayConfig(args, config, {
682
718
  agentClient: 'claude-desktop',
683
- agentName: 'claude-desktop-local-agent',
719
+ agentNamePrefix: 'claude-desktop',
684
720
  userObjective: 'Developer requested this action from Claude Desktop.',
685
721
  });
686
722
  const file = args.configPath ? path.resolve(args.configPath) : claudeDesktopMcpPath();
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ const discover_1 = require("./commands/discover");
11
11
  const hook_1 = require("./commands/hook");
12
12
  const installCursorHook_1 = require("./commands/installCursorHook");
13
13
  const mcpGateway_1 = require("./commands/mcpGateway");
14
- const VERSION = '1.1.12';
14
+ const VERSION = '1.1.13';
15
15
  function parseArgs(argv) {
16
16
  const flags = {};
17
17
  let command = '';
@@ -148,6 +148,8 @@ function printHelp() {
148
148
  --mcp-args <args> MCP server args/path, for example ./server.js
149
149
  --mcp-tool <tool> MCP tool to test, or all
150
150
  --server-name <name> MCP gateway server name for client installers
151
+ --developer-name <name> Runtime identity for user-scoped policies (auto-detected if omitted)
152
+ --agent-name <name> Runtime agent name (auto-generated from identity + client if omitted)
151
153
  --scope <scope> Claude Code MCP scope: local, project, or user
152
154
  --config-path <path> Claude Desktop config override path
153
155
  --mcp-auth-type <type> HTTP MCP auth: none, bearer, basic, api-key
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fullcourtdefense-cli",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "Full Court Defense CLI — security scanning for AI agents from your terminal",
5
5
  "main": "dist/index.js",
6
6
  "bin": {