@skippr/live-agent-sdk 0.111.0 → 0.113.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/esm/lib-exports.js +599 -353
- package/dist/skippr-sdk.css +1 -1
- package/dist/skippr-sdk.js +101 -101
- package/dist/types/components/VoiceBarFrame.d.ts +1 -1
- package/dist/types/context/LiveAgentContext.d.ts +3 -1
- package/dist/types/hooks/useAuth.d.ts +2 -1
- package/dist/types/hooks/useSession.d.ts +5 -2
- package/dist/types/hooks/useTransientError.d.ts +1 -0
- package/dist/types/hooks/useVoiceBarDrag.d.ts +1 -1
- package/dist/types/lib/apiError.d.ts +7 -0
- package/dist/types/lib/errorCopy.d.ts +13 -0
- package/dist/types/lib/voiceBar.d.ts +6 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ interface VoiceBarFrameProps {
|
|
|
4
4
|
pos: BarPos;
|
|
5
5
|
canFold: boolean;
|
|
6
6
|
notifications: BarNotification[];
|
|
7
|
-
onDrop: (pos: BarPos) => void;
|
|
7
|
+
onDrop: (pos: BarPos, widthPx: number) => void;
|
|
8
8
|
setDragging: (dragging: boolean) => void;
|
|
9
9
|
}
|
|
10
10
|
export declare function VoiceBarFrame({ pos, canFold, notifications, onDrop, setDragging, }: VoiceBarFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -115,6 +115,7 @@ export interface LiveAgentPublicValue {
|
|
|
115
115
|
isDisconnecting: boolean;
|
|
116
116
|
isPausing: boolean;
|
|
117
117
|
error: string;
|
|
118
|
+
errorSeq: number;
|
|
118
119
|
errorCode: number | null;
|
|
119
120
|
agentId: string | null;
|
|
120
121
|
agentMode: AgentMode | null;
|
|
@@ -186,6 +187,7 @@ export interface LiveAgentContextValue extends LiveAgentPublicValue {
|
|
|
186
187
|
pauseTimeoutSeconds: number | null;
|
|
187
188
|
usesHostAuth: boolean;
|
|
188
189
|
authFailed: boolean;
|
|
190
|
+
locale: string | undefined;
|
|
189
191
|
connection: {
|
|
190
192
|
livekitUrl: string;
|
|
191
193
|
token: string;
|
|
@@ -207,7 +209,7 @@ export interface LiveAgentContextValue extends LiveAgentPublicValue {
|
|
|
207
209
|
commitLauncherDrop: (target: LauncherDropTarget) => void;
|
|
208
210
|
popsDown: boolean;
|
|
209
211
|
barPos: BarPos | null;
|
|
210
|
-
setBarPos: (next: BarPos) => void;
|
|
212
|
+
setBarPos: (next: BarPos, widthPx: number) => void;
|
|
211
213
|
launcherDock: BarDock;
|
|
212
214
|
setLauncherDock: (next: BarDock) => void;
|
|
213
215
|
panelExpanded: boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
interface UseAuthParams {
|
|
2
2
|
appKey?: string | undefined;
|
|
3
|
+
locale?: string | undefined;
|
|
3
4
|
}
|
|
4
|
-
export declare function useAuth({ appKey }: UseAuthParams): {
|
|
5
|
+
export declare function useAuth({ appKey, locale }: UseAuthParams): {
|
|
5
6
|
isAuthenticated: boolean;
|
|
6
7
|
isValidating: boolean;
|
|
7
8
|
hasResolvedStoredToken: boolean;
|
|
@@ -7,6 +7,7 @@ interface LiveKitConnection {
|
|
|
7
7
|
}
|
|
8
8
|
interface UseSessionParams {
|
|
9
9
|
captureMode?: CaptureMode | undefined;
|
|
10
|
+
locale?: string | undefined;
|
|
10
11
|
authToken?: string | undefined;
|
|
11
12
|
appKey?: string | undefined;
|
|
12
13
|
getUserToken?: (() => Promise<string>) | undefined;
|
|
@@ -18,20 +19,22 @@ interface UseSessionParams {
|
|
|
18
19
|
}
|
|
19
20
|
export interface StartSessionOptions {
|
|
20
21
|
agentId: string;
|
|
22
|
+
agentName?: string | undefined;
|
|
21
23
|
agentControls?: AgentControls | undefined;
|
|
22
24
|
existingSessionId?: string | undefined;
|
|
23
25
|
adoptionGoalId?: string | undefined;
|
|
24
26
|
autoStarted?: boolean | undefined;
|
|
25
27
|
}
|
|
26
28
|
export declare function requestScreenShare(): Promise<MediaStream | null>;
|
|
27
|
-
export declare function useSession({ captureMode, authToken, appKey, getUserToken, userToken, userContext, onStart, onStartError, onDisconnect, }: UseSessionParams): {
|
|
29
|
+
export declare function useSession({ captureMode, locale, authToken, appKey, getUserToken, userToken, userContext, onStart, onStartError, onDisconnect, }: UseSessionParams): {
|
|
28
30
|
connection: LiveKitConnection | null;
|
|
29
31
|
shouldConnect: boolean;
|
|
30
32
|
isStarting: boolean;
|
|
31
33
|
isDisconnecting: boolean;
|
|
32
34
|
error: string;
|
|
35
|
+
errorSeq: number;
|
|
33
36
|
errorCode: number | null;
|
|
34
|
-
startSession: ({ agentId, agentControls, existingSessionId, adoptionGoalId, autoStarted, }: StartSessionOptions) => Promise<void>;
|
|
37
|
+
startSession: ({ agentId, agentName, agentControls, existingSessionId, adoptionGoalId, autoStarted, }: StartSessionOptions) => Promise<void>;
|
|
35
38
|
pauseSession: () => Promise<void>;
|
|
36
39
|
disconnect: () => Promise<void>;
|
|
37
40
|
isPaused: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useTransientError(error: string, errorSeq: number): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BarPos } from '../lib/voiceBar';
|
|
2
2
|
type FollowerRef = React.RefObject<HTMLElement | null>;
|
|
3
3
|
export declare function useVoiceBarDrag(containerRef: React.RefObject<HTMLElement | null>, onDrop: (pos: BarPos) => void, followRefs?: FollowerRef[] | null, reportDragging?: (dragging: boolean) => void): {
|
|
4
4
|
wasDraggedRef: React.RefObject<boolean>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare class ApiError extends Error {
|
|
2
|
+
readonly status: number;
|
|
3
|
+
constructor(status: number, detail: string);
|
|
4
|
+
}
|
|
5
|
+
export declare function parseApiError(resp: Response): Promise<ApiError>;
|
|
6
|
+
export declare function isNetworkError(e: unknown): boolean;
|
|
7
|
+
export declare function isClientError(e: unknown): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum ErrorContext {
|
|
2
|
+
Auth = "auth",
|
|
3
|
+
SessionStart = "sessionStart",
|
|
4
|
+
SessionPause = "sessionPause",
|
|
5
|
+
OtpRequest = "otpRequest",
|
|
6
|
+
OtpVerify = "otpVerify",
|
|
7
|
+
Modules = "modules"
|
|
8
|
+
}
|
|
9
|
+
export declare function resolveAuthFailedCopy(locale: string | undefined): {
|
|
10
|
+
title: string;
|
|
11
|
+
hint: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function resolveErrorMessage(context: ErrorContext, locale: string | undefined, error?: unknown, agentName?: string | undefined): string;
|
|
@@ -11,13 +11,18 @@ export interface BarPos {
|
|
|
11
11
|
x: number;
|
|
12
12
|
y: number;
|
|
13
13
|
}
|
|
14
|
+
export interface BarPosRatio {
|
|
15
|
+
xRatio: number;
|
|
16
|
+
yRatio: number;
|
|
17
|
+
}
|
|
14
18
|
export type DockKind = 'launcher';
|
|
15
19
|
export declare function isHorizontalEdge(edge: BarEdge): boolean;
|
|
16
20
|
export declare function readSavedDock(kind: DockKind): BarDock | null;
|
|
17
21
|
export declare function persistDock(kind: DockKind, dock: BarDock): void;
|
|
18
22
|
export declare function readSavedBarPos(): BarPos | null;
|
|
23
|
+
export declare function barPosRatio(pos: BarPos): BarPosRatio;
|
|
19
24
|
export declare function persistBarPos(pos: BarPos): void;
|
|
20
|
-
export declare function clampBarPos(pos: BarPos): BarPos;
|
|
25
|
+
export declare function clampBarPos(pos: BarPos, widthPx: number): BarPos;
|
|
21
26
|
export declare function barPopsDown(pos: BarPos): boolean;
|
|
22
27
|
export declare function barLeftAligned(pos: BarPos): boolean;
|
|
23
28
|
export declare function defaultBarPos(): BarPos;
|