fullcourtdefense-cli 1.1.7 → 1.1.8
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.
|
@@ -83,6 +83,7 @@ function resolveGatewayConfig(args, config) {
|
|
|
83
83
|
shieldKey: args.shieldKey || process.env.FCD_SHIELD_KEY || process.env.FULLCOURTDEFENSE_SHIELD_KEY || process.env.AGENTGUARD_SHIELD_KEY || config.shieldKey || home.shieldKey,
|
|
84
84
|
apiUrl: (args.apiUrl || process.env.FCD_API_URL || process.env.FULLCOURTDEFENSE_API_URL || config.apiUrl || home.apiUrl || DEFAULT_API_URL).replace(/\/$/, ''),
|
|
85
85
|
agentName: args.agentName || process.env.FCD_AGENT_NAME || 'cursor-local-agent',
|
|
86
|
+
developerName: args.developerName || process.env.FCD_DEVELOPER_NAME || process.env.USER_EMAIL || safeUserName(),
|
|
86
87
|
environment: args.environment || process.env.FCD_ENVIRONMENT || 'developer-workstation',
|
|
87
88
|
userObjective: args.userObjective || process.env.FCD_USER_OBJECTIVE || 'Developer requested this action from Cursor.',
|
|
88
89
|
authority: args.authority || process.env.FCD_AUTHORITY || 'developer',
|
|
@@ -93,17 +94,29 @@ function resolveGatewayConfig(args, config) {
|
|
|
93
94
|
failClosed: args.failClosed !== 'false',
|
|
94
95
|
};
|
|
95
96
|
}
|
|
96
|
-
function machineMetadata() {
|
|
97
|
+
function machineMetadata(developerName) {
|
|
97
98
|
return {
|
|
99
|
+
developerName: developerName || safeUserName(),
|
|
98
100
|
machineName: os.hostname(),
|
|
99
101
|
os: `${os.platform()} ${os.release()}`,
|
|
100
102
|
username: safeUserName(),
|
|
103
|
+
ipAddress: firstPrivateIp(),
|
|
101
104
|
cwd: process.cwd(),
|
|
102
105
|
workspacePath: process.env.WORKSPACE_PATH || process.cwd(),
|
|
103
106
|
agentClient: 'cursor',
|
|
104
107
|
gateway: 'agentguard-mcp-gateway',
|
|
105
108
|
};
|
|
106
109
|
}
|
|
110
|
+
function firstPrivateIp() {
|
|
111
|
+
const interfaces = os.networkInterfaces();
|
|
112
|
+
for (const entries of Object.values(interfaces)) {
|
|
113
|
+
for (const entry of entries || []) {
|
|
114
|
+
if (entry.family === 'IPv4' && !entry.internal)
|
|
115
|
+
return entry.address;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return 'unknown';
|
|
119
|
+
}
|
|
107
120
|
function safeUserName() {
|
|
108
121
|
try {
|
|
109
122
|
return os.userInfo().username;
|
|
@@ -112,8 +125,8 @@ function safeUserName() {
|
|
|
112
125
|
return 'unknown';
|
|
113
126
|
}
|
|
114
127
|
}
|
|
115
|
-
function summarizeToolArgs(args) {
|
|
116
|
-
const out = { ...machineMetadata() };
|
|
128
|
+
function summarizeToolArgs(args, developerName) {
|
|
129
|
+
const out = { ...machineMetadata(developerName) };
|
|
117
130
|
for (const [key, value] of Object.entries(args || {})) {
|
|
118
131
|
if (/token|secret|password|credential|key/i.test(key)) {
|
|
119
132
|
out[key] = '[redacted]';
|
|
@@ -273,7 +286,7 @@ class AgentGuardApi {
|
|
|
273
286
|
toolName: input.toolName,
|
|
274
287
|
operation: input.operation,
|
|
275
288
|
toolArgs: input.toolArgs,
|
|
276
|
-
argsSummary: summarizeToolArgs(input.toolArgs),
|
|
289
|
+
argsSummary: summarizeToolArgs(input.toolArgs, this.config.developerName),
|
|
277
290
|
environment: this.config.environment,
|
|
278
291
|
userObjective: this.config.userObjective,
|
|
279
292
|
authority: this.config.authority,
|
|
@@ -291,7 +304,7 @@ class AgentGuardApi {
|
|
|
291
304
|
toolName: input.toolName,
|
|
292
305
|
operation: input.operation,
|
|
293
306
|
toolArgs: input.toolArgs,
|
|
294
|
-
argsSummary: summarizeToolArgs(input.toolArgs),
|
|
307
|
+
argsSummary: summarizeToolArgs(input.toolArgs, this.config.developerName),
|
|
295
308
|
environment: this.config.environment,
|
|
296
309
|
userObjective: this.config.userObjective,
|
|
297
310
|
authority: this.config.authority,
|
|
@@ -547,6 +560,7 @@ async function installCursorMcpGatewayCommand(args, config) {
|
|
|
547
560
|
'--mcp-command', downstreamCommand,
|
|
548
561
|
'--mcp-args', JSON.stringify(parseArgsList(args.mcpArgs || process.env.FCD_MCP_ARGS)),
|
|
549
562
|
'--agent-name', gatewayConfig.agentName,
|
|
563
|
+
'--developer-name', gatewayConfig.developerName,
|
|
550
564
|
'--shield-id', gatewayConfig.shieldId,
|
|
551
565
|
'--user-objective', gatewayConfig.userObjective || 'Developer requested this action from Cursor.',
|
|
552
566
|
'--authority', gatewayConfig.authority || 'developer',
|