verimu 0.0.14 → 0.0.16
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 +34 -2
- package/dist/cli.mjs +18134 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.cjs +14928 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +179 -1
- package/dist/index.d.ts +179 -1
- package/dist/index.mjs +14933 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -1
- package/dist/cli.js +0 -3188
- package/dist/cli.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -108,6 +108,108 @@ interface CveCheckResult {
|
|
|
108
108
|
/** Total time taken for all checks (ms) */
|
|
109
109
|
checkDurationMs: number;
|
|
110
110
|
}
|
|
111
|
+
/** How confidently a vulnerable package is used in source code */
|
|
112
|
+
type UsageContextStatus = 'direct_evidence' | 'indirect_no_evidence' | 'unsupported' | 'analysis_error';
|
|
113
|
+
/** Match categories for usage snippets */
|
|
114
|
+
type UsageSnippetMatchKind = 'import' | 'require' | 'dynamic_import' | 'export_from' | 'call';
|
|
115
|
+
/** A code snippet where a vulnerable package appears to be used */
|
|
116
|
+
interface UsageSnippet {
|
|
117
|
+
/** Project-relative path to the file */
|
|
118
|
+
filePath: string;
|
|
119
|
+
/** 1-based start line of the snippet in source file */
|
|
120
|
+
startLine: number;
|
|
121
|
+
/** 1-based end line of the snippet in source file */
|
|
122
|
+
endLine: number;
|
|
123
|
+
/** Snippet text including context lines */
|
|
124
|
+
code: string;
|
|
125
|
+
/** Kind of syntax match */
|
|
126
|
+
matchKind: UsageSnippetMatchKind;
|
|
127
|
+
/** Called symbol if this snippet is a call-site match */
|
|
128
|
+
calledSymbol?: string;
|
|
129
|
+
/** Confidence score in [0, 1] */
|
|
130
|
+
confidence: number;
|
|
131
|
+
}
|
|
132
|
+
/** Usage-context outcome for one vulnerability */
|
|
133
|
+
interface UsageContextVulnerabilityFinding {
|
|
134
|
+
/** Vulnerability identifier (CVE/GHSA/etc.) */
|
|
135
|
+
vulnerabilityId: string;
|
|
136
|
+
/** Package name that is vulnerable */
|
|
137
|
+
packageName: string;
|
|
138
|
+
/** Ecosystem the package belongs to */
|
|
139
|
+
ecosystem: Ecosystem;
|
|
140
|
+
/** Whether dependency scanner marked it as direct, if known */
|
|
141
|
+
directDependency: boolean | null;
|
|
142
|
+
/** Resolution status for this package usage */
|
|
143
|
+
status: UsageContextStatus;
|
|
144
|
+
/** Matched snippets for this vulnerable package */
|
|
145
|
+
snippets: UsageSnippet[];
|
|
146
|
+
/** Number of snippets in this finding */
|
|
147
|
+
evidenceCount: number;
|
|
148
|
+
/** Optional explanatory note */
|
|
149
|
+
notes?: string;
|
|
150
|
+
}
|
|
151
|
+
/** LLM-friendly usage context payload for one vulnerability */
|
|
152
|
+
interface UsageContextLlmPayload {
|
|
153
|
+
vulnerability: {
|
|
154
|
+
id: string;
|
|
155
|
+
aliases: string[];
|
|
156
|
+
severity: Severity;
|
|
157
|
+
summary: string;
|
|
158
|
+
affectedVersionRange?: string;
|
|
159
|
+
fixedVersion?: string;
|
|
160
|
+
referenceUrl?: string;
|
|
161
|
+
};
|
|
162
|
+
package: {
|
|
163
|
+
name: string;
|
|
164
|
+
ecosystem: Ecosystem;
|
|
165
|
+
directDependency: boolean | null;
|
|
166
|
+
};
|
|
167
|
+
status: UsageContextStatus;
|
|
168
|
+
evidenceCount: number;
|
|
169
|
+
snippets: UsageSnippet[];
|
|
170
|
+
notes?: string;
|
|
171
|
+
}
|
|
172
|
+
/** Analyzer-level status summary for one ecosystem */
|
|
173
|
+
interface UsageContextEcosystemStatus {
|
|
174
|
+
ecosystem: Ecosystem;
|
|
175
|
+
analyzer: string;
|
|
176
|
+
status: 'analyzed' | 'unsupported' | 'error';
|
|
177
|
+
vulnerablePackages: number;
|
|
178
|
+
snippetsFound: number;
|
|
179
|
+
note?: string;
|
|
180
|
+
}
|
|
181
|
+
/** Non-fatal usage-context analysis error */
|
|
182
|
+
interface UsageContextError {
|
|
183
|
+
analyzer: string;
|
|
184
|
+
ecosystem?: Ecosystem;
|
|
185
|
+
packageName?: string;
|
|
186
|
+
error: string;
|
|
187
|
+
}
|
|
188
|
+
/** Complete usage-context output for a scan */
|
|
189
|
+
interface UsageContextResult {
|
|
190
|
+
/** Whether usage analysis was executed */
|
|
191
|
+
triggered: boolean;
|
|
192
|
+
/** Scan duration in milliseconds */
|
|
193
|
+
durationMs: number;
|
|
194
|
+
/** Effective context lines setting (±N around each match) */
|
|
195
|
+
numContextLines: number;
|
|
196
|
+
/** Package-level snippet cap */
|
|
197
|
+
maxSnippetsPerPackage: number;
|
|
198
|
+
/** Global snippet cap */
|
|
199
|
+
maxSnippetsTotal: number;
|
|
200
|
+
/** Total snippets emitted */
|
|
201
|
+
totalSnippets: number;
|
|
202
|
+
/** Artifact path if written to disk */
|
|
203
|
+
artifactPath?: string;
|
|
204
|
+
/** Per-vulnerability findings */
|
|
205
|
+
packageFindings: UsageContextVulnerabilityFinding[];
|
|
206
|
+
/** Ecosystem-level analyzer status */
|
|
207
|
+
ecosystemStatus: UsageContextEcosystemStatus[];
|
|
208
|
+
/** Non-fatal analysis errors */
|
|
209
|
+
errors: UsageContextError[];
|
|
210
|
+
/** LLM-ready payload entries */
|
|
211
|
+
llmPayload: UsageContextLlmPayload[];
|
|
212
|
+
}
|
|
111
213
|
/** Complete output of a Verimu scan */
|
|
112
214
|
interface VerimuReport {
|
|
113
215
|
/** Project info */
|
|
@@ -122,6 +224,8 @@ interface VerimuReport {
|
|
|
122
224
|
artifacts?: SbomArtifacts;
|
|
123
225
|
/** CVE check results */
|
|
124
226
|
cveCheck: CveCheckResult;
|
|
227
|
+
/** Optional usage-context analysis for vulnerable packages */
|
|
228
|
+
usageContext?: UsageContextResult;
|
|
125
229
|
/** Overall summary */
|
|
126
230
|
summary: {
|
|
127
231
|
totalDependencies: number;
|
|
@@ -155,6 +259,8 @@ interface VerimuConfig {
|
|
|
155
259
|
apiBaseUrl?: string;
|
|
156
260
|
/** Skip CVE checking (just generate SBOM) */
|
|
157
261
|
skipCveCheck?: boolean;
|
|
262
|
+
/** Optional context lines around usage snippets (default: 4, clamped to 0..20) */
|
|
263
|
+
numContextLines?: number;
|
|
158
264
|
}
|
|
159
265
|
/** Input for the pure `generateSbom()` function */
|
|
160
266
|
interface GenerateSbomInput {
|
|
@@ -264,6 +370,23 @@ declare function generateSpdxSbom(input: GenerateSbomInput): GenerateSpdxSbomRes
|
|
|
264
370
|
*/
|
|
265
371
|
declare function generateSwidTag(input: GenerateSbomInput): GenerateSwidTagResult;
|
|
266
372
|
|
|
373
|
+
/**
|
|
374
|
+
* Source detection for SBOM scans.
|
|
375
|
+
*
|
|
376
|
+
* Determines the scan source with the following priority:
|
|
377
|
+
* 1. VERIMU_SOURCE environment variable (explicit override)
|
|
378
|
+
* 2. Auto-detect CI/CD environment
|
|
379
|
+
* 3. Default to "cli"
|
|
380
|
+
*/
|
|
381
|
+
type SbomSource = 'cli' | 'cicd';
|
|
382
|
+
/**
|
|
383
|
+
* Detects the scan source with priority:
|
|
384
|
+
* 1. VERIMU_SOURCE env var (explicit override)
|
|
385
|
+
* 2. Auto-detect CI/CD environment
|
|
386
|
+
* 3. Default to "cli"
|
|
387
|
+
*/
|
|
388
|
+
declare function detectSource(): SbomSource;
|
|
389
|
+
|
|
267
390
|
/**
|
|
268
391
|
* Verimu API client — communicates with the Verimu backend.
|
|
269
392
|
*
|
|
@@ -315,6 +438,11 @@ interface SbomUploadBundle {
|
|
|
315
438
|
cyclonedx: Record<string, unknown>;
|
|
316
439
|
spdx?: Record<string, unknown>;
|
|
317
440
|
swid?: string;
|
|
441
|
+
meta?: {
|
|
442
|
+
source?: SbomSource;
|
|
443
|
+
commit_sha?: string;
|
|
444
|
+
};
|
|
445
|
+
usage_context?: Omit<UsageContextResult, 'artifactPath'>;
|
|
318
446
|
}
|
|
319
447
|
declare class VerimuApiClient {
|
|
320
448
|
private readonly baseUrl;
|
|
@@ -1321,4 +1449,54 @@ declare class ConsoleReporter implements Reporter {
|
|
|
1321
1449
|
report(result: VerimuReport): string;
|
|
1322
1450
|
}
|
|
1323
1451
|
|
|
1324
|
-
|
|
1452
|
+
interface VulnerablePackageInput {
|
|
1453
|
+
packageName: string;
|
|
1454
|
+
ecosystem: Ecosystem;
|
|
1455
|
+
directDependency: boolean | null;
|
|
1456
|
+
vulnerabilities: Vulnerability[];
|
|
1457
|
+
}
|
|
1458
|
+
interface PackageAnalysisResult {
|
|
1459
|
+
packageName: string;
|
|
1460
|
+
ecosystem: Ecosystem;
|
|
1461
|
+
status: UsageContextStatus;
|
|
1462
|
+
snippets: UsageSnippet[];
|
|
1463
|
+
notes?: string;
|
|
1464
|
+
}
|
|
1465
|
+
interface AnalyzerRunContext {
|
|
1466
|
+
projectPath: string;
|
|
1467
|
+
ecosystem: Ecosystem;
|
|
1468
|
+
packages: VulnerablePackageInput[];
|
|
1469
|
+
numContextLines: number;
|
|
1470
|
+
maxSnippetsPerPackage: number;
|
|
1471
|
+
maxSnippetsTotal: number;
|
|
1472
|
+
}
|
|
1473
|
+
interface AnalyzerRunResult {
|
|
1474
|
+
packages: PackageAnalysisResult[];
|
|
1475
|
+
errors: UsageContextError[];
|
|
1476
|
+
snippetsProduced: number;
|
|
1477
|
+
}
|
|
1478
|
+
interface UsageContextAnalyzer {
|
|
1479
|
+
readonly name: string;
|
|
1480
|
+
supports(ecosystem: Ecosystem): boolean;
|
|
1481
|
+
analyze(context: AnalyzerRunContext): Promise<AnalyzerRunResult>;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
interface UsageContextEngineInput {
|
|
1485
|
+
projectPath: string;
|
|
1486
|
+
dependencies: Dependency[];
|
|
1487
|
+
vulnerabilities: Vulnerability[];
|
|
1488
|
+
numContextLines?: number;
|
|
1489
|
+
maxSnippetsPerPackage?: number;
|
|
1490
|
+
maxSnippetsTotal?: number;
|
|
1491
|
+
}
|
|
1492
|
+
declare class UsageContextEngine {
|
|
1493
|
+
private readonly analyzers;
|
|
1494
|
+
constructor(analyzers?: UsageContextAnalyzer[]);
|
|
1495
|
+
analyze(input: UsageContextEngineInput): Promise<UsageContextResult>;
|
|
1496
|
+
private addFindingsForPackage;
|
|
1497
|
+
private buildVulnerablePackages;
|
|
1498
|
+
private pickAnalyzer;
|
|
1499
|
+
private normalizePositiveInt;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
export { ApiKeyRequiredError, CargoScanner, type CiProvider, ComposerScanner, ConsoleReporter, CveAggregator, type CveCheckResult, CveSourceError, CycloneDxGenerator, DenoScanner, type Dependency, type Ecosystem, type GenerateSbomInput, type GenerateSbomResult, type GenerateSpdxSbomResult, type GenerateSwidTagResult, GoScanner, LockfileParseError, MavenScanner, NoLockfileError, NpmScanner, NugetScanner, OsvSource, PipScanner, PnpmScanner, RubyScanner, type Sbom, type SbomArtifacts, type SbomDependency, type SbomFormat, type SbomSource, type ScanResult, ScannerRegistry, type Severity, SpdxJsonGenerator, SwidTagGenerator, type UploadResult, type UsageContextEcosystemStatus, UsageContextEngine, type UsageContextError, type UsageContextLlmPayload, type UsageContextResult, type UsageContextStatus, type UsageContextVulnerabilityFinding, type UsageSnippet, type UsageSnippetMatchKind, VerimuApiClient, type VerimuConfig, VerimuError, type VerimuReport, type Vulnerability, type VulnerabilitySource, YarnScanner, detectSource, generateSbom, generateSbomArtifacts, generateSpdxSbom, generateSwidTag, printReport, scan, shouldFailCi, uploadToVerimu };
|
package/dist/index.d.ts
CHANGED
|
@@ -108,6 +108,108 @@ interface CveCheckResult {
|
|
|
108
108
|
/** Total time taken for all checks (ms) */
|
|
109
109
|
checkDurationMs: number;
|
|
110
110
|
}
|
|
111
|
+
/** How confidently a vulnerable package is used in source code */
|
|
112
|
+
type UsageContextStatus = 'direct_evidence' | 'indirect_no_evidence' | 'unsupported' | 'analysis_error';
|
|
113
|
+
/** Match categories for usage snippets */
|
|
114
|
+
type UsageSnippetMatchKind = 'import' | 'require' | 'dynamic_import' | 'export_from' | 'call';
|
|
115
|
+
/** A code snippet where a vulnerable package appears to be used */
|
|
116
|
+
interface UsageSnippet {
|
|
117
|
+
/** Project-relative path to the file */
|
|
118
|
+
filePath: string;
|
|
119
|
+
/** 1-based start line of the snippet in source file */
|
|
120
|
+
startLine: number;
|
|
121
|
+
/** 1-based end line of the snippet in source file */
|
|
122
|
+
endLine: number;
|
|
123
|
+
/** Snippet text including context lines */
|
|
124
|
+
code: string;
|
|
125
|
+
/** Kind of syntax match */
|
|
126
|
+
matchKind: UsageSnippetMatchKind;
|
|
127
|
+
/** Called symbol if this snippet is a call-site match */
|
|
128
|
+
calledSymbol?: string;
|
|
129
|
+
/** Confidence score in [0, 1] */
|
|
130
|
+
confidence: number;
|
|
131
|
+
}
|
|
132
|
+
/** Usage-context outcome for one vulnerability */
|
|
133
|
+
interface UsageContextVulnerabilityFinding {
|
|
134
|
+
/** Vulnerability identifier (CVE/GHSA/etc.) */
|
|
135
|
+
vulnerabilityId: string;
|
|
136
|
+
/** Package name that is vulnerable */
|
|
137
|
+
packageName: string;
|
|
138
|
+
/** Ecosystem the package belongs to */
|
|
139
|
+
ecosystem: Ecosystem;
|
|
140
|
+
/** Whether dependency scanner marked it as direct, if known */
|
|
141
|
+
directDependency: boolean | null;
|
|
142
|
+
/** Resolution status for this package usage */
|
|
143
|
+
status: UsageContextStatus;
|
|
144
|
+
/** Matched snippets for this vulnerable package */
|
|
145
|
+
snippets: UsageSnippet[];
|
|
146
|
+
/** Number of snippets in this finding */
|
|
147
|
+
evidenceCount: number;
|
|
148
|
+
/** Optional explanatory note */
|
|
149
|
+
notes?: string;
|
|
150
|
+
}
|
|
151
|
+
/** LLM-friendly usage context payload for one vulnerability */
|
|
152
|
+
interface UsageContextLlmPayload {
|
|
153
|
+
vulnerability: {
|
|
154
|
+
id: string;
|
|
155
|
+
aliases: string[];
|
|
156
|
+
severity: Severity;
|
|
157
|
+
summary: string;
|
|
158
|
+
affectedVersionRange?: string;
|
|
159
|
+
fixedVersion?: string;
|
|
160
|
+
referenceUrl?: string;
|
|
161
|
+
};
|
|
162
|
+
package: {
|
|
163
|
+
name: string;
|
|
164
|
+
ecosystem: Ecosystem;
|
|
165
|
+
directDependency: boolean | null;
|
|
166
|
+
};
|
|
167
|
+
status: UsageContextStatus;
|
|
168
|
+
evidenceCount: number;
|
|
169
|
+
snippets: UsageSnippet[];
|
|
170
|
+
notes?: string;
|
|
171
|
+
}
|
|
172
|
+
/** Analyzer-level status summary for one ecosystem */
|
|
173
|
+
interface UsageContextEcosystemStatus {
|
|
174
|
+
ecosystem: Ecosystem;
|
|
175
|
+
analyzer: string;
|
|
176
|
+
status: 'analyzed' | 'unsupported' | 'error';
|
|
177
|
+
vulnerablePackages: number;
|
|
178
|
+
snippetsFound: number;
|
|
179
|
+
note?: string;
|
|
180
|
+
}
|
|
181
|
+
/** Non-fatal usage-context analysis error */
|
|
182
|
+
interface UsageContextError {
|
|
183
|
+
analyzer: string;
|
|
184
|
+
ecosystem?: Ecosystem;
|
|
185
|
+
packageName?: string;
|
|
186
|
+
error: string;
|
|
187
|
+
}
|
|
188
|
+
/** Complete usage-context output for a scan */
|
|
189
|
+
interface UsageContextResult {
|
|
190
|
+
/** Whether usage analysis was executed */
|
|
191
|
+
triggered: boolean;
|
|
192
|
+
/** Scan duration in milliseconds */
|
|
193
|
+
durationMs: number;
|
|
194
|
+
/** Effective context lines setting (±N around each match) */
|
|
195
|
+
numContextLines: number;
|
|
196
|
+
/** Package-level snippet cap */
|
|
197
|
+
maxSnippetsPerPackage: number;
|
|
198
|
+
/** Global snippet cap */
|
|
199
|
+
maxSnippetsTotal: number;
|
|
200
|
+
/** Total snippets emitted */
|
|
201
|
+
totalSnippets: number;
|
|
202
|
+
/** Artifact path if written to disk */
|
|
203
|
+
artifactPath?: string;
|
|
204
|
+
/** Per-vulnerability findings */
|
|
205
|
+
packageFindings: UsageContextVulnerabilityFinding[];
|
|
206
|
+
/** Ecosystem-level analyzer status */
|
|
207
|
+
ecosystemStatus: UsageContextEcosystemStatus[];
|
|
208
|
+
/** Non-fatal analysis errors */
|
|
209
|
+
errors: UsageContextError[];
|
|
210
|
+
/** LLM-ready payload entries */
|
|
211
|
+
llmPayload: UsageContextLlmPayload[];
|
|
212
|
+
}
|
|
111
213
|
/** Complete output of a Verimu scan */
|
|
112
214
|
interface VerimuReport {
|
|
113
215
|
/** Project info */
|
|
@@ -122,6 +224,8 @@ interface VerimuReport {
|
|
|
122
224
|
artifacts?: SbomArtifacts;
|
|
123
225
|
/** CVE check results */
|
|
124
226
|
cveCheck: CveCheckResult;
|
|
227
|
+
/** Optional usage-context analysis for vulnerable packages */
|
|
228
|
+
usageContext?: UsageContextResult;
|
|
125
229
|
/** Overall summary */
|
|
126
230
|
summary: {
|
|
127
231
|
totalDependencies: number;
|
|
@@ -155,6 +259,8 @@ interface VerimuConfig {
|
|
|
155
259
|
apiBaseUrl?: string;
|
|
156
260
|
/** Skip CVE checking (just generate SBOM) */
|
|
157
261
|
skipCveCheck?: boolean;
|
|
262
|
+
/** Optional context lines around usage snippets (default: 4, clamped to 0..20) */
|
|
263
|
+
numContextLines?: number;
|
|
158
264
|
}
|
|
159
265
|
/** Input for the pure `generateSbom()` function */
|
|
160
266
|
interface GenerateSbomInput {
|
|
@@ -264,6 +370,23 @@ declare function generateSpdxSbom(input: GenerateSbomInput): GenerateSpdxSbomRes
|
|
|
264
370
|
*/
|
|
265
371
|
declare function generateSwidTag(input: GenerateSbomInput): GenerateSwidTagResult;
|
|
266
372
|
|
|
373
|
+
/**
|
|
374
|
+
* Source detection for SBOM scans.
|
|
375
|
+
*
|
|
376
|
+
* Determines the scan source with the following priority:
|
|
377
|
+
* 1. VERIMU_SOURCE environment variable (explicit override)
|
|
378
|
+
* 2. Auto-detect CI/CD environment
|
|
379
|
+
* 3. Default to "cli"
|
|
380
|
+
*/
|
|
381
|
+
type SbomSource = 'cli' | 'cicd';
|
|
382
|
+
/**
|
|
383
|
+
* Detects the scan source with priority:
|
|
384
|
+
* 1. VERIMU_SOURCE env var (explicit override)
|
|
385
|
+
* 2. Auto-detect CI/CD environment
|
|
386
|
+
* 3. Default to "cli"
|
|
387
|
+
*/
|
|
388
|
+
declare function detectSource(): SbomSource;
|
|
389
|
+
|
|
267
390
|
/**
|
|
268
391
|
* Verimu API client — communicates with the Verimu backend.
|
|
269
392
|
*
|
|
@@ -315,6 +438,11 @@ interface SbomUploadBundle {
|
|
|
315
438
|
cyclonedx: Record<string, unknown>;
|
|
316
439
|
spdx?: Record<string, unknown>;
|
|
317
440
|
swid?: string;
|
|
441
|
+
meta?: {
|
|
442
|
+
source?: SbomSource;
|
|
443
|
+
commit_sha?: string;
|
|
444
|
+
};
|
|
445
|
+
usage_context?: Omit<UsageContextResult, 'artifactPath'>;
|
|
318
446
|
}
|
|
319
447
|
declare class VerimuApiClient {
|
|
320
448
|
private readonly baseUrl;
|
|
@@ -1321,4 +1449,54 @@ declare class ConsoleReporter implements Reporter {
|
|
|
1321
1449
|
report(result: VerimuReport): string;
|
|
1322
1450
|
}
|
|
1323
1451
|
|
|
1324
|
-
|
|
1452
|
+
interface VulnerablePackageInput {
|
|
1453
|
+
packageName: string;
|
|
1454
|
+
ecosystem: Ecosystem;
|
|
1455
|
+
directDependency: boolean | null;
|
|
1456
|
+
vulnerabilities: Vulnerability[];
|
|
1457
|
+
}
|
|
1458
|
+
interface PackageAnalysisResult {
|
|
1459
|
+
packageName: string;
|
|
1460
|
+
ecosystem: Ecosystem;
|
|
1461
|
+
status: UsageContextStatus;
|
|
1462
|
+
snippets: UsageSnippet[];
|
|
1463
|
+
notes?: string;
|
|
1464
|
+
}
|
|
1465
|
+
interface AnalyzerRunContext {
|
|
1466
|
+
projectPath: string;
|
|
1467
|
+
ecosystem: Ecosystem;
|
|
1468
|
+
packages: VulnerablePackageInput[];
|
|
1469
|
+
numContextLines: number;
|
|
1470
|
+
maxSnippetsPerPackage: number;
|
|
1471
|
+
maxSnippetsTotal: number;
|
|
1472
|
+
}
|
|
1473
|
+
interface AnalyzerRunResult {
|
|
1474
|
+
packages: PackageAnalysisResult[];
|
|
1475
|
+
errors: UsageContextError[];
|
|
1476
|
+
snippetsProduced: number;
|
|
1477
|
+
}
|
|
1478
|
+
interface UsageContextAnalyzer {
|
|
1479
|
+
readonly name: string;
|
|
1480
|
+
supports(ecosystem: Ecosystem): boolean;
|
|
1481
|
+
analyze(context: AnalyzerRunContext): Promise<AnalyzerRunResult>;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
interface UsageContextEngineInput {
|
|
1485
|
+
projectPath: string;
|
|
1486
|
+
dependencies: Dependency[];
|
|
1487
|
+
vulnerabilities: Vulnerability[];
|
|
1488
|
+
numContextLines?: number;
|
|
1489
|
+
maxSnippetsPerPackage?: number;
|
|
1490
|
+
maxSnippetsTotal?: number;
|
|
1491
|
+
}
|
|
1492
|
+
declare class UsageContextEngine {
|
|
1493
|
+
private readonly analyzers;
|
|
1494
|
+
constructor(analyzers?: UsageContextAnalyzer[]);
|
|
1495
|
+
analyze(input: UsageContextEngineInput): Promise<UsageContextResult>;
|
|
1496
|
+
private addFindingsForPackage;
|
|
1497
|
+
private buildVulnerablePackages;
|
|
1498
|
+
private pickAnalyzer;
|
|
1499
|
+
private normalizePositiveInt;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
export { ApiKeyRequiredError, CargoScanner, type CiProvider, ComposerScanner, ConsoleReporter, CveAggregator, type CveCheckResult, CveSourceError, CycloneDxGenerator, DenoScanner, type Dependency, type Ecosystem, type GenerateSbomInput, type GenerateSbomResult, type GenerateSpdxSbomResult, type GenerateSwidTagResult, GoScanner, LockfileParseError, MavenScanner, NoLockfileError, NpmScanner, NugetScanner, OsvSource, PipScanner, PnpmScanner, RubyScanner, type Sbom, type SbomArtifacts, type SbomDependency, type SbomFormat, type SbomSource, type ScanResult, ScannerRegistry, type Severity, SpdxJsonGenerator, SwidTagGenerator, type UploadResult, type UsageContextEcosystemStatus, UsageContextEngine, type UsageContextError, type UsageContextLlmPayload, type UsageContextResult, type UsageContextStatus, type UsageContextVulnerabilityFinding, type UsageSnippet, type UsageSnippetMatchKind, VerimuApiClient, type VerimuConfig, VerimuError, type VerimuReport, type Vulnerability, type VulnerabilitySource, YarnScanner, detectSource, generateSbom, generateSbomArtifacts, generateSpdxSbom, generateSwidTag, printReport, scan, shouldFailCi, uploadToVerimu };
|