@wispbit/local 1.0.29 → 1.0.31
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/cli.js +99 -4241
- package/dist/index.js +1 -20
- package/dist/package.json +6 -9
- package/package.json +5 -5
- package/dist/build.d.ts +0 -3
- package/dist/build.d.ts.map +0 -1
- package/dist/cli.js.map +0 -7
- package/dist/index.js.map +0 -7
- package/dist/src/api/WispbitApiClient.d.ts +0 -190
- package/dist/src/api/WispbitApiClient.d.ts.map +0 -1
- package/dist/src/cli.d.ts +0 -16
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/config.d.ts +0 -6
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/environment/Config.d.ts +0 -79
- package/dist/src/environment/Config.d.ts.map +0 -1
- package/dist/src/environment/Environment.d.ts +0 -23
- package/dist/src/environment/Environment.d.ts.map +0 -1
- package/dist/src/environment/Sandbox.d.ts +0 -48
- package/dist/src/environment/Sandbox.d.ts.map +0 -1
- package/dist/src/environment/Storage.d.ts +0 -84
- package/dist/src/environment/Storage.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -16
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/languages.d.ts +0 -36
- package/dist/src/languages.d.ts.map +0 -1
- package/dist/src/providers/AstGrepAstProvider.d.ts +0 -44
- package/dist/src/providers/AstGrepAstProvider.d.ts.map +0 -1
- package/dist/src/providers/LanguageBackend.d.ts +0 -74
- package/dist/src/providers/LanguageBackend.d.ts.map +0 -1
- package/dist/src/providers/RuleProvider.d.ts +0 -46
- package/dist/src/providers/RuleProvider.d.ts.map +0 -1
- package/dist/src/providers/ScipIntelligenceProvider.d.ts +0 -84
- package/dist/src/providers/ScipIntelligenceProvider.d.ts.map +0 -1
- package/dist/src/providers/ViolationValidationProvider.d.ts +0 -38
- package/dist/src/providers/ViolationValidationProvider.d.ts.map +0 -1
- package/dist/src/providers/WispbitRuleProvider.d.ts +0 -29
- package/dist/src/providers/WispbitRuleProvider.d.ts.map +0 -1
- package/dist/src/providers/WispbitViolationValidationProvider.d.ts +0 -12
- package/dist/src/providers/WispbitViolationValidationProvider.d.ts.map +0 -1
- package/dist/src/schemas.d.ts +0 -1270
- package/dist/src/schemas.d.ts.map +0 -1
- package/dist/src/steps/ExecutionEventEmitter.d.ts +0 -191
- package/dist/src/steps/ExecutionEventEmitter.d.ts.map +0 -1
- package/dist/src/steps/FileExecutionContext.d.ts +0 -87
- package/dist/src/steps/FileExecutionContext.d.ts.map +0 -1
- package/dist/src/steps/FileFilterStep.d.ts +0 -28
- package/dist/src/steps/FileFilterStep.d.ts.map +0 -1
- package/dist/src/steps/FileFilterStep.test.d.ts +0 -2
- package/dist/src/steps/FileFilterStep.test.d.ts.map +0 -1
- package/dist/src/steps/FindMatchesStep.d.ts +0 -41
- package/dist/src/steps/FindMatchesStep.d.ts.map +0 -1
- package/dist/src/steps/FindMatchesStep.test.d.ts +0 -2
- package/dist/src/steps/FindMatchesStep.test.d.ts.map +0 -1
- package/dist/src/steps/GotoDefinitionStep.d.ts +0 -86
- package/dist/src/steps/GotoDefinitionStep.d.ts.map +0 -1
- package/dist/src/steps/LLMStep.d.ts +0 -40
- package/dist/src/steps/LLMStep.d.ts.map +0 -1
- package/dist/src/steps/RuleExecutor.d.ts +0 -39
- package/dist/src/steps/RuleExecutor.d.ts.map +0 -1
- package/dist/src/steps/RuleExecutor.test.d.ts +0 -2
- package/dist/src/steps/RuleExecutor.test.d.ts.map +0 -1
- package/dist/src/test/TestExecutor.d.ts +0 -38
- package/dist/src/test/TestExecutor.d.ts.map +0 -1
- package/dist/src/test/rules.test.d.ts +0 -2
- package/dist/src/test/rules.test.d.ts.map +0 -1
- package/dist/src/types.d.ts +0 -197
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/utils/asciiFrames.d.ts +0 -5
- package/dist/src/utils/asciiFrames.d.ts.map +0 -1
- package/dist/src/utils/coordinates.d.ts +0 -12
- package/dist/src/utils/coordinates.d.ts.map +0 -1
- package/dist/src/utils/debugLogger.d.ts +0 -6
- package/dist/src/utils/debugLogger.d.ts.map +0 -1
- package/dist/src/utils/diffValidation.d.ts +0 -24
- package/dist/src/utils/diffValidation.d.ts.map +0 -1
- package/dist/src/utils/diffValidation.test.d.ts +0 -2
- package/dist/src/utils/diffValidation.test.d.ts.map +0 -1
- package/dist/src/utils/formatters.d.ts +0 -58
- package/dist/src/utils/formatters.d.ts.map +0 -1
- package/dist/src/utils/generateTreeDump.d.ts +0 -19
- package/dist/src/utils/generateTreeDump.d.ts.map +0 -1
- package/dist/src/utils/git.d.ts +0 -68
- package/dist/src/utils/git.d.ts.map +0 -1
- package/dist/src/utils/git.test.d.ts +0 -2
- package/dist/src/utils/git.test.d.ts.map +0 -1
- package/dist/src/utils/hashString.d.ts +0 -2
- package/dist/src/utils/hashString.d.ts.map +0 -1
- package/dist/src/utils/patternMatching.d.ts +0 -2
- package/dist/src/utils/patternMatching.d.ts.map +0 -1
- package/dist/src/utils/readTextAtRange.d.ts +0 -10
- package/dist/src/utils/readTextAtRange.d.ts.map +0 -1
- package/dist/src/utils/ruleExecution.d.ts +0 -20
- package/dist/src/utils/ruleExecution.d.ts.map +0 -1
- package/dist/src/utils/snapshotComparison.d.ts +0 -16
- package/dist/src/utils/snapshotComparison.d.ts.map +0 -1
- package/dist/src/utils/startupScreen.d.ts +0 -5
- package/dist/src/utils/startupScreen.d.ts.map +0 -1
- package/dist/src/utils/validateRule.d.ts +0 -52
- package/dist/src/utils/validateRule.d.ts.map +0 -1
- package/dist/src/validationSchemas.d.ts +0 -553
- package/dist/src/validationSchemas.d.ts.map +0 -1
- package/dist/src/version.d.ts +0 -3
- package/dist/src/version.d.ts.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/vitest.config.d.mts +0 -3
- package/dist/vitest.config.d.mts.map +0 -1
package/dist/src/types.d.ts
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { Language } from "powerlint/languages";
|
|
2
|
-
export type LLMProvider = "wispbit";
|
|
3
|
-
export declare class InvalidRuleFormatError extends Error {
|
|
4
|
-
validationErrors?: string[] | undefined;
|
|
5
|
-
constructor(ruleId: string, message: string, validationErrors?: string[] | undefined);
|
|
6
|
-
}
|
|
7
|
-
export interface RuleTestCaseFile {
|
|
8
|
-
path: string;
|
|
9
|
-
content: string;
|
|
10
|
-
}
|
|
11
|
-
export interface RuleTestCase {
|
|
12
|
-
it: string;
|
|
13
|
-
files: RuleTestCaseFile[];
|
|
14
|
-
snapshot?: any[];
|
|
15
|
-
}
|
|
16
|
-
export interface RangePosition {
|
|
17
|
-
line: number;
|
|
18
|
-
column?: number;
|
|
19
|
-
}
|
|
20
|
-
export interface RangeObject {
|
|
21
|
-
start: RangePosition;
|
|
22
|
-
end: RangePosition;
|
|
23
|
-
}
|
|
24
|
-
export interface PatternObject {
|
|
25
|
-
selector?: string;
|
|
26
|
-
context?: string;
|
|
27
|
-
strictness?: "cst" | "smart" | "ast" | "relaxed" | "signature";
|
|
28
|
-
}
|
|
29
|
-
export type NthChild = number | string | {
|
|
30
|
-
position: number | string;
|
|
31
|
-
reverse?: boolean;
|
|
32
|
-
ofRule?: AstGrepRule;
|
|
33
|
-
};
|
|
34
|
-
export interface AstGrepRule {
|
|
35
|
-
pattern?: string | PatternObject;
|
|
36
|
-
kind?: string;
|
|
37
|
-
regex?: string;
|
|
38
|
-
nthChild?: NthChild;
|
|
39
|
-
range?: RangeObject;
|
|
40
|
-
inside?: {
|
|
41
|
-
stopBy?: "neighbor" | "end" | AstGrepRule;
|
|
42
|
-
field?: string;
|
|
43
|
-
} & AstGrepRule;
|
|
44
|
-
has?: {
|
|
45
|
-
stopBy?: "neighbor" | "end" | AstGrepRule;
|
|
46
|
-
field?: string;
|
|
47
|
-
} & AstGrepRule;
|
|
48
|
-
precedes?: {
|
|
49
|
-
stopBy?: "neighbor" | "end" | AstGrepRule;
|
|
50
|
-
} & AstGrepRule;
|
|
51
|
-
follows?: {
|
|
52
|
-
stopBy?: "neighbor" | "end" | AstGrepRule;
|
|
53
|
-
} & AstGrepRule;
|
|
54
|
-
all?: AstGrepRule[];
|
|
55
|
-
any?: AstGrepRule[];
|
|
56
|
-
not?: AstGrepRule;
|
|
57
|
-
matches?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface FactPredicate {
|
|
60
|
-
fact: "fs.siblingAny" | "fs.siblingExists" | "fs.ancestorHas";
|
|
61
|
-
args?: null | string | boolean | number | (string | number | boolean | object | any[] | null)[] | object;
|
|
62
|
-
equals?: boolean;
|
|
63
|
-
}
|
|
64
|
-
export interface WhereExpr {
|
|
65
|
-
all?: FactPredicate[];
|
|
66
|
-
any?: FactPredicate[];
|
|
67
|
-
not?: FactPredicate[];
|
|
68
|
-
}
|
|
69
|
-
export type FileFilterCondition = {
|
|
70
|
-
"fs.siblingExists": {
|
|
71
|
-
filename: string;
|
|
72
|
-
};
|
|
73
|
-
} | {
|
|
74
|
-
"fs.ancestorHas": {
|
|
75
|
-
filename: string;
|
|
76
|
-
};
|
|
77
|
-
} | {
|
|
78
|
-
"fs.siblingAny": {
|
|
79
|
-
pattern: string;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
export interface FileFilterConditions {
|
|
83
|
-
all?: FileFilterCondition[];
|
|
84
|
-
any?: FileFilterCondition[];
|
|
85
|
-
not?: FileFilterCondition[];
|
|
86
|
-
}
|
|
87
|
-
export interface AstGrepStep {
|
|
88
|
-
type: "ast-grep";
|
|
89
|
-
language: Language;
|
|
90
|
-
rule: AstGrepRule;
|
|
91
|
-
constraints?: Record<string, AstGrepRule>;
|
|
92
|
-
}
|
|
93
|
-
export interface FileFilterStep {
|
|
94
|
-
type: "file-filter";
|
|
95
|
-
include?: string[];
|
|
96
|
-
ignore?: string[];
|
|
97
|
-
conditions?: FileFilterConditions;
|
|
98
|
-
}
|
|
99
|
-
export interface LLMStep {
|
|
100
|
-
type: "llm";
|
|
101
|
-
}
|
|
102
|
-
interface NameSpec {
|
|
103
|
-
equals?: string;
|
|
104
|
-
anyOf?: string[];
|
|
105
|
-
regex?: string;
|
|
106
|
-
}
|
|
107
|
-
interface FileMatch {
|
|
108
|
-
path?: string;
|
|
109
|
-
glob?: string;
|
|
110
|
-
regex?: string;
|
|
111
|
-
}
|
|
112
|
-
interface MethodSelector {
|
|
113
|
-
file?: FileMatch;
|
|
114
|
-
name: NameSpec;
|
|
115
|
-
}
|
|
116
|
-
interface ClassSelector {
|
|
117
|
-
file?: FileMatch;
|
|
118
|
-
name: NameSpec;
|
|
119
|
-
method?: MethodSelector;
|
|
120
|
-
}
|
|
121
|
-
interface FunctionSelector {
|
|
122
|
-
file?: FileMatch;
|
|
123
|
-
name: NameSpec;
|
|
124
|
-
}
|
|
125
|
-
interface DefinitionPredicateBase {
|
|
126
|
-
file?: FileMatch;
|
|
127
|
-
class?: ClassSelector;
|
|
128
|
-
method?: MethodSelector;
|
|
129
|
-
function?: FunctionSelector;
|
|
130
|
-
}
|
|
131
|
-
interface DefinitionFilter {
|
|
132
|
-
all?: DefinitionPredicateBase[];
|
|
133
|
-
any?: DefinitionPredicateBase[];
|
|
134
|
-
not?: DefinitionPredicateBase;
|
|
135
|
-
}
|
|
136
|
-
export interface GotoDefinitionStep {
|
|
137
|
-
type: "goto-definition";
|
|
138
|
-
language: Language;
|
|
139
|
-
where?: DefinitionFilter;
|
|
140
|
-
}
|
|
141
|
-
export interface StepGroupStep {
|
|
142
|
-
type: "step-group";
|
|
143
|
-
steps: (AstGrepStep | FileFilterStep | LLMStep | GotoDefinitionStep)[];
|
|
144
|
-
}
|
|
145
|
-
export type RuleStep = AstGrepStep | FileFilterStep | LLMStep | GotoDefinitionStep | StepGroupStep;
|
|
146
|
-
export interface MatchRange {
|
|
147
|
-
start: {
|
|
148
|
-
line: number;
|
|
149
|
-
column: number;
|
|
150
|
-
};
|
|
151
|
-
end: {
|
|
152
|
-
line: number;
|
|
153
|
-
column: number;
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
export interface MatchSource {
|
|
157
|
-
filePath: string;
|
|
158
|
-
text?: string;
|
|
159
|
-
range: MatchRange;
|
|
160
|
-
symbol?: string;
|
|
161
|
-
language: Language;
|
|
162
|
-
}
|
|
163
|
-
export interface Match {
|
|
164
|
-
filePath: string;
|
|
165
|
-
text?: string;
|
|
166
|
-
range: MatchRange;
|
|
167
|
-
symbol?: string;
|
|
168
|
-
language: Language;
|
|
169
|
-
source?: MatchSource[];
|
|
170
|
-
metadata?: {
|
|
171
|
-
fromCache?: boolean;
|
|
172
|
-
llmValidation?: {
|
|
173
|
-
isViolation: boolean;
|
|
174
|
-
confidence: number;
|
|
175
|
-
reason: string;
|
|
176
|
-
};
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
export interface RuleStepWithId {
|
|
180
|
-
id: string;
|
|
181
|
-
step: RuleStep;
|
|
182
|
-
}
|
|
183
|
-
export interface RuleConfig {
|
|
184
|
-
message: string;
|
|
185
|
-
severity: "suggestion" | "violation";
|
|
186
|
-
execution: "llm" | "deterministic";
|
|
187
|
-
steps: RuleStepWithId[];
|
|
188
|
-
}
|
|
189
|
-
export interface Rule {
|
|
190
|
-
id: string;
|
|
191
|
-
internalId: string;
|
|
192
|
-
config: RuleConfig;
|
|
193
|
-
prompt: string;
|
|
194
|
-
testCases: RuleTestCase[];
|
|
195
|
-
}
|
|
196
|
-
export {};
|
|
197
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C,MAAM,MAAM,WAAW,GAAG,SAAS,CAAA;AAEnC,qBAAa,sBAAuB,SAAQ,KAAK;IAItC,gBAAgB,CAAC,EAAE,MAAM,EAAE;gBAFlC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,E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EAAE,CAAA;IACtB,QAAQ,CAAC,EAAE;QACT,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,aAAa,CAAC,EAAE;YACd,WAAW,EAAE,OAAO,CAAA;YACpB,UAAU,EAAE,MAAM,CAAA;YAClB,MAAM,EAAE,MAAM,CAAA;SACf,CAAA;KACF,CAAA;CACF;AAID,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,QAAQ,CAAA;CACf;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,YAAY,GAAG,WAAW,CAAA;IACpC,SAAS,EAAE,KAAK,GAAG,eAAe,CAAA;IAClC,KAAK,EAAE,cAAc,EAAE,CAAA;CACxB;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,UAAU,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,YAAY,EAAE,CAAA;CAC1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asciiFrames.d.ts","sourceRoot":"","sources":["../../../src/utils/asciiFrames.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,cAAc,UAkD1B,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Match } from "powerlint/types";
|
|
2
|
-
/**
|
|
3
|
-
* Convert a match with 1-indexed coordinates (line and column) to 0-indexed coordinates
|
|
4
|
-
* Used when interfacing with tools that expect 0-indexed coordinates (SCIP, ast-grep)
|
|
5
|
-
*/
|
|
6
|
-
export declare function matchTo0Indexed(match: Match): Match;
|
|
7
|
-
/**
|
|
8
|
-
* Convert a match with 0-indexed coordinates (line and column) to 1-indexed coordinates
|
|
9
|
-
* Used when converting results from tools that use 0-indexed coordinates (SCIP, ast-grep)
|
|
10
|
-
*/
|
|
11
|
-
export declare function matchTo1Indexed(match: Match): Match;
|
|
12
|
-
//# sourceMappingURL=coordinates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coordinates.d.ts","sourceRoot":"","sources":["../../../src/utils/coordinates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAcnD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAcnD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debugLogger.d.ts","sourceRoot":"","sources":["../../../src/utils/debugLogger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAA;AAE7E;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,qBAAqB,GAAG,IAAI,CAgG3E"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Match } from "powerlint/types";
|
|
2
|
-
import type { FileChange } from "powerlint/utils/git";
|
|
3
|
-
export interface DiffValidationOptions {
|
|
4
|
-
changedFiles: string[];
|
|
5
|
-
fileChangeMap: Map<string, FileChange>;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Check if a file path is valid against the given diff changes
|
|
9
|
-
*/
|
|
10
|
-
export declare function isFileValidInDiff(filePath: string, options: DiffValidationOptions): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Check if a line range is valid against the given diff changes
|
|
13
|
-
*/
|
|
14
|
-
export declare function isLineRangeValidInDiff(filePath: string, startLine: number, endLine: number, options: DiffValidationOptions): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Check if a match is valid against the given diff changes
|
|
17
|
-
*/
|
|
18
|
-
export declare function isMatchValidInDiff(match: Match, options: DiffValidationOptions): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Parse a git patch to determine if a line range intersects with changed lines
|
|
21
|
-
* Adapted from patchParser.ts logic
|
|
22
|
-
*/
|
|
23
|
-
export declare function isLineRangeInPatch(patch: string, startLine: number, endLine: number): boolean;
|
|
24
|
-
//# sourceMappingURL=diffValidation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diffValidation.d.ts","sourceRoot":"","sources":["../../../src/utils/diffValidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;CACvC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAS3F;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAqBT;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAKxF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAmC7F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diffValidation.test.d.ts","sourceRoot":"","sources":["../../../src/utils/diffValidation.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { ScanResult } from "powerlint/cli";
|
|
2
|
-
import { ExecutionEventEmitter } from "powerlint/steps/ExecutionEventEmitter";
|
|
3
|
-
export declare const VIOLATION_COLOR = "#f87171";
|
|
4
|
-
export declare const SUGGESTION_COLOR = "#60a5fa";
|
|
5
|
-
export declare const SKIPPED_COLOR = "#9b59b6";
|
|
6
|
-
export declare const BRAND_COLOR = "#fbbf24";
|
|
7
|
-
export declare const DETERMINISTIC_COLOR = "#9ca3af";
|
|
8
|
-
export declare const LLM_COLOR = "#9b59b6";
|
|
9
|
-
export declare const LINE_NUMBER_BG_COLOR = "#f8f8f8";
|
|
10
|
-
export declare const LINE_NUMBER_TEXT_COLOR = "#888888";
|
|
11
|
-
export interface LintSummary {
|
|
12
|
-
totalRules: number;
|
|
13
|
-
violationCount: number;
|
|
14
|
-
suggestionCount: number;
|
|
15
|
-
totalMatches: number;
|
|
16
|
-
totalLLMCost: string;
|
|
17
|
-
totalLLMTokens: number;
|
|
18
|
-
executionMode?: {
|
|
19
|
-
mode: "check" | "diff";
|
|
20
|
-
filePath?: string;
|
|
21
|
-
baseCommit?: string;
|
|
22
|
-
headCommit?: string;
|
|
23
|
-
};
|
|
24
|
-
executionTime?: number;
|
|
25
|
-
totalFiles?: number;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Text table utility function based on ESLint's implementation
|
|
29
|
-
* @param {string[][]} rows Array of rows, each row is an array of strings
|
|
30
|
-
* @param {object} opts Options object with align and stringLength properties
|
|
31
|
-
* @returns {string} Formatted table as string
|
|
32
|
-
*/
|
|
33
|
-
export declare function textTable(rows: string[][], opts?: {
|
|
34
|
-
align?: string[];
|
|
35
|
-
stringLength?: (str: string) => number;
|
|
36
|
-
}): string;
|
|
37
|
-
export declare function printSummary(results: ScanResult[], summary: LintSummary): void;
|
|
38
|
-
/**
|
|
39
|
-
* Print a formatted list of rules with their ID, severity, and message
|
|
40
|
-
*/
|
|
41
|
-
export declare function printRulesList(rules: Array<{
|
|
42
|
-
id: string;
|
|
43
|
-
internalId?: string;
|
|
44
|
-
config: {
|
|
45
|
-
severity: "violation" | "suggestion";
|
|
46
|
-
message: string;
|
|
47
|
-
execution: "llm" | "deterministic";
|
|
48
|
-
};
|
|
49
|
-
}>): void;
|
|
50
|
-
/**
|
|
51
|
-
* Output results in JSON format compatible with ast-grep
|
|
52
|
-
*/
|
|
53
|
-
export declare function outputJSON(results: ScanResult[], format?: "pretty" | "stream" | "compact"): void;
|
|
54
|
-
/**
|
|
55
|
-
* Set up terminal reporting for the event emitter
|
|
56
|
-
*/
|
|
57
|
-
export declare function setupTerminalReporter(eventEmitter: ExecutionEventEmitter, debugMode?: boolean): () => void;
|
|
58
|
-
//# sourceMappingURL=formatters.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../src/utils/formatters.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAA;AAG7E,eAAO,MAAM,eAAe,YAAY,CAAA;AACxC,eAAO,MAAM,gBAAgB,YAAY,CAAA;AACzC,eAAO,MAAM,aAAa,YAAY,CAAA;AAGtC,eAAO,MAAM,WAAW,YAAY,CAAA;AAGpC,eAAO,MAAM,mBAAmB,YAAY,CAAA;AAC5C,eAAO,MAAM,SAAS,YAAY,CAAA;AAyBlC,eAAO,MAAM,oBAAoB,YAAY,CAAA;AAC7C,eAAO,MAAM,sBAAsB,YAAY,CAAA;AA6B/C,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE;QACd,IAAI,EAAE,OAAO,GAAG,MAAM,CAAA;QACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAgBD;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EAAE,EAAE,EAChB,IAAI,GAAE;IACJ,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;CAClC,GACL,MAAM,CAiCR;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAoL9E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,KAAK,CAAC;IACX,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE;QACN,QAAQ,EAAE,WAAW,GAAG,YAAY,CAAA;QACpC,OAAO,EAAE,MAAM,CAAA;QACf,SAAS,EAAE,KAAK,GAAG,eAAe,CAAA;KACnC,CAAA;CACF,CAAC,GACD,IAAI,CAyEN;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,UAAU,EAAE,EACrB,MAAM,GAAE,QAAQ,GAAG,QAAQ,GAAG,SAAoB,GACjD,IAAI,CAgCN;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,qBAAqB,EACnC,SAAS,GAAE,OAAe,GACzB,MAAM,IAAI,CAwQZ"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Language } from "powerlint/languages";
|
|
2
|
-
export declare enum DebugFormat {
|
|
3
|
-
/** Print the AST format, only named nodes are shown */
|
|
4
|
-
AST = "ast",
|
|
5
|
-
/** Print the CST format, both named and unnamed nodes are shown */
|
|
6
|
-
CST = "cst",
|
|
7
|
-
/** Print the S-expression format */
|
|
8
|
-
SEXP = "sexp"
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Generate a tree dump similar to ast-grep's Rust implementation
|
|
12
|
-
* @param language - The language to parse the code as
|
|
13
|
-
* @param code - The source code to analyze
|
|
14
|
-
* @param format - The debug format to use (AST, CST, or SEXP)
|
|
15
|
-
* @param colored - Whether to use colored output (default: false)
|
|
16
|
-
* @returns Formatted tree representation
|
|
17
|
-
*/
|
|
18
|
-
export declare function generateTreeDump(language: Language, code: string, format?: DebugFormat, colored?: boolean): string;
|
|
19
|
-
//# sourceMappingURL=generateTreeDump.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateTreeDump.d.ts","sourceRoot":"","sources":["../../../src/utils/generateTreeDump.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C,oBAAY,WAAW;IACrB,uDAAuD;IACvD,GAAG,QAAQ;IACX,mEAAmE;IACnE,GAAG,QAAQ;IACX,oCAAoC;IACpC,IAAI,SAAS;CACd;AAsKD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,WAA6B,EACrC,OAAO,GAAE,OAAe,GACvB,MAAM,CAkCR"}
|
package/dist/src/utils/git.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
export interface FileChange {
|
|
2
|
-
filename: string;
|
|
3
|
-
status: "added" | "modified" | "removed";
|
|
4
|
-
patch: string;
|
|
5
|
-
additions: number;
|
|
6
|
-
deletions: number;
|
|
7
|
-
sha: string;
|
|
8
|
-
oldFilename?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface GitChanges {
|
|
11
|
-
files: FileChange[];
|
|
12
|
-
currentBranch: string;
|
|
13
|
-
currentCommit: string;
|
|
14
|
-
diffBranch: string;
|
|
15
|
-
diffCommit: string;
|
|
16
|
-
}
|
|
17
|
-
export type LocalInclude = "committed" | "staged" | "unstaged" | "untracked";
|
|
18
|
-
/**
|
|
19
|
-
* Find the Git repository root directory by looking for .git
|
|
20
|
-
*/
|
|
21
|
-
export declare function findGitRoot(): string;
|
|
22
|
-
/**
|
|
23
|
-
* Get list of git-ignored files in the repository
|
|
24
|
-
* Uses: git ls-files --ignored --exclude-standard --others
|
|
25
|
-
*/
|
|
26
|
-
export declare function getGitIgnoredFiles(repoRoot: string): Promise<string[]>;
|
|
27
|
-
/**
|
|
28
|
-
* Get the remote repository URL from Git config
|
|
29
|
-
* @param repoRoot Path to the Git repository root
|
|
30
|
-
* @param remoteName Name of the remote (default: origin)
|
|
31
|
-
* @returns The remote repository URL or null if not found
|
|
32
|
-
*/
|
|
33
|
-
export declare function getRepositoryUrl(repoRoot: string, remoteName?: string): Promise<string | null>;
|
|
34
|
-
/**
|
|
35
|
-
* Get the default branch from remote (typically main or master)
|
|
36
|
-
* @param repoRoot Path to the Git repository root
|
|
37
|
-
* @param remoteName Name of the remote (default: origin)
|
|
38
|
-
*/
|
|
39
|
-
export declare function getDefaultBranch(repoRoot: string, remoteName?: string): Promise<string | null>;
|
|
40
|
-
/**
|
|
41
|
-
* Get the current Git branch name
|
|
42
|
-
*/
|
|
43
|
-
export declare function getCurrentBranch(repoRoot: string): Promise<string>;
|
|
44
|
-
/**
|
|
45
|
-
* Validate that worktree includes are only used with ranges ending at HEAD or current branch
|
|
46
|
-
* Returns null if valid, error message if invalid
|
|
47
|
-
*/
|
|
48
|
-
export declare function validateWorktreeIncludes(commitSelector: string, includes: LocalInclude[], currentBranch: string): string | null;
|
|
49
|
-
/**
|
|
50
|
-
* Get the default commit selector for the current repository
|
|
51
|
-
* Returns a commit selector string and default includes
|
|
52
|
-
*/
|
|
53
|
-
export declare function getDefaultCommitSelector(repoRoot: string): Promise<{
|
|
54
|
-
commitSelector: string;
|
|
55
|
-
include: LocalInclude[];
|
|
56
|
-
}>;
|
|
57
|
-
/**
|
|
58
|
-
* Get list of changed files in the current Git repository with their changes
|
|
59
|
-
* @param repoRoot Path to the Git repository root
|
|
60
|
-
* @param options Options for selecting commits and including changed files
|
|
61
|
-
*/
|
|
62
|
-
export declare function getChangedFiles(repoRoot: string, options: {
|
|
63
|
-
/** Commit selector: "<rev>", "<A..B>", "<A...B>", "HEAD" */
|
|
64
|
-
commitSelector: string;
|
|
65
|
-
/** Types of changes to include */
|
|
66
|
-
include: LocalInclude[];
|
|
67
|
-
}): Promise<GitChanges>;
|
|
68
|
-
//# sourceMappingURL=git.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../src/utils/git.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAA;AAS5E;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAGpC;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAU5E;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,UAAU,GAAE,MAAiB,GAC5B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMxB;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,UAAU,GAAE,MAAiB,GAC5B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAuBxB;AA0QD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKxE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,YAAY,EAAE,EACxB,aAAa,EAAE,MAAM,GACpB,MAAM,GAAG,IAAI,CA0Bf;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IACxE,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB,CAAC,CAsDD;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;IACP,4DAA4D;IAC5D,cAAc,EAAE,MAAM,CAAA;IACtB,kCAAkC;IAClC,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB,GACA,OAAO,CAAC,UAAU,CAAC,CA4TrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git.test.d.ts","sourceRoot":"","sources":["../../../src/utils/git.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hashString.d.ts","sourceRoot":"","sources":["../../../src/utils/hashString.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,UAErC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"patternMatching.d.ts","sourceRoot":"","sources":["../../../src/utils/patternMatching.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAI/E"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { MatchRange } from "powerlint/types";
|
|
2
|
-
/**
|
|
3
|
-
* Read text from a file at the given range
|
|
4
|
-
* @param workspaceRoot - The workspace root directory
|
|
5
|
-
* @param filePath - The relative file path from workspace root
|
|
6
|
-
* @param range - The range object with start and end positions
|
|
7
|
-
* @returns The text content at the specified range
|
|
8
|
-
*/
|
|
9
|
-
export declare function readTextAtRange(workspaceRoot: string, filePath: string, range: MatchRange): Promise<string>;
|
|
10
|
-
//# sourceMappingURL=readTextAtRange.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readTextAtRange.d.ts","sourceRoot":"","sources":["../../../src/utils/readTextAtRange.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,MAAM,CAAC,CAyBjB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { RuleStep, RuleStepWithId } from "../types";
|
|
2
|
-
export type RuleExecutionType = "llm" | "deterministic";
|
|
3
|
-
/**
|
|
4
|
-
* Determines whether a rule uses LLM or deterministic execution based on its schema.
|
|
5
|
-
*
|
|
6
|
-
* @param schema - The rule schema (can be null, RuleConfig object, or JSON string)
|
|
7
|
-
* @returns "llm" if the rule uses LLM steps or has no schema, "deterministic" otherwise
|
|
8
|
-
*/
|
|
9
|
-
export declare function determineRuleExecution(schema: RuleStepWithId[] | null | undefined): RuleExecutionType;
|
|
10
|
-
/**
|
|
11
|
-
* Type guard to check if a step is an LLM step
|
|
12
|
-
*/
|
|
13
|
-
export declare function isLlmStep(step: RuleStep): step is {
|
|
14
|
-
type: "llm";
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Checks if a rule configuration contains any LLM steps
|
|
18
|
-
*/
|
|
19
|
-
export declare function hasLlmSteps(steps: RuleStepWithId[]): boolean;
|
|
20
|
-
//# sourceMappingURL=ruleExecution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ruleExecution.d.ts","sourceRoot":"","sources":["../../../src/utils/ruleExecution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAEnD,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,eAAe,CAAA;AAEvD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,GAAG,SAAS,GAC1C,iBAAiB,CAWnB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,IAAI;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAEjE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAe5D"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Match } from "powerlint/types";
|
|
2
|
-
export interface SnapshotComparisonResult {
|
|
3
|
-
matches: boolean;
|
|
4
|
-
error?: string;
|
|
5
|
-
expected?: any[];
|
|
6
|
-
actual?: any[];
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Compare actual matches against expected snapshot data
|
|
10
|
-
*/
|
|
11
|
-
export declare function compareSnapshots(actualMatches: Match[], expectedSnapshot: any[] | undefined, testName: string): SnapshotComparisonResult;
|
|
12
|
-
/**
|
|
13
|
-
* Format snapshot comparison error for display
|
|
14
|
-
*/
|
|
15
|
-
export declare function formatSnapshotError(result: SnapshotComparisonResult): string;
|
|
16
|
-
//# sourceMappingURL=snapshotComparison.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotComparison.d.ts","sourceRoot":"","sources":["../../../src/utils/snapshotComparison.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;CACf;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,KAAK,EAAE,EACtB,gBAAgB,EAAE,GAAG,EAAE,GAAG,SAAS,EACnC,QAAQ,EAAE,MAAM,GACf,wBAAwB,CAyB1B;AAoCD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,wBAAwB,GAAG,MAAM,CAa5E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"startupScreen.d.ts","sourceRoot":"","sources":["../../../src/utils/startupScreen.ts"],"names":[],"mappings":"AA0DA;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA0BhE"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { RuleTestCase } from "powerlint/types";
|
|
3
|
-
export declare const TestCasesSchema: z.ZodObject<{
|
|
4
|
-
it: z.ZodString;
|
|
5
|
-
files: z.ZodArray<z.ZodObject<{
|
|
6
|
-
path: z.ZodString;
|
|
7
|
-
content: z.ZodString;
|
|
8
|
-
matches: z.ZodNumber;
|
|
9
|
-
}, "strip", z.ZodTypeAny, {
|
|
10
|
-
path: string;
|
|
11
|
-
matches: number;
|
|
12
|
-
content: string;
|
|
13
|
-
}, {
|
|
14
|
-
path: string;
|
|
15
|
-
matches: number;
|
|
16
|
-
content: string;
|
|
17
|
-
}>, "many">;
|
|
18
|
-
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
files: {
|
|
20
|
-
path: string;
|
|
21
|
-
matches: number;
|
|
22
|
-
content: string;
|
|
23
|
-
}[];
|
|
24
|
-
it: string;
|
|
25
|
-
}, {
|
|
26
|
-
files: {
|
|
27
|
-
path: string;
|
|
28
|
-
matches: number;
|
|
29
|
-
content: string;
|
|
30
|
-
}[];
|
|
31
|
-
it: string;
|
|
32
|
-
}>;
|
|
33
|
-
export declare function validateRuleSteps(steps: {
|
|
34
|
-
id: string;
|
|
35
|
-
step: any;
|
|
36
|
-
}[], testCases: RuleTestCase[], include?: string[], ignore?: string[]): Promise<{
|
|
37
|
-
isValid: boolean;
|
|
38
|
-
feedback: string;
|
|
39
|
-
data?: undefined;
|
|
40
|
-
} | {
|
|
41
|
-
isValid: boolean;
|
|
42
|
-
feedback: string;
|
|
43
|
-
data: {
|
|
44
|
-
id: string;
|
|
45
|
-
step: any;
|
|
46
|
-
}[];
|
|
47
|
-
}>;
|
|
48
|
-
export declare function validateTests(testCases: RuleTestCase[], include: string[]): {
|
|
49
|
-
isValid: boolean;
|
|
50
|
-
feedback: string;
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=validateRule.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateRule.d.ts","sourceRoot":"","sources":["../../../src/utils/validateRule.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAA;AAInB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAI9C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW1B,CAAA;AAEF,wBAAsB,iBAAiB,CACrC,KAAK,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,EAAE,EAClC,SAAS,EAAE,YAAY,EAAE,EACzB,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,MAAM,CAAC,EAAE,MAAM,EAAE;;;;;;;;YAGW,MAAM;cAAQ,GAAG;;GAqE9C;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;;;EAqDzE"}
|