@danypops/pi-lector 0.13.1 → 0.13.5

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.
@@ -5,6 +5,8 @@
5
5
  * unit-testable without a real daemon or terminal. See caching-overlay.ts for the stateful
6
6
  * ctx.ui.setWidget-registered class that drives these from a live poll.
7
7
  */
8
+
9
+ import { basename } from "node:path";
8
10
  import { vehicleWidgetTitle } from "@danypops/vehicle-client-pi/widget-header";
9
11
  import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
10
12
  import { type AutoRotatingWindow, renderCardRow, type TextMeasure } from "malevich-tui-components";
@@ -20,6 +22,10 @@ export const LECTOR_CACHING_WIDGET_VISIBLE_ROWS = 5;
20
22
  export interface CachingWidgetRow {
21
23
  workspaceId: string;
22
24
  status: "queued" | "running" | "waiting-for-resources";
25
+ /** Absent for an already-unregistered workspace -- falls back to the bare workspaceId for display. */
26
+ rootPath?: string;
27
+ /** Absent until the first file of this run completes, or while still queued -- nothing walked yet. */
28
+ progress?: { filesProcessed: number; filesTotal: number };
23
29
  }
24
30
 
25
31
  export interface CachingWidgetProjection {
@@ -31,6 +37,11 @@ export function buildCachingWidgetProjection(jobs: readonly CachingWidgetRow[]):
31
37
  return { rows: [...jobs], total: jobs.length };
32
38
  }
33
39
 
40
+ /** The project directory's own basename when a path is known ("lector", not the full absolute path a narrow card has no room for) -- falls back to the bare workspaceId hash for a row with no rootPath at all. */
41
+ function cachingRowLabel(row: CachingWidgetRow): string {
42
+ return row.rootPath ? basename(row.rootPath) : row.workspaceId;
43
+ }
44
+
34
45
  function cachingRowLine(theme: { fg(color: string, text: string): string }, row: CachingWidgetRow, width: number): string {
35
46
  const glyph =
36
47
  row.status === "waiting-for-resources"
@@ -38,7 +49,8 @@ function cachingRowLine(theme: { fg(color: string, text: string): string }, row:
38
49
  : row.status === "queued"
39
50
  ? theme.fg("muted", "\u2022")
40
51
  : theme.fg("accent", "\u25b6");
41
- return truncateToWidth(`${glyph} ${row.workspaceId}`, width, "\u2026");
52
+ const progressSuffix = row.progress ? theme.fg("muted", ` (${row.progress.filesProcessed}/${row.progress.filesTotal})`) : "";
53
+ return truncateToWidth(`${glyph} ${cachingRowLabel(row)}${progressSuffix}`, width, "\u2026");
42
54
  }
43
55
 
44
56
  /** "Lector · Caching · <N>", plus a "page/total ⟳" suffix once genuinely paging. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danypops/pi-lector",
3
- "version": "0.13.1",
3
+ "version": "0.13.5",
4
4
  "description": "Pi host adapter for Lector: overrides read/write/edit with a daemon-backed, hash-guarded filesystem",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,7 +19,7 @@
19
19
  "@earendil-works/pi-coding-agent": "*",
20
20
  "@earendil-works/pi-tui": "*",
21
21
  "typebox": "*",
22
- "@danypops/vehicle-client-pi": "^0.43.0"
22
+ "@danypops/vehicle-client-pi": "^0.45.0"
23
23
  },
24
24
  "dependencies": {
25
25
  "@danypops/lector": "^0.19.9",
@@ -29,7 +29,7 @@
29
29
  "picomatch": "^4.0.5"
30
30
  },
31
31
  "devDependencies": {
32
- "@danypops/vehicle-client-pi": "^0.43.0",
32
+ "@danypops/vehicle-client-pi": "^0.45.0",
33
33
  "@danypops/vehicle-conformance": "^0.4.0",
34
34
  "@danypops/pi-extension-harness": "^0.2.0",
35
35
  "@danypops/pi-tui-harness": "^0.0.1",