pi-lens 3.1.2 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/README.md +16 -12
- package/clients/ast-grep-client.js +8 -1
- package/clients/ast-grep-client.ts +9 -1
- package/clients/biome-client.js +51 -38
- package/clients/biome-client.ts +60 -58
- package/clients/dependency-checker.js +30 -1
- package/clients/dependency-checker.ts +35 -1
- package/clients/dispatch/__tests__/runner-registration.test.ts +286 -282
- package/clients/dispatch/bus-dispatcher.js +15 -14
- package/clients/dispatch/bus-dispatcher.ts +32 -25
- package/clients/dispatch/dispatcher.js +18 -25
- package/clients/dispatch/dispatcher.test.ts +2 -1
- package/clients/dispatch/dispatcher.ts +17 -28
- package/clients/dispatch/plan.js +77 -32
- package/clients/dispatch/plan.ts +78 -32
- package/clients/dispatch/runners/ast-grep-napi.js +36 -376
- package/clients/dispatch/runners/ast-grep-napi.ts +60 -433
- package/clients/dispatch/runners/index.js +8 -4
- package/clients/dispatch/runners/index.ts +8 -4
- package/clients/dispatch/runners/lsp.js +65 -0
- package/clients/dispatch/runners/lsp.ts +125 -0
- package/clients/dispatch/runners/oxlint.js +2 -2
- package/clients/dispatch/runners/oxlint.ts +2 -2
- package/clients/dispatch/runners/pyright.js +24 -8
- package/clients/dispatch/runners/pyright.ts +28 -14
- package/clients/dispatch/runners/rust-clippy.js +2 -2
- package/clients/dispatch/runners/rust-clippy.ts +2 -4
- package/clients/dispatch/runners/tree-sitter.js +14 -2
- package/clients/dispatch/runners/tree-sitter.ts +15 -2
- package/clients/dispatch/runners/ts-lsp.js +3 -3
- package/clients/dispatch/runners/ts-lsp.ts +8 -5
- package/clients/dispatch/runners/yaml-rule-parser.js +292 -0
- package/clients/dispatch/runners/yaml-rule-parser.ts +338 -0
- package/clients/dispatch/types.js +3 -0
- package/clients/dispatch/types.ts +3 -0
- package/clients/formatters.js +67 -14
- package/clients/formatters.ts +68 -15
- package/clients/installer/index.js +78 -10
- package/clients/installer/index.ts +519 -426
- package/clients/jscpd-client.js +28 -0
- package/clients/jscpd-client.ts +41 -3
- package/clients/knip-client.js +30 -1
- package/clients/knip-client.ts +34 -2
- package/clients/lsp/__tests__/client.test.ts +64 -41
- package/clients/lsp/__tests__/config.test.ts +25 -17
- package/clients/lsp/__tests__/launch.test.ts +108 -43
- package/clients/lsp/__tests__/service.test.ts +76 -48
- package/clients/lsp/client.js +87 -2
- package/clients/lsp/client.ts +150 -6
- package/clients/lsp/config.js +8 -11
- package/clients/lsp/config.ts +24 -21
- package/clients/lsp/index.js +69 -0
- package/clients/lsp/index.ts +82 -0
- package/clients/lsp/interactive-install.js +19 -8
- package/clients/lsp/interactive-install.ts +52 -27
- package/clients/lsp/launch.js +182 -32
- package/clients/lsp/launch.ts +241 -38
- package/clients/lsp/path-utils.js +3 -46
- package/clients/lsp/path-utils.ts +11 -51
- package/clients/lsp/server.js +93 -71
- package/clients/lsp/server.ts +173 -131
- package/clients/path-utils.js +142 -0
- package/clients/path-utils.ts +153 -0
- package/clients/ruff-client.js +33 -4
- package/clients/ruff-client.ts +44 -13
- package/clients/safe-spawn.js +3 -1
- package/clients/safe-spawn.ts +3 -1
- package/clients/services/effect-integration.js +11 -7
- package/clients/services/effect-integration.ts +34 -26
- package/clients/sg-runner.js +51 -9
- package/clients/sg-runner.ts +58 -15
- package/clients/tree-sitter-client.js +12 -0
- package/clients/tree-sitter-client.ts +12 -0
- package/clients/typescript-client.js +6 -2
- package/clients/typescript-client.ts +9 -2
- package/commands/booboo.js +2 -4
- package/commands/booboo.ts +2 -4
- package/index.ts +377 -93
- package/package.json +2 -1
- package/rules/tree-sitter-queries/tsx/no-nested-links.yml +45 -0
- package/rules/tree-sitter-queries/typescript/constructor-super.yml +55 -0
- package/rules/tree-sitter-queries/typescript/debugger.yml +1 -1
- package/rules/tree-sitter-queries/typescript/no-dupe-class-members.yml +47 -0
- package/tsconfig.json +1 -1
- package/clients/__tests__/file-time.test.js +0 -216
- package/clients/__tests__/format-service.test.js +0 -245
- package/clients/__tests__/formatters.test.js +0 -271
- package/clients/agent-behavior-client.test.js +0 -94
- package/clients/ast-grep-client.test.js +0 -129
- package/clients/ast-grep-client.test.ts +0 -155
- package/clients/biome-client.test.js +0 -144
- package/clients/cache-manager.test.js +0 -197
- package/clients/complexity-client.test.js +0 -234
- package/clients/dependency-checker.test.js +0 -60
- package/clients/dispatch/__tests__/autofix-integration.test.js +0 -245
- package/clients/dispatch/__tests__/runner-registration.test.js +0 -236
- package/clients/dispatch/dispatcher.edge.test.js +0 -82
- package/clients/dispatch/dispatcher.format.test.js +0 -46
- package/clients/dispatch/dispatcher.inline.test.js +0 -74
- package/clients/dispatch/dispatcher.test.js +0 -115
- package/clients/dispatch/runners/architect.test.js +0 -138
- package/clients/dispatch/runners/ast-grep-napi.test.js +0 -106
- package/clients/dispatch/runners/oxlint.test.js +0 -230
- package/clients/dispatch/runners/pyright.test.js +0 -98
- package/clients/dispatch/runners/python-slop.test.js +0 -203
- package/clients/dispatch/runners/scan_codebase.test.js +0 -89
- package/clients/dispatch/runners/shellcheck.test.js +0 -98
- package/clients/dispatch/runners/spellcheck.test.js +0 -158
- package/clients/dispatch/runners/ts-slop.test.js +0 -180
- package/clients/dispatch/runners/ts-slop.test.ts +0 -230
- package/clients/dogfood.test.js +0 -201
- package/clients/file-kinds.test.js +0 -169
- package/clients/go-client.test.js +0 -127
- package/clients/jscpd-client.test.js +0 -127
- package/clients/knip-client.test.js +0 -112
- package/clients/lsp/__tests__/client.test.js +0 -325
- package/clients/lsp/__tests__/config.test.js +0 -166
- package/clients/lsp/__tests__/error-recovery.test.js +0 -213
- package/clients/lsp/__tests__/integration.test.js +0 -127
- package/clients/lsp/__tests__/launch.test.js +0 -260
- package/clients/lsp/__tests__/server.test.js +0 -259
- package/clients/lsp/__tests__/service.test.js +0 -417
- package/clients/metrics-client.test.js +0 -141
- package/clients/ruff-client.test.js +0 -132
- package/clients/rust-client.test.js +0 -108
- package/clients/sanitize.test.js +0 -177
- package/clients/secrets-scanner.test.js +0 -100
- package/clients/services/__tests__/effect-integration.test.js +0 -86
- package/clients/test-runner-client.test.js +0 -192
- package/clients/todo-scanner.test.js +0 -301
- package/clients/type-coverage-client.test.js +0 -105
- package/clients/typescript-client.codefix.test.js +0 -157
- package/clients/typescript-client.test.js +0 -105
- package/commands/clients/ast-grep-client.js +0 -250
- package/commands/clients/ast-grep-parser.js +0 -86
- package/commands/clients/ast-grep-rule-manager.js +0 -91
- package/commands/clients/ast-grep-types.js +0 -9
- package/commands/clients/biome-client.js +0 -380
- package/commands/clients/complexity-client.js +0 -667
- package/commands/clients/file-kinds.js +0 -177
- package/commands/clients/file-utils.js +0 -40
- package/commands/clients/jscpd-client.js +0 -169
- package/commands/clients/knip-client.js +0 -211
- package/commands/clients/ruff-client.js +0 -297
- package/commands/clients/safe-spawn.js +0 -88
- package/commands/clients/scan-utils.js +0 -83
- package/commands/clients/sg-runner.js +0 -190
- package/commands/clients/types.js +0 -11
- package/commands/clients/typescript-client.js +0 -505
- package/commands/rate.test.js +0 -119
- package/rules/ast-grep-rules/rules/no-dangerously-set-inner-html.yml +0 -13
- package/rules/ast-grep-rules/rules/no-debugger.yml +0 -12
- package/rules/ast-grep-rules/rules/no-eval.yml +0 -13
package/clients/dispatch/plan.ts
CHANGED
|
@@ -15,6 +15,13 @@ import type { ToolPlan } from "./types.js";
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Tool plans organized by purpose
|
|
18
|
+
*
|
|
19
|
+
* CORE PRINCIPLE: File write only runs BLOCKING tools
|
|
20
|
+
* - Type checking (LSP) - blocking errors
|
|
21
|
+
* - Security/correctness lint - blocking errors
|
|
22
|
+
* - Auto-format/auto-fix handled by direct calls in index.ts (not here)
|
|
23
|
+
*
|
|
24
|
+
* Warning-only tools run on /lens-booboo command only
|
|
18
25
|
*/
|
|
19
26
|
export const TOOL_PLANS: Record<string, ToolPlan> = {
|
|
20
27
|
/**
|
|
@@ -23,17 +30,18 @@ export const TOOL_PLANS: Record<string, ToolPlan> = {
|
|
|
23
30
|
jsts: {
|
|
24
31
|
name: "JavaScript/TypeScript Linting",
|
|
25
32
|
groups: [
|
|
26
|
-
//
|
|
27
|
-
{ mode: "all", runnerIds: ["
|
|
28
|
-
//
|
|
29
|
-
{ mode: "
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
//
|
|
33
|
-
|
|
33
|
+
// LSP type checking (unified for all languages) - priority 4, blocking errors
|
|
34
|
+
{ mode: "all", runnerIds: ["lsp"], filterKinds: ["jsts"] },
|
|
35
|
+
// Tree-sitter native structural analysis (blocking rules: constructor-super, dangerouslySetInnerHTML, etc.)
|
|
36
|
+
{ mode: "all", runnerIds: ["tree-sitter"], filterKinds: ["jsts"] },
|
|
37
|
+
// AST structural analysis (blocking: no-dupe-keys, no-hardcoded-secrets, jwt-no-verify, etc.)
|
|
38
|
+
// DISABLED in post-write - ast-grep-napi can crash. Runs via /lens-booboo only.
|
|
39
|
+
// { mode: "all", runnerIds: ["ast-grep-napi"], filterKinds: ["jsts"] },
|
|
40
|
+
// Type safety checks (has some blocking errors)
|
|
41
|
+
{ mode: "fallback", runnerIds: ["type-safety"], filterKinds: ["jsts"] },
|
|
34
42
|
// Note: ast-grep CLI kept for ast_grep_search/ast_grep_replace tools only
|
|
35
|
-
//
|
|
36
|
-
|
|
43
|
+
// Note: biome, oxlint handled by direct auto-fix calls in index.ts (not in dispatch)
|
|
44
|
+
// Architectural rules (guidance only, not blocking) - runs via /lens-booboo only
|
|
37
45
|
],
|
|
38
46
|
},
|
|
39
47
|
|
|
@@ -43,10 +51,13 @@ export const TOOL_PLANS: Record<string, ToolPlan> = {
|
|
|
43
51
|
python: {
|
|
44
52
|
name: "Python Linting",
|
|
45
53
|
groups: [
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
// Pyright type checking (standard mode - no LSP flag needed)
|
|
55
|
+
// Provides Python type errors in standard pi mode
|
|
56
|
+
{ mode: "all", runnerIds: ["pyright"], filterKinds: ["python"] },
|
|
57
|
+
// LSP type checking (unified) - when --lens-lsp enabled
|
|
58
|
+
{ mode: "all", runnerIds: ["lsp"], filterKinds: ["python"] },
|
|
59
|
+
// Note: ruff handled by direct auto-fix calls in index.ts (not in dispatch)
|
|
60
|
+
// Architectural rules (guidance only, not blocking) - runs via /lens-booboo only
|
|
50
61
|
],
|
|
51
62
|
},
|
|
52
63
|
|
|
@@ -56,10 +67,11 @@ export const TOOL_PLANS: Record<string, ToolPlan> = {
|
|
|
56
67
|
go: {
|
|
57
68
|
name: "Go Linting",
|
|
58
69
|
groups: [
|
|
59
|
-
//
|
|
60
|
-
{ mode: "
|
|
61
|
-
//
|
|
62
|
-
{ mode: "fallback", runnerIds: ["
|
|
70
|
+
// LSP type checking (gopls)
|
|
71
|
+
{ mode: "all", runnerIds: ["lsp"], filterKinds: ["go"] },
|
|
72
|
+
// Go vet for additional checks (warning only, but low cost)
|
|
73
|
+
{ mode: "fallback", runnerIds: ["go-vet"], filterKinds: ["go"] },
|
|
74
|
+
// Architectural rules (guidance only, not blocking) - runs via /lens-booboo only
|
|
63
75
|
],
|
|
64
76
|
},
|
|
65
77
|
|
|
@@ -69,10 +81,11 @@ export const TOOL_PLANS: Record<string, ToolPlan> = {
|
|
|
69
81
|
rust: {
|
|
70
82
|
name: "Rust Linting",
|
|
71
83
|
groups: [
|
|
72
|
-
//
|
|
73
|
-
{ mode: "
|
|
74
|
-
//
|
|
75
|
-
{ mode: "fallback", runnerIds: ["
|
|
84
|
+
// LSP type checking (rust-analyzer)
|
|
85
|
+
{ mode: "all", runnerIds: ["lsp"], filterKinds: ["rust"] },
|
|
86
|
+
// Cargo clippy for additional checks
|
|
87
|
+
{ mode: "fallback", runnerIds: ["rust-clippy"], filterKinds: ["rust"] },
|
|
88
|
+
// Architectural rules (guidance only, not blocking) - runs via /lens-booboo only
|
|
76
89
|
],
|
|
77
90
|
},
|
|
78
91
|
|
|
@@ -82,8 +95,7 @@ export const TOOL_PLANS: Record<string, ToolPlan> = {
|
|
|
82
95
|
cxx: {
|
|
83
96
|
name: "C/C++ Linting",
|
|
84
97
|
groups: [
|
|
85
|
-
// Architectural rules
|
|
86
|
-
{ mode: "fallback", runnerIds: ["architect"] },
|
|
98
|
+
// Architectural rules (guidance only, not blocking) - runs via /lens-booboo only
|
|
87
99
|
],
|
|
88
100
|
},
|
|
89
101
|
|
|
@@ -93,8 +105,8 @@ export const TOOL_PLANS: Record<string, ToolPlan> = {
|
|
|
93
105
|
json: {
|
|
94
106
|
name: "JSON Processing",
|
|
95
107
|
groups: [
|
|
96
|
-
// Biome handles JSON
|
|
97
|
-
|
|
108
|
+
// Note: Biome handles JSON formatting via direct call in index.ts
|
|
109
|
+
// No additional linting needed for JSON
|
|
98
110
|
],
|
|
99
111
|
},
|
|
100
112
|
|
|
@@ -104,7 +116,7 @@ export const TOOL_PLANS: Record<string, ToolPlan> = {
|
|
|
104
116
|
markdown: {
|
|
105
117
|
name: "Markdown Processing",
|
|
106
118
|
groups: [
|
|
107
|
-
// Spellcheck for typos
|
|
119
|
+
// Spellcheck for typos (warning only, but useful)
|
|
108
120
|
{ mode: "fallback", runnerIds: ["spellcheck"] },
|
|
109
121
|
],
|
|
110
122
|
},
|
|
@@ -115,10 +127,9 @@ export const TOOL_PLANS: Record<string, ToolPlan> = {
|
|
|
115
127
|
shell: {
|
|
116
128
|
name: "Shell Script Linting",
|
|
117
129
|
groups: [
|
|
118
|
-
// Shellcheck for bash/sh/zsh linting
|
|
130
|
+
// Shellcheck for bash/sh/zsh linting (has blocking errors for syntax)
|
|
119
131
|
{ mode: "fallback", runnerIds: ["shellcheck"] },
|
|
120
|
-
// Architectural rules
|
|
121
|
-
{ mode: "fallback", runnerIds: ["architect"] },
|
|
132
|
+
// Architectural rules (guidance only, not blocking) - runs via /lens-booboo only
|
|
122
133
|
],
|
|
123
134
|
},
|
|
124
135
|
|
|
@@ -128,8 +139,7 @@ export const TOOL_PLANS: Record<string, ToolPlan> = {
|
|
|
128
139
|
cmake: {
|
|
129
140
|
name: "CMake Processing",
|
|
130
141
|
groups: [
|
|
131
|
-
// Architectural rules
|
|
132
|
-
{ mode: "fallback", runnerIds: ["architect"] },
|
|
142
|
+
// Architectural rules (guidance only, not blocking) - runs via /lens-booboo only
|
|
133
143
|
],
|
|
134
144
|
},
|
|
135
145
|
};
|
|
@@ -147,3 +157,39 @@ export function getToolPlan(kind: FileKind): ToolPlan | undefined {
|
|
|
147
157
|
export function getAllToolPlans(): Record<string, ToolPlan> {
|
|
148
158
|
return TOOL_PLANS;
|
|
149
159
|
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Full lint plan for /lens-booboo command (includes warning-only tools)
|
|
163
|
+
* This includes ALL runners for comprehensive analysis
|
|
164
|
+
*/
|
|
165
|
+
export const FULL_LINT_PLANS: Record<string, ToolPlan> = {
|
|
166
|
+
...TOOL_PLANS,
|
|
167
|
+
// Override jsts to include warning-only tools
|
|
168
|
+
jsts: {
|
|
169
|
+
name: "JavaScript/TypeScript Full Lint",
|
|
170
|
+
groups: [
|
|
171
|
+
{ mode: "all", runnerIds: ["lsp"], filterKinds: ["jsts"] },
|
|
172
|
+
{ mode: "all", runnerIds: ["tree-sitter"], filterKinds: ["jsts"] },
|
|
173
|
+
{ mode: "all", runnerIds: ["ast-grep-napi"], filterKinds: ["jsts"] },
|
|
174
|
+
// Warning-only tools (for full lint, not file write)
|
|
175
|
+
{
|
|
176
|
+
mode: "fallback",
|
|
177
|
+
runnerIds: ["biome-lint", "oxlint"],
|
|
178
|
+
filterKinds: ["jsts"],
|
|
179
|
+
},
|
|
180
|
+
{ mode: "fallback", runnerIds: ["type-safety"], filterKinds: ["jsts"] },
|
|
181
|
+
{ mode: "fallback", runnerIds: ["architect"], filterKinds: ["jsts"] },
|
|
182
|
+
],
|
|
183
|
+
},
|
|
184
|
+
// Override python to include warning-only tools
|
|
185
|
+
python: {
|
|
186
|
+
name: "Python Full Lint",
|
|
187
|
+
groups: [
|
|
188
|
+
{ mode: "all", runnerIds: ["lsp"], filterKinds: ["python"] },
|
|
189
|
+
// Warning-only tools
|
|
190
|
+
{ mode: "fallback", runnerIds: ["ruff-lint"], filterKinds: ["python"] },
|
|
191
|
+
{ mode: "fallback", runnerIds: ["python-slop"], filterKinds: ["python"] },
|
|
192
|
+
{ mode: "fallback", runnerIds: ["architect"], filterKinds: ["python"] },
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
};
|