@pluno/product-agent-web 0.1.223 → 0.1.225

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.
@@ -8,5 +8,5 @@ export declare class ProductAgentHttpTransport {
8
8
  auth: ProductAgentSocketAuth;
9
9
  });
10
10
  dispose(): void;
11
- request<T = unknown>(path: string, params?: Record<string, unknown>, body?: unknown, method?: string, namespace?: 'runtime' | 'extension' | 'embed'): Promise<T>;
11
+ request<T = unknown>(path: string, params?: Record<string, unknown>, body?: unknown, method?: string, namespace?: 'runtime' | 'extension' | 'embed', cancellation?: AbortSignal): Promise<T>;
12
12
  }
@@ -10,6 +10,7 @@ type Options = {
10
10
  currentSession: (page?: Record<string, any>) => string | null;
11
11
  contextKey?: (event: WireEvent) => string;
12
12
  sessionReferences: () => readonly string[];
13
+ entrySurface?: string;
13
14
  };
14
15
  export declare class ProductAgentBackendTransport extends EventTarget {
15
16
  private readonly options;
@@ -28,8 +29,23 @@ export declare class ProductAgentBackendTransport extends EventTarget {
28
29
  private readonly acceptedMessages;
29
30
  private hydration;
30
31
  private hydrations;
32
+ private bootstrapRequests;
33
+ private suggestionTimer;
34
+ private readonly diagnostics;
35
+ private diagnosticTimer;
36
+ private diagnosticFlush;
37
+ private diagnosticFailures;
38
+ private initialReadinessTimer;
39
+ private hasBeenReady;
40
+ initialReadinessExpired: boolean;
31
41
  constructor(options: Options);
32
42
  get directoryRooms(): Pick<ProductAgentSocketIOTransport, 'retain' | 'release'>;
43
+ get connectionAttempt(): import("./socketIOTransport").ProductAgentConnectionAttempt | null;
44
+ retryReadiness(): void;
45
+ private startInitialReadinessBudget;
46
+ private resetBootstrap;
47
+ private queueDiagnostic;
48
+ private flushDiagnostics;
33
49
  replaceCredentials(auth: ProductAgentSocketAuth, authorityChanged: boolean, bootstrap?: Record<string, any> | null): void;
34
50
  pause(): void;
35
51
  close(): void;
@@ -43,6 +59,8 @@ export declare class ProductAgentBackendTransport extends EventTarget {
43
59
  private buffer;
44
60
  private fail;
45
61
  private http;
62
+ private isRetryableRead;
63
+ private loadUserSuggestions;
46
64
  private dispatch;
47
65
  private isCurrent;
48
66
  synchronizeReferences(): void;
@@ -10,6 +10,12 @@ export type ProductAgentSocketAuth = {
10
10
  local_runtime_client_id?: string;
11
11
  extension_id?: string;
12
12
  extension_version?: string;
13
+ connection_attempt_id?: string;
14
+ };
15
+ export type ProductAgentConnectionAttempt = {
16
+ connectionAttemptId: string;
17
+ reconnectAttempt: number;
18
+ startedAt: number;
13
19
  };
14
20
  type Ready = {
15
21
  protocol: number;
@@ -28,7 +34,10 @@ type Options = {
28
34
  onError: (error: ProductAgentSocketError) => void;
29
35
  requestTimeoutMs?: number;
30
36
  reconnect?: boolean;
37
+ bootstrapRequired?: boolean;
38
+ onAttempt?: (attempt: ProductAgentConnectionAttempt) => void;
31
39
  };
40
+ export declare const PRODUCT_AGENT_READINESS_TIMEOUT_MS = 45000;
32
41
  export declare class ProductAgentSocketError extends Error {
33
42
  readonly code: string;
34
43
  readonly outcomeUnknown: boolean;
@@ -52,12 +61,22 @@ export declare class ProductAgentSocketIOTransport {
52
61
  private operations;
53
62
  private queuedOperations;
54
63
  private uploadingResult;
64
+ private admissionTimer;
65
+ private readinessTimer;
66
+ private attemptCount;
67
+ private attempt;
55
68
  constructor(options: Options);
56
69
  connect(): void;
57
70
  replaceCredentials(auth: ProductAgentSocketAuth, authorityChanged: boolean): void;
58
71
  suspend(): void;
59
72
  disconnect(): void;
60
73
  dispose(): void;
74
+ get connectionAttempt(): ProductAgentConnectionAttempt | null;
75
+ markReady(): void;
76
+ private restoreBackoff;
77
+ recover(): void;
78
+ private beginAttempt;
79
+ private clearReadinessTimers;
61
80
  retain(sessionId: string, owner: string): Promise<void>;
62
81
  release(sessionId: string, owner: string): Promise<void>;
63
82
  rpc(type: string, payload: Record<string, unknown>): Promise<unknown>;