pi-lens 3.8.64 → 3.8.65

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 CHANGED
@@ -10,6 +10,16 @@ All notable changes to pi-lens will be documented in this file.
10
10
 
11
11
  ### Fixed
12
12
 
13
+ ## [3.8.65] - 2026-07-04
14
+
15
+ ### Added
16
+
17
+ ### Changed
18
+
19
+ ### Fixed
20
+
21
+ - **Full-scan progress bar now actually renders** — the progress bar added in 3.8.64 was computed and streamed to the tool's `onUpdate`, but never displayed: `lens_diagnostics`/`lsp_diagnostics` define a custom `renderResult` (`compactRenderResult`), and the pi host renders a partial update through that renderer, which drove its summary off structured `details` and ignored the progress text in `content`. The summarizers now detect a streaming progress partial (`details.phase === "scanning"`, via the new `scanningSummaryLine` helper) and show the bar (`Scanning… [████░░░░░░] 62/123 (50%)`) during the scan, falling back to the normal diagnostic summary on completion. Also ran `npm pkg fix` to drop the `./` prefix from the `bin` paths, silencing an npm publish auto-correct warning (the published bins were already correct).
22
+
13
23
  ## [3.8.64] - 2026-07-04
14
24
 
15
25
  ### Added
@@ -17,7 +17,7 @@ import { getLSPService } from "../clients/lsp/index.js";
17
17
  import { loadProjectDiagnosticsDeltaReport, loadProjectDiagnosticsSnapshot, reconcileProjectDiagnosticsSnapshot, } from "../clients/project-diagnostics/cache.js";
18
18
  import { scanProjectDiagnostics } from "../clients/project-diagnostics/scanner.js";
19
19
  import { getFileDiagnosticSummaries, reconcileStaleWidgetFiles, } from "../clients/widget-state.js";
20
- import { makeProgressReporter } from "./scan-progress.js";
20
+ import { makeProgressReporter, scanningSummaryLine } from "./scan-progress.js";
21
21
  // The widget state exposes the full per-file diagnostic set; this is the tool's
22
22
  // own generous display budget per file (independent of the TUI's 12 cap), to
23
23
  // keep output bounded on a pathologically broken file.
@@ -61,6 +61,12 @@ flushPending = async () => { }) {
61
61
  "also scans cheap project runners (tree-sitter + fact-rules) and caches them.",
62
62
  promptSnippet: "Use lens_diagnostics mode=all to verify no blocking errors remain; use mode=full for expensive project-wide checks",
63
63
  renderResult: compactRenderResult(({ details, args, isError, text }) => {
64
+ // Streaming progress partials render the live bar (see scanningSummaryLine)
65
+ // instead of the details-driven summary, which would show "0 diagnostics"
66
+ // mid-scan.
67
+ const scanning = scanningSummaryLine(details, text);
68
+ if (scanning)
69
+ return scanning;
64
70
  const mode = details?.mode ?? (typeof args.mode === "string" ? args.mode : "delta");
65
71
  if (isError) {
66
72
  return `lens_diagnostics ${mode} — ${text.split("\n")[0] ?? "error"}`;
@@ -11,7 +11,7 @@ import { getProjectIgnoreMatcher, isExcludedDirName, } from "../clients/file-uti
11
11
  import { getLSPService } from "../clients/lsp/index.js";
12
12
  import { combineAbortSignals } from "../clients/deadline-utils.js";
13
13
  import { baseName, compactRenderResult } from "./render-compact.js";
14
- import { makeProgressReporter } from "./scan-progress.js";
14
+ import { makeProgressReporter, scanningSummaryLine } from "./scan-progress.js";
15
15
  const LANG_EXTENSIONS = {
16
16
  ".ts": [".ts", ".tsx", ".mts", ".cts"],
17
17
  ".tsx": [".ts", ".tsx", ".mts", ".cts"],
@@ -157,6 +157,10 @@ export function createLspDiagnosticsTool() {
157
157
  "Works on directories by auto-detecting file extensions and scanning all matching files.",
158
158
  promptSnippet: "Get LSP diagnostics for a file or directory (use before builds)",
159
159
  renderResult: compactRenderResult(({ details, args, isError, text }) => {
160
+ // Streaming progress partials render the live bar (see scanningSummaryLine).
161
+ const scanning = scanningSummaryLine(details, text);
162
+ if (scanning)
163
+ return scanning;
160
164
  if (isError) {
161
165
  return `lsp_diagnostics — ${text.split("\n")[0] ?? "error"}`;
162
166
  }
@@ -4,6 +4,21 @@
4
4
  * are opaque for minutes; this streams a throttled progress bar to the tool's
5
5
  * `onUpdate` callback so the agent/user sees movement.
6
6
  */
7
+ /**
8
+ * For a tool's `compactRenderResult` summarizer: when the result is a streaming
9
+ * progress partial (`details.phase === "scanning"`, emitted via `onUpdate` during
10
+ * a full scan), return the bar to display — the joined content `text` (which
11
+ * already holds `renderScanProgress` output), or a counts fallback. Returns
12
+ * `null` for a normal (non-progress) result so the caller falls through to its
13
+ * usual summary. Without this, the details-driven summarizer renders "0
14
+ * diagnostics" mid-scan and the bar never shows.
15
+ */
16
+ export function scanningSummaryLine(details, text) {
17
+ const d = details;
18
+ if (d?.phase !== "scanning")
19
+ return null;
20
+ return text || `Scanning… ${d.completed ?? 0}/${d.total ?? 0}`;
21
+ }
7
22
  /** A ≤20-char ASCII bar + counts, e.g. `Scanning… [████░░░░░░] 45/123 (37%)`. */
8
23
  export function renderScanProgress(completed, total, label = "Scanning project diagnostics") {
9
24
  const pct = total > 0 ? Math.min(100, Math.round((completed / total) * 100)) : 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-lens",
3
- "version": "3.8.64",
3
+ "version": "3.8.65",
4
4
  "type": "module",
5
5
  "description": "Real-time code feedback for pi — LSP, linters, formatters, type-checking, structural analysis & booboo",
6
6
  "repository": {
@@ -9,8 +9,8 @@
9
9
  },
10
10
  "main": "./dist/index.js",
11
11
  "bin": {
12
- "pi-lens-mcp": "./dist/mcp/server.js",
13
- "pi-lens-analyze": "./dist/mcp/analyze-cli.js"
12
+ "pi-lens-mcp": "dist/mcp/server.js",
13
+ "pi-lens-analyze": "dist/mcp/analyze-cli.js"
14
14
  },
15
15
  "scripts": {
16
16
  "build": "tsc --project tsconfig.build.json",