@hyperdrive.bot/fleet-client 0.3.195 → 0.3.197

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.
@@ -843,6 +843,17 @@ export declare class UploadFailedError extends Error {
843
843
  readonly code?: FileUploadErrorCode;
844
844
  constructor(uploadId: string, message: string, code?: FileUploadErrorCode);
845
845
  }
846
+ /**
847
+ * A directory-suggestions request that a later keystroke replaced before it finished.
848
+ *
849
+ * Not a failure of anything: the answer was simply abandoned because it is no longer the
850
+ * question being asked. It is an error rather than an empty result so that a caller
851
+ * caching by query text cannot store the abandoned walk's truncated list as the answer for
852
+ * that prefix. See `DaemonClient.getDirectorySuggestions`.
853
+ */
854
+ export declare class DirectorySuggestionsSupersededError extends Error {
855
+ constructor();
856
+ }
846
857
  export declare class DaemonClient {
847
858
  private config;
848
859
  private transport;
@@ -1,5 +1,5 @@
1
1
  import { CLIENT_CAPS, } from "@hyperdrive.bot/fleet-protocol/client-capabilities";
2
- import { AgentCreateFailedStatusPayloadSchema, AgentCreatedStatusPayloadSchema, AgentRefreshedStatusPayloadSchema, AgentResumedStatusPayloadSchema, parseServerInfoStatusPayload, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, SessionInboundMessageSchema, } from "@hyperdrive.bot/fleet-protocol/messages";
2
+ import { AgentCreateFailedStatusPayloadSchema, AgentCreatedStatusPayloadSchema, AgentRefreshedStatusPayloadSchema, AgentResumedStatusPayloadSchema, parseServerInfoStatusPayload, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, SessionInboundMessageSchema, DIRECTORY_SUGGESTIONS_SUPERSEDED_ERROR, } from "@hyperdrive.bot/fleet-protocol/messages";
3
3
  import { validateWSOutboundMessage } from "@hyperdrive.bot/fleet-protocol/validation/ws-outbound";
4
4
  import { isRelayClientWebSocketUrl } from "@hyperdrive.bot/fleet-protocol/daemon-endpoints";
5
5
  import { terminalSubscriptionKey } from "@hyperdrive.bot/fleet-protocol/terminal-subscription-key";
@@ -98,6 +98,20 @@ export class UploadFailedError extends Error {
98
98
  }
99
99
  }
100
100
  }
101
+ /**
102
+ * A directory-suggestions request that a later keystroke replaced before it finished.
103
+ *
104
+ * Not a failure of anything: the answer was simply abandoned because it is no longer the
105
+ * question being asked. It is an error rather than an empty result so that a caller
106
+ * caching by query text cannot store the abandoned walk's truncated list as the answer for
107
+ * that prefix. See `DaemonClient.getDirectorySuggestions`.
108
+ */
109
+ export class DirectorySuggestionsSupersededError extends Error {
110
+ constructor() {
111
+ super("Directory suggestions superseded by a newer request");
112
+ this.name = "DirectorySuggestionsSupersededError";
113
+ }
114
+ }
101
115
  /**
102
116
  * Map a daemon upload error code to the matching typed client error.
103
117
  * `too_large` → cap-exceeded; everything else → generic transfer failure.
@@ -3289,7 +3303,7 @@ export class DaemonClient {
3289
3303
  });
3290
3304
  }
3291
3305
  async getDirectorySuggestions(options, requestId) {
3292
- return this.sendCorrelatedSessionRequest({
3306
+ const payload = await this.sendCorrelatedSessionRequest({
3293
3307
  requestId,
3294
3308
  message: {
3295
3309
  type: "directory_suggestions_request",
@@ -3304,6 +3318,17 @@ export class DaemonClient {
3304
3318
  // Home-tree scans on large home dirs can take several seconds; don't cut
3305
3319
  // the suggestion request off early (it would surface as an empty list).
3306
3320
  });
3321
+ // A later keystroke superseded this walk, so the daemon stopped it partway: there is no
3322
+ // answer here, only an absence that looks like one. Rejecting is what keeps it out of
3323
+ // the caller's cache. Both call sites run this inside a react-query `useQuery` with
3324
+ // `staleTime: 15_000` and `retry: false`, so a resolved empty list would be stored as
3325
+ // the answer for that prefix for 15 seconds, while a rejection leaves the previous data
3326
+ // in place and caches nothing. Typed, so the UI can tell this apart from a real failure
3327
+ // and stay quiet about it.
3328
+ if (payload.error === DIRECTORY_SUGGESTIONS_SUPERSEDED_ERROR) {
3329
+ throw new DirectorySuggestionsSupersededError();
3330
+ }
3331
+ return payload;
3307
3332
  }
3308
3333
  // ============================================================================
3309
3334
  // File Explorer
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import type { AgentSnapshotPayload, CreateAgentRequestMessage, FetchWorkspacesRe
2
2
  import { DaemonClient } from "./daemon-client.js";
3
3
  import type { FetchAgentTimelineCursor, FetchAgentTimelineDirection, FetchAgentTimelinePayload, FetchAgentTimelineProjection } from "./daemon-client.js";
4
4
  export { DaemonClient };
5
- export { UploadCancelledError, UploadCapExceededError, UploadFailedError, } from "./daemon-client.js";
5
+ export { DirectorySuggestionsSupersededError, UploadCancelledError, UploadCapExceededError, UploadFailedError, } from "./daemon-client.js";
6
6
  export type { DaemonClientConfig, DaemonEvent, DaemonRequestCompletion, BrowserAutomationExecuteRequestMessage, BrowserAutomationExecuteResponseMessage, WebSocketFactory, WebSocketLike, } from "./daemon-client.js";
7
7
  export type ConnectionState = {
8
8
  status: "idle";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DaemonClient } from "./daemon-client.js";
2
2
  export { DaemonClient };
3
- export { UploadCancelledError, UploadCapExceededError, UploadFailedError, } from "./daemon-client.js";
3
+ export { DirectorySuggestionsSupersededError, UploadCancelledError, UploadCapExceededError, UploadFailedError, } from "./daemon-client.js";
4
4
  export function createPaseoClient(config) {
5
5
  const daemonClient = new DaemonClient({
6
6
  ...config,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperdrive.bot/fleet-client",
3
- "version": "0.3.195",
3
+ "version": "0.3.197",
4
4
  "description": "Paseo client SDK package",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -23,9 +23,6 @@
23
23
  "default": "./dist/daemon-client-transport-types.js"
24
24
  }
25
25
  },
26
- "publishConfig": {
27
- "access": "public"
28
- },
29
26
  "scripts": {
30
27
  "clean": "node ../../scripts/clean-package-dist.mjs",
31
28
  "build": "npm run build --workspace=@hyperdrive.bot/fleet-protocol && tsc -p tsconfig.json --incremental false",
@@ -36,8 +33,8 @@
36
33
  "test": "vitest run"
37
34
  },
38
35
  "dependencies": {
39
- "@hyperdrive.bot/fleet-protocol": "0.3.195",
40
- "@hyperdrive.bot/fleet-relay": "0.3.195",
36
+ "@hyperdrive.bot/fleet-protocol": "0.3.197",
37
+ "@hyperdrive.bot/fleet-relay": "0.3.197",
41
38
  "zod": "^4.4.3"
42
39
  },
43
40
  "devDependencies": {