@pluno/product-agent-web 0.1.221 → 0.1.224
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/dist/adapters/web/backendHttp.d.ts +1 -1
- package/dist/adapters/web/backendTransport.d.ts +19 -0
- package/dist/adapters/web/socketIOTransport.d.ts +22 -1
- package/dist/core/active-users/reducer.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/product-agent-sdk.js +1343 -1161
- package/dist/product-agent-widget.js +3889 -3615
- package/package.json +1 -1
|
@@ -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,13 +29,29 @@ 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;
|
|
36
52
|
private finishClose;
|
|
37
53
|
send(data: string): void;
|
|
54
|
+
sendRetainedCommand(event: WireEvent): Promise<boolean>;
|
|
38
55
|
private receive;
|
|
39
56
|
acceptMessage(message: Event): void;
|
|
40
57
|
private rejectToolReceipts;
|
|
@@ -42,6 +59,8 @@ export declare class ProductAgentBackendTransport extends EventTarget {
|
|
|
42
59
|
private buffer;
|
|
43
60
|
private fail;
|
|
44
61
|
private http;
|
|
62
|
+
private isRetryableRead;
|
|
63
|
+
private loadUserSuggestions;
|
|
45
64
|
private dispatch;
|
|
46
65
|
private isCurrent;
|
|
47
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,12 +34,16 @@ 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;
|
|
35
44
|
readonly detail?: unknown | undefined;
|
|
36
|
-
|
|
45
|
+
readonly backendRefusal: boolean;
|
|
46
|
+
constructor(message: string, code: string, outcomeUnknown?: boolean, detail?: unknown | undefined, backendRefusal?: boolean);
|
|
37
47
|
}
|
|
38
48
|
export declare class ProductAgentSocketIOTransport {
|
|
39
49
|
private readonly options;
|
|
@@ -51,12 +61,22 @@ export declare class ProductAgentSocketIOTransport {
|
|
|
51
61
|
private operations;
|
|
52
62
|
private queuedOperations;
|
|
53
63
|
private uploadingResult;
|
|
64
|
+
private admissionTimer;
|
|
65
|
+
private readinessTimer;
|
|
66
|
+
private attemptCount;
|
|
67
|
+
private attempt;
|
|
54
68
|
constructor(options: Options);
|
|
55
69
|
connect(): void;
|
|
56
70
|
replaceCredentials(auth: ProductAgentSocketAuth, authorityChanged: boolean): void;
|
|
57
71
|
suspend(): void;
|
|
58
72
|
disconnect(): void;
|
|
59
73
|
dispose(): void;
|
|
74
|
+
get connectionAttempt(): ProductAgentConnectionAttempt | null;
|
|
75
|
+
markReady(): void;
|
|
76
|
+
private restoreBackoff;
|
|
77
|
+
recover(): void;
|
|
78
|
+
private beginAttempt;
|
|
79
|
+
private clearReadinessTimers;
|
|
60
80
|
retain(sessionId: string, owner: string): Promise<void>;
|
|
61
81
|
release(sessionId: string, owner: string): Promise<void>;
|
|
62
82
|
rpc(type: string, payload: Record<string, unknown>): Promise<unknown>;
|
|
@@ -67,6 +87,7 @@ export declare class ProductAgentSocketIOTransport {
|
|
|
67
87
|
private assertReady;
|
|
68
88
|
private uploadResult;
|
|
69
89
|
private request;
|
|
90
|
+
private recoverUncertainDelivery;
|
|
70
91
|
private invalidate;
|
|
71
92
|
}
|
|
72
93
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PAQueryState } from "../kernel/state";
|
|
2
2
|
import type { PAEffect, PAEffectResultEvent } from "../kernel/effects";
|
|
3
3
|
export declare const ACTIVE_USERS_POLL_MS = 10000;
|
|
4
|
-
export declare const ACTIVE_USERS_DISPLAY_MS =
|
|
4
|
+
export declare const ACTIVE_USERS_DISPLAY_MS = 3000;
|
|
5
5
|
export type PAActiveUsersState = Readonly<{
|
|
6
6
|
authenticated: boolean;
|
|
7
7
|
generation: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -298,6 +298,7 @@ export declare class ProductAgentSessionEngine {
|
|
|
298
298
|
private networkBatchTimer;
|
|
299
299
|
private queuedNetworkEvents;
|
|
300
300
|
private queuedClientEvents;
|
|
301
|
+
private readonly pendingRetainedCommandDeliveries;
|
|
301
302
|
private pendingWidgetLifecycleEvents;
|
|
302
303
|
private pendingPassiveWarmupEvent;
|
|
303
304
|
private pendingComposerWarmup;
|