@aigrc/core 0.1.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/dist/index.d.mts +226 -0
- package/dist/index.d.ts +226 -0
- package/dist/index.js +2337 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2264 -0
- package/dist/index.mjs.map +1 -0
- package/dist/schemas/index.d.mts +2332 -0
- package/dist/schemas/index.d.ts +2332 -0
- package/dist/schemas/index.js +213 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/index.mjs +176 -0
- package/dist/schemas/index.mjs.map +1 -0
- package/package.json +69 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { RiskFactors, Trustworthiness, AssetCard, JurisdictionClassification, Intent, Technical } from './schemas/index.mjs';
|
|
2
|
+
export { ApprovalSchema, AssetCardSchema, Classification, ClassificationSchema, Constraints, ConstraintsSchema, ControlStatus, ControlStatusSchema, Governance, GovernanceSchema, IntentSchema, JurisdictionClassificationSchema, Owner, OwnerSchema, RiskFactorsSchema, TechnicalSchema, TrustworthinessCharacteristic, TrustworthinessCharacteristicSchema, TrustworthinessSchema } from './schemas/index.mjs';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
type RiskLevel = "minimal" | "limited" | "high" | "unacceptable";
|
|
6
|
+
interface ClassificationResult {
|
|
7
|
+
riskLevel: RiskLevel;
|
|
8
|
+
reasons: string[];
|
|
9
|
+
euAiActCategory: string;
|
|
10
|
+
requiredArtifacts: string[];
|
|
11
|
+
}
|
|
12
|
+
declare function classifyRisk(factors: RiskFactors): ClassificationResult;
|
|
13
|
+
declare function validateRiskFactors(factors: RiskFactors): boolean;
|
|
14
|
+
|
|
15
|
+
interface CreateAssetCardOptions {
|
|
16
|
+
name: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
owner: {
|
|
19
|
+
name: string;
|
|
20
|
+
email: string;
|
|
21
|
+
team?: string;
|
|
22
|
+
};
|
|
23
|
+
technical: {
|
|
24
|
+
type: "model" | "agent" | "api_client" | "framework" | "pipeline";
|
|
25
|
+
framework?: string;
|
|
26
|
+
frameworkVersion?: string;
|
|
27
|
+
};
|
|
28
|
+
riskFactors?: {
|
|
29
|
+
autonomousDecisions?: boolean;
|
|
30
|
+
customerFacing?: boolean;
|
|
31
|
+
toolExecution?: boolean;
|
|
32
|
+
externalDataAccess?: boolean;
|
|
33
|
+
piiProcessing?: "yes" | "no" | "unknown";
|
|
34
|
+
highStakesDecisions?: boolean;
|
|
35
|
+
};
|
|
36
|
+
/** Jurisdiction/profile IDs to track compliance against */
|
|
37
|
+
jurisdictions?: string[];
|
|
38
|
+
/** Initial trustworthiness characteristics */
|
|
39
|
+
trustworthiness?: Partial<Trustworthiness>;
|
|
40
|
+
}
|
|
41
|
+
declare function generateAssetId(): string;
|
|
42
|
+
declare function createAssetCard(options: CreateAssetCardOptions): AssetCard;
|
|
43
|
+
/**
|
|
44
|
+
* Add or update jurisdiction tracking on an existing asset card
|
|
45
|
+
*/
|
|
46
|
+
declare function addJurisdiction(card: AssetCard, jurisdictionId: string, riskLevel?: string): AssetCard;
|
|
47
|
+
/**
|
|
48
|
+
* Update jurisdiction classification with compliance check results
|
|
49
|
+
*/
|
|
50
|
+
declare function updateJurisdictionCompliance(card: AssetCard, jurisdictionId: string, update: Partial<JurisdictionClassification>): AssetCard;
|
|
51
|
+
declare function loadAssetCard(filePath: string): AssetCard;
|
|
52
|
+
declare function saveAssetCard(card: AssetCard, filePath: string): void;
|
|
53
|
+
declare function validateAssetCard(card: unknown): {
|
|
54
|
+
valid: boolean;
|
|
55
|
+
errors?: string[];
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
interface TicketInfo {
|
|
59
|
+
system: "jira" | "ado" | "github" | "gitlab";
|
|
60
|
+
id: string;
|
|
61
|
+
url: string;
|
|
62
|
+
title: string;
|
|
63
|
+
status: string;
|
|
64
|
+
assignee?: string;
|
|
65
|
+
reporter?: string;
|
|
66
|
+
businessJustification?: string;
|
|
67
|
+
riskTolerance?: "low" | "medium" | "high";
|
|
68
|
+
}
|
|
69
|
+
interface LinkResult {
|
|
70
|
+
success: boolean;
|
|
71
|
+
intent: Intent;
|
|
72
|
+
warnings?: string[];
|
|
73
|
+
}
|
|
74
|
+
declare function linkAssetToTicket(asset: AssetCard, ticket: TicketInfo): LinkResult;
|
|
75
|
+
declare function validateGoldenThread(asset: AssetCard): {
|
|
76
|
+
valid: boolean;
|
|
77
|
+
healthScore: number;
|
|
78
|
+
issues: string[];
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
declare const ConfidenceLevelSchema: z.ZodEnum<["high", "medium", "low"]>;
|
|
82
|
+
type ConfidenceLevel = z.infer<typeof ConfidenceLevelSchema>;
|
|
83
|
+
declare const DetectionStrategySchema: z.ZodEnum<["pattern_match", "import_analysis", "file_extension", "annotation"]>;
|
|
84
|
+
type DetectionStrategy = z.infer<typeof DetectionStrategySchema>;
|
|
85
|
+
declare const FrameworkCategorySchema: z.ZodEnum<["llm_provider", "framework", "agent_framework", "ml_framework", "ml_ops", "model_file"]>;
|
|
86
|
+
type FrameworkCategory = z.infer<typeof FrameworkCategorySchema>;
|
|
87
|
+
interface RiskImplication {
|
|
88
|
+
factor: keyof RiskFactors;
|
|
89
|
+
value: boolean | "yes" | "no" | "unknown";
|
|
90
|
+
reason: string;
|
|
91
|
+
}
|
|
92
|
+
type PatternRuleType = "regex" | "literal" | "import" | "decorator";
|
|
93
|
+
type PatternLanguage = "python" | "javascript" | "typescript" | "any";
|
|
94
|
+
interface PatternRule {
|
|
95
|
+
type: PatternRuleType;
|
|
96
|
+
pattern: string;
|
|
97
|
+
confidence: ConfidenceLevel;
|
|
98
|
+
description?: string;
|
|
99
|
+
}
|
|
100
|
+
interface PatternDefinition {
|
|
101
|
+
id: string;
|
|
102
|
+
name: string;
|
|
103
|
+
category: FrameworkCategory;
|
|
104
|
+
language: PatternLanguage;
|
|
105
|
+
patterns: PatternRule[];
|
|
106
|
+
implies: RiskImplication[];
|
|
107
|
+
version?: string;
|
|
108
|
+
documentation?: string;
|
|
109
|
+
}
|
|
110
|
+
interface DetectionResult {
|
|
111
|
+
filePath: string;
|
|
112
|
+
line: number;
|
|
113
|
+
column?: number;
|
|
114
|
+
match: string;
|
|
115
|
+
matchContext?: string;
|
|
116
|
+
registryCard: string;
|
|
117
|
+
framework: string;
|
|
118
|
+
category: FrameworkCategory;
|
|
119
|
+
confidence: ConfidenceLevel;
|
|
120
|
+
strategy: DetectionStrategy;
|
|
121
|
+
implies: RiskImplication[];
|
|
122
|
+
metadata?: Record<string, unknown>;
|
|
123
|
+
}
|
|
124
|
+
interface ScanOptions {
|
|
125
|
+
directory: string;
|
|
126
|
+
recursive?: boolean;
|
|
127
|
+
extensions?: string[];
|
|
128
|
+
ignorePatterns?: string[];
|
|
129
|
+
strategies?: DetectionStrategy[];
|
|
130
|
+
maxFileSize?: number;
|
|
131
|
+
maxFiles?: number;
|
|
132
|
+
earlyExit?: boolean;
|
|
133
|
+
respectGitignore?: boolean;
|
|
134
|
+
customPatterns?: PatternDefinition[];
|
|
135
|
+
}
|
|
136
|
+
interface ScanProgress {
|
|
137
|
+
totalFiles: number;
|
|
138
|
+
scannedFiles: number;
|
|
139
|
+
currentFile: string;
|
|
140
|
+
detections: number;
|
|
141
|
+
}
|
|
142
|
+
type ScanProgressCallback = (progress: ScanProgress) => void;
|
|
143
|
+
interface ScanSummary {
|
|
144
|
+
totalDetections: number;
|
|
145
|
+
byFramework: Record<string, number>;
|
|
146
|
+
byCategory: Record<FrameworkCategory, number>;
|
|
147
|
+
byConfidence: Record<ConfidenceLevel, number>;
|
|
148
|
+
primaryFramework?: string;
|
|
149
|
+
primaryCategory?: FrameworkCategory;
|
|
150
|
+
}
|
|
151
|
+
interface ScanError {
|
|
152
|
+
filePath: string;
|
|
153
|
+
error: string;
|
|
154
|
+
recoverable: boolean;
|
|
155
|
+
}
|
|
156
|
+
interface ScanResult {
|
|
157
|
+
detections: DetectionResult[];
|
|
158
|
+
summary: ScanSummary;
|
|
159
|
+
inferredRiskFactors: Partial<RiskFactors>;
|
|
160
|
+
suggestedTechnical: Partial<Technical>;
|
|
161
|
+
scannedFiles: number;
|
|
162
|
+
skippedFiles: number;
|
|
163
|
+
duration: number;
|
|
164
|
+
errors?: ScanError[];
|
|
165
|
+
}
|
|
166
|
+
interface AssetCardSuggestion {
|
|
167
|
+
name: string;
|
|
168
|
+
description: string;
|
|
169
|
+
technical: {
|
|
170
|
+
type: Technical["type"];
|
|
171
|
+
framework: string;
|
|
172
|
+
components: Array<{
|
|
173
|
+
type: string;
|
|
174
|
+
provider?: string;
|
|
175
|
+
model?: string;
|
|
176
|
+
}>;
|
|
177
|
+
sourceFiles: string[];
|
|
178
|
+
};
|
|
179
|
+
riskFactors: Partial<RiskFactors>;
|
|
180
|
+
confidence: ConfidenceLevel;
|
|
181
|
+
basedOn: string[];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
declare function scan(options: ScanOptions, onProgress?: ScanProgressCallback): Promise<ScanResult>;
|
|
185
|
+
declare function scanSync(options: ScanOptions, onProgress?: ScanProgressCallback): ScanResult;
|
|
186
|
+
|
|
187
|
+
declare function inferRiskFactors(detections: DetectionResult[]): Partial<RiskFactors>;
|
|
188
|
+
declare function applyImplicationChains(detections: DetectionResult[]): DetectionResult[];
|
|
189
|
+
|
|
190
|
+
declare function suggestAssetCard(scanResult: ScanResult): AssetCardSuggestion;
|
|
191
|
+
|
|
192
|
+
declare function registerPattern(pattern: PatternDefinition): void;
|
|
193
|
+
declare function getPattern(id: string): PatternDefinition | undefined;
|
|
194
|
+
declare function getAllPatterns(): PatternDefinition[];
|
|
195
|
+
declare function getPatternsByCategory(category: FrameworkCategory): PatternDefinition[];
|
|
196
|
+
declare function getPatternsByLanguage(language: PatternLanguage): PatternDefinition[];
|
|
197
|
+
declare function clearRegistry(): void;
|
|
198
|
+
declare function isRegistryInitialized(): boolean;
|
|
199
|
+
declare function createImplication(factor: RiskImplication["factor"], value: RiskImplication["value"], reason: string): RiskImplication;
|
|
200
|
+
|
|
201
|
+
declare const pythonPatterns: PatternDefinition[];
|
|
202
|
+
|
|
203
|
+
declare const javascriptPatterns: PatternDefinition[];
|
|
204
|
+
|
|
205
|
+
declare const modelFilePatterns: PatternDefinition[];
|
|
206
|
+
|
|
207
|
+
declare const riskIndicatorPatterns: PatternDefinition[];
|
|
208
|
+
|
|
209
|
+
declare function initializePatterns(): void;
|
|
210
|
+
declare function resetPatterns(): void;
|
|
211
|
+
|
|
212
|
+
declare function matchPatterns(filePath: string, lines: string[], patterns: PatternDefinition[]): DetectionResult[];
|
|
213
|
+
|
|
214
|
+
declare function analyzeImports(filePath: string, content: string, patterns: PatternDefinition[]): DetectionResult[];
|
|
215
|
+
|
|
216
|
+
declare function scanFileExtension(filePath: string): DetectionResult[];
|
|
217
|
+
declare const MODEL_EXTENSIONS: string[];
|
|
218
|
+
declare function isModelFile(filePath: string): boolean;
|
|
219
|
+
|
|
220
|
+
declare function detectAnnotations(filePath: string, lines: string[], patterns: PatternDefinition[]): DetectionResult[];
|
|
221
|
+
|
|
222
|
+
declare function formatDate(date: Date): string;
|
|
223
|
+
declare function parseDate(dateString: string): Date;
|
|
224
|
+
declare function slugify(text: string): string;
|
|
225
|
+
|
|
226
|
+
export { AssetCard, type AssetCardSuggestion, type ClassificationResult, type ConfidenceLevel, ConfidenceLevelSchema, type CreateAssetCardOptions, type DetectionResult, type DetectionStrategy, DetectionStrategySchema, type FrameworkCategory, FrameworkCategorySchema, Intent, JurisdictionClassification, type LinkResult, MODEL_EXTENSIONS, type PatternDefinition, type PatternLanguage, type PatternRule, type PatternRuleType, RiskFactors, type RiskImplication, type RiskLevel, type ScanError, type ScanOptions, type ScanProgress, type ScanProgressCallback, type ScanResult, type ScanSummary, Technical, type TicketInfo, Trustworthiness, addJurisdiction, analyzeImports, applyImplicationChains, classifyRisk, clearRegistry, createAssetCard, createImplication, detectAnnotations, formatDate, generateAssetId, getAllPatterns, getPattern, getPatternsByCategory, getPatternsByLanguage, inferRiskFactors, initializePatterns, isModelFile, isRegistryInitialized, javascriptPatterns, linkAssetToTicket, loadAssetCard, matchPatterns, modelFilePatterns, parseDate, pythonPatterns, registerPattern, resetPatterns, riskIndicatorPatterns, saveAssetCard, scan, scanFileExtension, scanSync, slugify, suggestAssetCard, updateJurisdictionCompliance, validateAssetCard, validateGoldenThread, validateRiskFactors };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { RiskFactors, Trustworthiness, AssetCard, JurisdictionClassification, Intent, Technical } from './schemas/index.js';
|
|
2
|
+
export { ApprovalSchema, AssetCardSchema, Classification, ClassificationSchema, Constraints, ConstraintsSchema, ControlStatus, ControlStatusSchema, Governance, GovernanceSchema, IntentSchema, JurisdictionClassificationSchema, Owner, OwnerSchema, RiskFactorsSchema, TechnicalSchema, TrustworthinessCharacteristic, TrustworthinessCharacteristicSchema, TrustworthinessSchema } from './schemas/index.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
type RiskLevel = "minimal" | "limited" | "high" | "unacceptable";
|
|
6
|
+
interface ClassificationResult {
|
|
7
|
+
riskLevel: RiskLevel;
|
|
8
|
+
reasons: string[];
|
|
9
|
+
euAiActCategory: string;
|
|
10
|
+
requiredArtifacts: string[];
|
|
11
|
+
}
|
|
12
|
+
declare function classifyRisk(factors: RiskFactors): ClassificationResult;
|
|
13
|
+
declare function validateRiskFactors(factors: RiskFactors): boolean;
|
|
14
|
+
|
|
15
|
+
interface CreateAssetCardOptions {
|
|
16
|
+
name: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
owner: {
|
|
19
|
+
name: string;
|
|
20
|
+
email: string;
|
|
21
|
+
team?: string;
|
|
22
|
+
};
|
|
23
|
+
technical: {
|
|
24
|
+
type: "model" | "agent" | "api_client" | "framework" | "pipeline";
|
|
25
|
+
framework?: string;
|
|
26
|
+
frameworkVersion?: string;
|
|
27
|
+
};
|
|
28
|
+
riskFactors?: {
|
|
29
|
+
autonomousDecisions?: boolean;
|
|
30
|
+
customerFacing?: boolean;
|
|
31
|
+
toolExecution?: boolean;
|
|
32
|
+
externalDataAccess?: boolean;
|
|
33
|
+
piiProcessing?: "yes" | "no" | "unknown";
|
|
34
|
+
highStakesDecisions?: boolean;
|
|
35
|
+
};
|
|
36
|
+
/** Jurisdiction/profile IDs to track compliance against */
|
|
37
|
+
jurisdictions?: string[];
|
|
38
|
+
/** Initial trustworthiness characteristics */
|
|
39
|
+
trustworthiness?: Partial<Trustworthiness>;
|
|
40
|
+
}
|
|
41
|
+
declare function generateAssetId(): string;
|
|
42
|
+
declare function createAssetCard(options: CreateAssetCardOptions): AssetCard;
|
|
43
|
+
/**
|
|
44
|
+
* Add or update jurisdiction tracking on an existing asset card
|
|
45
|
+
*/
|
|
46
|
+
declare function addJurisdiction(card: AssetCard, jurisdictionId: string, riskLevel?: string): AssetCard;
|
|
47
|
+
/**
|
|
48
|
+
* Update jurisdiction classification with compliance check results
|
|
49
|
+
*/
|
|
50
|
+
declare function updateJurisdictionCompliance(card: AssetCard, jurisdictionId: string, update: Partial<JurisdictionClassification>): AssetCard;
|
|
51
|
+
declare function loadAssetCard(filePath: string): AssetCard;
|
|
52
|
+
declare function saveAssetCard(card: AssetCard, filePath: string): void;
|
|
53
|
+
declare function validateAssetCard(card: unknown): {
|
|
54
|
+
valid: boolean;
|
|
55
|
+
errors?: string[];
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
interface TicketInfo {
|
|
59
|
+
system: "jira" | "ado" | "github" | "gitlab";
|
|
60
|
+
id: string;
|
|
61
|
+
url: string;
|
|
62
|
+
title: string;
|
|
63
|
+
status: string;
|
|
64
|
+
assignee?: string;
|
|
65
|
+
reporter?: string;
|
|
66
|
+
businessJustification?: string;
|
|
67
|
+
riskTolerance?: "low" | "medium" | "high";
|
|
68
|
+
}
|
|
69
|
+
interface LinkResult {
|
|
70
|
+
success: boolean;
|
|
71
|
+
intent: Intent;
|
|
72
|
+
warnings?: string[];
|
|
73
|
+
}
|
|
74
|
+
declare function linkAssetToTicket(asset: AssetCard, ticket: TicketInfo): LinkResult;
|
|
75
|
+
declare function validateGoldenThread(asset: AssetCard): {
|
|
76
|
+
valid: boolean;
|
|
77
|
+
healthScore: number;
|
|
78
|
+
issues: string[];
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
declare const ConfidenceLevelSchema: z.ZodEnum<["high", "medium", "low"]>;
|
|
82
|
+
type ConfidenceLevel = z.infer<typeof ConfidenceLevelSchema>;
|
|
83
|
+
declare const DetectionStrategySchema: z.ZodEnum<["pattern_match", "import_analysis", "file_extension", "annotation"]>;
|
|
84
|
+
type DetectionStrategy = z.infer<typeof DetectionStrategySchema>;
|
|
85
|
+
declare const FrameworkCategorySchema: z.ZodEnum<["llm_provider", "framework", "agent_framework", "ml_framework", "ml_ops", "model_file"]>;
|
|
86
|
+
type FrameworkCategory = z.infer<typeof FrameworkCategorySchema>;
|
|
87
|
+
interface RiskImplication {
|
|
88
|
+
factor: keyof RiskFactors;
|
|
89
|
+
value: boolean | "yes" | "no" | "unknown";
|
|
90
|
+
reason: string;
|
|
91
|
+
}
|
|
92
|
+
type PatternRuleType = "regex" | "literal" | "import" | "decorator";
|
|
93
|
+
type PatternLanguage = "python" | "javascript" | "typescript" | "any";
|
|
94
|
+
interface PatternRule {
|
|
95
|
+
type: PatternRuleType;
|
|
96
|
+
pattern: string;
|
|
97
|
+
confidence: ConfidenceLevel;
|
|
98
|
+
description?: string;
|
|
99
|
+
}
|
|
100
|
+
interface PatternDefinition {
|
|
101
|
+
id: string;
|
|
102
|
+
name: string;
|
|
103
|
+
category: FrameworkCategory;
|
|
104
|
+
language: PatternLanguage;
|
|
105
|
+
patterns: PatternRule[];
|
|
106
|
+
implies: RiskImplication[];
|
|
107
|
+
version?: string;
|
|
108
|
+
documentation?: string;
|
|
109
|
+
}
|
|
110
|
+
interface DetectionResult {
|
|
111
|
+
filePath: string;
|
|
112
|
+
line: number;
|
|
113
|
+
column?: number;
|
|
114
|
+
match: string;
|
|
115
|
+
matchContext?: string;
|
|
116
|
+
registryCard: string;
|
|
117
|
+
framework: string;
|
|
118
|
+
category: FrameworkCategory;
|
|
119
|
+
confidence: ConfidenceLevel;
|
|
120
|
+
strategy: DetectionStrategy;
|
|
121
|
+
implies: RiskImplication[];
|
|
122
|
+
metadata?: Record<string, unknown>;
|
|
123
|
+
}
|
|
124
|
+
interface ScanOptions {
|
|
125
|
+
directory: string;
|
|
126
|
+
recursive?: boolean;
|
|
127
|
+
extensions?: string[];
|
|
128
|
+
ignorePatterns?: string[];
|
|
129
|
+
strategies?: DetectionStrategy[];
|
|
130
|
+
maxFileSize?: number;
|
|
131
|
+
maxFiles?: number;
|
|
132
|
+
earlyExit?: boolean;
|
|
133
|
+
respectGitignore?: boolean;
|
|
134
|
+
customPatterns?: PatternDefinition[];
|
|
135
|
+
}
|
|
136
|
+
interface ScanProgress {
|
|
137
|
+
totalFiles: number;
|
|
138
|
+
scannedFiles: number;
|
|
139
|
+
currentFile: string;
|
|
140
|
+
detections: number;
|
|
141
|
+
}
|
|
142
|
+
type ScanProgressCallback = (progress: ScanProgress) => void;
|
|
143
|
+
interface ScanSummary {
|
|
144
|
+
totalDetections: number;
|
|
145
|
+
byFramework: Record<string, number>;
|
|
146
|
+
byCategory: Record<FrameworkCategory, number>;
|
|
147
|
+
byConfidence: Record<ConfidenceLevel, number>;
|
|
148
|
+
primaryFramework?: string;
|
|
149
|
+
primaryCategory?: FrameworkCategory;
|
|
150
|
+
}
|
|
151
|
+
interface ScanError {
|
|
152
|
+
filePath: string;
|
|
153
|
+
error: string;
|
|
154
|
+
recoverable: boolean;
|
|
155
|
+
}
|
|
156
|
+
interface ScanResult {
|
|
157
|
+
detections: DetectionResult[];
|
|
158
|
+
summary: ScanSummary;
|
|
159
|
+
inferredRiskFactors: Partial<RiskFactors>;
|
|
160
|
+
suggestedTechnical: Partial<Technical>;
|
|
161
|
+
scannedFiles: number;
|
|
162
|
+
skippedFiles: number;
|
|
163
|
+
duration: number;
|
|
164
|
+
errors?: ScanError[];
|
|
165
|
+
}
|
|
166
|
+
interface AssetCardSuggestion {
|
|
167
|
+
name: string;
|
|
168
|
+
description: string;
|
|
169
|
+
technical: {
|
|
170
|
+
type: Technical["type"];
|
|
171
|
+
framework: string;
|
|
172
|
+
components: Array<{
|
|
173
|
+
type: string;
|
|
174
|
+
provider?: string;
|
|
175
|
+
model?: string;
|
|
176
|
+
}>;
|
|
177
|
+
sourceFiles: string[];
|
|
178
|
+
};
|
|
179
|
+
riskFactors: Partial<RiskFactors>;
|
|
180
|
+
confidence: ConfidenceLevel;
|
|
181
|
+
basedOn: string[];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
declare function scan(options: ScanOptions, onProgress?: ScanProgressCallback): Promise<ScanResult>;
|
|
185
|
+
declare function scanSync(options: ScanOptions, onProgress?: ScanProgressCallback): ScanResult;
|
|
186
|
+
|
|
187
|
+
declare function inferRiskFactors(detections: DetectionResult[]): Partial<RiskFactors>;
|
|
188
|
+
declare function applyImplicationChains(detections: DetectionResult[]): DetectionResult[];
|
|
189
|
+
|
|
190
|
+
declare function suggestAssetCard(scanResult: ScanResult): AssetCardSuggestion;
|
|
191
|
+
|
|
192
|
+
declare function registerPattern(pattern: PatternDefinition): void;
|
|
193
|
+
declare function getPattern(id: string): PatternDefinition | undefined;
|
|
194
|
+
declare function getAllPatterns(): PatternDefinition[];
|
|
195
|
+
declare function getPatternsByCategory(category: FrameworkCategory): PatternDefinition[];
|
|
196
|
+
declare function getPatternsByLanguage(language: PatternLanguage): PatternDefinition[];
|
|
197
|
+
declare function clearRegistry(): void;
|
|
198
|
+
declare function isRegistryInitialized(): boolean;
|
|
199
|
+
declare function createImplication(factor: RiskImplication["factor"], value: RiskImplication["value"], reason: string): RiskImplication;
|
|
200
|
+
|
|
201
|
+
declare const pythonPatterns: PatternDefinition[];
|
|
202
|
+
|
|
203
|
+
declare const javascriptPatterns: PatternDefinition[];
|
|
204
|
+
|
|
205
|
+
declare const modelFilePatterns: PatternDefinition[];
|
|
206
|
+
|
|
207
|
+
declare const riskIndicatorPatterns: PatternDefinition[];
|
|
208
|
+
|
|
209
|
+
declare function initializePatterns(): void;
|
|
210
|
+
declare function resetPatterns(): void;
|
|
211
|
+
|
|
212
|
+
declare function matchPatterns(filePath: string, lines: string[], patterns: PatternDefinition[]): DetectionResult[];
|
|
213
|
+
|
|
214
|
+
declare function analyzeImports(filePath: string, content: string, patterns: PatternDefinition[]): DetectionResult[];
|
|
215
|
+
|
|
216
|
+
declare function scanFileExtension(filePath: string): DetectionResult[];
|
|
217
|
+
declare const MODEL_EXTENSIONS: string[];
|
|
218
|
+
declare function isModelFile(filePath: string): boolean;
|
|
219
|
+
|
|
220
|
+
declare function detectAnnotations(filePath: string, lines: string[], patterns: PatternDefinition[]): DetectionResult[];
|
|
221
|
+
|
|
222
|
+
declare function formatDate(date: Date): string;
|
|
223
|
+
declare function parseDate(dateString: string): Date;
|
|
224
|
+
declare function slugify(text: string): string;
|
|
225
|
+
|
|
226
|
+
export { AssetCard, type AssetCardSuggestion, type ClassificationResult, type ConfidenceLevel, ConfidenceLevelSchema, type CreateAssetCardOptions, type DetectionResult, type DetectionStrategy, DetectionStrategySchema, type FrameworkCategory, FrameworkCategorySchema, Intent, JurisdictionClassification, type LinkResult, MODEL_EXTENSIONS, type PatternDefinition, type PatternLanguage, type PatternRule, type PatternRuleType, RiskFactors, type RiskImplication, type RiskLevel, type ScanError, type ScanOptions, type ScanProgress, type ScanProgressCallback, type ScanResult, type ScanSummary, Technical, type TicketInfo, Trustworthiness, addJurisdiction, analyzeImports, applyImplicationChains, classifyRisk, clearRegistry, createAssetCard, createImplication, detectAnnotations, formatDate, generateAssetId, getAllPatterns, getPattern, getPatternsByCategory, getPatternsByLanguage, inferRiskFactors, initializePatterns, isModelFile, isRegistryInitialized, javascriptPatterns, linkAssetToTicket, loadAssetCard, matchPatterns, modelFilePatterns, parseDate, pythonPatterns, registerPattern, resetPatterns, riskIndicatorPatterns, saveAssetCard, scan, scanFileExtension, scanSync, slugify, suggestAssetCard, updateJurisdictionCompliance, validateAssetCard, validateGoldenThread, validateRiskFactors };
|