fullcourtdefense-cli 1.26.8 → 1.26.9
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/telemetry.d.ts +6 -3
- package/dist/telemetry.js +39 -7
- package/dist/version.json +1 -1
- package/package.json +1 -1
package/dist/telemetry.d.ts
CHANGED
|
@@ -37,9 +37,12 @@ export interface SpoolEvent {
|
|
|
37
37
|
*/
|
|
38
38
|
export type VerdictPath = 'ipc' | 'local' | 'fail_open' | 'gateway';
|
|
39
39
|
/**
|
|
40
|
-
* Compact JSON of the command/path/query the agent attempted. The console
|
|
41
|
-
* Details column renders this as
|
|
42
|
-
*
|
|
40
|
+
* Compact JSON of the command/path/query/args the agent attempted. The console
|
|
41
|
+
* Details column renders this as labeled Command / Query / URL / File / Args
|
|
42
|
+
* rows. Truncated to 500 chars so it survives backend sanitize().
|
|
43
|
+
*
|
|
44
|
+
* Known keys are preferred. Other primitive args (action, selector, prompt, …)
|
|
45
|
+
* are included so MCP tools that are not a shell/file still show what ran.
|
|
43
46
|
*/
|
|
44
47
|
export declare function evidenceFromToolArgs(toolArgs: Record<string, unknown> | undefined): string | undefined;
|
|
45
48
|
interface VerdictTiming {
|
package/dist/telemetry.js
CHANGED
|
@@ -73,21 +73,53 @@ const SPOOL_TRIM_BYTES = 2 * 1024 * 1024;
|
|
|
73
73
|
const ACTION_EVIDENCE_KEYS = [
|
|
74
74
|
'command', 'cmd', 'commandLine', 'script', 'query', 'sql', 'url',
|
|
75
75
|
'path', 'file_path', 'filePath', 'file', 'target',
|
|
76
|
+
'pattern', 'glob', 'search', 'q',
|
|
76
77
|
];
|
|
78
|
+
/** Noise / secrets — never stamp these as activity evidence. */
|
|
79
|
+
const EVIDENCE_SKIP_KEYS = /^(cwd|pwd|env|environment|headers|cookie|cookies|authorization|password|passwd|secret|token|api[_-]?key|private[_-]?key|session|retryCount|timeoutMs|timeout)$/i;
|
|
80
|
+
function stringifyEvidenceValue(value) {
|
|
81
|
+
if (typeof value === 'string' && value.trim())
|
|
82
|
+
return value.trim().slice(0, 480);
|
|
83
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
84
|
+
return String(value);
|
|
85
|
+
if (typeof value === 'boolean')
|
|
86
|
+
return value ? 'true' : 'false';
|
|
87
|
+
if (Array.isArray(value) || (value && typeof value === 'object')) {
|
|
88
|
+
try {
|
|
89
|
+
const json = JSON.stringify(value);
|
|
90
|
+
return json && json !== '{}' && json !== '[]' ? json.slice(0, 240) : undefined;
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
77
98
|
/**
|
|
78
|
-
* Compact JSON of the command/path/query the agent attempted. The console
|
|
79
|
-
* Details column renders this as
|
|
80
|
-
*
|
|
99
|
+
* Compact JSON of the command/path/query/args the agent attempted. The console
|
|
100
|
+
* Details column renders this as labeled Command / Query / URL / File / Args
|
|
101
|
+
* rows. Truncated to 500 chars so it survives backend sanitize().
|
|
102
|
+
*
|
|
103
|
+
* Known keys are preferred. Other primitive args (action, selector, prompt, …)
|
|
104
|
+
* are included so MCP tools that are not a shell/file still show what ran.
|
|
81
105
|
*/
|
|
82
106
|
function evidenceFromToolArgs(toolArgs) {
|
|
83
107
|
if (!toolArgs)
|
|
84
108
|
return undefined;
|
|
85
109
|
const picked = {};
|
|
86
110
|
for (const key of ACTION_EVIDENCE_KEYS) {
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
picked[key] =
|
|
90
|
-
|
|
111
|
+
const text = stringifyEvidenceValue(toolArgs[key]);
|
|
112
|
+
if (text)
|
|
113
|
+
picked[key] = text;
|
|
114
|
+
}
|
|
115
|
+
for (const [key, value] of Object.entries(toolArgs)) {
|
|
116
|
+
if (picked[key] || EVIDENCE_SKIP_KEYS.test(key))
|
|
117
|
+
continue;
|
|
118
|
+
if (Object.keys(picked).length >= 8)
|
|
119
|
+
break;
|
|
120
|
+
const text = stringifyEvidenceValue(value);
|
|
121
|
+
if (text)
|
|
122
|
+
picked[key] = text;
|
|
91
123
|
}
|
|
92
124
|
if (Object.keys(picked).length === 0)
|
|
93
125
|
return undefined;
|
package/dist/version.json
CHANGED