@wispbit/local 1.0.25
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/build.d.ts +3 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/cli.js +3668 -0
- package/dist/cli.js.map +7 -0
- package/dist/index.js +3868 -0
- package/dist/index.js.map +7 -0
- package/dist/package.json +72 -0
- package/dist/src/cli.d.ts +16 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/config.d.ts +6 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/environment/Config.d.ts +69 -0
- package/dist/src/environment/Config.d.ts.map +1 -0
- package/dist/src/environment/Environment.d.ts +23 -0
- package/dist/src/environment/Environment.d.ts.map +1 -0
- package/dist/src/environment/Sandbox.d.ts +48 -0
- package/dist/src/environment/Sandbox.d.ts.map +1 -0
- package/dist/src/environment/Storage.d.ts +84 -0
- package/dist/src/environment/Storage.d.ts.map +1 -0
- package/dist/src/index.d.ts +16 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/languages.d.ts +36 -0
- package/dist/src/languages.d.ts.map +1 -0
- package/dist/src/providers/AstGrepAstProvider.d.ts +44 -0
- package/dist/src/providers/AstGrepAstProvider.d.ts.map +1 -0
- package/dist/src/providers/LanguageBackend.d.ts +74 -0
- package/dist/src/providers/LanguageBackend.d.ts.map +1 -0
- package/dist/src/providers/RuleProvider.d.ts +46 -0
- package/dist/src/providers/RuleProvider.d.ts.map +1 -0
- package/dist/src/providers/ScipIntelligenceProvider.d.ts +84 -0
- package/dist/src/providers/ScipIntelligenceProvider.d.ts.map +1 -0
- package/dist/src/providers/ViolationValidationProvider.d.ts +42 -0
- package/dist/src/providers/ViolationValidationProvider.d.ts.map +1 -0
- package/dist/src/providers/WispbitRuleProvider.d.ts +45 -0
- package/dist/src/providers/WispbitRuleProvider.d.ts.map +1 -0
- package/dist/src/providers/WispbitViolationValidationProvider.d.ts +15 -0
- package/dist/src/providers/WispbitViolationValidationProvider.d.ts.map +1 -0
- package/dist/src/schemas.d.ts +1771 -0
- package/dist/src/schemas.d.ts.map +1 -0
- package/dist/src/steps/ExecutionEventEmitter.d.ts +156 -0
- package/dist/src/steps/ExecutionEventEmitter.d.ts.map +1 -0
- package/dist/src/steps/FileExecutionContext.d.ts +85 -0
- package/dist/src/steps/FileExecutionContext.d.ts.map +1 -0
- package/dist/src/steps/FileFilterStep.d.ts +35 -0
- package/dist/src/steps/FileFilterStep.d.ts.map +1 -0
- package/dist/src/steps/FileFilterStep.test.d.ts +2 -0
- package/dist/src/steps/FileFilterStep.test.d.ts.map +1 -0
- package/dist/src/steps/FindMatchesStep.d.ts +41 -0
- package/dist/src/steps/FindMatchesStep.d.ts.map +1 -0
- package/dist/src/steps/FindMatchesStep.test.d.ts +2 -0
- package/dist/src/steps/FindMatchesStep.test.d.ts.map +1 -0
- package/dist/src/steps/GotoDefinitionStep.d.ts +86 -0
- package/dist/src/steps/GotoDefinitionStep.d.ts.map +1 -0
- package/dist/src/steps/LLMStep.d.ts +50 -0
- package/dist/src/steps/LLMStep.d.ts.map +1 -0
- package/dist/src/steps/RuleExecutor.d.ts +35 -0
- package/dist/src/steps/RuleExecutor.d.ts.map +1 -0
- package/dist/src/steps/RuleExecutor.test.d.ts +2 -0
- package/dist/src/steps/RuleExecutor.test.d.ts.map +1 -0
- package/dist/src/test/TestExecutor.d.ts +33 -0
- package/dist/src/test/TestExecutor.d.ts.map +1 -0
- package/dist/src/test/rules.test.d.ts +2 -0
- package/dist/src/test/rules.test.d.ts.map +1 -0
- package/dist/src/types.d.ts +200 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/utils/asciiFrames.d.ts +5 -0
- package/dist/src/utils/asciiFrames.d.ts.map +1 -0
- package/dist/src/utils/formatters.d.ts +55 -0
- package/dist/src/utils/formatters.d.ts.map +1 -0
- package/dist/src/utils/generateTreeDump.d.ts +19 -0
- package/dist/src/utils/generateTreeDump.d.ts.map +1 -0
- package/dist/src/utils/git.d.ts +39 -0
- package/dist/src/utils/git.d.ts.map +1 -0
- package/dist/src/utils/hashString.d.ts +2 -0
- package/dist/src/utils/hashString.d.ts.map +1 -0
- package/dist/src/utils/readTextAtRange.d.ts +10 -0
- package/dist/src/utils/readTextAtRange.d.ts.map +1 -0
- package/dist/src/utils/snapshotComparison.d.ts +16 -0
- package/dist/src/utils/snapshotComparison.d.ts.map +1 -0
- package/dist/src/utils/startupScreen.d.ts +5 -0
- package/dist/src/utils/startupScreen.d.ts.map +1 -0
- package/dist/src/utils/validateRule.d.ts +16 -0
- package/dist/src/utils/validateRule.d.ts.map +1 -0
- package/dist/src/version.d.ts +3 -0
- package/dist/src/version.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/vitest.config.d.mts +3 -0
- package/dist/vitest.config.d.mts.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { Environment } from "powerlint/environment/Environment";
|
|
2
|
+
import { Language } from "powerlint/languages";
|
|
3
|
+
import type { IntelligenceProvider } from "powerlint/providers/LanguageBackend";
|
|
4
|
+
import { ExecutionEventEmitter } from "powerlint/steps/ExecutionEventEmitter";
|
|
5
|
+
import { Match } from "powerlint/types";
|
|
6
|
+
/**
|
|
7
|
+
* SCIP (Source Code Intelligence Protocol) implementation of IntelligenceProvider
|
|
8
|
+
* Provides code navigation features using SCIP indexes
|
|
9
|
+
*/
|
|
10
|
+
export declare class ScipIntelligenceProvider implements IntelligenceProvider {
|
|
11
|
+
private environment;
|
|
12
|
+
private storage;
|
|
13
|
+
private language;
|
|
14
|
+
private scipIndex;
|
|
15
|
+
private indexingPromise;
|
|
16
|
+
private eventEmitter;
|
|
17
|
+
constructor(environment: Environment, language: Language, eventEmitter?: ExecutionEventEmitter);
|
|
18
|
+
/**
|
|
19
|
+
* Get the SCIP CLI command for the given language
|
|
20
|
+
*/
|
|
21
|
+
private getScipCommand;
|
|
22
|
+
/**
|
|
23
|
+
* Ensure the index is ready, starting indexing if needed
|
|
24
|
+
*/
|
|
25
|
+
private ensureIndexReady;
|
|
26
|
+
/**
|
|
27
|
+
* Start the indexing process
|
|
28
|
+
*/
|
|
29
|
+
private startIndexing;
|
|
30
|
+
/**
|
|
31
|
+
* Find all definitions for a given match
|
|
32
|
+
* Automatically filters out external symbols
|
|
33
|
+
*/
|
|
34
|
+
findDefinitions(match: Match): Promise<Match[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Find all references for a given match
|
|
37
|
+
* Automatically filters out external symbols
|
|
38
|
+
*/
|
|
39
|
+
findReferences(match: Match): Promise<Match[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Check if a symbol is from an external library (internal use)
|
|
42
|
+
*/
|
|
43
|
+
private isExternalSymbol;
|
|
44
|
+
/**
|
|
45
|
+
* Find the best SCIP occurrence that overlaps with the given match
|
|
46
|
+
* Uses heuristics to pick the most relevant occurrence when multiple overlap
|
|
47
|
+
*/
|
|
48
|
+
private findBestOverlappingOccurrence;
|
|
49
|
+
/**
|
|
50
|
+
* Check if two ranges overlap
|
|
51
|
+
*/
|
|
52
|
+
private rangesOverlap;
|
|
53
|
+
/**
|
|
54
|
+
* Check if SCIP range is fully inside the match span
|
|
55
|
+
*/
|
|
56
|
+
private rangeFullyInside;
|
|
57
|
+
/**
|
|
58
|
+
* Extract class and method names from SCIP symbol
|
|
59
|
+
* e.g., "scip-typescript npm @wispbit/server 1.0.0 src/services/`OrganizationService`#updateViolationCounts()."
|
|
60
|
+
* returns { className: "OrganizationService", methodName: "updateViolationCounts" }
|
|
61
|
+
*
|
|
62
|
+
* For standalone functions without a class:
|
|
63
|
+
* e.g., "scip-typescript npm @wispbit/server 1.0.0 src/utils/helper()."
|
|
64
|
+
* returns { className: null, methodName: "helper" }
|
|
65
|
+
*/
|
|
66
|
+
private extractSymbolNames;
|
|
67
|
+
/**
|
|
68
|
+
* Find definition for a symbol across all documents
|
|
69
|
+
*/
|
|
70
|
+
private findDefinitionForSymbol;
|
|
71
|
+
/**
|
|
72
|
+
* Find all references for a symbol across all documents
|
|
73
|
+
*/
|
|
74
|
+
private findReferencesForSymbol;
|
|
75
|
+
/**
|
|
76
|
+
* Load SCIP index from the configured path
|
|
77
|
+
*/
|
|
78
|
+
loadIndex(): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Parse a SCIP index from bytes
|
|
81
|
+
*/
|
|
82
|
+
private parseIndex;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=ScipIntelligenceProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScipIntelligenceProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/ScipIntelligenceProvider.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAgEvC;;;GAGG;AACH,qBAAa,wBAAyB,YAAW,oBAAoB;IACnE,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,eAAe,CAA6B;IACpD,OAAO,CAAC,YAAY,CAAuB;gBAE/B,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,qBAAqB;IAO9F;;OAEG;IACH,OAAO,CAAC,cAAc;IAatB;;OAEG;YACW,gBAAgB;IAgB9B;;OAEG;YACW,aAAa;IA6E3B;;;OAGG;IACG,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAsCrD;;;OAGG;IACG,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAiCpD;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAMxB;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAmDrC;;OAEG;IACH,OAAO,CAAC,aAAa;IA0BrB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAkBxB;;;;;;;;OAQG;IACH,OAAO,CAAC,kBAAkB;IA6B1B;;OAEG;YACW,uBAAuB;IAyCrC;;OAEG;YACW,uBAAuB;IA4CrC;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAQhC;;OAEG;IACH,OAAO,CAAC,UAAU;CAGnB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Match, Rule } from "powerlint/types";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for violation validation providers that can validate violations using different methods
|
|
4
|
+
*/
|
|
5
|
+
export interface ViolationValidationProvider {
|
|
6
|
+
/**
|
|
7
|
+
* Validate potential violations from a list of matches
|
|
8
|
+
* @param params Validation parameters
|
|
9
|
+
* @returns Promise that resolves to validation results
|
|
10
|
+
*/
|
|
11
|
+
validateViolations(params: ViolationValidationParams): Promise<ViolationValidationResult[]>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Parameters for violation validation
|
|
15
|
+
*/
|
|
16
|
+
export interface ViolationValidationParams {
|
|
17
|
+
/** The rule being validated against */
|
|
18
|
+
rule: Rule;
|
|
19
|
+
/** The matches to validate */
|
|
20
|
+
matches: Match[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Result of violation validation for a single match
|
|
24
|
+
*/
|
|
25
|
+
export interface ViolationValidationResult {
|
|
26
|
+
/** The match ID that was validated */
|
|
27
|
+
matchId: string;
|
|
28
|
+
/** Whether this is a valid violation */
|
|
29
|
+
isViolation: boolean;
|
|
30
|
+
/** Explanation of the validation decision */
|
|
31
|
+
reason: string;
|
|
32
|
+
/** Confidence score (0-1) */
|
|
33
|
+
confidence: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Configuration interface for violation validation providers
|
|
37
|
+
*/
|
|
38
|
+
export interface ViolationValidationProviderConfig {
|
|
39
|
+
type: string;
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=ViolationValidationProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViolationValidationProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/ViolationValidationProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAElD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,kBAAkB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAAA;CAC5F;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,uCAAuC;IACvC,IAAI,EAAE,IAAI,CAAA;IACV,8BAA8B;IAC9B,OAAO,EAAE,KAAK,EAAE,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,WAAW,EAAE,OAAO,CAAA;IACpB,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,6BAA6B;IAC7B,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Config } from "powerlint/environment/Config";
|
|
2
|
+
import type { Environment } from "powerlint/environment/Environment";
|
|
3
|
+
import { RuleProvider } from "powerlint/providers/RuleProvider";
|
|
4
|
+
import type { Rule } from "powerlint/types";
|
|
5
|
+
/**
|
|
6
|
+
* Rule provider that fetches rules from Wispbit Cloud
|
|
7
|
+
*/
|
|
8
|
+
export declare class WispbitRuleProvider implements RuleProvider {
|
|
9
|
+
private config;
|
|
10
|
+
private environment;
|
|
11
|
+
constructor(config: Config, environment: Environment);
|
|
12
|
+
/**
|
|
13
|
+
* Make a request to the Wispbit API
|
|
14
|
+
*/
|
|
15
|
+
private makeApiRequest;
|
|
16
|
+
/**
|
|
17
|
+
* Get the repository URL for API requests
|
|
18
|
+
*/
|
|
19
|
+
private getRepositoryUrl;
|
|
20
|
+
/**
|
|
21
|
+
* Load a specific rule by ID from Wispbit Cloud
|
|
22
|
+
*/
|
|
23
|
+
loadRuleById(ruleId: string): Promise<Rule>;
|
|
24
|
+
/**
|
|
25
|
+
* Load all rules from Wispbit Cloud for the configured repository
|
|
26
|
+
*/
|
|
27
|
+
loadAllRules(): Promise<Rule[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Fetch rules from Wispbit Cloud API
|
|
30
|
+
*/
|
|
31
|
+
private fetchRules;
|
|
32
|
+
/**
|
|
33
|
+
* Create a new rule in Wispbit Cloud
|
|
34
|
+
*/
|
|
35
|
+
createRule(_rule: Rule): Promise<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Update an existing rule in Wispbit Cloud
|
|
38
|
+
*/
|
|
39
|
+
updateRule(_ruleId: string, _rule: Rule): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Delete a rule from Wispbit Cloud
|
|
42
|
+
*/
|
|
43
|
+
deleteRule(_ruleId: string): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=WispbitRuleProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WispbitRuleProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/WispbitRuleProvider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAc3C;;GAEG;AACH,qBAAa,mBAAoB,YAAW,YAAY;IACtD,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,WAAW,CAAa;gBAEpB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;IAKpD;;OAEG;YACW,cAAc;IAqB5B;;OAEG;YACW,gBAAgB;IAU9B;;OAEG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjD;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAIrC;;OAEG;YACW,UAAU;IA0CxB;;OAEG;IACG,UAAU,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAK9C;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7D;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAIjD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Config } from "powerlint/environment/Config";
|
|
2
|
+
import type { ViolationValidationProvider, ViolationValidationParams, ViolationValidationResult } from "powerlint/providers/ViolationValidationProvider";
|
|
3
|
+
/**
|
|
4
|
+
* Violation validation provider that uses Wispbit's specialized validation endpoint
|
|
5
|
+
*/
|
|
6
|
+
export declare class WispbitViolationValidationProvider implements ViolationValidationProvider {
|
|
7
|
+
private config;
|
|
8
|
+
constructor(config: Config);
|
|
9
|
+
validateViolations(params: ViolationValidationParams): Promise<ViolationValidationResult[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Generate a unique ID for a single match
|
|
12
|
+
*/
|
|
13
|
+
private generateMatchId;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=WispbitViolationValidationProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WispbitViolationValidationProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/WispbitViolationValidationProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,iDAAiD,CAAA;AAIxD;;GAEG;AACH,qBAAa,kCAAmC,YAAW,2BAA2B;IACpF,OAAO,CAAC,MAAM,CAAQ;gBAEV,MAAM,EAAE,MAAM;IAIpB,kBAAkB,CACtB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,yBAAyB,EAAE,CAAC;IA0DvC;;OAEG;IACH,OAAO,CAAC,eAAe;CAWxB"}
|