@wispbit/local 1.0.28 → 1.0.30

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.
Files changed (99) hide show
  1. package/dist/cli.js +87 -4182
  2. package/dist/index.js +1 -20
  3. package/dist/package.json +6 -9
  4. package/package.json +4 -5
  5. package/dist/build.d.ts +0 -3
  6. package/dist/build.d.ts.map +0 -1
  7. package/dist/cli.js.map +0 -7
  8. package/dist/index.js.map +0 -7
  9. package/dist/src/api/WispbitApiClient.d.ts +0 -185
  10. package/dist/src/api/WispbitApiClient.d.ts.map +0 -1
  11. package/dist/src/cli.d.ts +0 -16
  12. package/dist/src/cli.d.ts.map +0 -1
  13. package/dist/src/config.d.ts +0 -6
  14. package/dist/src/config.d.ts.map +0 -1
  15. package/dist/src/environment/Config.d.ts +0 -79
  16. package/dist/src/environment/Config.d.ts.map +0 -1
  17. package/dist/src/environment/Environment.d.ts +0 -23
  18. package/dist/src/environment/Environment.d.ts.map +0 -1
  19. package/dist/src/environment/Sandbox.d.ts +0 -48
  20. package/dist/src/environment/Sandbox.d.ts.map +0 -1
  21. package/dist/src/environment/Storage.d.ts +0 -84
  22. package/dist/src/environment/Storage.d.ts.map +0 -1
  23. package/dist/src/index.d.ts +0 -16
  24. package/dist/src/index.d.ts.map +0 -1
  25. package/dist/src/languages.d.ts +0 -36
  26. package/dist/src/languages.d.ts.map +0 -1
  27. package/dist/src/providers/AstGrepAstProvider.d.ts +0 -44
  28. package/dist/src/providers/AstGrepAstProvider.d.ts.map +0 -1
  29. package/dist/src/providers/LanguageBackend.d.ts +0 -74
  30. package/dist/src/providers/LanguageBackend.d.ts.map +0 -1
  31. package/dist/src/providers/RuleProvider.d.ts +0 -46
  32. package/dist/src/providers/RuleProvider.d.ts.map +0 -1
  33. package/dist/src/providers/ScipIntelligenceProvider.d.ts +0 -84
  34. package/dist/src/providers/ScipIntelligenceProvider.d.ts.map +0 -1
  35. package/dist/src/providers/ViolationValidationProvider.d.ts +0 -38
  36. package/dist/src/providers/ViolationValidationProvider.d.ts.map +0 -1
  37. package/dist/src/providers/WispbitRuleProvider.d.ts +0 -29
  38. package/dist/src/providers/WispbitRuleProvider.d.ts.map +0 -1
  39. package/dist/src/providers/WispbitViolationValidationProvider.d.ts +0 -12
  40. package/dist/src/providers/WispbitViolationValidationProvider.d.ts.map +0 -1
  41. package/dist/src/schemas.d.ts +0 -1270
  42. package/dist/src/schemas.d.ts.map +0 -1
  43. package/dist/src/steps/ExecutionEventEmitter.d.ts +0 -191
  44. package/dist/src/steps/ExecutionEventEmitter.d.ts.map +0 -1
  45. package/dist/src/steps/FileExecutionContext.d.ts +0 -94
  46. package/dist/src/steps/FileExecutionContext.d.ts.map +0 -1
  47. package/dist/src/steps/FileFilterStep.d.ts +0 -28
  48. package/dist/src/steps/FileFilterStep.d.ts.map +0 -1
  49. package/dist/src/steps/FileFilterStep.test.d.ts +0 -2
  50. package/dist/src/steps/FileFilterStep.test.d.ts.map +0 -1
  51. package/dist/src/steps/FindMatchesStep.d.ts +0 -41
  52. package/dist/src/steps/FindMatchesStep.d.ts.map +0 -1
  53. package/dist/src/steps/FindMatchesStep.test.d.ts +0 -2
  54. package/dist/src/steps/FindMatchesStep.test.d.ts.map +0 -1
  55. package/dist/src/steps/GotoDefinitionStep.d.ts +0 -86
  56. package/dist/src/steps/GotoDefinitionStep.d.ts.map +0 -1
  57. package/dist/src/steps/LLMStep.d.ts +0 -40
  58. package/dist/src/steps/LLMStep.d.ts.map +0 -1
  59. package/dist/src/steps/RuleExecutor.d.ts +0 -39
  60. package/dist/src/steps/RuleExecutor.d.ts.map +0 -1
  61. package/dist/src/steps/RuleExecutor.test.d.ts +0 -2
  62. package/dist/src/steps/RuleExecutor.test.d.ts.map +0 -1
  63. package/dist/src/test/TestExecutor.d.ts +0 -38
  64. package/dist/src/test/TestExecutor.d.ts.map +0 -1
  65. package/dist/src/test/rules.test.d.ts +0 -2
  66. package/dist/src/test/rules.test.d.ts.map +0 -1
  67. package/dist/src/types.d.ts +0 -196
  68. package/dist/src/types.d.ts.map +0 -1
  69. package/dist/src/utils/asciiFrames.d.ts +0 -5
  70. package/dist/src/utils/asciiFrames.d.ts.map +0 -1
  71. package/dist/src/utils/debugLogger.d.ts +0 -6
  72. package/dist/src/utils/debugLogger.d.ts.map +0 -1
  73. package/dist/src/utils/formatters.d.ts +0 -55
  74. package/dist/src/utils/formatters.d.ts.map +0 -1
  75. package/dist/src/utils/generateTreeDump.d.ts +0 -19
  76. package/dist/src/utils/generateTreeDump.d.ts.map +0 -1
  77. package/dist/src/utils/git.d.ts +0 -68
  78. package/dist/src/utils/git.d.ts.map +0 -1
  79. package/dist/src/utils/git.test.d.ts +0 -2
  80. package/dist/src/utils/git.test.d.ts.map +0 -1
  81. package/dist/src/utils/hashString.d.ts +0 -2
  82. package/dist/src/utils/hashString.d.ts.map +0 -1
  83. package/dist/src/utils/patternMatching.d.ts +0 -2
  84. package/dist/src/utils/patternMatching.d.ts.map +0 -1
  85. package/dist/src/utils/readTextAtRange.d.ts +0 -10
  86. package/dist/src/utils/readTextAtRange.d.ts.map +0 -1
  87. package/dist/src/utils/snapshotComparison.d.ts +0 -16
  88. package/dist/src/utils/snapshotComparison.d.ts.map +0 -1
  89. package/dist/src/utils/startupScreen.d.ts +0 -5
  90. package/dist/src/utils/startupScreen.d.ts.map +0 -1
  91. package/dist/src/utils/validateRule.d.ts +0 -52
  92. package/dist/src/utils/validateRule.d.ts.map +0 -1
  93. package/dist/src/validationSchemas.d.ts +0 -553
  94. package/dist/src/validationSchemas.d.ts.map +0 -1
  95. package/dist/src/version.d.ts +0 -3
  96. package/dist/src/version.d.ts.map +0 -1
  97. package/dist/tsconfig.tsbuildinfo +0 -1
  98. package/dist/vitest.config.d.mts +0 -3
  99. package/dist/vitest.config.d.mts.map +0 -1
package/dist/index.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts"],
4
- "sourcesContent": ["#!/usr/bin/env node\n\nprocess.emitWarning = () => {}\nprocess.removeAllListeners(\"warning\")\n\n// ast-grep gives annoying warnings\nconsole.debug = () => {}\n\n// Suppress specific experimental warnings\nconst originalEmit = process.emit\nprocess.emit = function (event, ...args) {\n if (event === \"warning\" && args[0]) {\n const warning = args[0] as any\n // Suppress ExperimentalWarning (including JSON module imports)\n if (warning.name === \"ExperimentalWarning\") {\n return false\n }\n // Suppress DEP0040\n if (warning.code === \"DEP0040\") {\n return false\n }\n }\n // @ts-expect-error - This is a workaround to suppress experimental warnings\n return originalEmit.apply(process, [event, ...args])\n} as typeof process.emit\n\n// Use the file extension to help the module resolver find the file\n// eslint-disable-next-line import/no-unresolved\nimport(\"./cli.js\").catch(console.error)\n"],
5
- "mappings": ";AAEA,QAAQ,cAAc,MAAM;AAAC;AAC7B,QAAQ,mBAAmB,SAAS;AAGpC,QAAQ,QAAQ,MAAM;AAAC;AAGvB,MAAM,eAAe,QAAQ;AAC7B,QAAQ,OAAO,SAAU,UAAU,MAAM;AACvC,MAAI,UAAU,aAAa,KAAK,CAAC,GAAG;AAClC,UAAM,UAAU,KAAK,CAAC;AAEtB,QAAI,QAAQ,SAAS,uBAAuB;AAC1C,aAAO;AAAA,IACT;AAEA,QAAI,QAAQ,SAAS,WAAW;AAC9B,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO,aAAa,MAAM,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;AACrD;AAIA,OAAO,UAAU,EAAE,MAAM,QAAQ,KAAK;",
6
- "names": []
7
- }
@@ -1,185 +0,0 @@
1
- import { z } from "zod";
2
- import { ValidateViolationResponseSchema } from "powerlint/validationSchemas";
3
- /**
4
- * Request/Response schemas for Wispbit API endpoints
5
- */
6
- export declare const InitializeRequestSchema: z.ZodObject<{
7
- repository_url: z.ZodString;
8
- powerlint_version: z.ZodString;
9
- schema_version: z.ZodString;
10
- }, "strip", z.ZodTypeAny, {
11
- repository_url: string;
12
- powerlint_version: string;
13
- schema_version: string;
14
- }, {
15
- repository_url: string;
16
- powerlint_version: string;
17
- schema_version: string;
18
- }>;
19
- export declare const InitializeResponseSchema: z.ZodObject<{
20
- configured: z.ZodBoolean;
21
- invalid_api_key: z.ZodOptional<z.ZodBoolean>;
22
- is_valid_repository: z.ZodOptional<z.ZodBoolean>;
23
- config: z.ZodOptional<z.ZodObject<{
24
- ignored_globs: z.ZodArray<z.ZodString, "many">;
25
- }, "strip", z.ZodTypeAny, {
26
- ignored_globs: string[];
27
- }, {
28
- ignored_globs: string[];
29
- }>>;
30
- }, "strip", z.ZodTypeAny, {
31
- configured: boolean;
32
- invalid_api_key?: boolean | undefined;
33
- is_valid_repository?: boolean | undefined;
34
- config?: {
35
- ignored_globs: string[];
36
- } | undefined;
37
- }, {
38
- configured: boolean;
39
- invalid_api_key?: boolean | undefined;
40
- is_valid_repository?: boolean | undefined;
41
- config?: {
42
- ignored_globs: string[];
43
- } | undefined;
44
- }>;
45
- export type InitializeRequest = z.infer<typeof InitializeRequestSchema>;
46
- export type InitializeResponse = z.infer<typeof InitializeResponseSchema>;
47
- export declare const GetRulesRequestSchema: z.ZodObject<{
48
- repository_url: z.ZodString;
49
- rule_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
50
- schema_version: z.ZodString;
51
- powerlint_version: z.ZodString;
52
- }, "strip", z.ZodTypeAny, {
53
- repository_url: string;
54
- powerlint_version: string;
55
- schema_version: string;
56
- rule_ids?: string[] | undefined;
57
- }, {
58
- repository_url: string;
59
- powerlint_version: string;
60
- schema_version: string;
61
- rule_ids?: string[] | undefined;
62
- }>;
63
- export declare const GetRulesResponseSchema: z.ZodObject<{
64
- rules: z.ZodArray<z.ZodObject<{
65
- id: z.ZodString;
66
- internalId: z.ZodString;
67
- internalVersionId: z.ZodString;
68
- message: z.ZodString;
69
- prompt: z.ZodString;
70
- severity: z.ZodEnum<["suggestion", "violation"]>;
71
- schema: z.ZodAny;
72
- }, "strip", z.ZodTypeAny, {
73
- message: string;
74
- id: string;
75
- internalId: string;
76
- internalVersionId: string;
77
- prompt: string;
78
- severity: "suggestion" | "violation";
79
- schema?: any;
80
- }, {
81
- message: string;
82
- id: string;
83
- internalId: string;
84
- internalVersionId: string;
85
- prompt: string;
86
- severity: "suggestion" | "violation";
87
- schema?: any;
88
- }>, "many">;
89
- }, "strip", z.ZodTypeAny, {
90
- rules: {
91
- message: string;
92
- id: string;
93
- internalId: string;
94
- internalVersionId: string;
95
- prompt: string;
96
- severity: "suggestion" | "violation";
97
- schema?: any;
98
- }[];
99
- }, {
100
- rules: {
101
- message: string;
102
- id: string;
103
- internalId: string;
104
- internalVersionId: string;
105
- prompt: string;
106
- severity: "suggestion" | "violation";
107
- schema?: any;
108
- }[];
109
- }>;
110
- export type GetRulesRequest = z.infer<typeof GetRulesRequestSchema>;
111
- export type GetRulesResponse = z.infer<typeof GetRulesResponseSchema>;
112
- export declare const ValidateViolationRequestSchema: z.ZodObject<{
113
- rule: z.ZodObject<{
114
- internalId: z.ZodString;
115
- internalVersionId: z.ZodString;
116
- contents: z.ZodString;
117
- }, "strip", z.ZodTypeAny, {
118
- internalId: string;
119
- internalVersionId: string;
120
- contents: string;
121
- }, {
122
- internalId: string;
123
- internalVersionId: string;
124
- contents: string;
125
- }>;
126
- matches: z.ZodArray<z.ZodAny, "many">;
127
- powerlint_version: z.ZodString;
128
- schema_version: z.ZodString;
129
- }, "strip", z.ZodTypeAny, {
130
- powerlint_version: string;
131
- schema_version: string;
132
- rule: {
133
- internalId: string;
134
- internalVersionId: string;
135
- contents: string;
136
- };
137
- matches: any[];
138
- }, {
139
- powerlint_version: string;
140
- schema_version: string;
141
- rule: {
142
- internalId: string;
143
- internalVersionId: string;
144
- contents: string;
145
- };
146
- matches: any[];
147
- }>;
148
- export type ValidateViolationRequest = z.infer<typeof ValidateViolationRequestSchema>;
149
- export type ValidateViolationResponse = z.infer<typeof ValidateViolationResponseSchema>;
150
- /**
151
- * Configuration for the Wispbit API client
152
- */
153
- export interface WispbitApiClientConfig {
154
- baseUrl: string;
155
- apiKey: string;
156
- }
157
- /**
158
- * Unified API client for all Wispbit API calls with automatic retry logic
159
- */
160
- export declare class WispbitApiClient {
161
- private baseUrl;
162
- private apiKey;
163
- constructor(config: WispbitApiClientConfig);
164
- /**
165
- * Make a request to the Wispbit API with retry logic
166
- */
167
- private request;
168
- /**
169
- * Initialize PowerLint configuration with Wispbit
170
- */
171
- initialize(request: InitializeRequest): Promise<InitializeResponse>;
172
- /**
173
- * Get rules from Wispbit Cloud
174
- */
175
- getRules(request: GetRulesRequest): Promise<GetRulesResponse>;
176
- /**
177
- * Validate violations with Wispbit
178
- */
179
- validateViolation(request: ValidateViolationRequest): Promise<ValidateViolationResponse>;
180
- /**
181
- * Validate violations with Wispbit (internal endpoint for testing)
182
- */
183
- validateViolationInternal(request: ValidateViolationRequest): Promise<ValidateViolationResponse>;
184
- }
185
- //# sourceMappingURL=WispbitApiClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WispbitApiClient.d.ts","sourceRoot":"","sources":["../../../src/api/WispbitApiClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAA;AAE7E;;GAEG;AAGH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;EAIlC,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;EASnC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AACvE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAGzE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAKhC,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYjC,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AACnE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAGrE,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASzC,CAAA;AAEF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AACrF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAEvF;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,MAAM,CAAQ;gBAEV,MAAM,EAAE,sBAAsB;IAK1C;;OAEG;YACW,OAAO;IAiDrB;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAKzE;;OAEG;IACG,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAKnE;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAS9F;;OAEG;IACG,yBAAyB,CAC7B,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC;CAQtC"}
package/dist/src/cli.d.ts DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import { Match } from "powerlint/types";
3
- /**
4
- * Check for available updates
5
- */
6
- export declare function checkForUpdates(): Promise<void>;
7
- export interface ScanResult {
8
- ruleId: string;
9
- internalId?: string;
10
- message: string;
11
- severity: "violation" | "suggestion";
12
- matches: Match[];
13
- llmCost?: string;
14
- llmTokens?: number;
15
- }
16
- //# sourceMappingURL=cli.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AAkBA,OAAO,EAAE,KAAK,EAAgC,MAAM,iBAAiB,CAAA;AAgIrE;;GAEG;AACH,wBAAsB,eAAe,kBAcpC;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,WAAW,GAAG,YAAY,CAAA;IACpC,OAAO,EAAE,KAAK,EAAE,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
@@ -1,6 +0,0 @@
1
- export interface PowerLintConfig {
2
- ignoredGlobs: string[];
3
- apiKey?: string;
4
- baseUrl?: string;
5
- }
6
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
@@ -1,79 +0,0 @@
1
- import { WispbitApiClient } from "powerlint/api/WispbitApiClient";
2
- import { PowerLintConfig } from "powerlint/config";
3
- import { Environment } from "powerlint/environment/Environment";
4
- export interface InitializeResult {
5
- configured: boolean;
6
- invalid_api_key?: boolean;
7
- is_valid_repository?: boolean;
8
- config?: {
9
- ignored_globs: string[];
10
- };
11
- }
12
- export declare class Config {
13
- private config;
14
- private apiKey;
15
- private baseUrl;
16
- private apiClient;
17
- private useInternalEndpoint;
18
- constructor(config: Partial<PowerLintConfig>, options?: {
19
- useInternalEndpoint?: boolean;
20
- });
21
- getIgnoredGlobs(): string[];
22
- /**
23
- * Get the Wispbit API key
24
- * @returns The API key or null if not set
25
- */
26
- getApiKey(): string;
27
- /**
28
- * Get the Wispbit API base URL
29
- * @returns The base URL
30
- */
31
- getBaseUrl(): string;
32
- /**
33
- * Get the Wispbit API client
34
- * @returns The API client instance
35
- */
36
- getApiClient(): WispbitApiClient;
37
- /**
38
- * Get the local PowerLint version
39
- * @returns The current PowerLint version
40
- */
41
- getLocalVersion(): string;
42
- /**
43
- * Get the schema version
44
- * @returns The schema version
45
- */
46
- getSchemaVersion(): string;
47
- /**
48
- * Initialize configuration without network validation (for testing)
49
- * @param options Optional configuration options
50
- * @returns Config instance
51
- */
52
- static initializeWithoutNetwork(options?: {
53
- ignoredGlobs?: string[];
54
- apiKey?: string;
55
- baseUrl?: string;
56
- }): Config;
57
- /**
58
- * Initialize configuration by validating API key and repository URL with Wispbit
59
- * @param environment Environment instance to get repository URL
60
- * @param apiKey Optional API key to use for initialization. If not provided, will use environment variable
61
- * @returns Promise<Config | null> - Config if valid, null if API key missing/invalid
62
- */
63
- static initialize(environment: Environment, { apiKey, baseUrl, }: {
64
- apiKey?: string;
65
- baseUrl?: string;
66
- }): Promise<Config | {
67
- failed: true;
68
- error: "INVALID_API_KEY" | "INVALID_REPOSITORY";
69
- }>;
70
- /**
71
- * Check if PowerLint is configured (has valid API key)
72
- */
73
- isConfigured(): boolean;
74
- /**
75
- * Check if the internal validation endpoint should be used
76
- */
77
- shouldUseInternalEndpoint(): boolean;
78
- }
79
- //# sourceMappingURL=Config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/environment/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAG/D,MAAM,WAAW,gB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AAyB,IAAI,OAAO;CAGrC"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Environment contains workspace configuration
3
- * Used by providers and steps to access common configuration
4
- */
5
- export declare class Environment {
6
- private readonly workspaceRoot;
7
- private readonly repositoryUrl;
8
- constructor(config?: {
9
- workspaceRoot?: string;
10
- repositoryUrl?: string;
11
- });
12
- /**
13
- * Get the workspace root directory
14
- */
15
- getWorkspaceRoot(): string;
16
- /**
17
- * Get the remote repository URL from Git config
18
- * @param remoteName Name of the remote (default: origin)
19
- * @returns The remote repository URL or null if not found
20
- */
21
- getRepositoryUrl(remoteName?: string): Promise<string>;
22
- }
23
- //# sourceMappingURL=Environment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Environment.d.ts","sourceRoot":"","sources":["../../../src/environment/Environment.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAQ;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;gBAEjC,MAAM,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE;IAKvE;;OAEG;IACH,gBAAgB,IAAI,MAAM;IAI1B;;;;OAIG;IACG,gBAAgB,CAAC,UAAU,GAAE,MAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;CAYvE"}
@@ -1,48 +0,0 @@
1
- import { Environment } from "powerlint/environment/Environment";
2
- import { type Rule } from "powerlint/types";
3
- export interface VirtualFile {
4
- path: string;
5
- content: string;
6
- }
7
- export interface SandboxOptions {
8
- rule: Rule;
9
- virtualFiles?: VirtualFile[];
10
- }
11
- /**
12
- * Sandbox class for creating isolated test environments with rules and virtual files
13
- * Uses Environment class under the hood for rule management
14
- */
15
- export declare class Sandbox {
16
- private environment;
17
- private cleanupFn;
18
- constructor({ environment, cleanupFn }: {
19
- environment: Environment;
20
- cleanupFn: () => void;
21
- });
22
- static create(options: SandboxOptions): Promise<Sandbox>;
23
- /**
24
- * Get the Environment instance
25
- */
26
- getEnvironment(): Environment;
27
- /**
28
- * Clean up the sandbox
29
- */
30
- cleanup(): void;
31
- /**
32
- * Create a hash of the rule config and virtual files for directory naming
33
- */
34
- private static createContentHash;
35
- /**
36
- * Setup the sandbox with rule and virtual files
37
- */
38
- private setupSandbox;
39
- /**
40
- * Create language-specific configuration files
41
- */
42
- private createLanguageConfigs;
43
- /**
44
- * Create virtual files in the temp directory
45
- */
46
- private createVirtualFiles;
47
- }
48
- //# sourceMappingURL=Sandbox.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Sandbox.d.ts","sourceRoot":"","sources":["../../../src/environment/Sandbox.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAE/D,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAG3C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,WAAW,EAAE,CAAA;CAC7B;AAED;;;GAGG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,SAAS,CAAY;gBAEjB,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE;QAAE,WAAW,EAAE,WAAW,CAAC;QAAC,SAAS,EAAE,MAAM,IAAI,CAAA;KAAE;WAKvE,MAAM,CAAC,OAAO,EAAE,cAAc;IA6BlD;;OAEG;IACH,cAAc,IAAI,WAAW;IAI7B;;OAEG;IACH,OAAO,IAAI,IAAI;IAIf;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAwBhC;;OAEG;YACW,YAAY;IAQ1B;;OAEG;YACW,qBAAqB;IAuDnC;;OAEG;YACW,kBAAkB;CAQjC"}
@@ -1,84 +0,0 @@
1
- import { Environment } from "powerlint/environment/Environment";
2
- import type { Language } from "powerlint/languages";
3
- /**
4
- * Storage class manages cache and index storage directories
5
- * Provides centralized storage management for the powerlint environment
6
- */
7
- export declare class Storage {
8
- private environment;
9
- private cacheStore?;
10
- constructor(environment: Environment);
11
- /**
12
- * Get the base storage directory for powerlint
13
- * This replaces the getConfigDirectory functionality
14
- */
15
- getStorageDirectory(): string;
16
- /**
17
- * Get the base directory for indexes
18
- */
19
- getIndexDirectory(): string;
20
- /**
21
- * Get the base directory for caches
22
- */
23
- getCacheDirectory(): string;
24
- /**
25
- * Ensure a directory exists, creating it if necessary
26
- */
27
- ensureDirectory(dirPath: string): Promise<void>;
28
- /**
29
- * Get the file path for a specific index
30
- * Ensures the index directory exists
31
- */
32
- getIndexFilePath(language: Language, fileName?: string): Promise<string>;
33
- /**
34
- * Check if an index exists for a language
35
- */
36
- indexExists(language: Language, fileName?: string): Promise<boolean>;
37
- /**
38
- * Read an index file for a language
39
- */
40
- readIndex(language: Language, fileName?: string): Promise<Buffer | null>;
41
- /**
42
- * Save an index file for a language
43
- */
44
- saveIndex(language: Language, data: Buffer, fileName?: string): Promise<void>;
45
- /**
46
- * Get the cache file path
47
- */
48
- getCacheFilePath(): string;
49
- /**
50
- * Purge all storage (cache and indexes)
51
- * @returns Object with success status and details about what was purged
52
- */
53
- purgeStorage(): Promise<{
54
- success: boolean;
55
- deletedCount: number;
56
- }>;
57
- /**
58
- * Purge only cache data
59
- */
60
- purgeCache(): Promise<{
61
- success: boolean;
62
- deletedCount: number;
63
- }>;
64
- /**
65
- * Get or initialize the cache store
66
- */
67
- private getCacheStore;
68
- /**
69
- * Save data to cache
70
- */
71
- saveCache(ruleId: string, cacheKey: string, data: any): Promise<void>;
72
- /**
73
- * Read data from cache
74
- */
75
- readCache<T = any>(ruleId: string, cacheKey: string): Promise<T | null>;
76
- /**
77
- * Purge only index data
78
- */
79
- purgeIndexes(): Promise<{
80
- success: boolean;
81
- delet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IAkBF;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC;QAC1B,OAAO,EAAE,OAAO,CAAA;QAChB,YAAY,EAAE,MAAM,CAAA;KACrB,CAAC;IAkBF;;OAEG;IACH,OAAO,CAAC,aAAa;IAYrB;;OAEG;IACG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3E;;OAEG;IACG,SAAS,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAO7E;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC;QAC5B,OAAO,EAAE,OAAO,CAAA;QAChB,YAAY,EAAE,MAAM,CAAA;KACrB,CAAC;CAiBH"}
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- declare const originalEmit: {
3
- (event: "beforeExit", code: number): boolean;
4
- (event: "disconnect"): boolean;
5
- (event: "exit", code: number): boolean;
6
- (event: "rejectionHandled", promise: Promise<unknown>): boolean;
7
- (event: "uncaughtException", error: Error): boolean;
8
- (event: "uncaughtExceptionMonitor", error: Error): boolean;
9
- (event: "unhandledRejection", reason: unknown, promise: Promise<unknown>): boolean;
10
- (event: "warning", warning: Error): boolean;
11
- (event: "message", message: unknown, sendHandle: unknown): NodeJS.Process;
12
- (event: NodeJS.Signals, signal?: NodeJS.Signals): boolean;
13
- (event: "multipleResolves", type: NodeJS.MultipleResolveType, promise: Promise<unknown>, value: unknown): NodeJS.Process;
14
- (event: "worker", listener: NodeJS.WorkerListener): NodeJS.Process;
15
- };
16
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AASA,QAAA,MAAM,YAAY;;;;;;;;;;;;;CAAe,CAAA"}
@@ -1,36 +0,0 @@
1
- export declare enum Language {
2
- Angular = "Angular",
3
- Bash = "Bash",
4
- C = "C",
5
- Cpp = "Cpp",
6
- Csharp = "Csharp",
7
- Css = "Css",
8
- Dart = "Dart",
9
- Elixir = "Elixir",
10
- Go = "Go",
11
- Haskell = "Haskell",
12
- Html = "Html",
13
- Java = "Java",
14
- JavaScript = "JavaScript",
15
- Json = "Json",
16
- Kotlin = "Kotlin",
17
- Lua = "Lua",
18
- Markdown = "Markdown",
19
- Php = "Php",
20
- Python = "Python",
21
- Ruby = "Ruby",
22
- Rust = "Rust",
23
- Scala = "Scala",
24
- Sql = "Sql",
25
- Swift = "Swift",
26
- Toml = "Toml",
27
- Tsx = "Tsx",
28
- TypeScript = "TypeScript",
29
- Yaml = "Yaml",
30
- GraphQL = "GraphQL",
31
- Unknown = "Unknown"
32
- }
33
- export declare const REGISTERED_LANGUAGE_EXTENSIONS: Record<Language, string[]>;
34
- export declare function getLanguageFromFilePath(filePath: string): Language;
35
- export declare function getLanguageGlobsForLanguage(language: Language): string[];
36
- //# sourceMappingURL=languages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../src/languages.ts"],"names":[],"mappings":"AAsCA,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,CAAC,MAAM;IACP,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,EAAE,OAAO;IACT,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAkFD,eAAO,MAAM,8BAA8B,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,CAQrE,CAAA;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAIlE;AAQD,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE,CAExE"}
@@ -1,44 +0,0 @@
1
- import { NapiConfig } from "@ast-grep/napi/types/config";
2
- import type { Environment } from "powerlint/environment/Environment";
3
- import { Language } from "powerlint/languages";
4
- import type { AstProvider } from "powerlint/providers/LanguageBackend";
5
- import { Match } from "powerlint/types";
6
- /**
7
- * Ast-grep implementation of AstProvider
8
- * Provides pattern-based code matching using ast-grep
9
- */
10
- export declare class AstGrepAstProvider implements AstProvider {
11
- private environment;
12
- private language;
13
- constructor(environment: Environment, language: Language);
14
- /**
15
- * Find all matches based on ast-grep pattern
16
- * @param filePaths File paths to search in (relative to workspace root)
17
- * @param schema The ast-grep schema (rule, constraints, etc.)
18
- * @returns Array of matches found
19
- */
20
- findMatches(filePaths: string[], schema: NapiConfig): Promise<Match[]>;
21
- /**
22
- * Get optimal batch size based on available CPU cores and thread pool size
23
- */
24
- private getBatchSize;
25
- /**
26
- * Process a batch of files with memory-efficient approach
27
- */
28
- private processBatch;
29
- /**
30
- * Extract symbol name from ast-grep node if possible
31
- */
32
- private extractSymbol;
33
- /**
34
- * Expand a match to its enclosing function, method, or class definition
35
- * @param match The match to expand (typically a small range like a method name)
36
- * @returns Expanded match with the full function/method/class body, or null if not found
37
- */
38
- expandMatch(match: Match): Promise<Match | null>;
39
- /**
40
- * Find the deepest node at a given position
41
- */
42
- private findNodeAtPosition;
43
- }
44
- //# sourceMappingURL=AstGrepAstProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AstGrepAstProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/AstGrepAstProvider.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC;;;GAGG;AACH,qBAAa,kBAAmB,YAAW,WAAW;IACpD,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,QAAQ,CAAU;gBAEd,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ;IAKxD;;;;;OAKG;IACG,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAqB5E;;OAEG;IACH,OAAO,CAAC,YAAY;IAQpB;;OAEG;YACW,YAAY;IAmD1B;;OAEG;IACH,OAAO,CAAC,aAAa;IAqBrB;;;;OAIG;IACG,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAyDtD;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAyB3B"}