-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathvalidator-plugin.ts
More file actions
40 lines (35 loc) · 1.13 KB
/
validator-plugin.ts
File metadata and controls
40 lines (35 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import type { AgentRunner } from "../agents/agent-runner";
import type { ArtifactStore } from "../artifacts/artifact-store";
import type { ScanRunState, ValidationJob, ValidationResult } from "../domain";
import type { RunEventEmitter } from "../pipeline/events";
export interface ValidatorCapability {
kind: "web" | "ios" | "api" | "container" | "desktop";
label: string;
}
export interface ValidatorMatchContext {
runState: ScanRunState;
findingId: string;
}
export interface ValidatorMatchResult {
supported: boolean;
reason: string;
}
export interface PreparedEnvironment {
id: string;
metadata: Record<string, unknown>;
}
export interface ValidatorPlugin {
id: string;
label: string;
capabilities: ValidatorCapability[];
canValidate(context: ValidatorMatchContext): Promise<ValidatorMatchResult>;
prepare(job: ValidationJob): Promise<PreparedEnvironment>;
run(input: {
job: ValidationJob;
environment: PreparedEnvironment;
agentRunner: AgentRunner;
artifactStore: ArtifactStore;
emit: RunEventEmitter;
}): Promise<ValidationResult>;
cleanup(environment: PreparedEnvironment): Promise<void>;
}