opencode-codex-security 0.0.0-stage → 0.1.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/CONTRIBUTING.md +15 -0
- package/DISCLOSURE +19 -0
- package/LICENSE +202 -0
- package/README.md +103 -2
- package/SECURITY.md +22 -0
- package/dist/gui-experimental.cjs +17 -0
- package/docs/GLOBAL-CONFIG.md +64 -0
- package/docs/MULTI-SCAN.md +62 -0
- package/docs/PUBLISHING.md +71 -0
- package/docs/RELEASING.md +53 -0
- package/docs/SDK.md +36 -0
- package/fixtures/vulnerable/docs/ARCHITECTURE.md +2 -0
- package/fixtures/vulnerable/src/accounts.js +4 -0
- package/fixtures/vulnerable/src/diagnostics.js +5 -0
- package/fixtures/vulnerable/src/download.js +5 -0
- package/fixtures/vulnerable/src/profile.js +4 -0
- package/package.json +79 -4
- package/src/core/codex-adapter.ts +430 -0
- package/src/core/credential-guard.ts +83 -0
- package/src/core/planned-scan.ts +316 -0
- package/src/core/report-safety.ts +41 -0
- package/src/core/result-summary.ts +512 -0
- package/src/core/run-history.ts +107 -0
- package/src/core/run-telemetry.ts +359 -0
- package/src/core/scan-plan.ts +182 -0
- package/src/core/scan-service.mjs +129 -0
- package/src/core/scanner.mjs +129 -0
- package/src/core/sdk-settings.ts +123 -0
- package/src/core/security-operations.ts +598 -0
- package/src/gui.tsx +102 -0
- package/src/operation-tools.ts +247 -0
- package/src/plan-view.ts +47 -0
- package/src/plugin.ts +346 -0
- package/src/rpc.ts +124 -0
- package/src/scan-display.ts +284 -0
- package/src/security-operations-panel.tsx +551 -0
- package/src/security-panel.tsx +1003 -0
- package/src/security-styles.ts +10 -0
- package/src/security-tui-operations.tsx +343 -0
- package/src/state-order.ts +21 -0
- package/src/tui.tsx +630 -0
- package/src/types.ts +84 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ScanTelemetry } from './core/run-telemetry';
|
|
2
|
+
import type { ScanOutcomeSummary } from './core/result-summary';
|
|
3
|
+
import type { ScanPlan } from './core/scan-plan';
|
|
4
|
+
export interface Finding {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
severity: 'critical' | 'high' | 'medium' | 'low';
|
|
8
|
+
path: string;
|
|
9
|
+
line: number;
|
|
10
|
+
cwe: string;
|
|
11
|
+
summary: string;
|
|
12
|
+
evidence: string;
|
|
13
|
+
remediation: string;
|
|
14
|
+
confidence: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ScanState {
|
|
17
|
+
telemetry?: ScanTelemetry;
|
|
18
|
+
assessment?: ScanOutcomeSummary;
|
|
19
|
+
runId?: string;
|
|
20
|
+
mode?: 'standard' | 'deep';
|
|
21
|
+
model?: string;
|
|
22
|
+
estimatedCostUsd?: number;
|
|
23
|
+
updatedAt?: string;
|
|
24
|
+
archived?: boolean;
|
|
25
|
+
workers?: { phase: string; planned: number; started: number };
|
|
26
|
+
deepProgress?: { completed: number; active: number; maximum: number; consolidating?: boolean };
|
|
27
|
+
plan?: ScanPlan;
|
|
28
|
+
planConsumed?: boolean;
|
|
29
|
+
instanceId: string;
|
|
30
|
+
status: 'idle' | 'running' | 'completed' | 'cancelled' | 'error';
|
|
31
|
+
scanId: string | null;
|
|
32
|
+
phase: string;
|
|
33
|
+
progress: { done: number; total: number; unit?: 'files' | 'reviews' };
|
|
34
|
+
findings: Finding[];
|
|
35
|
+
events: { time: string; message: string }[];
|
|
36
|
+
error: string | null;
|
|
37
|
+
startedAt: string | null;
|
|
38
|
+
finishedAt: string | null;
|
|
39
|
+
repository: string;
|
|
40
|
+
engine: string;
|
|
41
|
+
skipped: number;
|
|
42
|
+
revision: number;
|
|
43
|
+
}
|
|
44
|
+
export function asState(value: unknown): ScanState {
|
|
45
|
+
if (
|
|
46
|
+
!value ||
|
|
47
|
+
typeof value !== 'object' ||
|
|
48
|
+
!('status' in value) ||
|
|
49
|
+
!('findings' in value) ||
|
|
50
|
+
!Array.isArray(value.findings)
|
|
51
|
+
)
|
|
52
|
+
throw new Error('Invalid security state');
|
|
53
|
+
return value as ScanState;
|
|
54
|
+
}
|
|
55
|
+
export function emptyState(): ScanState {
|
|
56
|
+
return {
|
|
57
|
+
instanceId: '',
|
|
58
|
+
status: 'idle',
|
|
59
|
+
scanId: null,
|
|
60
|
+
phase: 'Ready',
|
|
61
|
+
progress: { done: 0, total: 0 },
|
|
62
|
+
findings: [],
|
|
63
|
+
events: [],
|
|
64
|
+
error: null,
|
|
65
|
+
startedAt: null,
|
|
66
|
+
finishedAt: null,
|
|
67
|
+
repository: 'vulnerable (synthetic fixture)',
|
|
68
|
+
engine: 'local-patterns (prototype)',
|
|
69
|
+
skipped: 0,
|
|
70
|
+
revision: 0,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface ScanList {
|
|
75
|
+
engine: string;
|
|
76
|
+
instanceId: string;
|
|
77
|
+
revision: number;
|
|
78
|
+
runs: ScanState[];
|
|
79
|
+
drafts: ScanState[];
|
|
80
|
+
preview?: ScanState;
|
|
81
|
+
maxConcurrent: number;
|
|
82
|
+
historyLimit: number;
|
|
83
|
+
historyError?: string;
|
|
84
|
+
}
|