pi-lens 1.2.0 → 1.3.1

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 ADDED
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ All notable changes to pi-lens will be documented in this file.
4
+
5
+ ## [1.3.0] - 2026-03-23
6
+
7
+ ### Changed
8
+ - **Biome auto-fix disabled by default**: Biome still provides linting feedback, but no longer auto-fixes on write. Use `/format` to apply fixes or enable with `--autofix-biome`.
9
+
10
+ ### Added
11
+ - **ast-grep search/replace tools**: New `ast_grep_search` and `ast_grep_replace` tools for AST-aware code pattern matching. Supports meta-variables and 24 languages.
12
+ - **Rule descriptions in diagnostics**: ast-grep violations now include the rule's message and note, making feedback more actionable for the agent.
13
+
14
+ ### Changed
15
+ - **Reduced console noise**: Extension no longer prints to console by default. Enable with `--lens-verbose`.
16
+
17
+ ## [1.2.0] - 2026-03-23
18
+
19
+ ### Added
20
+ - GitHub repository link in npm package
21
+
22
+ ## [1.1.2] - Previous
23
+
24
+ - See git history for earlier releases
package/README.md CHANGED
@@ -104,7 +104,7 @@ pip install ruff
104
104
 
105
105
  | Flag | Default | Description |
106
106
  |---|---|---|
107
- | `--autofix-biome` | **`true`** | Auto-fix Biome lint/format issues on every write |
107
+ | `--autofix-biome` | `false` | Auto-fix Biome lint/format issues on every write |
108
108
  | `--autofix-ruff` | **`true`** | Auto-fix Ruff issues on every write |
109
109
  | `--no-biome` | `false` | Disable Biome |
110
110
  | `--no-ast-grep` | `false` | Disable ast-grep |
package/index.ts CHANGED
@@ -10,9 +10,9 @@
10
10
  * Proactive hints before write/edit:
11
11
  * - Warns when target file already has existing violations
12
12
  *
13
- * Auto-fix on write (enable with autofix-biome / autofix-ruff flags):
14
- * - Biome: applies --write --unsafe (lint + format fixes)
15
- * - Ruff: applies --fix + format (lint + format fixes)
13
+ * Auto-fix on write (enable with --autofix-ruff flag, Biome auto-fix disabled by default):
14
+ * - Biome: feedback only by default, use /format to apply fixes
15
+ * - Ruff: applies --fix + format (lint + format fixes)
16
16
  *
17
17
  * On-demand commands:
18
18
  * - /format - Apply Biome formatting
@@ -115,7 +115,7 @@ export default function (pi: ExtensionAPI) {
115
115
  description:
116
116
  "Auto-fix Biome lint/format issues on write (applies --write --unsafe)",
117
117
  type: "boolean",
118
- default: true,
118
+ default: false,
119
119
  });
120
120
 
121
121
  pi.registerFlag("autofix-ruff", {
@@ -263,11 +263,12 @@ export default function (pi: ExtensionAPI) {
263
263
  pi.registerTool({
264
264
  name: "ast_grep_search",
265
265
  label: "AST Search",
266
- description: "Search code patterns using AST-aware matching. Use meta-variables: $VAR (single node), $$$ (multiple). Examples: 'console.log($MSG)', 'def $FUNC($$$):'",
266
+ description: "Search code using AST-aware pattern matching. IMPORTANT: Use specific AST patterns, NOT text search. Examples:\n- Find function: 'function $NAME() { $$$BODY }'\n- Find call: 'fetchMetrics($ARGS)'\n- Find import: 'import { $NAMES } from \"$PATH\"'\n- Generic identifier (broad): 'fetchMetrics'\n\nAlways prefer specific patterns with context over bare identifiers. Use 'paths' to scope to specific files/folders.",
267
+ promptSnippet: "Use ast_grep_search for AST-aware code search",
267
268
  parameters: Type.Object({
268
- pattern: Type.String({ description: "AST pattern with meta-variables" }),
269
+ pattern: Type.String({ description: "AST pattern (use function/class/call context, not text)" }),
269
270
  lang: Type.Union(LANGUAGES.map((l) => Type.Literal(l)), { description: "Target language" }),
270
- paths: Type.Optional(Type.Array(Type.String(), { description: "Paths to search (default: .)" })),
271
+ paths: Type.Optional(Type.Array(Type.String(), { description: "Specific files/folders to search" })),
271
272
  }),
272
273
  async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
273
274
  if (!astGrepClient.isAvailable()) {
@@ -290,12 +291,13 @@ export default function (pi: ExtensionAPI) {
290
291
  pi.registerTool({
291
292
  name: "ast_grep_replace",
292
293
  label: "AST Replace",
293
- description: "Replace code patterns with AST-aware rewriting. Dry-run by default (preview changes). Use apply=true to apply. Example: pattern='console.log($MSG)' rewrite='logger.info($MSG)'",
294
+ description: "Replace code using AST-aware pattern matching. IMPORTANT: Use specific AST patterns, not text. Dry-run by default (use apply=true to apply).\n\nExamples:\n- pattern='console.log($MSG)' rewrite='logger.info($MSG)'\n- pattern='var $X' rewrite='let $X'\n- pattern='function $NAME() { }' rewrite='' (delete)\n\nAlways use 'paths' to scope to specific files/folders. Dry-run first to preview changes.",
295
+ promptSnippet: "Use ast_grep_replace for AST-aware find-and-replace",
294
296
  parameters: Type.Object({
295
- pattern: Type.String({ description: "AST pattern to match" }),
296
- rewrite: Type.String({ description: "Replacement pattern" }),
297
+ pattern: Type.String({ description: "AST pattern to match (be specific with context)" }),
298
+ rewrite: Type.String({ description: "Replacement using meta-variables from pattern" }),
297
299
  lang: Type.Union(LANGUAGES.map((l) => Type.Literal(l)), { description: "Target language" }),
298
- paths: Type.Optional(Type.Array(Type.String(), { description: "Paths to search (default: .)" })),
300
+ paths: Type.Optional(Type.Array(Type.String(), { description: "Specific files/folders" })),
299
301
  apply: Type.Optional(Type.Boolean({ description: "Apply changes (default: false)" })),
300
302
  }),
301
303
  async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "pi-lens",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "description": "Real-time code feedback for pi — TypeScript LSP, Biome, ast-grep, Ruff, TODO scanner, dead code, duplicate detection, type coverage",
5
- "repository": "github:apmantza/pi-lens",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/apmantza/pi-lens.git"
8
+ },
6
9
  "main": "index.ts",
7
10
  "scripts": {
8
11
  "build": "tsc",
@@ -30,7 +33,8 @@
30
33
  "clients/",
31
34
  "rules/",
32
35
  "tsconfig.json",
33
- "README.md"
36
+ "README.md",
37
+ "CHANGELOG.md"
34
38
  ],
35
39
  "peerDependencies": {
36
40
  "@mariozechner/pi-coding-agent": "*"