@skippr/live-agent-sdk 0.112.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.
@@ -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;
@@ -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;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skippr/live-agent-sdk",
3
- "version": "0.112.0",
3
+ "version": "0.113.0",
4
4
  "type": "module",
5
5
  "main": "dist/esm/lib-exports.js",
6
6
  "module": "dist/esm/lib-exports.js",