@pluno/product-agent-web 0.1.229 → 0.1.232
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 +16 -2
- package/dist/adapters/web/backendTransport.d.ts +3 -0
- package/dist/adapters/web/conversationAdapters.d.ts +59 -0
- package/dist/adapters/web/conversationCheckpoint.d.ts +16 -0
- package/dist/adapters/web/conversationInteractionAdapter.d.ts +11 -0
- package/dist/adapters/web/conversationPresentation.d.ts +4 -0
- package/dist/adapters/web/directoryAdapters.d.ts +2 -2
- package/dist/adapters/web/socketIOTransport.d.ts +4 -0
- package/dist/chatPresentation.d.ts +7 -0
- package/dist/core/conversation/contracts.d.ts +181 -1
- package/dist/core/conversation/delivery.d.ts +22 -0
- package/dist/core/conversation/deliveryContracts.d.ts +100 -0
- package/dist/core/conversation/display.d.ts +134 -0
- package/dist/core/conversation/reducer.d.ts +8 -0
- package/dist/core/conversation/selectors.d.ts +59 -0
- package/dist/core/conversation/state.d.ts +6 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/model-selection/commands.d.ts +1 -1
- package/dist/displayedErrors.d.ts +1 -1
- package/dist/entrySurface.d.ts +2 -0
- package/dist/index.d.ts +51 -117
- package/dist/interactionManager.d.ts +3 -0
- package/dist/interruptState.d.ts +1 -1
- package/dist/operationTiming.d.ts +21 -0
- package/dist/product-agent-runtime.cjs +1 -1
- package/dist/product-agent-runtime.js +578 -375
- package/dist/product-agent-sdk.js +4195 -4637
- package/dist/product-agent-widget.js +8748 -9160
- package/dist/protocolTrace.d.ts +3 -0
- package/dist/public/operationRoutes.d.ts +2 -0
- package/dist/renderDiagnostics.d.ts +31 -0
- package/dist/responseDiagnostics.d.ts +1 -0
- package/dist/runtime/composition.d.ts +13 -5
- package/dist/runtime/modelSelection.d.ts +1 -1
- package/dist/runtime.d.ts +2 -2
- package/dist/runtimeClient.d.ts +20 -6
- package/dist/runtimeState.d.ts +15 -0
- package/dist/shareCard.d.ts +1 -0
- package/dist/uiFlightRecorder.d.ts +4 -1
- package/dist/uiInvariants.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { PAConversationScopeId, PAViewId } from "../kernel/state";
|
|
2
|
+
import type { PADirectoryState } from "../session-directory/contracts";
|
|
3
|
+
import type { PAConversationProjection, PAConversationRecord, PAConversationSegment, PAConversationState } from "./contracts";
|
|
4
|
+
export declare function selectConversationScope(state: PAConversationState, directory: PADirectoryState, scope: PAConversationScopeId): PAConversationProjection;
|
|
5
|
+
export declare function selectComposerHandoff(projection: PAConversationProjection, viewId: PAViewId, rendererRevision: number): Readonly<{
|
|
6
|
+
viewId: PAViewId;
|
|
7
|
+
userMessageId: string;
|
|
8
|
+
acceptedRendererRevision: number;
|
|
9
|
+
}> | null;
|
|
10
|
+
export declare function selectConversationRetryTarget(projection: PAConversationProjection, explicitId?: string): {
|
|
11
|
+
type: "delivery";
|
|
12
|
+
userMessageId: string;
|
|
13
|
+
sessionId?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
type: "execution";
|
|
16
|
+
userMessageId: string;
|
|
17
|
+
sessionId: import("..").PASessionId;
|
|
18
|
+
} | null;
|
|
19
|
+
export declare function selectConversation(state: PAConversationState, directory: PADirectoryState): {
|
|
20
|
+
scopes: {
|
|
21
|
+
[k: string]: Readonly<{
|
|
22
|
+
preparation?: "pending" | "busy" | null;
|
|
23
|
+
selectionKey?: string;
|
|
24
|
+
isDraftSession: boolean;
|
|
25
|
+
proactiveQuestion: Readonly<{
|
|
26
|
+
id: string;
|
|
27
|
+
content: string;
|
|
28
|
+
}> | null;
|
|
29
|
+
followUps: readonly import("./display").PAConversationFollowUp[];
|
|
30
|
+
sessionId: import("..").PASessionId | null;
|
|
31
|
+
submissions: readonly import("./contracts").PAOwnedSubmission[];
|
|
32
|
+
deliveries: Readonly<Record<string, import("./deliveryContracts").PAConversationDelivery>>;
|
|
33
|
+
items: readonly import("./display").PADisplayItem[];
|
|
34
|
+
optimistic: readonly import("./contracts").PAOwnedSubmission[];
|
|
35
|
+
removedItems: Readonly<Record<string, string>>;
|
|
36
|
+
streamStates: Readonly<Record<string, import("./display").PAStreamLifecycle["state"] | "awaiting_content">>;
|
|
37
|
+
stop: (import("./contracts").PAConversationStop & Readonly<{
|
|
38
|
+
pending: boolean;
|
|
39
|
+
}>) | null;
|
|
40
|
+
segments: readonly PAConversationSegment[];
|
|
41
|
+
activity: Readonly<{
|
|
42
|
+
phase: import("./display").PAExecutionState["phase"] | "submitting" | "awaiting_execution";
|
|
43
|
+
activeItemId: string | null;
|
|
44
|
+
userMessageId?: string | null;
|
|
45
|
+
}>;
|
|
46
|
+
receipts: readonly Readonly<{
|
|
47
|
+
viewId: PAViewId;
|
|
48
|
+
userMessageId: string;
|
|
49
|
+
acceptedRendererRevision: number;
|
|
50
|
+
}>[];
|
|
51
|
+
}>;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export declare function isConversationTurnTerminal(record: PAConversationRecord, userMessageId: string | null): boolean;
|
|
55
|
+
export declare function selectConversationCompletion(projection: PAConversationProjection, record: PAConversationRecord | undefined): {
|
|
56
|
+
version: number;
|
|
57
|
+
userMessageIds: readonly string[];
|
|
58
|
+
answer: string;
|
|
59
|
+
} | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PAAuthorityId, type PASessionId } from "../kernel/state";
|
|
2
|
+
import type { PAConversationRecord, PAConversationState } from "./contracts";
|
|
3
|
+
export declare function freezeConversationValue<T>(value: T): T;
|
|
4
|
+
export declare function ownConversationValue<T>(value: T): T;
|
|
5
|
+
export declare function createConversationState(authorityId?: PAAuthorityId, generation?: number): PAConversationState;
|
|
6
|
+
export declare function createConversationRecord(sessionId: PASessionId): PAConversationRecord;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export * from "./browser-execution/contracts";
|
|
2
2
|
export * from "./conversation/contracts";
|
|
3
|
+
export * from "./conversation/display";
|
|
4
|
+
export * from "./conversation/state";
|
|
5
|
+
export * from "./conversation/reducer";
|
|
6
|
+
export * from "./conversation/selectors";
|
|
7
|
+
export * from "./conversation/deliveryContracts";
|
|
8
|
+
export * from "./conversation/delivery";
|
|
3
9
|
export * from "./interactions/contracts";
|
|
4
10
|
export * from "./kernel/capabilities";
|
|
5
11
|
export * from "./kernel/commands";
|
|
@@ -16,7 +16,7 @@ export type PAModelCommand = Readonly<{
|
|
|
16
16
|
}> | Readonly<{
|
|
17
17
|
type: "model.submission_capture";
|
|
18
18
|
clientMessageId: string;
|
|
19
|
-
requestedModel?: PAProductAgentModel;
|
|
19
|
+
requestedModel?: PAProductAgentModel | null;
|
|
20
20
|
}> | Readonly<{
|
|
21
21
|
type: "model.scope_close";
|
|
22
22
|
}>);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare function reportProductAgentTimelineJump(hasUserScrolled: boolean, report: (reason: string) => void): void;
|
|
2
|
-
export declare function observeProductAgentDisplayedErrors(root: HTMLElement, report: (reason: string, errorFingerprint: string, displayedMessage: string) => void): () => void;
|
|
2
|
+
export declare function observeProductAgentDisplayedErrors(root: HTMLElement, report: (reason: string, errorFingerprint: string, displayedMessage: string, itemId?: string) => void): () => void;
|
|
3
3
|
export declare function observeProductAgentDuplicateProactiveQuestions(root: HTMLElement, report: (reason: string, clientMessageId: string) => void): () => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type OperationTiming } from "./operationTiming";
|
|
1
2
|
import type { ActiveUsersCounterValue } from "./activeUsersCounter";
|
|
3
|
+
import { type RenderedErrorEvidence, type UiInvariantEvidence } from "./renderDiagnostics";
|
|
2
4
|
import type { ProductAgentTaskStatus } from "./taskPageTitle";
|
|
3
|
-
import type { ProductAgentEntityQueryData, ProductAgentAccountProjection, ProductAgentInteraction, ProductAgentInteractionAction, ProductAgentQueryState } from "./runtimeState";
|
|
5
|
+
import type { ProductAgentEntityQueryData, ProductAgentAccountProjection, ProductAgentSubmissionContext, ProductAgentInteraction, ProductAgentInteractionAction, ProductAgentQueryState } from "./runtimeState";
|
|
4
6
|
export type ProductAgentModel = "anthropic/claude-opus-5" | "anthropic/claude-sonnet-5" | "deepseek/deepseek-chat-v3.1" | "deepseek/deepseek-v4-flash" | "gpt-5.4-nano" | "gpt-5.4-mini" | "gpt-5.4" | "gpt-5.6-luna" | "gpt-5.6-terra" | "gpt-5.6-sol";
|
|
5
7
|
export type ProductAgentEntrySurface = "extension_sidepanel" | "extension_widget" | "main_web_chat" | "whatsapp" | "automation" | "mcp" | "embedded_widget" | "embedded_custom_ui";
|
|
6
8
|
export type ProductAgentProductVariant = "personal" | "customer_embedded";
|
|
@@ -50,6 +52,7 @@ export type ProductAgentMessage = {
|
|
|
50
52
|
sharePromptAllowed?: boolean;
|
|
51
53
|
attachments?: ProductAgentAttachment[];
|
|
52
54
|
loading?: boolean;
|
|
55
|
+
streamState?: "open" | "awaiting_content" | "finished" | "failed" | "stopped";
|
|
53
56
|
steered?: boolean;
|
|
54
57
|
retryable?: boolean;
|
|
55
58
|
integrationAuthRequest?: ProductAgentIntegrationAuthRequest;
|
|
@@ -130,6 +133,9 @@ export type ProductAgentAppearance = {
|
|
|
130
133
|
};
|
|
131
134
|
export type ProductAgentTurnPhase = "sending" | "starting" | "thinking";
|
|
132
135
|
export type ProductAgentState = {
|
|
136
|
+
selectionKey?: string;
|
|
137
|
+
isDraftSession?: boolean;
|
|
138
|
+
submissionContext?: ProductAgentSubmissionContext;
|
|
133
139
|
activeUsersCount?: number | null;
|
|
134
140
|
status: "idle" | "connecting" | "connected" | "reconnecting" | "closed" | "error";
|
|
135
141
|
user: ProductAgentUser | null;
|
|
@@ -138,7 +144,25 @@ export type ProductAgentState = {
|
|
|
138
144
|
starterPromptsLoading: boolean;
|
|
139
145
|
appearance: ProductAgentAppearance | null;
|
|
140
146
|
messages: ProductAgentMessage[];
|
|
147
|
+
removedItems?: Readonly<Record<string, string>>;
|
|
148
|
+
segments?: readonly Readonly<{
|
|
149
|
+
id: string;
|
|
150
|
+
userMessageId: string | null;
|
|
151
|
+
activityIds: readonly string[];
|
|
152
|
+
outcomeIds: readonly string[];
|
|
153
|
+
collapsed: boolean;
|
|
154
|
+
}>[];
|
|
155
|
+
activity?: Readonly<{
|
|
156
|
+
phase: "idle" | "queued" | "thinking" | "steering" | "stopping" | "completed" | "failed" | "stopped" | "submitting" | "awaiting_execution";
|
|
157
|
+
activeItemId: string | null;
|
|
158
|
+
}>;
|
|
159
|
+
receipts?: readonly Readonly<{
|
|
160
|
+
viewId: string;
|
|
161
|
+
userMessageId: string;
|
|
162
|
+
acceptedRendererRevision: number;
|
|
163
|
+
}>[];
|
|
141
164
|
activeScheduledFollowUps: ProductAgentActiveScheduledFollowUp[] | null;
|
|
165
|
+
historyPreparation?: "pending" | "busy" | null;
|
|
142
166
|
isLoadingSession: boolean;
|
|
143
167
|
assistantDraft: string;
|
|
144
168
|
assistantDraftItemId: string | null;
|
|
@@ -275,8 +299,12 @@ export declare const PRODUCT_AGENT_PROVIDER_INPUT_ATTACHMENT_ACCEPT = ".pdf,.png
|
|
|
275
299
|
export declare function calculateReconnectDelay(attempt: number, random?: () => number): number;
|
|
276
300
|
export declare class ProductAgentSessionEngine {
|
|
277
301
|
private readonly options;
|
|
278
|
-
private readonly assistantDeltaReplayGuard;
|
|
279
302
|
private readonly clientRuntime;
|
|
303
|
+
private conversationObservation;
|
|
304
|
+
private conversationAdapterGeneration;
|
|
305
|
+
private conversationUnsubscribe;
|
|
306
|
+
private composerRevision;
|
|
307
|
+
private submissionIntentRevision;
|
|
280
308
|
private readonly listeners;
|
|
281
309
|
private socket;
|
|
282
310
|
private reconnectTimer;
|
|
@@ -290,6 +318,9 @@ export declare class ProductAgentSessionEngine {
|
|
|
290
318
|
private token;
|
|
291
319
|
private rejectedTransportToken;
|
|
292
320
|
private refreshingDefaultCredentials;
|
|
321
|
+
private credentialRecovery;
|
|
322
|
+
private credentialRecoveryFailure;
|
|
323
|
+
private authenticationFailure;
|
|
293
324
|
private tokenExpiresAtMs;
|
|
294
325
|
private tokenRequest;
|
|
295
326
|
private tokenAbortController;
|
|
@@ -301,18 +332,14 @@ export declare class ProductAgentSessionEngine {
|
|
|
301
332
|
private queuedClientEvents;
|
|
302
333
|
private readonly pendingRetainedCommandDeliveries;
|
|
303
334
|
private pendingWidgetLifecycleEvents;
|
|
304
|
-
private pendingPassiveWarmupEvent;
|
|
305
|
-
private pendingComposerWarmup;
|
|
306
335
|
private activeComposerWarmupId;
|
|
307
|
-
private
|
|
308
|
-
private pendingWarmupAckTimer;
|
|
336
|
+
private readonly authenticatingWarmupHints;
|
|
309
337
|
private directoryAuthority;
|
|
310
338
|
private readonly directoryHttp;
|
|
311
339
|
private directoryScope;
|
|
312
340
|
private directoryObservation;
|
|
313
341
|
private directoryConversationScopeId;
|
|
314
342
|
private directoryProvisionalId;
|
|
315
|
-
private readonly conversationRecoveries;
|
|
316
343
|
private account;
|
|
317
344
|
private usingPaidCreditFallback;
|
|
318
345
|
private readonly accountListeners;
|
|
@@ -323,57 +350,15 @@ export declare class ProductAgentSessionEngine {
|
|
|
323
350
|
private integrationAuthStatusByRequestId;
|
|
324
351
|
private integrationAuthErrorByRequestId;
|
|
325
352
|
private tabGroupsPermissionNeeded;
|
|
326
|
-
private sessionLoadRequestId;
|
|
327
|
-
private sessionLoadRequestTimer;
|
|
328
|
-
private pendingSessionSubscription;
|
|
329
|
-
private sessionHistoryHydration;
|
|
330
|
-
private sessionActivityRequestId;
|
|
331
353
|
private readonly transportIdentity;
|
|
332
|
-
private retryAttemptsByClientMessageId;
|
|
333
|
-
private pendingDeliveryIssued;
|
|
334
|
-
private queuedDeliveryRetryAttempt;
|
|
335
|
-
private retryTimersByClientMessageId;
|
|
336
354
|
private readonly reportedHealthSignalKeys;
|
|
337
355
|
private readonly firstResponseTimersByClientMessageId;
|
|
338
|
-
private lastProjectedTurnPhase;
|
|
339
|
-
private lastProjectedTurnClientMessageId;
|
|
340
|
-
private readonly clientMessageIdsByUserMessageItemId;
|
|
341
|
-
private readonly backgroundSessionIds;
|
|
342
|
-
private readonly backgroundClientMessageIds;
|
|
343
|
-
private readonly deferredSessionUpdatedSessionIds;
|
|
344
|
-
private readonly sessionTimelineCache;
|
|
345
|
-
private readonly detachedSessionIds;
|
|
346
|
-
private readonly detachedClientMessageIds;
|
|
347
|
-
private readonly deferredDetachedSessionEvents;
|
|
348
|
-
private readonly retryableFailureRunIdsAwaitingDone;
|
|
349
|
-
private thinkingWatchdogTimer;
|
|
350
|
-
private runAckWatchdogTimer;
|
|
351
|
-
private runAckResyncRetryTimer;
|
|
352
|
-
private pendingDeliveryAckTimer;
|
|
353
|
-
private pendingDeliveryRetryTimer;
|
|
354
|
-
private pendingDeliveryReconciliationRequestId;
|
|
355
|
-
private pendingClientMessageId;
|
|
356
|
-
private pendingUserMessageEvent;
|
|
357
|
-
private failedUserMessageEvent;
|
|
358
356
|
private readonly modelClientScopeId;
|
|
359
|
-
private activeClientMessageId;
|
|
360
|
-
private activeRunAckObserved;
|
|
361
|
-
private activeResponseUserMessageId;
|
|
362
|
-
private activeResponseRunId;
|
|
363
|
-
private activeUserMessageEvent;
|
|
364
|
-
private latestRecoverableClientMessageId;
|
|
365
357
|
private lastUserMessagePageUrl;
|
|
366
|
-
private thinkingWatchdogResyncAttemptsByClientMessageId;
|
|
367
|
-
private retryableClientMessageId;
|
|
368
|
-
private stagedProactiveSuggestionQuestionMessageId;
|
|
369
358
|
private runtimeHelperJavascript;
|
|
370
359
|
private readonly attachmentFiles;
|
|
371
360
|
private sessionBrowserApisCleanup;
|
|
372
361
|
private readonly activeBrowserToolCalls;
|
|
373
|
-
private readonly cancelledSubmissions;
|
|
374
|
-
private readonly stoppedTurns;
|
|
375
|
-
private readonly pendingToolLoadingByCallId;
|
|
376
|
-
private readonly terminalToolCallIds;
|
|
377
362
|
private readonly nonTranscriptToolCallIds;
|
|
378
363
|
private pageLifecycleCleanup;
|
|
379
364
|
private transientStarterPromptsRequestInFlight;
|
|
@@ -381,15 +366,19 @@ export declare class ProductAgentSessionEngine {
|
|
|
381
366
|
private locationChangeCleanup;
|
|
382
367
|
private starterPromptUrlRefreshTimer;
|
|
383
368
|
private lastStarterPromptPageUrl;
|
|
384
|
-
private
|
|
369
|
+
private platformState;
|
|
370
|
+
private get state();
|
|
371
|
+
private set state(value);
|
|
385
372
|
private constructor();
|
|
386
373
|
static init(options: ProductAgentInitOptions): Promise<ProductAgentSessionEngine>;
|
|
387
|
-
private createConversationRecovery;
|
|
388
374
|
private createDirectoryAdapters;
|
|
375
|
+
private operationTimingReporter;
|
|
376
|
+
reportOperationTiming(timing: OperationTiming): void;
|
|
377
|
+
private initializeConversation;
|
|
389
378
|
private initializeDirectory;
|
|
390
379
|
private handleDirectoryTransportError;
|
|
380
|
+
private retainNavigatedConversation;
|
|
391
381
|
private beginDirectoryProvisional;
|
|
392
|
-
private selectDirectorySession;
|
|
393
382
|
on<T extends EventName>(eventName: T, listener: Listener<T>): () => void;
|
|
394
383
|
getState(): ProductAgentState;
|
|
395
384
|
stageProactiveSuggestionQuestion(question: string): void;
|
|
@@ -410,22 +399,20 @@ export declare class ProductAgentSessionEngine {
|
|
|
410
399
|
submittedAt?: number;
|
|
411
400
|
}): Promise<string | null>;
|
|
412
401
|
reportResponseVisibility(observation: ResponseVisibilityObservation): void;
|
|
413
|
-
reportInvalidStateTransition(reason: string, clientMessageId?: string): void;
|
|
414
|
-
reportDisplayedError(reason: string, errorFingerprint: string, displayedMessage?: string): void;
|
|
402
|
+
reportInvalidStateTransition(reason: string, clientMessageId?: string, uiInvariant?: UiInvariantEvidence): void;
|
|
403
|
+
reportDisplayedError(reason: string, errorFingerprint: string, displayedMessage?: string, renderedError?: RenderedErrorEvidence): void;
|
|
415
404
|
getModel(): ProductAgentModel | undefined;
|
|
416
405
|
setModel(model: ProductAgentModel): void;
|
|
417
406
|
retryLastMessage(): boolean;
|
|
418
407
|
createLocalAttachment(file: File): ProductAgentAttachment;
|
|
419
408
|
uploadAttachment(file: File): Promise<ProductAgentAttachment>;
|
|
420
|
-
private uploadAttachmentForMessage;
|
|
421
|
-
private updateAttachmentInState;
|
|
422
409
|
private prepareEmbedAttachmentUpload;
|
|
423
|
-
private fetchEmbedAttachmentUpload;
|
|
424
|
-
private getStopClientMessageId;
|
|
425
410
|
stop(): void;
|
|
411
|
+
private stopConversation;
|
|
426
412
|
startNewSession(options?: {
|
|
427
413
|
notifyTransport?: boolean;
|
|
428
414
|
}): void;
|
|
415
|
+
private resetConversationSelection;
|
|
429
416
|
listSessions(options?: {
|
|
430
417
|
cursor?: string | null;
|
|
431
418
|
limit?: number;
|
|
@@ -446,21 +433,14 @@ export declare class ProductAgentSessionEngine {
|
|
|
446
433
|
feedback?: string;
|
|
447
434
|
snoozeUntil?: string;
|
|
448
435
|
}): Promise<void>;
|
|
436
|
+
private createConversationInteractionPort;
|
|
449
437
|
private refreshRuntimeInteractions;
|
|
450
438
|
private rebuildRuntimeInteractions;
|
|
451
439
|
getAccount(): ProductAgentAccountProjection | null;
|
|
452
440
|
subscribeAccount(listener: (account: ProductAgentAccountProjection | null) => void): () => void;
|
|
453
441
|
refreshAccount(): Promise<void>;
|
|
454
442
|
loadSession(sessionId: string): void;
|
|
455
|
-
private canLoadSessionHistoryOverHttp;
|
|
456
|
-
private loadSessionHistoryOverHttp;
|
|
457
|
-
private subscribeToSessionBeforeHistory;
|
|
458
|
-
private autoLoadSessionActivity;
|
|
459
|
-
private fetchSessionHistoryPageUntilCurrent;
|
|
460
|
-
private fetchSessionHistoryPageOnce;
|
|
461
|
-
private failSessionHistoryRequest;
|
|
462
443
|
private send;
|
|
463
|
-
private getUploadToken;
|
|
464
444
|
private sendNow;
|
|
465
445
|
private reportHealthSignal;
|
|
466
446
|
private startFirstResponseTimer;
|
|
@@ -468,9 +448,6 @@ export declare class ProductAgentSessionEngine {
|
|
|
468
448
|
private reportFirstResponseSlow;
|
|
469
449
|
private clearFirstResponseTimer;
|
|
470
450
|
private clearAllFirstResponseTimers;
|
|
471
|
-
private rememberPendingDeliveryForRecovery;
|
|
472
|
-
private persistCurrentPendingDeliveryRecovery;
|
|
473
|
-
private clearPersistedPendingDelivery;
|
|
474
451
|
private requestTransientStarterPrompts;
|
|
475
452
|
private startStarterPromptUrlWatcher;
|
|
476
453
|
private handleStarterPromptUrlChange;
|
|
@@ -479,56 +456,13 @@ export declare class ProductAgentSessionEngine {
|
|
|
479
456
|
private flushQueuedClientEvents;
|
|
480
457
|
private resetForAuthenticationScopeChange;
|
|
481
458
|
private applyAuthenticatedDirectoryIdentity;
|
|
482
|
-
private
|
|
483
|
-
private getCachedSessionTimeline;
|
|
459
|
+
private waitForAuthentication;
|
|
484
460
|
private flushPendingWidgetLifecycleEvents;
|
|
485
|
-
private flushPendingPassiveWarmup;
|
|
486
|
-
private flushPendingComposerWarmup;
|
|
487
|
-
private findStoppedTurn;
|
|
488
|
-
private findStoppedTurnForEvent;
|
|
489
|
-
private rememberDurablyStoppedTurn;
|
|
490
|
-
private forgetSupersededTaskTabClosedTurn;
|
|
491
|
-
private shouldIgnoreStoppedTurnEvent;
|
|
492
|
-
private filterStoppedSnapshotItems;
|
|
493
461
|
private handleServerEvent;
|
|
494
462
|
private applyAccountSubmissionError;
|
|
495
463
|
private updatePersonalModelFromSession;
|
|
496
464
|
private updateAccountFallbackFromSession;
|
|
497
|
-
private shouldIgnoreBackgroundSessionEvent;
|
|
498
|
-
private updateInactiveSessionTimelineCache;
|
|
499
|
-
private shouldIgnoreDetachedSessionEvent;
|
|
500
|
-
private shouldDeferDetachedSessionEvent;
|
|
501
|
-
private rememberCurrentRunAsDetached;
|
|
502
|
-
private rememberCurrentRunAsBackground;
|
|
503
|
-
private handleRetryableRecoveryError;
|
|
504
|
-
private clearRetryTimers;
|
|
505
|
-
private rememberUserMessageClientMessageIds;
|
|
506
|
-
private clearSessionLoadRequest;
|
|
507
|
-
private markThinkingProgress;
|
|
508
|
-
private scheduleThinkingWatchdog;
|
|
509
|
-
private clearThinkingWatchdog;
|
|
510
|
-
private handleRunAck;
|
|
511
|
-
private promotePendingDelivery;
|
|
512
|
-
private promotePendingDeliveryFromResponseEvidence;
|
|
513
|
-
private getResponseEvidenceUserMessageId;
|
|
514
|
-
private getResponseEvidenceClientMessageId;
|
|
515
|
-
private promotePendingDeliveryFromSnapshotResponseEvidence;
|
|
516
|
-
private acknowledgePendingDeliveryAcceptance;
|
|
517
|
-
private shouldDeferPendingDeliveryPromotion;
|
|
518
|
-
private schedulePendingDeliveryAck;
|
|
519
|
-
private retryPendingDelivery;
|
|
520
|
-
private requestPendingDeliveryReconciliation;
|
|
521
|
-
private failPendingDelivery;
|
|
522
|
-
private clearPendingDeliveryTimers;
|
|
523
|
-
private handleRunSteered;
|
|
524
|
-
private scheduleRunAckWatchdog;
|
|
525
|
-
private recoverMissedRunAck;
|
|
526
|
-
private clearRunAckResyncRetryTimer;
|
|
527
|
-
private clearRunAckTimers;
|
|
528
|
-
private recoverStuckThinking;
|
|
529
|
-
private resyncThinkingSession;
|
|
530
465
|
private executeToolCall;
|
|
531
|
-
private setToolMessageLoading;
|
|
532
466
|
private startPageLifecycleRecovery;
|
|
533
467
|
private installSessionBrowserApis;
|
|
534
468
|
private cleanupSessionBrowserApis;
|
|
@@ -537,19 +471,19 @@ export declare class ProductAgentSessionEngine {
|
|
|
537
471
|
private enqueueNetworkEvent;
|
|
538
472
|
private scheduleReconnect;
|
|
539
473
|
private replaceDefaultTransportCredentials;
|
|
474
|
+
private stopAuthentication;
|
|
475
|
+
private recoverHttpAuthentication;
|
|
476
|
+
private refreshCredentials;
|
|
540
477
|
private refreshDefaultTransportCredentials;
|
|
541
478
|
private startHeartbeat;
|
|
542
479
|
private stopHeartbeat;
|
|
543
480
|
private clearHeartbeatAckTimer;
|
|
544
|
-
private clearPendingWarmupAckTimer;
|
|
545
|
-
private clearPendingComposerWarmup;
|
|
546
481
|
private clearSocketConnectTimer;
|
|
547
482
|
private clearSocketAuthTimer;
|
|
548
483
|
private clearSocketPhaseTimers;
|
|
549
484
|
private replaceTimedOutSocket;
|
|
550
485
|
private setState;
|
|
551
486
|
private setReconnectingState;
|
|
552
|
-
private applySessionRecoverySnapshot;
|
|
553
487
|
private emit;
|
|
554
488
|
}
|
|
555
489
|
declare global {
|
|
@@ -560,7 +494,7 @@ declare global {
|
|
|
560
494
|
export declare function getProductAgentOriginAccessErrorMessage(message: string, runtimeOrigin?: string): string | null;
|
|
561
495
|
export declare function normalizeProductAgentSessionItems(value: unknown, backendUrl?: string): ProductAgentMessage[];
|
|
562
496
|
export declare function validateProductAgentProviderInputFile(file: File): void;
|
|
563
|
-
export { createProductAgentQueryState, mergeProductAgentEntityPages, normalizeProductAgentEntityPage, ProductAgentQueryController, resolveProductAgentComposerAction, resolveProductAgentWidgetPresentation, selectProductAgentQueryEntities, } from "./runtimeState";
|
|
497
|
+
export { createProductAgentQueryState, mergeProductAgentEntityPages, normalizeProductAgentEntityPage, ProductAgentQueryController, resolveProductAgentComposerAction, canSubmitPersonalProductAgentMessage, isProductAgentAuthReconnectError, PRODUCT_AGENT_AUTH_RECONNECTING_ERROR_MESSAGE, resolveProductAgentWidgetPresentation, selectProductAgentQueryEntities, } from "./runtimeState";
|
|
564
498
|
export { ProductAgentSessionHistoryManager } from "./sessionHistoryState";
|
|
565
499
|
export type { ProductAgentSessionHistoryEntity, ProductAgentSessionHistoryLoader, } from "./sessionHistoryState";
|
|
566
500
|
export { createLocalStorageInteractionDecisionStorage, ProductAgentInteractionManager, readLocalStorageInteractionDecisions, } from "./interactionManager";
|
|
@@ -12,6 +12,9 @@ export type ProductAgentInteractionDecisionStorage = {
|
|
|
12
12
|
};
|
|
13
13
|
export declare class ProductAgentInteractionManager {
|
|
14
14
|
private readonly storage;
|
|
15
|
+
private conversationReader;
|
|
16
|
+
private sources;
|
|
17
|
+
private invalidateAuth;
|
|
15
18
|
private decisions;
|
|
16
19
|
private scheduledEligibility;
|
|
17
20
|
private initialized;
|
package/dist/interruptState.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ProductAgentState } from "./index";
|
|
2
|
-
export declare function projectInterruptedState(state:
|
|
2
|
+
export declare function projectInterruptedState<T extends Pick<ProductAgentState, "messages" | "assistantDraftRespondsToUserMessageId" | "activeResponseUserMessageId" | "segments" | "isLoadingSession">>(state: T, stoppedAt: string, phase?: "stopping" | "stopped", userMessageIds?: readonly string[]): T;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const OPERATION_TIMING_STAGES: readonly ["submit", "stop", "staging_ipc", "send_ipc", "stop_ipc", "attachment_transfer", "tab_lookup", "tab_recovery", "session_recovery", "conversation_scope", "local_stage", "view_publication", "page_access", "authentication", "community", "preferences", "page_capture", "session_tabs", "context_ready", "first_frame", "checkpoint", "command_http", "http_authentication", "http_request", "receipt_http", "attachment_upload", "runtime_reading", "runtime_stopping", "runtime_progress", "runtime_stopped", "message_painted", "reading_painted", "stopping_painted", "progress_painted", "stopped_painted"];
|
|
2
|
+
export type OperationTimingStage = typeof OPERATION_TIMING_STAGES[number];
|
|
3
|
+
export type OperationTiming = {
|
|
4
|
+
entrySurface?: "extension_sidepanel" | "extension_widget" | "main_web_chat" | "embedded_widget" | "embedded_custom_ui" | "automation" | "mcp" | "whatsapp";
|
|
5
|
+
operation: "send" | "stop";
|
|
6
|
+
layer: "renderer" | "sdk" | "extension" | "http";
|
|
7
|
+
stage: OperationTimingStage;
|
|
8
|
+
status: "started" | "completed" | "failed" | "observed";
|
|
9
|
+
spanId: string;
|
|
10
|
+
requestId: string;
|
|
11
|
+
clientMessageId: string | null;
|
|
12
|
+
sessionId: string | null;
|
|
13
|
+
occurredAt: string;
|
|
14
|
+
durationMs: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function isOperationTiming(value: unknown): value is OperationTiming;
|
|
17
|
+
export declare function createOperationTimer(report: ((timing: OperationTiming) => void) | undefined, identity: Pick<OperationTiming, "operation" | "layer" | "requestId" | "clientMessageId" | "sessionId" | "entrySurface">): {
|
|
18
|
+
mark: (stage: OperationTimingStage) => void;
|
|
19
|
+
measure<T>(stage: OperationTimingStage, work: () => Promise<T>): Promise<T>;
|
|
20
|
+
};
|
|
21
|
+
export declare function batchOperationTimings(report: (timings: OperationTiming[]) => void): (timing: OperationTiming) => void;
|