@inkog-io/mcp 1.0.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/LICENSE +190 -0
- package/README.md +265 -0
- package/dist/api/client.d.ts +108 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +288 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/types.d.ts +286 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +21 -0
- package/dist/api/types.js.map +1 -0
- package/dist/config.d.ts +68 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +130 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +203 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/audit-a2a.d.ts +20 -0
- package/dist/tools/audit-a2a.d.ts.map +1 -0
- package/dist/tools/audit-a2a.js +382 -0
- package/dist/tools/audit-a2a.js.map +1 -0
- package/dist/tools/audit-mcp.d.ts +16 -0
- package/dist/tools/audit-mcp.d.ts.map +1 -0
- package/dist/tools/audit-mcp.js +259 -0
- package/dist/tools/audit-mcp.js.map +1 -0
- package/dist/tools/compliance.d.ts +14 -0
- package/dist/tools/compliance.d.ts.map +1 -0
- package/dist/tools/compliance.js +255 -0
- package/dist/tools/compliance.js.map +1 -0
- package/dist/tools/explain.d.ts +14 -0
- package/dist/tools/explain.d.ts.map +1 -0
- package/dist/tools/explain.js +202 -0
- package/dist/tools/explain.js.map +1 -0
- package/dist/tools/governance.d.ts +16 -0
- package/dist/tools/governance.d.ts.map +1 -0
- package/dist/tools/governance.js +200 -0
- package/dist/tools/governance.js.map +1 -0
- package/dist/tools/index.d.ts +50 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +94 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/mlbom.d.ts +18 -0
- package/dist/tools/mlbom.d.ts.map +1 -0
- package/dist/tools/mlbom.js +344 -0
- package/dist/tools/mlbom.js.map +1 -0
- package/dist/tools/scan.d.ts +15 -0
- package/dist/tools/scan.d.ts.map +1 -0
- package/dist/tools/scan.js +270 -0
- package/dist/tools/scan.js.map +1 -0
- package/dist/utils/file-reader.d.ts +55 -0
- package/dist/utils/file-reader.d.ts.map +1 -0
- package/dist/utils/file-reader.js +269 -0
- package/dist/utils/file-reader.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inkog API Client
|
|
3
|
+
*
|
|
4
|
+
* Enterprise-grade HTTP client for communicating with the Inkog API.
|
|
5
|
+
* Features:
|
|
6
|
+
* - Automatic retry with exponential backoff
|
|
7
|
+
* - Request/response validation
|
|
8
|
+
* - Structured error handling
|
|
9
|
+
* - Configurable timeouts
|
|
10
|
+
* - API key authentication
|
|
11
|
+
*/
|
|
12
|
+
import { buildApiUrl, getApiKey, getConfig, } from '../config.js';
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// Error Classes
|
|
15
|
+
// =============================================================================
|
|
16
|
+
export class InkogApiError extends Error {
|
|
17
|
+
code;
|
|
18
|
+
statusCode;
|
|
19
|
+
details;
|
|
20
|
+
constructor(message, code, statusCode, details) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.code = code;
|
|
23
|
+
this.statusCode = statusCode;
|
|
24
|
+
this.details = details;
|
|
25
|
+
this.name = 'InkogApiError';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export class InkogAuthError extends InkogApiError {
|
|
29
|
+
constructor(message = 'API key is required. Get your free key at https://app.inkog.io') {
|
|
30
|
+
super(message, 'AUTH_REQUIRED', 401);
|
|
31
|
+
this.name = 'InkogAuthError';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export class InkogRateLimitError extends InkogApiError {
|
|
35
|
+
retryAfter;
|
|
36
|
+
constructor(retryAfter, message = 'Rate limit exceeded') {
|
|
37
|
+
super(message, 'RATE_LIMIT', 429);
|
|
38
|
+
this.retryAfter = retryAfter;
|
|
39
|
+
this.name = 'InkogRateLimitError';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export class InkogNetworkError extends Error {
|
|
43
|
+
cause;
|
|
44
|
+
constructor(message, cause) {
|
|
45
|
+
super(message);
|
|
46
|
+
this.cause = cause;
|
|
47
|
+
this.name = 'InkogNetworkError';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// =============================================================================
|
|
51
|
+
// Inkog API Client
|
|
52
|
+
// =============================================================================
|
|
53
|
+
export class InkogClient {
|
|
54
|
+
config;
|
|
55
|
+
apiKey;
|
|
56
|
+
constructor(config, apiKey) {
|
|
57
|
+
this.config = config ? { ...getConfig(), ...config } : getConfig();
|
|
58
|
+
this.apiKey = apiKey ?? getApiKey();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Check if client has valid API key
|
|
62
|
+
*/
|
|
63
|
+
hasApiKey() {
|
|
64
|
+
return this.apiKey !== undefined && this.apiKey.length > 0;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Make authenticated API request with retry logic
|
|
68
|
+
*/
|
|
69
|
+
async request(options) {
|
|
70
|
+
if (!this.hasApiKey()) {
|
|
71
|
+
throw new InkogAuthError();
|
|
72
|
+
}
|
|
73
|
+
const url = buildApiUrl(this.config, options.path);
|
|
74
|
+
const timeout = options.timeout ?? this.config.apiTimeout;
|
|
75
|
+
const maxRetries = options.retries ?? this.config.apiRetryAttempts;
|
|
76
|
+
let lastError = null;
|
|
77
|
+
let attempt = 0;
|
|
78
|
+
while (attempt <= maxRetries) {
|
|
79
|
+
try {
|
|
80
|
+
const controller = new AbortController();
|
|
81
|
+
const timeoutId = setTimeout(() => { controller.abort(); }, timeout);
|
|
82
|
+
const fetchOptions = {
|
|
83
|
+
method: options.method,
|
|
84
|
+
headers: {
|
|
85
|
+
'Content-Type': 'application/json',
|
|
86
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
87
|
+
'User-Agent': `inkog-mcp/${this.config.serverVersion}`,
|
|
88
|
+
...options.headers,
|
|
89
|
+
},
|
|
90
|
+
signal: controller.signal,
|
|
91
|
+
};
|
|
92
|
+
if (options.body !== undefined) {
|
|
93
|
+
fetchOptions.body = JSON.stringify(options.body);
|
|
94
|
+
}
|
|
95
|
+
const response = await fetch(url, fetchOptions);
|
|
96
|
+
clearTimeout(timeoutId);
|
|
97
|
+
// Handle rate limiting
|
|
98
|
+
if (response.status === 429) {
|
|
99
|
+
const retryAfter = parseInt(response.headers.get('Retry-After') ?? '60', 10);
|
|
100
|
+
throw new InkogRateLimitError(retryAfter);
|
|
101
|
+
}
|
|
102
|
+
// Handle authentication errors
|
|
103
|
+
if (response.status === 401) {
|
|
104
|
+
throw new InkogAuthError();
|
|
105
|
+
}
|
|
106
|
+
// Handle other errors
|
|
107
|
+
if (!response.ok) {
|
|
108
|
+
const errorBody = (await response.json().catch(() => ({})));
|
|
109
|
+
throw new InkogApiError(errorBody.error?.message ?? `Request failed with status ${response.status}`, errorBody.error?.code ?? 'API_ERROR', response.status, errorBody.error?.details);
|
|
110
|
+
}
|
|
111
|
+
return (await response.json());
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
115
|
+
// Don't retry auth errors or rate limits
|
|
116
|
+
if (error instanceof InkogAuthError) {
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
if (error instanceof InkogRateLimitError) {
|
|
120
|
+
throw error;
|
|
121
|
+
}
|
|
122
|
+
// Don't retry client errors (4xx except rate limit)
|
|
123
|
+
if (error instanceof InkogApiError && error.statusCode >= 400 && error.statusCode < 500) {
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
// Retry on network errors or server errors
|
|
127
|
+
if (attempt < maxRetries) {
|
|
128
|
+
const delay = this.config.apiRetryDelay * Math.pow(2, attempt);
|
|
129
|
+
await this.sleep(delay);
|
|
130
|
+
attempt++;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
// Wrap network errors
|
|
134
|
+
if (lastError.name === 'AbortError') {
|
|
135
|
+
throw new InkogNetworkError('Request timed out', lastError);
|
|
136
|
+
}
|
|
137
|
+
if (lastError.name === 'TypeError' && lastError.message.includes('fetch')) {
|
|
138
|
+
throw new InkogNetworkError('Network request failed', lastError);
|
|
139
|
+
}
|
|
140
|
+
throw lastError;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
throw lastError ?? new Error('Request failed after retries');
|
|
144
|
+
}
|
|
145
|
+
sleep(ms) {
|
|
146
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
147
|
+
}
|
|
148
|
+
// ===========================================================================
|
|
149
|
+
// API Methods
|
|
150
|
+
// ===========================================================================
|
|
151
|
+
/**
|
|
152
|
+
* Scan files for AI agent vulnerabilities
|
|
153
|
+
*/
|
|
154
|
+
async scan(files, options) {
|
|
155
|
+
return this.request({
|
|
156
|
+
method: 'POST',
|
|
157
|
+
path: 'scan',
|
|
158
|
+
body: {
|
|
159
|
+
files,
|
|
160
|
+
policy: options?.policy ?? 'balanced',
|
|
161
|
+
output: options?.output ?? 'summary',
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Verify AGENTS.md governance declarations against actual code.
|
|
167
|
+
* Either provide files directly, or reference a previous scan by scanId.
|
|
168
|
+
*/
|
|
169
|
+
async verifyGovernance(files, options) {
|
|
170
|
+
const body = {};
|
|
171
|
+
if (options?.scanId) {
|
|
172
|
+
body.scan_id = options.scanId;
|
|
173
|
+
}
|
|
174
|
+
else if (files.length > 0) {
|
|
175
|
+
body.files = files;
|
|
176
|
+
}
|
|
177
|
+
return this.request({
|
|
178
|
+
method: 'POST',
|
|
179
|
+
path: 'governance/verify',
|
|
180
|
+
body,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Generate compliance report for a regulatory framework.
|
|
185
|
+
* Either provide files directly, or reference a previous scan by scanId.
|
|
186
|
+
*/
|
|
187
|
+
async generateComplianceReport(files, options) {
|
|
188
|
+
const body = {
|
|
189
|
+
framework: options?.framework ?? 'eu-ai-act',
|
|
190
|
+
format: options?.format ?? 'markdown',
|
|
191
|
+
};
|
|
192
|
+
if (options?.scanId) {
|
|
193
|
+
body.scan_id = options.scanId;
|
|
194
|
+
}
|
|
195
|
+
else if (files.length > 0) {
|
|
196
|
+
body.files = files;
|
|
197
|
+
}
|
|
198
|
+
return this.request({
|
|
199
|
+
method: 'POST',
|
|
200
|
+
path: 'compliance/report',
|
|
201
|
+
body,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Get detailed explanation and remediation for a finding or pattern
|
|
206
|
+
*/
|
|
207
|
+
async explainFinding(options) {
|
|
208
|
+
if (options.findingId === undefined && options.pattern === undefined) {
|
|
209
|
+
throw new Error('Either findingId or pattern must be provided');
|
|
210
|
+
}
|
|
211
|
+
// Backend expects: /v1/findings/{pattern_id}/explain
|
|
212
|
+
const patternId = options.pattern ?? options.findingId;
|
|
213
|
+
return this.request({
|
|
214
|
+
method: 'GET',
|
|
215
|
+
path: `findings/${patternId}/explain`,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Security audit an MCP server from the registry or GitHub
|
|
220
|
+
*/
|
|
221
|
+
async auditMcpServer(options) {
|
|
222
|
+
if (options.serverName === undefined && options.repositoryUrl === undefined) {
|
|
223
|
+
throw new Error('Either serverName or repositoryUrl must be provided');
|
|
224
|
+
}
|
|
225
|
+
return this.request({
|
|
226
|
+
method: 'POST',
|
|
227
|
+
path: 'mcp/audit',
|
|
228
|
+
body: options,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Generate ML Bill of Materials (MLBOM).
|
|
233
|
+
* Either provide files directly, or reference a previous scan by scanId.
|
|
234
|
+
*/
|
|
235
|
+
async generateMlbom(files, options) {
|
|
236
|
+
const body = {
|
|
237
|
+
format: options?.format ?? 'cyclonedx',
|
|
238
|
+
include_vulnerabilities: options?.includeVulnerabilities ?? true,
|
|
239
|
+
};
|
|
240
|
+
if (options?.scanId) {
|
|
241
|
+
body.scan_id = options.scanId;
|
|
242
|
+
}
|
|
243
|
+
else if (files.length > 0) {
|
|
244
|
+
body.files = files;
|
|
245
|
+
}
|
|
246
|
+
return this.request({
|
|
247
|
+
method: 'POST',
|
|
248
|
+
path: 'mlbom/generate',
|
|
249
|
+
body,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Audit Agent-to-Agent (A2A) communications.
|
|
254
|
+
* Either provide files directly, or reference a previous scan by scanId.
|
|
255
|
+
*/
|
|
256
|
+
async auditA2A(files, options) {
|
|
257
|
+
const body = {
|
|
258
|
+
protocol: options?.protocol ?? 'auto-detect',
|
|
259
|
+
check_delegation_chains: options?.checkDelegationChains ?? true,
|
|
260
|
+
};
|
|
261
|
+
if (options?.scanId) {
|
|
262
|
+
body.scan_id = options.scanId;
|
|
263
|
+
}
|
|
264
|
+
else if (files.length > 0) {
|
|
265
|
+
body.files = files;
|
|
266
|
+
}
|
|
267
|
+
return this.request({
|
|
268
|
+
method: 'POST',
|
|
269
|
+
path: 'a2a/audit',
|
|
270
|
+
body,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
// =============================================================================
|
|
275
|
+
// Default Client Instance
|
|
276
|
+
// =============================================================================
|
|
277
|
+
let defaultClient = null;
|
|
278
|
+
export function getClient() {
|
|
279
|
+
defaultClient ??= new InkogClient();
|
|
280
|
+
return defaultClient;
|
|
281
|
+
}
|
|
282
|
+
export function createClient(config, apiKey) {
|
|
283
|
+
return new InkogClient(config, apiKey);
|
|
284
|
+
}
|
|
285
|
+
export function resetClient() {
|
|
286
|
+
defaultClient = null;
|
|
287
|
+
}
|
|
288
|
+
//# sourceMappingURL=client.js.map
|
|
@@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AAY,CAAC,MAAwB,EAAE,MAAe;IACpE,OAAO,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inkog API Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for all Inkog API requests and responses.
|
|
5
|
+
* These types mirror the backend contract types.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export type Severity = 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW';
|
|
9
|
+
export type RiskTier = 'vulnerability' | 'risk_pattern' | 'hardening';
|
|
10
|
+
export type ComplianceFramework = 'eu-ai-act' | 'nist-ai-rmf' | 'iso-42001' | 'owasp-llm-top-10' | 'gdpr';
|
|
11
|
+
export type OutputFormat = 'summary' | 'detailed' | 'sarif' | 'json' | 'markdown';
|
|
12
|
+
export type MlbomFormat = 'cyclonedx' | 'spdx' | 'json';
|
|
13
|
+
export type SecurityPolicy = 'low-noise' | 'balanced' | 'comprehensive' | 'governance' | 'eu-ai-act';
|
|
14
|
+
export interface ComplianceMapping {
|
|
15
|
+
euAiActArticles: string[];
|
|
16
|
+
nistCategories: string[];
|
|
17
|
+
owaspItems: string[];
|
|
18
|
+
cweIds: string[];
|
|
19
|
+
iso42001Clauses: string[];
|
|
20
|
+
gdprArticles: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface Finding {
|
|
23
|
+
id: string;
|
|
24
|
+
patternId: string;
|
|
25
|
+
file: string;
|
|
26
|
+
line: number;
|
|
27
|
+
column: number;
|
|
28
|
+
endLine?: number;
|
|
29
|
+
endColumn?: number;
|
|
30
|
+
severity: Severity;
|
|
31
|
+
confidence: number;
|
|
32
|
+
calibratedConfidence?: number;
|
|
33
|
+
message: string;
|
|
34
|
+
cwe?: string;
|
|
35
|
+
category: string;
|
|
36
|
+
riskTier: RiskTier;
|
|
37
|
+
inputTainted: boolean;
|
|
38
|
+
taintSource?: string;
|
|
39
|
+
remediation?: string;
|
|
40
|
+
complianceMapping?: ComplianceMapping;
|
|
41
|
+
codeSnippet?: string;
|
|
42
|
+
}
|
|
43
|
+
export declare const ScanRequestSchema: z.ZodObject<{
|
|
44
|
+
files: z.ZodArray<z.ZodObject<{
|
|
45
|
+
path: z.ZodString;
|
|
46
|
+
content: z.ZodString;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
path: string;
|
|
49
|
+
content: string;
|
|
50
|
+
}, {
|
|
51
|
+
path: string;
|
|
52
|
+
content: string;
|
|
53
|
+
}>, "many">;
|
|
54
|
+
policy: z.ZodDefault<z.ZodEnum<["low-noise", "balanced", "comprehensive", "governance", "eu-ai-act"]>>;
|
|
55
|
+
output: z.ZodDefault<z.ZodEnum<["summary", "detailed", "sarif"]>>;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
files: {
|
|
58
|
+
path: string;
|
|
59
|
+
content: string;
|
|
60
|
+
}[];
|
|
61
|
+
policy: "eu-ai-act" | "low-noise" | "balanced" | "comprehensive" | "governance";
|
|
62
|
+
output: "summary" | "detailed" | "sarif";
|
|
63
|
+
}, {
|
|
64
|
+
files: {
|
|
65
|
+
path: string;
|
|
66
|
+
content: string;
|
|
67
|
+
}[];
|
|
68
|
+
policy?: "eu-ai-act" | "low-noise" | "balanced" | "comprehensive" | "governance" | undefined;
|
|
69
|
+
output?: "summary" | "detailed" | "sarif" | undefined;
|
|
70
|
+
}>;
|
|
71
|
+
export type ScanRequest = z.infer<typeof ScanRequestSchema>;
|
|
72
|
+
export interface ScanResponse {
|
|
73
|
+
success: boolean;
|
|
74
|
+
scanId: string;
|
|
75
|
+
riskScore: number;
|
|
76
|
+
findingsCount: number;
|
|
77
|
+
criticalCount: number;
|
|
78
|
+
highCount: number;
|
|
79
|
+
mediumCount: number;
|
|
80
|
+
lowCount: number;
|
|
81
|
+
findings: Finding[];
|
|
82
|
+
filesScanned: number;
|
|
83
|
+
scanDuration: string;
|
|
84
|
+
governance?: GovernanceResult;
|
|
85
|
+
}
|
|
86
|
+
export interface ArticleStatus {
|
|
87
|
+
article: string;
|
|
88
|
+
status: 'PASS' | 'FAIL' | 'PARTIAL';
|
|
89
|
+
description: string;
|
|
90
|
+
findingCount: number;
|
|
91
|
+
}
|
|
92
|
+
export interface FrameworkStatus {
|
|
93
|
+
framework: string;
|
|
94
|
+
status: 'PASS' | 'FAIL' | 'PARTIAL';
|
|
95
|
+
items: string[];
|
|
96
|
+
findingCount: number;
|
|
97
|
+
}
|
|
98
|
+
export interface GovernanceResult {
|
|
99
|
+
governanceScore: number;
|
|
100
|
+
euAiActReadiness: 'READY' | 'PARTIAL' | 'NOT_READY';
|
|
101
|
+
articleMapping: Record<string, ArticleStatus>;
|
|
102
|
+
frameworkMapping: Record<string, FrameworkStatus>;
|
|
103
|
+
}
|
|
104
|
+
export interface GovernanceMismatch {
|
|
105
|
+
declared: string;
|
|
106
|
+
actual: string;
|
|
107
|
+
file: string;
|
|
108
|
+
line: number;
|
|
109
|
+
severity: Severity;
|
|
110
|
+
description: string;
|
|
111
|
+
}
|
|
112
|
+
export interface GovernanceVerifyResponse {
|
|
113
|
+
success: boolean;
|
|
114
|
+
hasAgentsMd: boolean;
|
|
115
|
+
agentsMdPath?: string;
|
|
116
|
+
mismatches: GovernanceMismatch[];
|
|
117
|
+
declaredCapabilities: string[];
|
|
118
|
+
declaredLimitations: string[];
|
|
119
|
+
declaredTools: string[];
|
|
120
|
+
complianceScore: number;
|
|
121
|
+
recommendation?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface ComplianceReportRequest {
|
|
124
|
+
files: {
|
|
125
|
+
path: string;
|
|
126
|
+
content: string;
|
|
127
|
+
}[];
|
|
128
|
+
framework: ComplianceFramework | 'all';
|
|
129
|
+
format: 'markdown' | 'json' | 'pdf';
|
|
130
|
+
}
|
|
131
|
+
export interface ComplianceArticle {
|
|
132
|
+
id: string;
|
|
133
|
+
title: string;
|
|
134
|
+
status: 'COMPLIANT' | 'NON_COMPLIANT' | 'PARTIAL' | 'NOT_APPLICABLE';
|
|
135
|
+
findings: Finding[];
|
|
136
|
+
recommendations: string[];
|
|
137
|
+
}
|
|
138
|
+
export interface ComplianceReportResponse {
|
|
139
|
+
success: boolean;
|
|
140
|
+
framework: ComplianceFramework;
|
|
141
|
+
overallStatus: 'COMPLIANT' | 'NON_COMPLIANT' | 'PARTIAL';
|
|
142
|
+
complianceScore: number;
|
|
143
|
+
articles: ComplianceArticle[];
|
|
144
|
+
executiveSummary: string;
|
|
145
|
+
generatedAt: string;
|
|
146
|
+
reportContent?: string;
|
|
147
|
+
}
|
|
148
|
+
export interface ExplainRequest {
|
|
149
|
+
findingId?: string;
|
|
150
|
+
pattern?: string;
|
|
151
|
+
}
|
|
152
|
+
export interface RemediationStep {
|
|
153
|
+
order: number;
|
|
154
|
+
description: string;
|
|
155
|
+
codeExample?: string;
|
|
156
|
+
language?: string;
|
|
157
|
+
}
|
|
158
|
+
export interface ExplainResponse {
|
|
159
|
+
success: boolean;
|
|
160
|
+
pattern: string;
|
|
161
|
+
title: string;
|
|
162
|
+
description: string;
|
|
163
|
+
severity: Severity;
|
|
164
|
+
cwe?: string;
|
|
165
|
+
owaspLlm?: string;
|
|
166
|
+
riskTier: RiskTier;
|
|
167
|
+
explanation: string;
|
|
168
|
+
impact: string;
|
|
169
|
+
remediationSteps: RemediationStep[];
|
|
170
|
+
references: string[];
|
|
171
|
+
codeExamples?: {
|
|
172
|
+
vulnerable: string;
|
|
173
|
+
secure: string;
|
|
174
|
+
language: string;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
export interface McpServerInfo {
|
|
178
|
+
name: string;
|
|
179
|
+
displayName?: string;
|
|
180
|
+
description?: string;
|
|
181
|
+
repository: string;
|
|
182
|
+
homepage?: string;
|
|
183
|
+
license?: string;
|
|
184
|
+
tools: string[];
|
|
185
|
+
resources?: string[];
|
|
186
|
+
}
|
|
187
|
+
export interface McpSecurityIssue {
|
|
188
|
+
severity: Severity;
|
|
189
|
+
category: string;
|
|
190
|
+
title: string;
|
|
191
|
+
description: string;
|
|
192
|
+
file?: string;
|
|
193
|
+
line?: number;
|
|
194
|
+
recommendation: string;
|
|
195
|
+
}
|
|
196
|
+
export interface McpAuditResponse {
|
|
197
|
+
success: boolean;
|
|
198
|
+
serverInfo: McpServerInfo;
|
|
199
|
+
securityScore: number;
|
|
200
|
+
issues: McpSecurityIssue[];
|
|
201
|
+
toolPermissions: Record<string, {
|
|
202
|
+
reads: string[];
|
|
203
|
+
writes: string[];
|
|
204
|
+
executes: string[];
|
|
205
|
+
network: string[];
|
|
206
|
+
}>;
|
|
207
|
+
dataFlowRisks: string[];
|
|
208
|
+
recommendations: string[];
|
|
209
|
+
}
|
|
210
|
+
export interface MlComponent {
|
|
211
|
+
type: 'model' | 'tool' | 'data-source' | 'framework' | 'dependency';
|
|
212
|
+
name: string;
|
|
213
|
+
version?: string;
|
|
214
|
+
provider?: string;
|
|
215
|
+
license?: string;
|
|
216
|
+
location: string;
|
|
217
|
+
line?: number;
|
|
218
|
+
properties?: Record<string, string>;
|
|
219
|
+
vulnerabilities?: MlVulnerability[];
|
|
220
|
+
}
|
|
221
|
+
export interface MlVulnerability {
|
|
222
|
+
id: string;
|
|
223
|
+
severity: Severity;
|
|
224
|
+
description: string;
|
|
225
|
+
cve?: string;
|
|
226
|
+
advisory?: string;
|
|
227
|
+
}
|
|
228
|
+
export interface MlbomResponse {
|
|
229
|
+
success: boolean;
|
|
230
|
+
format: MlbomFormat;
|
|
231
|
+
version: string;
|
|
232
|
+
generatedAt: string;
|
|
233
|
+
components: MlComponent[];
|
|
234
|
+
vulnerabilityCount: number;
|
|
235
|
+
riskScore: number;
|
|
236
|
+
bomContent?: string;
|
|
237
|
+
}
|
|
238
|
+
export type A2AProtocol = 'a2a' | 'crewai' | 'langgraph' | 'auto-detect';
|
|
239
|
+
export interface AgentDefinition {
|
|
240
|
+
id: string;
|
|
241
|
+
name: string;
|
|
242
|
+
role?: string;
|
|
243
|
+
tools: string[];
|
|
244
|
+
permissions: string[];
|
|
245
|
+
file: string;
|
|
246
|
+
line: number;
|
|
247
|
+
}
|
|
248
|
+
export interface DelegationEdge {
|
|
249
|
+
from: string;
|
|
250
|
+
to: string;
|
|
251
|
+
type: 'delegate' | 'handoff' | 'spawn';
|
|
252
|
+
file: string;
|
|
253
|
+
line: number;
|
|
254
|
+
hasGuards: boolean;
|
|
255
|
+
}
|
|
256
|
+
export interface A2ASecurityIssue {
|
|
257
|
+
severity: Severity;
|
|
258
|
+
category: 'infinite-delegation' | 'privilege-escalation' | 'data-leakage' | 'unauthorized-handoff' | 'missing-guards';
|
|
259
|
+
title: string;
|
|
260
|
+
description: string;
|
|
261
|
+
agents: string[];
|
|
262
|
+
file: string;
|
|
263
|
+
line: number;
|
|
264
|
+
recommendation: string;
|
|
265
|
+
}
|
|
266
|
+
export interface A2AAuditResponse {
|
|
267
|
+
success: boolean;
|
|
268
|
+
protocol: A2AProtocol;
|
|
269
|
+
agents: AgentDefinition[];
|
|
270
|
+
delegationGraph: DelegationEdge[];
|
|
271
|
+
issues: A2ASecurityIssue[];
|
|
272
|
+
securityScore: number;
|
|
273
|
+
hasCycles: boolean;
|
|
274
|
+
maxDelegationDepth: number;
|
|
275
|
+
recommendations: string[];
|
|
276
|
+
}
|
|
277
|
+
export interface ApiError {
|
|
278
|
+
code: string;
|
|
279
|
+
message: string;
|
|
280
|
+
details?: Record<string, unknown>;
|
|
281
|
+
}
|
|
282
|
+
export interface ApiErrorResponse {
|
|
283
|
+
success: false;
|
|
284
|
+
error: ApiError;
|
|
285
|
+
}
|
|
286
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO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;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,WAAW,CAAC;IACtB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAMD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,QAAQ,CAAC;CACjB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inkog API Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for all Inkog API requests and responses.
|
|
5
|
+
* These types mirror the backend contract types.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
// =============================================================================
|
|
9
|
+
// Scan Types
|
|
10
|
+
// =============================================================================
|
|
11
|
+
export const ScanRequestSchema = z.object({
|
|
12
|
+
files: z.array(z.object({
|
|
13
|
+
path: z.string(),
|
|
14
|
+
content: z.string(),
|
|
15
|
+
})),
|
|
16
|
+
policy: z
|
|
17
|
+
.enum(['low-noise', 'balanced', 'comprehensive', 'governance', 'eu-ai-act'])
|
|
18
|
+
.default('balanced'),
|
|
19
|
+
output: z.enum(['summary', 'detailed', 'sarif']).default('summary'),
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0DxB,gFAAgF;AAChF,aAAa;AACb,gFAAgF;AAEhF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,CAAC,CAAC,KAAK,CACZ,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB,CAAC,CACH;IACD,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;SAC3E,OAAO,CAAC,UAAU,CAAC;IACtB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;CACpE,CAAC,CAAC"}
|