@oh-my-pi/pi-coding-agent 17.2.0 → 17.2.1
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/CHANGELOG.md +18 -0
- package/dist/{CHANGELOG-be1f2t8h.md → CHANGELOG-dj46zzrm.md} +18 -0
- package/dist/cli.js +3340 -3195
- package/dist/types/config/model-discovery.d.ts +12 -0
- package/dist/types/config/settings-schema.d.ts +10 -0
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +23 -0
- package/dist/types/internal-urls/index.d.ts +1 -0
- package/dist/types/internal-urls/security-protocol.d.ts +15 -0
- package/dist/types/internal-urls/types.d.ts +1 -1
- package/dist/types/sdk.d.ts +17 -0
- package/dist/types/security/auth.d.ts +30 -0
- package/dist/types/security/cloud.d.ts +79 -0
- package/dist/types/security/comparison.d.ts +49 -0
- package/dist/types/security/contracts/ids.d.ts +15 -0
- package/dist/types/security/contracts/index.d.ts +4 -0
- package/dist/types/security/contracts/schemas.d.ts +660 -0
- package/dist/types/security/contracts/types.d.ts +234 -0
- package/dist/types/security/contracts/validation.d.ts +5 -0
- package/dist/types/security/coordinator.d.ts +100 -0
- package/dist/types/security/importers/codex-security.d.ts +7 -0
- package/dist/types/security/importers/index.d.ts +2 -0
- package/dist/types/security/importers/sarif.d.ts +9 -0
- package/dist/types/security/index.d.ts +13 -0
- package/dist/types/security/preflight.d.ts +61 -0
- package/dist/types/security/provenance.d.ts +24 -0
- package/dist/types/security/publication.d.ts +78 -0
- package/dist/types/security/remediation.d.ts +27 -0
- package/dist/types/security/resource-output.d.ts +8 -0
- package/dist/types/security/sarif.d.ts +2 -0
- package/dist/types/security/store.d.ts +40 -0
- package/dist/types/slash-commands/helpers/security.d.ts +2 -0
- package/dist/types/system-prompt.d.ts +2 -0
- package/dist/types/task/executor.d.ts +3 -0
- package/dist/types/tools/builtin-names.d.ts +1 -1
- package/dist/types/tools/index.d.ts +6 -1
- package/dist/types/tools/security-scan.d.ts +96 -0
- package/package.json +12 -12
- package/scripts/security-compare.ts +40 -0
- package/src/config/model-discovery.ts +32 -5
- package/src/config/model-registry.ts +4 -0
- package/src/config/settings-schema.ts +12 -0
- package/src/eval/py/prelude.py +7 -3
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +53 -0
- package/src/internal-urls/index.ts +1 -0
- package/src/internal-urls/router.ts +4 -1
- package/src/internal-urls/security-protocol.ts +261 -0
- package/src/internal-urls/types.ts +1 -1
- package/src/lsp/index.ts +3 -0
- package/src/modes/rpc/host-uris.ts +6 -0
- package/src/prompts/agents/security-reviewer.md +75 -0
- package/src/prompts/security/scan-coordinator.md +7 -0
- package/src/prompts/security/scan-request.md +21 -0
- package/src/prompts/security/validate-request.md +8 -0
- package/src/prompts/system/system-prompt.md +3 -0
- package/src/prompts/tools/security-publish.md +1 -0
- package/src/prompts/tools/security-scan.md +1 -0
- package/src/sdk.ts +34 -6
- package/src/security/auth.ts +98 -0
- package/src/security/cloud.ts +686 -0
- package/src/security/comparison.ts +255 -0
- package/src/security/contracts/ids.ts +111 -0
- package/src/security/contracts/index.ts +4 -0
- package/src/security/contracts/schemas.ts +201 -0
- package/src/security/contracts/types.ts +254 -0
- package/src/security/contracts/validation.ts +65 -0
- package/src/security/coordinator.ts +708 -0
- package/src/security/importers/codex-security.ts +387 -0
- package/src/security/importers/index.ts +2 -0
- package/src/security/importers/sarif.ts +357 -0
- package/src/security/index.ts +13 -0
- package/src/security/preflight.ts +405 -0
- package/src/security/provenance.ts +106 -0
- package/src/security/publication.ts +326 -0
- package/src/security/remediation.ts +93 -0
- package/src/security/resource-output.ts +50 -0
- package/src/security/sarif.ts +78 -0
- package/src/security/store.ts +430 -0
- package/src/slash-commands/builtin-registry.ts +21 -0
- package/src/slash-commands/helpers/security.ts +451 -0
- package/src/system-prompt.ts +4 -0
- package/src/task/agents.ts +2 -0
- package/src/task/executor.ts +3 -0
- package/src/task/structured-subagent.ts +6 -4
- package/src/tools/builtin-names.ts +1 -0
- package/src/tools/index.ts +9 -1
- package/src/tools/path-utils.ts +3 -0
- package/src/tools/security-scan.ts +287 -0
|
@@ -11,6 +11,18 @@ import type { ModelSpec } from "@oh-my-pi/pi-catalog/types";
|
|
|
11
11
|
import type { ProviderDiscovery } from "./models-config-schema.js";
|
|
12
12
|
export declare const DISCOVERY_DEFAULT_CONTEXT_WINDOW = 128000;
|
|
13
13
|
export declare const DISCOVERY_DEFAULT_MAX_TOKENS = 32768;
|
|
14
|
+
/**
|
|
15
|
+
* Pick a discovery-probe timeout for a local-engine base URL.
|
|
16
|
+
*
|
|
17
|
+
* The implicit `127.0.0.1` default probe keeps a tight `loopbackMs` cap so a
|
|
18
|
+
* busy or foreign service on the default port never stalls startup. But that
|
|
19
|
+
* cap is far too short for a host reached over the network: a user who points
|
|
20
|
+
* `LLAMA_CPP_BASE_URL` / `OLLAMA_BASE_URL` / `OLLAMA_HOST` at a remote or LAN
|
|
21
|
+
* machine has real round-trip latency, and a 250ms cap made that server look
|
|
22
|
+
* empty (issue #7087). Anything that is not strictly loopback therefore gets
|
|
23
|
+
* {@link REMOTE_DISCOVERY_TIMEOUT_MS}.
|
|
24
|
+
*/
|
|
25
|
+
export declare function discoveryProbeTimeoutMs(baseUrl: string, loopbackMs: number): number;
|
|
14
26
|
export declare function getImplicitOllamaBaseUrl(): string;
|
|
15
27
|
export declare function getOllamaContextLengthOverride(): number | undefined;
|
|
16
28
|
/** Routes discovered-model `maxTokens` defaults around Anthropic's 3× output divisor. */
|
|
@@ -4151,6 +4151,16 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4151
4151
|
readonly description: "Enable the web_search tool for live web results";
|
|
4152
4152
|
};
|
|
4153
4153
|
};
|
|
4154
|
+
readonly "security.enabled": {
|
|
4155
|
+
readonly type: "boolean";
|
|
4156
|
+
readonly default: false;
|
|
4157
|
+
readonly ui: {
|
|
4158
|
+
readonly tab: "tools";
|
|
4159
|
+
readonly group: "Available Tools";
|
|
4160
|
+
readonly label: "Security";
|
|
4161
|
+
readonly description: "Enable OMP-native security scan planning, execution, and the read-only security:// resource namespace";
|
|
4162
|
+
};
|
|
4163
|
+
};
|
|
4154
4164
|
readonly "ask.enabled": {
|
|
4155
4165
|
readonly type: "boolean";
|
|
4156
4166
|
readonly default: true;
|
|
@@ -77,6 +77,21 @@ export interface LsOperations {
|
|
|
77
77
|
export interface LsToolOptions {
|
|
78
78
|
operations?: LsOperations;
|
|
79
79
|
}
|
|
80
|
+
export interface EditOperations {
|
|
81
|
+
readFile: (absolutePath: string) => Promise<Buffer>;
|
|
82
|
+
writeFile: (absolutePath: string, content: string) => Promise<void>;
|
|
83
|
+
access: (absolutePath: string) => Promise<void>;
|
|
84
|
+
}
|
|
85
|
+
export interface EditToolOptions {
|
|
86
|
+
operations?: EditOperations;
|
|
87
|
+
}
|
|
88
|
+
export interface WriteOperations {
|
|
89
|
+
writeFile: (absolutePath: string, content: string) => Promise<void>;
|
|
90
|
+
mkdir: (dir: string) => Promise<void>;
|
|
91
|
+
}
|
|
92
|
+
export interface WriteToolOptions {
|
|
93
|
+
operations?: WriteOperations;
|
|
94
|
+
}
|
|
80
95
|
/** Format the active shortcut for legacy extensions that render keybinding hints. */
|
|
81
96
|
export declare function keyText(action: Keybinding): string;
|
|
82
97
|
/** Parse frontmatter using the historical Pi package-root helper. */
|
|
@@ -110,6 +125,14 @@ export declare function createFindTool(cwd: string, options?: FindToolOptions):
|
|
|
110
125
|
export declare function createLsToolDefinition(cwd: string, options?: LsToolOptions): ToolDefinition;
|
|
111
126
|
/** Create the legacy ls tool. */
|
|
112
127
|
export declare function createLsTool(cwd: string, options?: LsToolOptions): ToolDefinition;
|
|
128
|
+
/** Create the legacy edit tool definition. */
|
|
129
|
+
export declare function createEditToolDefinition(cwd: string, options?: EditToolOptions): ToolDefinition;
|
|
130
|
+
/** Create the legacy edit tool. */
|
|
131
|
+
export declare function createEditTool(cwd: string, options?: EditToolOptions): ToolDefinition;
|
|
132
|
+
/** Create the legacy write tool definition. */
|
|
133
|
+
export declare function createWriteToolDefinition(cwd: string, options?: WriteToolOptions): ToolDefinition;
|
|
134
|
+
/** Create the legacy write tool. */
|
|
135
|
+
export declare function createWriteTool(cwd: string, options?: WriteToolOptions): ToolDefinition;
|
|
113
136
|
/** Create legacy read, bash, edit, and write tools. */
|
|
114
137
|
export declare function createCodingTools(cwd: string): ToolDefinition[];
|
|
115
138
|
/** Create legacy read, grep, find, and ls tools. */
|
|
@@ -19,6 +19,7 @@ export * from "./omp-protocol.js";
|
|
|
19
19
|
export * from "./parse.js";
|
|
20
20
|
export * from "./router.js";
|
|
21
21
|
export * from "./rule-protocol.js";
|
|
22
|
+
export * from "./security-protocol.js";
|
|
22
23
|
export * from "./skill-protocol.js";
|
|
23
24
|
export * from "./ssh-protocol.js";
|
|
24
25
|
export type * from "./types.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SecurityStore } from "../security/store.js";
|
|
2
|
+
import type { InternalResource, InternalUrl, ProtocolHandler, ResolveContext, UrlCompletion } from "./types.js";
|
|
3
|
+
export type SecurityStoreResolver = (cwd: string, signal?: AbortSignal) => Promise<SecurityStore>;
|
|
4
|
+
export declare function isSecurityEnabled(): boolean;
|
|
5
|
+
export declare class SecurityDisabledError extends Error {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
export declare class SecurityProtocolHandler implements ProtocolHandler {
|
|
9
|
+
#private;
|
|
10
|
+
readonly scheme = "security";
|
|
11
|
+
readonly immutable = true;
|
|
12
|
+
constructor(resolveStore?: SecurityStoreResolver, enabled?: () => boolean);
|
|
13
|
+
resolve(url: InternalUrl, context?: ResolveContext): Promise<InternalResource>;
|
|
14
|
+
complete(query?: string, context?: ResolveContext): Promise<UrlCompletion[]>;
|
|
15
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types for the internal URL routing system.
|
|
3
3
|
*
|
|
4
|
-
* Internal URLs (`agent://`, `artifact://`, `history://`, `issue://`, `local://`, `mcp://`, `memory://`, `omp://`, `pr://`, `rule://`, `skill://`, `ssh://`, `vault://`, and `xd://`) are resolved by tools like read,
|
|
4
|
+
* Internal URLs (`agent://`, `artifact://`, `history://`, `issue://`, `local://`, `mcp://`, `memory://`, `omp://`, `pr://`, `rule://`, `security://`, `skill://`, `ssh://`, `vault://`, and `xd://`) are resolved by tools like read,
|
|
5
5
|
* providing access to agent outputs and server resources without exposing filesystem paths.
|
|
6
6
|
*/
|
|
7
7
|
import type { Skill } from "../extensibility/skills.js";
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -39,6 +39,13 @@ export interface CreateAgentSessionOptions {
|
|
|
39
39
|
authStorage?: AuthStorage;
|
|
40
40
|
/** Model registry. Default: discoverModels(authStorage, agentDir) */
|
|
41
41
|
modelRegistry?: ModelRegistry;
|
|
42
|
+
/**
|
|
43
|
+
* Request credential resolver. Defaults to the model registry's normal
|
|
44
|
+
* session-affine resolver. Security scans use this narrow seam to keep one
|
|
45
|
+
* durable OAuth row pinned for the operation without changing ordinary
|
|
46
|
+
* provider routing.
|
|
47
|
+
*/
|
|
48
|
+
getApiKey?: AgentOptions["getApiKey"];
|
|
42
49
|
/** Model to use. Default: from settings, else first available */
|
|
43
50
|
model?: Model;
|
|
44
51
|
/** Raw model pattern(s) (e.g. from --model CLI flag) to resolve after extensions load.
|
|
@@ -158,6 +165,8 @@ export interface CreateAgentSessionOptions {
|
|
|
158
165
|
mcpManager?: MCPManager;
|
|
159
166
|
/** Enable LSP integration (tool, formatting, diagnostics, warmup). Default: true */
|
|
160
167
|
enableLsp?: boolean;
|
|
168
|
+
/** Restrict LSP to navigation and diagnostics even when enabled. Defaults to true for restricted sessions. */
|
|
169
|
+
lspReadOnly?: boolean;
|
|
161
170
|
/** Whether this invocation may expose IRC. `false` removes it even for subagents. */
|
|
162
171
|
enableIrc?: boolean;
|
|
163
172
|
/** Skip subprocess-kernel availability checks and prelude warmup */
|
|
@@ -166,6 +175,12 @@ export interface CreateAgentSessionOptions {
|
|
|
166
175
|
toolNames?: string[];
|
|
167
176
|
/** Limit the session to explicitly supplied tool names, without discovered extras. */
|
|
168
177
|
restrictToolNames?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Permit only caller-supplied SDK custom tools inside a restricted session.
|
|
180
|
+
* They must still be named in {@link toolNames}; discovered extensions, MCP,
|
|
181
|
+
* and ambient custom tools remain disabled. Default: false.
|
|
182
|
+
*/
|
|
183
|
+
allowRestrictedCustomTools?: boolean;
|
|
169
184
|
/** Output schema for structured completion (subagents). */
|
|
170
185
|
outputSchema?: unknown;
|
|
171
186
|
/** Enforcement policy for {@link outputSchema}; defaults to legacy permissive behavior. */
|
|
@@ -368,6 +383,8 @@ export interface BuildSystemPromptOptions {
|
|
|
368
383
|
appendPrompt?: string;
|
|
369
384
|
inlineToolDescriptors?: boolean;
|
|
370
385
|
includeWorkspaceTree?: boolean;
|
|
386
|
+
/** Include the read-only security:// resource inventory entry. Default: false. */
|
|
387
|
+
securityEnabled?: boolean;
|
|
371
388
|
}
|
|
372
389
|
/**
|
|
373
390
|
* Build the default provider-facing system prompt blocks.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AgentOptions } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { OAuthAccessResolution } from "@oh-my-pi/pi-ai";
|
|
3
|
+
import type { AuthStorage } from "../session/auth-storage.js";
|
|
4
|
+
import type { SecurityAccountRef } from "./contracts/index.js";
|
|
5
|
+
export interface ExactSecurityOAuthOptions {
|
|
6
|
+
authStorage: AuthStorage;
|
|
7
|
+
account: SecurityAccountRef;
|
|
8
|
+
}
|
|
9
|
+
export declare function assertSecurityIdentityMatches(account: SecurityAccountRef, resolution: {
|
|
10
|
+
credentialId?: number;
|
|
11
|
+
accountId?: string;
|
|
12
|
+
email?: string;
|
|
13
|
+
orgId?: string;
|
|
14
|
+
orgName?: string;
|
|
15
|
+
}): void;
|
|
16
|
+
export declare function selectSecurityAccount(authStorage: AuthStorage, provider: string, requestedCredentialId?: number, sessionId?: string): SecurityAccountRef;
|
|
17
|
+
export declare function resolveExactSecurityOAuthAccess(authStorage: AuthStorage, account: SecurityAccountRef, options: {
|
|
18
|
+
forceRefresh: boolean;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
}): Promise<Extract<OAuthAccessResolution, {
|
|
21
|
+
ok: true;
|
|
22
|
+
}>>;
|
|
23
|
+
/**
|
|
24
|
+
* Build a request credential resolver pinned to one durable OAuth row.
|
|
25
|
+
*
|
|
26
|
+
* Initial resolution and refresh both target the same row. The auth driver's
|
|
27
|
+
* final sibling-rotation step returns `undefined`, so an unavailable account
|
|
28
|
+
* fails the scan rather than crossing an account/workspace boundary.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createExactSecurityOAuthResolver(options: ExactSecurityOAuthOptions): NonNullable<AgentOptions["getApiKey"]>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { AuthStorage } from "../session/auth-storage.js";
|
|
2
|
+
import { type SecurityAccountRef, type SecurityScanBundle, type SecuritySeverityLevel } from "./contracts/index.js";
|
|
3
|
+
import type { SecurityStore } from "./store.js";
|
|
4
|
+
type JsonObject = Record<string, unknown>;
|
|
5
|
+
export type CodexSecurityCloudFetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
6
|
+
export interface CodexSecurityCloudClientOptions {
|
|
7
|
+
authStorage: AuthStorage;
|
|
8
|
+
account: SecurityAccountRef;
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
fetch?: CodexSecurityCloudFetch;
|
|
11
|
+
}
|
|
12
|
+
export interface CodexSecurityCloudConfiguration {
|
|
13
|
+
id: string;
|
|
14
|
+
sourceId?: string;
|
|
15
|
+
repositoryId: string;
|
|
16
|
+
repositoryUrl: string;
|
|
17
|
+
environmentId: string;
|
|
18
|
+
state?: string;
|
|
19
|
+
currentStep?: string;
|
|
20
|
+
scanType?: string;
|
|
21
|
+
remainingScans?: number;
|
|
22
|
+
totalScans?: number;
|
|
23
|
+
createdAt?: string;
|
|
24
|
+
updatedAt?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CodexSecurityCloudConfigurationPage {
|
|
27
|
+
items: CodexSecurityCloudConfiguration[];
|
|
28
|
+
nextCursor?: string;
|
|
29
|
+
totalInAccount?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface StartCodexSecurityCloudScanInput {
|
|
32
|
+
repositoryId: string;
|
|
33
|
+
repositoryUrl: string;
|
|
34
|
+
environmentId: string;
|
|
35
|
+
lookbackDays?: number | "all";
|
|
36
|
+
maintainerAttackConcerns?: string;
|
|
37
|
+
maintainerFocusAreas?: string;
|
|
38
|
+
maintainerAdditionalContext?: string;
|
|
39
|
+
signal?: AbortSignal;
|
|
40
|
+
}
|
|
41
|
+
export interface CodexSecurityCloudStats {
|
|
42
|
+
configurationId: string;
|
|
43
|
+
sourceConfigurationId?: string;
|
|
44
|
+
currentStep?: string;
|
|
45
|
+
pendingCommits: number;
|
|
46
|
+
finishedCommits: number;
|
|
47
|
+
failedCommits: number;
|
|
48
|
+
findingCounts: Record<SecuritySeverityLevel, number>;
|
|
49
|
+
lastScannedCommit?: string;
|
|
50
|
+
lastScannedAt?: string;
|
|
51
|
+
updatedAt?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface PullCodexSecurityCloudResultsInput {
|
|
54
|
+
client: CodexSecurityCloudClient;
|
|
55
|
+
configurationId: string;
|
|
56
|
+
store: SecurityStore;
|
|
57
|
+
signal?: AbortSignal;
|
|
58
|
+
}
|
|
59
|
+
export declare class CodexSecurityCloudHttpError extends Error {
|
|
60
|
+
readonly status: number;
|
|
61
|
+
readonly endpoint: string;
|
|
62
|
+
constructor(status: number, endpoint: string);
|
|
63
|
+
}
|
|
64
|
+
export declare class CodexSecurityCloudClient {
|
|
65
|
+
#private;
|
|
66
|
+
constructor(options: CodexSecurityCloudClientOptions);
|
|
67
|
+
listConfigurations(options?: {
|
|
68
|
+
limit?: number;
|
|
69
|
+
cursor?: string;
|
|
70
|
+
signal?: AbortSignal;
|
|
71
|
+
}): Promise<CodexSecurityCloudConfigurationPage>;
|
|
72
|
+
listAllConfigurations(signal?: AbortSignal): Promise<CodexSecurityCloudConfiguration[]>;
|
|
73
|
+
getConfiguration(configurationId: string, signal?: AbortSignal): Promise<CodexSecurityCloudConfiguration>;
|
|
74
|
+
startScan(input: StartCodexSecurityCloudScanInput): Promise<CodexSecurityCloudConfiguration>;
|
|
75
|
+
getStats(configurationId: string, signal?: AbortSignal): Promise<CodexSecurityCloudStats>;
|
|
76
|
+
listFindingDetails(repositoryUrl: string, configuration: CodexSecurityCloudConfiguration, signal?: AbortSignal): Promise<JsonObject[]>;
|
|
77
|
+
}
|
|
78
|
+
export declare function pullCodexSecurityCloudResults(input: PullCodexSecurityCloudResultsInput): Promise<SecurityScanBundle>;
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { SecurityComparisonReport, SecurityFinding, SecurityScanBundle } from "./contracts/index.js";
|
|
2
|
+
export interface SecurityDifferentialFindingMatch {
|
|
3
|
+
referenceFindingId: string;
|
|
4
|
+
candidateFindingId: string;
|
|
5
|
+
basis: "fingerprint" | "rule_location" | "taxonomy_location";
|
|
6
|
+
}
|
|
7
|
+
export interface SecurityDifferentialFindingSummary {
|
|
8
|
+
findingId: string;
|
|
9
|
+
ruleId: string;
|
|
10
|
+
title: string;
|
|
11
|
+
severity: SecurityFinding["severity"]["level"];
|
|
12
|
+
confidence: SecurityFinding["confidence"]["level"];
|
|
13
|
+
validationStatus: SecurityFinding["validation"]["status"];
|
|
14
|
+
dispositionStatus: SecurityFinding["disposition"]["status"];
|
|
15
|
+
primaryLocation?: {
|
|
16
|
+
path: string;
|
|
17
|
+
startLine: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface SecurityDifferentialScanSummary {
|
|
21
|
+
scanId: string;
|
|
22
|
+
producer: SecurityScanBundle["scan"]["producer"];
|
|
23
|
+
status: SecurityScanBundle["scan"]["status"];
|
|
24
|
+
findingCount: number;
|
|
25
|
+
actionableFindingCount: number;
|
|
26
|
+
validatedFindingCount: number;
|
|
27
|
+
rejectedFindingCount: number;
|
|
28
|
+
coverage: SecurityScanBundle["scan"]["coverage"];
|
|
29
|
+
metrics?: SecurityScanBundle["scan"]["metrics"];
|
|
30
|
+
}
|
|
31
|
+
export interface SecurityDifferentialReport {
|
|
32
|
+
referenceScanId: string;
|
|
33
|
+
candidateScanId: string;
|
|
34
|
+
matches: SecurityDifferentialFindingMatch[];
|
|
35
|
+
referenceOnlyFindingIds: string[];
|
|
36
|
+
candidateOnlyFindingIds: string[];
|
|
37
|
+
reference: SecurityDifferentialScanSummary;
|
|
38
|
+
candidate: SecurityDifferentialScanSummary;
|
|
39
|
+
referenceOnlyFindings: SecurityDifferentialFindingSummary[];
|
|
40
|
+
candidateOnlyFindings: SecurityDifferentialFindingSummary[];
|
|
41
|
+
referenceFindingCount: number;
|
|
42
|
+
candidateFindingCount: number;
|
|
43
|
+
matchedFindingCount: number;
|
|
44
|
+
recallAgainstReference: number;
|
|
45
|
+
precisionAgainstReference: number;
|
|
46
|
+
jaccardOverlap: number;
|
|
47
|
+
}
|
|
48
|
+
export declare function compareSecurityProducers(reference: SecurityScanBundle, candidate: SecurityScanBundle): SecurityDifferentialReport;
|
|
49
|
+
export declare function compareSecurityLineage(before: SecurityScanBundle, after: SecurityScanBundle): SecurityComparisonReport;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SecurityLocation } from "./types.js";
|
|
2
|
+
export declare function canonicalSecurityJson(value: unknown): string;
|
|
3
|
+
export interface SecurityFindingFingerprintInput {
|
|
4
|
+
ruleId: string;
|
|
5
|
+
category: string;
|
|
6
|
+
anchor?: string;
|
|
7
|
+
locations: readonly SecurityLocation[];
|
|
8
|
+
}
|
|
9
|
+
export declare function createSecurityFindingFingerprint(input: SecurityFindingFingerprintInput): string;
|
|
10
|
+
export declare function createSecurityFindingId(fingerprint: string): string;
|
|
11
|
+
export declare function createSecurityOccurrenceId(fingerprint: string, locations: readonly SecurityLocation[]): string;
|
|
12
|
+
export declare function createSecurityEvidenceId(fingerprint: string, label: string, ordinal: number): string;
|
|
13
|
+
export declare function createSecurityScanId(randomUuid?: () => string): string;
|
|
14
|
+
export declare function createSecurityPlanId(fingerprint: string): string;
|
|
15
|
+
export declare function encodeSecurityProjectKey(repositoryRoot: string): string;
|