@alxxsck/ai-assistant 2.25.3 → 2.26.0
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/{Avatar-C3PubeMM.js → Avatar-Cr3PsHzw.js} +1 -1
- package/dist/{ChatWidgetContent-Dt6meIg2.js → ChatWidgetContent-DJ2Y9kKV.js} +527 -530
- package/dist/api/chat-attachments.api.d.ts +0 -1
- package/dist/bridge-ai-chat-widget.es.js +1 -1
- package/dist/domain/client-environment/ClientEnvironmentRuntime.d.ts +61 -0
- package/dist/domain/client-environment/collectClientEnvironment.d.ts +6 -0
- package/dist/domain/client-environment/types.d.ts +93 -0
- package/dist/domain/command/CommandRuntime.d.ts +1 -0
- package/dist/domain/tracking/LolaEventTracker.d.ts +5 -1
- package/dist/{index-DDvZeFFo.js → index-D01wjcEK.js} +1153 -552
- package/dist/index.d.ts +1 -0
- package/dist/lib/uuid.d.ts +2 -0
- package/dist/{mount-C7CMxso3.js → mount-DCjHLj_e.js} +3 -3
- package/dist/sdk-version.d.ts +1 -0
- package/package.json +1 -1
|
@@ -30,7 +30,6 @@ type BackendTransportDependencies = {
|
|
|
30
30
|
wait?: typeof abortableDelay;
|
|
31
31
|
pollIntervalMs?: number;
|
|
32
32
|
maxPolls?: number;
|
|
33
|
-
createId?: () => string;
|
|
34
33
|
};
|
|
35
34
|
export declare const createBackendChatAttachmentTransport: (config: WidgetConfig, api: Pick<AppApi, "onSessionExpired">, dependencies?: BackendTransportDependencies) => ChatAttachmentTransport;
|
|
36
35
|
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { CustomerInteractionSession } from "@/types";
|
|
2
|
+
import { changeProjectionV1, collectClientEnvironmentV1 } from "./collectClientEnvironment";
|
|
3
|
+
type ClientEnvironmentRuntimeOptions = Readonly<{
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
fetch?: typeof fetch;
|
|
6
|
+
collect?: typeof collectClientEnvironmentV1;
|
|
7
|
+
project?: typeof changeProjectionV1;
|
|
8
|
+
createId?: () => string;
|
|
9
|
+
now?: () => number;
|
|
10
|
+
random?: () => number;
|
|
11
|
+
sdkVersion?: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare class ClientEnvironmentRuntime {
|
|
14
|
+
private readonly getSession;
|
|
15
|
+
private readonly onSessionExpired;
|
|
16
|
+
private readonly baseUrl;
|
|
17
|
+
private readonly fetchImpl;
|
|
18
|
+
private readonly collect;
|
|
19
|
+
private readonly project;
|
|
20
|
+
private readonly createId;
|
|
21
|
+
private readonly now;
|
|
22
|
+
private readonly random;
|
|
23
|
+
private readonly sdkVersion;
|
|
24
|
+
private sessionId;
|
|
25
|
+
private accessToken;
|
|
26
|
+
private generation;
|
|
27
|
+
private runtimeId;
|
|
28
|
+
private nextSequence;
|
|
29
|
+
private latestFenceRevision;
|
|
30
|
+
private lastStartedAt;
|
|
31
|
+
private cooldownUntil;
|
|
32
|
+
private lastCollectedProjection;
|
|
33
|
+
private acknowledged;
|
|
34
|
+
private active;
|
|
35
|
+
private pending;
|
|
36
|
+
private recovery;
|
|
37
|
+
private awaitingRenewalToken;
|
|
38
|
+
private currentProjectionUncertain;
|
|
39
|
+
private suppressedProjectionKey;
|
|
40
|
+
private pumpTimer;
|
|
41
|
+
private readonly eventWaiters;
|
|
42
|
+
private started;
|
|
43
|
+
private destroyed;
|
|
44
|
+
constructor(getSession: () => CustomerInteractionSession, onSessionExpired: () => void, options?: ClientEnvironmentRuntimeOptions);
|
|
45
|
+
start(): void;
|
|
46
|
+
ensureForEvent(expectedSessionId: string): Promise<string | null>;
|
|
47
|
+
updateSession(session: CustomerInteractionSession): void;
|
|
48
|
+
destroy(): void;
|
|
49
|
+
private requestCurrentObservation;
|
|
50
|
+
private startRecovery;
|
|
51
|
+
private pump;
|
|
52
|
+
private upload;
|
|
53
|
+
private runAttempts;
|
|
54
|
+
private sendOnce;
|
|
55
|
+
private withEventDeadline;
|
|
56
|
+
private delay;
|
|
57
|
+
private resetGeneration;
|
|
58
|
+
private safeCreateId;
|
|
59
|
+
private cancelGeneration;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ClientEnvironmentBrowserSources, type ClientEnvironmentChangeProjectionV1, type ClientEnvironmentCollectionInput, type ClientEnvironmentObservationV1 } from "./types";
|
|
2
|
+
export declare const CLIENT_ENVIRONMENT_BROWSER_INSTANCE_STORAGE_KEY = "lola-ai-assistant:client-environment:browser-instance:v1";
|
|
3
|
+
export declare const browserClientEnvironmentSources: ClientEnvironmentBrowserSources;
|
|
4
|
+
export declare const resolveClientEnvironmentBrowserInstanceId: (sources?: ClientEnvironmentBrowserSources) => string | null;
|
|
5
|
+
export declare const collectClientEnvironmentV1: (input: ClientEnvironmentCollectionInput, sources?: ClientEnvironmentBrowserSources) => ClientEnvironmentObservationV1;
|
|
6
|
+
export declare const changeProjectionV1: (observation: ClientEnvironmentObservationV1, previous?: ClientEnvironmentChangeProjectionV1 | null) => ClientEnvironmentChangeProjectionV1;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export declare const CLIENT_ENVIRONMENT_SCHEMA_VERSION: 1;
|
|
2
|
+
export declare const CLIENT_ENVIRONMENT_CHANGE_PROJECTION_VERSION: 1;
|
|
3
|
+
export type ClientEnvironmentOrientation = "portrait" | "landscape" | "unknown";
|
|
4
|
+
export interface ClientEnvironmentObservationV1 {
|
|
5
|
+
readonly schemaVersion: typeof CLIENT_ENVIRONMENT_SCHEMA_VERSION;
|
|
6
|
+
readonly clientObservationId: string;
|
|
7
|
+
readonly clientRuntimeId: string;
|
|
8
|
+
readonly clientSequence: number;
|
|
9
|
+
readonly browserInstanceId: string | null;
|
|
10
|
+
readonly collectedAt: string;
|
|
11
|
+
readonly sdk: Readonly<{
|
|
12
|
+
name: "lola-ai-assistant";
|
|
13
|
+
version: string;
|
|
14
|
+
}>;
|
|
15
|
+
readonly locale: Readonly<{
|
|
16
|
+
language: string | null;
|
|
17
|
+
languages: readonly string[];
|
|
18
|
+
timeZone: string | null;
|
|
19
|
+
localUtcOffsetMinutes: number | null;
|
|
20
|
+
}>;
|
|
21
|
+
readonly screen: Readonly<{
|
|
22
|
+
widthCssPx: number | null;
|
|
23
|
+
heightCssPx: number | null;
|
|
24
|
+
availableWidthCssPx: number | null;
|
|
25
|
+
availableHeightCssPx: number | null;
|
|
26
|
+
devicePixelRatio: number | null;
|
|
27
|
+
orientation: ClientEnvironmentOrientation;
|
|
28
|
+
}>;
|
|
29
|
+
readonly viewport: Readonly<{
|
|
30
|
+
widthCssPx: number | null;
|
|
31
|
+
heightCssPx: number | null;
|
|
32
|
+
visualWidthCssPx: number | null;
|
|
33
|
+
visualHeightCssPx: number | null;
|
|
34
|
+
visualScale: number | null;
|
|
35
|
+
}>;
|
|
36
|
+
readonly interaction: Readonly<{
|
|
37
|
+
maxTouchPoints: number | null;
|
|
38
|
+
coarsePointer: boolean | null;
|
|
39
|
+
hoverSupported: boolean | null;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
export interface ClientEnvironmentCollectionInput {
|
|
43
|
+
readonly clientObservationId: string;
|
|
44
|
+
readonly clientRuntimeId: string;
|
|
45
|
+
readonly clientSequence: number;
|
|
46
|
+
readonly sdkVersion: string;
|
|
47
|
+
}
|
|
48
|
+
export interface BrowserInstanceStorage {
|
|
49
|
+
getItem(key: string): string | null;
|
|
50
|
+
setItem(key: string, value: string): void;
|
|
51
|
+
}
|
|
52
|
+
export interface ClientEnvironmentBrowserSources {
|
|
53
|
+
readonly now: () => unknown;
|
|
54
|
+
readonly language: () => unknown;
|
|
55
|
+
readonly languages: () => unknown;
|
|
56
|
+
readonly timeZone: () => unknown;
|
|
57
|
+
readonly timeZoneOffsetMinutes: () => unknown;
|
|
58
|
+
readonly screenWidth: () => unknown;
|
|
59
|
+
readonly screenHeight: () => unknown;
|
|
60
|
+
readonly screenAvailableWidth: () => unknown;
|
|
61
|
+
readonly screenAvailableHeight: () => unknown;
|
|
62
|
+
readonly devicePixelRatio: () => unknown;
|
|
63
|
+
readonly screenOrientationType: () => unknown;
|
|
64
|
+
readonly viewportWidth: () => unknown;
|
|
65
|
+
readonly viewportHeight: () => unknown;
|
|
66
|
+
readonly visualViewportWidth: () => unknown;
|
|
67
|
+
readonly visualViewportHeight: () => unknown;
|
|
68
|
+
readonly visualViewportScale: () => unknown;
|
|
69
|
+
readonly maxTouchPoints: () => unknown;
|
|
70
|
+
readonly coarsePointer: () => unknown;
|
|
71
|
+
readonly hoverSupported: () => unknown;
|
|
72
|
+
readonly storage: () => BrowserInstanceStorage | null | undefined;
|
|
73
|
+
readonly randomUuid: () => unknown;
|
|
74
|
+
}
|
|
75
|
+
export interface ClientEnvironmentChangeProjectionV1 {
|
|
76
|
+
readonly projectionVersion: typeof CLIENT_ENVIRONMENT_CHANGE_PROJECTION_VERSION;
|
|
77
|
+
readonly browserInstanceId: string | null;
|
|
78
|
+
readonly language: string | null;
|
|
79
|
+
readonly languages: readonly string[];
|
|
80
|
+
readonly timeZone: string | null;
|
|
81
|
+
readonly localUtcOffsetMinutes: number | null;
|
|
82
|
+
readonly screenWidthCssPx: number | null;
|
|
83
|
+
readonly screenHeightCssPx: number | null;
|
|
84
|
+
readonly screenAvailableWidthCssPx: number | null;
|
|
85
|
+
readonly screenAvailableHeightCssPx: number | null;
|
|
86
|
+
readonly devicePixelRatio: number | null;
|
|
87
|
+
readonly orientation: ClientEnvironmentOrientation;
|
|
88
|
+
readonly viewportWidthBucketCssPx: number | null;
|
|
89
|
+
readonly visualScale: number | null;
|
|
90
|
+
readonly maxTouchPoints: number | null;
|
|
91
|
+
readonly coarsePointer: boolean | null;
|
|
92
|
+
readonly hoverSupported: boolean | null;
|
|
93
|
+
}
|
|
@@ -53,6 +53,7 @@ export declare class CommandRuntime {
|
|
|
53
53
|
private requireEnvelopeTarget;
|
|
54
54
|
private findTargetElement;
|
|
55
55
|
private applyDefaultHighlight;
|
|
56
|
+
private applyHighlightEffect;
|
|
56
57
|
private removeDefaultHighlight;
|
|
57
58
|
private observeTarget;
|
|
58
59
|
private createTargetActivationReporter;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CustomerInteractionSession } from "@/types";
|
|
2
|
+
import type { ClientEnvironmentRuntime } from "@/domain/client-environment/ClientEnvironmentRuntime";
|
|
2
3
|
export type TrackEvent = {
|
|
3
4
|
event: string;
|
|
4
5
|
params?: Record<string, unknown>;
|
|
@@ -6,6 +7,9 @@ export type TrackEvent = {
|
|
|
6
7
|
export declare class LolaEventTracker {
|
|
7
8
|
private readonly getSession;
|
|
8
9
|
private readonly onSessionExpired;
|
|
9
|
-
|
|
10
|
+
private readonly clientEnvironment;
|
|
11
|
+
private destroyed;
|
|
12
|
+
constructor(getSession: () => CustomerInteractionSession, onSessionExpired: () => void, clientEnvironment: Pick<ClientEnvironmentRuntime, "ensureForEvent">);
|
|
10
13
|
track(trackingEvent: TrackEvent): Promise<void>;
|
|
14
|
+
destroy(): void;
|
|
11
15
|
}
|