@methiu/raigal 0.16.2

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.
@@ -0,0 +1,351 @@
1
+ import { z } from "zod/v4";
2
+ //#region src/config/schema.d.ts
3
+ declare const AislopConfigSchema: z.ZodObject<{
4
+ version: z.ZodDefault<z.ZodNumber>;
5
+ extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
6
+ engines: z.ZodDefault<z.ZodObject<{
7
+ format: z.ZodDefault<z.ZodBoolean>;
8
+ lint: z.ZodDefault<z.ZodBoolean>;
9
+ "code-quality": z.ZodDefault<z.ZodBoolean>;
10
+ "ai-slop": z.ZodDefault<z.ZodBoolean>;
11
+ architecture: z.ZodDefault<z.ZodBoolean>;
12
+ security: z.ZodDefault<z.ZodBoolean>;
13
+ }, z.core.$strict>>;
14
+ quality: z.ZodDefault<z.ZodObject<{
15
+ maxFunctionLoc: z.ZodDefault<z.ZodNumber>;
16
+ maxFileLoc: z.ZodDefault<z.ZodNumber>;
17
+ maxNesting: z.ZodDefault<z.ZodNumber>;
18
+ maxParams: z.ZodDefault<z.ZodNumber>;
19
+ }, z.core.$strict>>;
20
+ lint: z.ZodDefault<z.ZodObject<{
21
+ typecheck: z.ZodDefault<z.ZodBoolean>;
22
+ expoDoctor: z.ZodDefault<z.ZodBoolean>;
23
+ csharp: z.ZodDefault<z.ZodObject<{
24
+ projectEvaluation: z.ZodDefault<z.ZodBoolean>;
25
+ jb: z.ZodDefault<z.ZodBoolean>;
26
+ roslynator: z.ZodDefault<z.ZodBoolean>;
27
+ jbSeverityFloor: z.ZodDefault<z.ZodEnum<{
28
+ ERROR: "ERROR";
29
+ WARNING: "WARNING";
30
+ SUGGESTION: "SUGGESTION";
31
+ HINT: "HINT";
32
+ }>>;
33
+ jbExcludeTypes: z.ZodDefault<z.ZodArray<z.ZodString>>;
34
+ jbProjects: z.ZodOptional<z.ZodString>;
35
+ }, z.core.$strict>>;
36
+ cpp: z.ZodDefault<z.ZodObject<{
37
+ cppcheck: z.ZodDefault<z.ZodBoolean>;
38
+ clangTidy: z.ZodDefault<z.ZodBoolean>;
39
+ cppcheckEnable: z.ZodDefault<z.ZodString>;
40
+ jb: z.ZodDefault<z.ZodBoolean>;
41
+ jbProjects: z.ZodOptional<z.ZodString>;
42
+ jbSeverityFloor: z.ZodDefault<z.ZodEnum<{
43
+ ERROR: "ERROR";
44
+ WARNING: "WARNING";
45
+ SUGGESTION: "SUGGESTION";
46
+ HINT: "HINT";
47
+ }>>;
48
+ jbExcludeTypes: z.ZodDefault<z.ZodArray<z.ZodString>>;
49
+ }, z.core.$strict>>;
50
+ }, z.core.$strict>>;
51
+ security: z.ZodDefault<z.ZodObject<{
52
+ audit: z.ZodDefault<z.ZodBoolean>;
53
+ auditTimeout: z.ZodDefault<z.ZodNumber>;
54
+ }, z.core.$strict>>;
55
+ scoring: z.ZodDefault<z.ZodObject<{
56
+ weights: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
57
+ thresholds: z.ZodDefault<z.ZodObject<{
58
+ good: z.ZodDefault<z.ZodNumber>;
59
+ ok: z.ZodDefault<z.ZodNumber>;
60
+ }, z.core.$strict>>;
61
+ smoothing: z.ZodDefault<z.ZodNumber>;
62
+ maxPerRule: z.ZodDefault<z.ZodNumber>;
63
+ }, z.core.$strict>>;
64
+ ci: z.ZodDefault<z.ZodObject<{
65
+ failBelow: z.ZodDefault<z.ZodNumber>;
66
+ format: z.ZodDefault<z.ZodEnum<{
67
+ json: "json";
68
+ }>>;
69
+ }, z.core.$strict>>;
70
+ telemetry: z.ZodDefault<z.ZodObject<{
71
+ enabled: z.ZodDefault<z.ZodBoolean>;
72
+ }, z.core.$strict>>;
73
+ rules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
74
+ error: "error";
75
+ warning: "warning";
76
+ off: "off";
77
+ }>>>;
78
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
79
+ include: z.ZodDefault<z.ZodArray<z.ZodString>>;
80
+ }, z.core.$strict>;
81
+ declare const RaigalConfigSchema: z.ZodObject<{
82
+ version: z.ZodDefault<z.ZodNumber>;
83
+ extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
84
+ engines: z.ZodDefault<z.ZodObject<{
85
+ format: z.ZodDefault<z.ZodBoolean>;
86
+ lint: z.ZodDefault<z.ZodBoolean>;
87
+ "code-quality": z.ZodDefault<z.ZodBoolean>;
88
+ "ai-slop": z.ZodDefault<z.ZodBoolean>;
89
+ architecture: z.ZodDefault<z.ZodBoolean>;
90
+ security: z.ZodDefault<z.ZodBoolean>;
91
+ }, z.core.$strict>>;
92
+ quality: z.ZodDefault<z.ZodObject<{
93
+ maxFunctionLoc: z.ZodDefault<z.ZodNumber>;
94
+ maxFileLoc: z.ZodDefault<z.ZodNumber>;
95
+ maxNesting: z.ZodDefault<z.ZodNumber>;
96
+ maxParams: z.ZodDefault<z.ZodNumber>;
97
+ }, z.core.$strict>>;
98
+ lint: z.ZodDefault<z.ZodObject<{
99
+ typecheck: z.ZodDefault<z.ZodBoolean>;
100
+ expoDoctor: z.ZodDefault<z.ZodBoolean>;
101
+ csharp: z.ZodDefault<z.ZodObject<{
102
+ projectEvaluation: z.ZodDefault<z.ZodBoolean>;
103
+ jb: z.ZodDefault<z.ZodBoolean>;
104
+ roslynator: z.ZodDefault<z.ZodBoolean>;
105
+ jbSeverityFloor: z.ZodDefault<z.ZodEnum<{
106
+ ERROR: "ERROR";
107
+ WARNING: "WARNING";
108
+ SUGGESTION: "SUGGESTION";
109
+ HINT: "HINT";
110
+ }>>;
111
+ jbExcludeTypes: z.ZodDefault<z.ZodArray<z.ZodString>>;
112
+ jbProjects: z.ZodOptional<z.ZodString>;
113
+ }, z.core.$strict>>;
114
+ cpp: z.ZodDefault<z.ZodObject<{
115
+ cppcheck: z.ZodDefault<z.ZodBoolean>;
116
+ clangTidy: z.ZodDefault<z.ZodBoolean>;
117
+ cppcheckEnable: z.ZodDefault<z.ZodString>;
118
+ jb: z.ZodDefault<z.ZodBoolean>;
119
+ jbProjects: z.ZodOptional<z.ZodString>;
120
+ jbSeverityFloor: z.ZodDefault<z.ZodEnum<{
121
+ ERROR: "ERROR";
122
+ WARNING: "WARNING";
123
+ SUGGESTION: "SUGGESTION";
124
+ HINT: "HINT";
125
+ }>>;
126
+ jbExcludeTypes: z.ZodDefault<z.ZodArray<z.ZodString>>;
127
+ }, z.core.$strict>>;
128
+ }, z.core.$strict>>;
129
+ security: z.ZodDefault<z.ZodObject<{
130
+ audit: z.ZodDefault<z.ZodBoolean>;
131
+ auditTimeout: z.ZodDefault<z.ZodNumber>;
132
+ }, z.core.$strict>>;
133
+ scoring: z.ZodDefault<z.ZodObject<{
134
+ weights: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
135
+ thresholds: z.ZodDefault<z.ZodObject<{
136
+ good: z.ZodDefault<z.ZodNumber>;
137
+ ok: z.ZodDefault<z.ZodNumber>;
138
+ }, z.core.$strict>>;
139
+ smoothing: z.ZodDefault<z.ZodNumber>;
140
+ maxPerRule: z.ZodDefault<z.ZodNumber>;
141
+ }, z.core.$strict>>;
142
+ ci: z.ZodDefault<z.ZodObject<{
143
+ failBelow: z.ZodDefault<z.ZodNumber>;
144
+ format: z.ZodDefault<z.ZodEnum<{
145
+ json: "json";
146
+ }>>;
147
+ }, z.core.$strict>>;
148
+ telemetry: z.ZodDefault<z.ZodObject<{
149
+ enabled: z.ZodDefault<z.ZodBoolean>;
150
+ }, z.core.$strict>>;
151
+ rules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
152
+ error: "error";
153
+ warning: "warning";
154
+ off: "off";
155
+ }>>>;
156
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
157
+ include: z.ZodDefault<z.ZodArray<z.ZodString>>;
158
+ }, z.core.$strict>;
159
+ type RaigalConfig = z.infer<typeof RaigalConfigSchema>;
160
+ type AislopConfig = RaigalConfig;
161
+ //#endregion
162
+ //#region src/config/index.d.ts
163
+ declare const loadConfig: (directory: string) => AislopConfig;
164
+ //#endregion
165
+ //#region src/utils/discovery-classifiers.d.ts
166
+ type Language = "typescript" | "javascript" | "python" | "go" | "rust" | "java" | "ruby" | "php" | "csharp" | "cpp";
167
+ type Framework = "nextjs" | "react" | "vite" | "remix" | "expo" | "astro" | "django" | "flask" | "fastapi" | "none";
168
+ //#endregion
169
+ //#region src/utils/discovery-coverage.d.ts
170
+ interface Coverage {
171
+ readonly dominantUnsupported: string | null;
172
+ readonly scoreable: boolean;
173
+ readonly supportedFiles: number;
174
+ readonly unsupportedFiles: number;
175
+ }
176
+ //#endregion
177
+ //#region src/utils/discover.d.ts
178
+ interface ProjectInfo {
179
+ rootDirectory: string;
180
+ projectName: string;
181
+ languages: Language[];
182
+ frameworks: Framework[];
183
+ sourceFileCount: number;
184
+ coverage: Coverage;
185
+ installedTools: Record<string, boolean>;
186
+ }
187
+ interface DiscoveryInputs {
188
+ readonly includePatterns?: string[];
189
+ readonly installedTools?: Record<string, boolean>;
190
+ readonly projectFiles?: string[];
191
+ readonly sourceFiles?: string[];
192
+ }
193
+ declare const discoverProject: (directory: string, excludePatterns?: string[], inputs?: DiscoveryInputs) => Promise<ProjectInfo>;
194
+ //#endregion
195
+ //#region src/commands/doctor-plan.d.ts
196
+ interface DoctorEngineRow {
197
+ engine: string;
198
+ tool: string;
199
+ status: "ok" | "missing" | "skipped";
200
+ remediation?: string;
201
+ skipReason?: string;
202
+ }
203
+ //#endregion
204
+ //#region src/commands/doctor.d.ts
205
+ interface BuildDoctorRenderInput {
206
+ projectName: string;
207
+ languageLabel: string;
208
+ rows: DoctorEngineRow[];
209
+ invocation: string;
210
+ printBrand?: boolean;
211
+ }
212
+ declare const buildDoctorRender: (input: BuildDoctorRenderInput) => string;
213
+ interface DoctorOptions {
214
+ printBrand?: boolean;
215
+ }
216
+ declare const doctorCommand: (directory: string, options?: DoctorOptions) => Promise<void>;
217
+ //#endregion
218
+ //#region src/ui/rail.d.ts
219
+ type RailStepStatus = "active" | "done" | "warn" | "failed" | "skipped";
220
+ interface RailStep {
221
+ status: RailStepStatus;
222
+ label: string;
223
+ notes?: string[];
224
+ }
225
+ //#endregion
226
+ //#region src/commands/fix.d.ts
227
+ interface FixOptions {
228
+ verbose: boolean;
229
+ force?: boolean;
230
+ /** Restrict to reversible fixes only (imports, comment removal, safe formatter runs) */
231
+ safe?: boolean;
232
+ dryRun?: boolean;
233
+ changes?: boolean;
234
+ staged?: boolean;
235
+ base?: string;
236
+ /** Agent CLI to launch with remaining issues (e.g. "claude", "codex") */
237
+ agent?: string;
238
+ /** Print the prompt to stdout instead of launching an agent */
239
+ prompt?: boolean;
240
+ showHeader?: boolean;
241
+ printBrand?: boolean;
242
+ }
243
+ declare const fixCommand: (directory: string, config: AislopConfig, options?: FixOptions) => Promise<{
244
+ exitCode: number;
245
+ }>;
246
+ //#endregion
247
+ //#region src/commands/init.d.ts
248
+ interface BuildInitRenderInput {
249
+ steps: RailStep[];
250
+ nextCommand: string;
251
+ includeHeader?: boolean;
252
+ printBrand?: boolean;
253
+ }
254
+ declare const buildInitSuccessRender: (input: BuildInitRenderInput) => string;
255
+ interface InitOptions {
256
+ printBrand?: boolean;
257
+ strict?: boolean;
258
+ }
259
+ declare const initCommand: (directory: string, options?: InitOptions) => Promise<void>;
260
+ //#endregion
261
+ //#region src/commands/rules-render.d.ts
262
+ interface RuleEntry {
263
+ id: string;
264
+ engine: string;
265
+ severity: "error" | "warning" | "info";
266
+ fixable: boolean;
267
+ }
268
+ interface BuildRulesRenderInput {
269
+ rules: RuleEntry[];
270
+ invocation?: string;
271
+ printBrand?: boolean;
272
+ includeHeader?: boolean;
273
+ }
274
+ declare const buildRulesRender: (input: BuildRulesRenderInput) => string;
275
+ declare const buildRuleDetailRender: (rule: RuleEntry, input?: {
276
+ printBrand?: boolean;
277
+ includeHeader?: boolean;
278
+ }) => string;
279
+ //#endregion
280
+ //#region src/commands/rules.d.ts
281
+ interface RulesOptions {
282
+ printBrand?: boolean;
283
+ interactive?: boolean;
284
+ }
285
+ declare const rulesCommand: (directory: string, options?: RulesOptions) => Promise<void>;
286
+ //#endregion
287
+ //#region src/commands/scan-exit-code.d.ts
288
+ type FailOnMode = "none" | "error" | "warning";
289
+ //#endregion
290
+ //#region src/commands/scan-options.d.ts
291
+ interface ScanOptions {
292
+ changes: boolean;
293
+ staged: boolean;
294
+ base?: string;
295
+ verbose: boolean;
296
+ json: boolean;
297
+ sarif?: boolean;
298
+ showHeader?: boolean;
299
+ printBrand?: boolean;
300
+ exclude?: string[];
301
+ include?: string[];
302
+ /** Used for telemetry to distinguish scan vs ci invocation */
303
+ command?: "scan" | "ci";
304
+ failOn?: FailOnMode;
305
+ }
306
+ //#endregion
307
+ //#region src/engines/types.d.ts
308
+ type Severity = "error" | "warning" | "info";
309
+ type EngineName = "format" | "lint" | "code-quality" | "ai-slop" | "architecture" | "security";
310
+ type ChangeContext = "changed-line" | "existing-file-context" | "unknown";
311
+ interface Diagnostic {
312
+ filePath: string;
313
+ engine: EngineName;
314
+ rule: string;
315
+ severity: Severity;
316
+ message: string;
317
+ help: string;
318
+ line: number;
319
+ column: number;
320
+ category: string;
321
+ fixable: boolean;
322
+ detail?: string;
323
+ changeContext?: ChangeContext;
324
+ redactSource?: boolean;
325
+ }
326
+ interface EngineResult {
327
+ engine: EngineName;
328
+ diagnostics: Diagnostic[];
329
+ elapsed: number;
330
+ skipped: boolean;
331
+ skipReason?: string;
332
+ }
333
+ //#endregion
334
+ //#region src/commands/scan.d.ts
335
+ declare const scanCommand: (directory: string, config: AislopConfig, options: ScanOptions) => Promise<{
336
+ exitCode: number;
337
+ }>;
338
+ //#endregion
339
+ //#region src/scoring/index.d.ts
340
+ interface ScoreResult {
341
+ score: number;
342
+ label: string;
343
+ effectiveSourceFileCount?: number;
344
+ sourceFileCountMode?: "provided" | "estimated-from-diagnostics" | "not-needed";
345
+ }
346
+ declare const calculateScore: (diagnostics: Diagnostic[], weights: Record<string, number>, thresholds: {
347
+ good: number;
348
+ ok: number;
349
+ }, sourceFileCount?: number, smoothing?: number, maxPerRule?: number) => ScoreResult;
350
+ //#endregion
351
+ export { type AislopConfig, AislopConfigSchema, type Diagnostic, type EngineName, type EngineResult, type Framework, type Language, type ProjectInfo, type RaigalConfig, RaigalConfigSchema, type ScoreResult, type Severity, buildDoctorRender, buildInitSuccessRender, buildRuleDetailRender, buildRulesRender, calculateScore, discoverProject, doctorCommand, fixCommand, initCommand, loadConfig, rulesCommand, scanCommand };