fullcourtdefense-cli 1.1.6 → 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.
|
@@ -3,10 +3,13 @@ export interface McpGatewayArgs {
|
|
|
3
3
|
mcpCommand?: string;
|
|
4
4
|
mcpArgs?: string;
|
|
5
5
|
agentName?: string;
|
|
6
|
+
developerName?: string;
|
|
6
7
|
shieldId?: string;
|
|
7
8
|
shieldKey?: string;
|
|
8
9
|
apiUrl?: string;
|
|
9
10
|
environment?: string;
|
|
11
|
+
userObjective?: string;
|
|
12
|
+
authority?: string;
|
|
10
13
|
approvalMode?: string;
|
|
11
14
|
approvalTimeoutMs?: string;
|
|
12
15
|
approvalPollMs?: string;
|
|
@@ -83,7 +83,10 @@ 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',
|
|
88
|
+
userObjective: args.userObjective || process.env.FCD_USER_OBJECTIVE || 'Developer requested this action from Cursor.',
|
|
89
|
+
authority: args.authority || process.env.FCD_AUTHORITY || 'developer',
|
|
87
90
|
approvalMode: args.approvalMode === 'block' ? 'block' : 'wait',
|
|
88
91
|
approvalTimeoutMs: Number(args.approvalTimeoutMs) > 0 ? Number(args.approvalTimeoutMs) : 300000,
|
|
89
92
|
approvalPollMs: Math.max(1000, Number(args.approvalPollMs) > 0 ? Number(args.approvalPollMs) : 3000),
|
|
@@ -91,17 +94,29 @@ function resolveGatewayConfig(args, config) {
|
|
|
91
94
|
failClosed: args.failClosed !== 'false',
|
|
92
95
|
};
|
|
93
96
|
}
|
|
94
|
-
function machineMetadata() {
|
|
97
|
+
function machineMetadata(developerName) {
|
|
95
98
|
return {
|
|
99
|
+
developerName: developerName || safeUserName(),
|
|
96
100
|
machineName: os.hostname(),
|
|
97
101
|
os: `${os.platform()} ${os.release()}`,
|
|
98
102
|
username: safeUserName(),
|
|
103
|
+
ipAddress: firstPrivateIp(),
|
|
99
104
|
cwd: process.cwd(),
|
|
100
105
|
workspacePath: process.env.WORKSPACE_PATH || process.cwd(),
|
|
101
106
|
agentClient: 'cursor',
|
|
102
107
|
gateway: 'agentguard-mcp-gateway',
|
|
103
108
|
};
|
|
104
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
|
+
}
|
|
105
120
|
function safeUserName() {
|
|
106
121
|
try {
|
|
107
122
|
return os.userInfo().username;
|
|
@@ -110,8 +125,8 @@ function safeUserName() {
|
|
|
110
125
|
return 'unknown';
|
|
111
126
|
}
|
|
112
127
|
}
|
|
113
|
-
function summarizeToolArgs(args) {
|
|
114
|
-
const out = { ...machineMetadata() };
|
|
128
|
+
function summarizeToolArgs(args, developerName) {
|
|
129
|
+
const out = { ...machineMetadata(developerName) };
|
|
115
130
|
for (const [key, value] of Object.entries(args || {})) {
|
|
116
131
|
if (/token|secret|password|credential|key/i.test(key)) {
|
|
117
132
|
out[key] = '[redacted]';
|
|
@@ -271,8 +286,10 @@ class AgentGuardApi {
|
|
|
271
286
|
toolName: input.toolName,
|
|
272
287
|
operation: input.operation,
|
|
273
288
|
toolArgs: input.toolArgs,
|
|
274
|
-
argsSummary: summarizeToolArgs(input.toolArgs),
|
|
289
|
+
argsSummary: summarizeToolArgs(input.toolArgs, this.config.developerName),
|
|
275
290
|
environment: this.config.environment,
|
|
291
|
+
userObjective: this.config.userObjective,
|
|
292
|
+
authority: this.config.authority,
|
|
276
293
|
source: 'runtime_sdk',
|
|
277
294
|
});
|
|
278
295
|
if (!result.success || !result.data) {
|
|
@@ -287,8 +304,10 @@ class AgentGuardApi {
|
|
|
287
304
|
toolName: input.toolName,
|
|
288
305
|
operation: input.operation,
|
|
289
306
|
toolArgs: input.toolArgs,
|
|
290
|
-
argsSummary: summarizeToolArgs(input.toolArgs),
|
|
307
|
+
argsSummary: summarizeToolArgs(input.toolArgs, this.config.developerName),
|
|
291
308
|
environment: this.config.environment,
|
|
309
|
+
userObjective: this.config.userObjective,
|
|
310
|
+
authority: this.config.authority,
|
|
292
311
|
decision: input.decision,
|
|
293
312
|
reason: input.reason,
|
|
294
313
|
source: 'runtime_sdk',
|
|
@@ -541,7 +560,10 @@ async function installCursorMcpGatewayCommand(args, config) {
|
|
|
541
560
|
'--mcp-command', downstreamCommand,
|
|
542
561
|
'--mcp-args', JSON.stringify(parseArgsList(args.mcpArgs || process.env.FCD_MCP_ARGS)),
|
|
543
562
|
'--agent-name', gatewayConfig.agentName,
|
|
563
|
+
'--developer-name', gatewayConfig.developerName,
|
|
544
564
|
'--shield-id', gatewayConfig.shieldId,
|
|
565
|
+
'--user-objective', gatewayConfig.userObjective || 'Developer requested this action from Cursor.',
|
|
566
|
+
'--authority', gatewayConfig.authority || 'developer',
|
|
545
567
|
'--approval-mode', gatewayConfig.approvalMode,
|
|
546
568
|
'--approval-timeout-ms', String(gatewayConfig.approvalTimeoutMs),
|
|
547
569
|
'--approval-poll-ms', String(gatewayConfig.approvalPollMs),
|
package/dist/index.js
CHANGED
|
@@ -343,6 +343,8 @@ async function main() {
|
|
|
343
343
|
shieldKey: flags['shield-key'],
|
|
344
344
|
apiUrl: flags['api-url'],
|
|
345
345
|
environment: flags.environment,
|
|
346
|
+
userObjective: flags['user-objective'],
|
|
347
|
+
authority: flags.authority,
|
|
346
348
|
approvalMode: flags['approval-mode'],
|
|
347
349
|
approvalTimeoutMs: flags['approval-timeout-ms'],
|
|
348
350
|
approvalPollMs: flags['approval-poll-ms'],
|
|
@@ -363,6 +365,8 @@ async function main() {
|
|
|
363
365
|
shieldKey: flags['shield-key'],
|
|
364
366
|
apiUrl: flags['api-url'],
|
|
365
367
|
environment: flags.environment,
|
|
368
|
+
userObjective: flags['user-objective'],
|
|
369
|
+
authority: flags.authority,
|
|
366
370
|
approvalMode: flags['approval-mode'],
|
|
367
371
|
approvalTimeoutMs: flags['approval-timeout-ms'],
|
|
368
372
|
approvalPollMs: flags['approval-poll-ms'],
|