@danypops/pi-lector 0.12.2 → 0.12.4

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,13 +5,14 @@ import {
5
5
  descriptorForExtension,
6
6
  LANGUAGE_SERVER_DESCRIPTORS,
7
7
  type LectorClient,
8
+ LectorDaemonUnavailable,
8
9
  type OperationInputs,
9
10
  type OperationName,
10
11
  type OperationOutputs,
11
12
  remoteErrorIs,
12
13
  type WorkspaceId,
13
14
  } from "@danypops/lector";
14
- import { createRetryingClient, type RetryingClient } from "@danypops/vehicle-client/daemon-client";
15
+ import { createRetryingClient, isLikelyStaleConnectionError, type RetryingClient } from "@danypops/vehicle-client/daemon-client";
15
16
  import { nearestGitRoot, nearestProjectRoot } from "./nearest-workspace-root.ts";
16
17
 
17
18
  /**
@@ -37,7 +38,10 @@ let connector: ClientConnector = () => connectLectorClient();
37
38
  // Wraps `() => connector()` rather than `connector` itself, so a test's
38
39
  // setLectorClientConnectorForTests still takes effect after this retrying
39
40
  // client is constructed once at module load.
40
- const retryingClient: RetryingClient<LectorClient> = createRetryingClient(() => connector(), { label: "Lector" });
41
+ const retryingClient: RetryingClient<LectorClient> = createRetryingClient(() => connector(), {
42
+ label: "Lector",
43
+ isStaleConnectionError: (error) => error instanceof LectorDaemonUnavailable || isLikelyStaleConnectionError(error),
44
+ });
41
45
  const workspaceIdByRoot = new Map<string, WorkspaceId>();
42
46
 
43
47
  /**
@@ -172,7 +172,7 @@ export async function monitorWorkspaceCache(operations: WorkspaceCacheOperations
172
172
  }
173
173
 
174
174
  let jobId: string;
175
- if (initial.status === "caching") {
175
+ if (initial.status === "caching" || initial.status === "waiting-for-resources") {
176
176
  jobId = initial.jobId;
177
177
  } else {
178
178
  options.onState({ status: "not-cached", reason: initial.reason });
@@ -32,6 +32,7 @@ export function formatWorkspaceCacheStatusResult(status: WorkspaceCacheStatus |
32
32
  if (!status) return theme.fg("dim", "No result.");
33
33
  if (status.status === "not-cached") return theme.fg("warning", `not cached (${status.reason})`);
34
34
  if (status.status === "caching") return theme.fg("accent", `caching (job ${status.jobId})`);
35
+ if (status.status === "waiting-for-resources") return theme.fg("accent", `waiting for resources (job ${status.jobId})`);
35
36
  if (status.status === "partial") return theme.fg("warning", `partial -- ${formatResultCounts(status.generation.result)}`);
36
37
  return theme.fg("success", `cached -- ${formatResultCounts(status.generation.result)}`);
37
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danypops/pi-lector",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
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
  },
20
20
  "dependencies": {
21
21
  "@danypops/vehicle-client": "^0.2.0",
22
- "@danypops/lector": "^0.17.0",
22
+ "@danypops/lector": "^0.18.0",
23
23
  "malevich-tui-components": "^0.19.0",
24
24
  "picomatch": "^4.0.5"
25
25
  },