@skippr/live-agent-sdk 0.35.0 → 0.36.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 +92 -129
- package/dist/skippr-sdk.js +146 -146
- package/dist/types/context/LiveAgentContext.d.ts +11 -2
- package/dist/types/hooks/useSession.d.ts +3 -12
- package/dist/types/lib/session.d.ts +4 -0
- package/package.json +1 -1
|
@@ -4,13 +4,21 @@ export type CaptureMode = 'screenshare' | 'auto';
|
|
|
4
4
|
export interface AgentControls {
|
|
5
5
|
highlight?: boolean;
|
|
6
6
|
}
|
|
7
|
+
export type SessionStatus = 'pending' | 'active' | 'paused' | 'completed' | 'expired';
|
|
8
|
+
export type AgentMode = 'standard' | 'always_on';
|
|
9
|
+
export interface ModuleCurrentSession {
|
|
10
|
+
id: string;
|
|
11
|
+
status: SessionStatus;
|
|
12
|
+
}
|
|
7
13
|
export interface Module {
|
|
8
14
|
id: string;
|
|
9
15
|
name: string;
|
|
10
16
|
description: string | null;
|
|
11
17
|
type: string;
|
|
18
|
+
mode: AgentMode;
|
|
12
19
|
priority: number;
|
|
13
20
|
controls: AgentControls;
|
|
21
|
+
currentSession: ModuleCurrentSession | null;
|
|
14
22
|
}
|
|
15
23
|
export interface ResumableSession {
|
|
16
24
|
id: string;
|
|
@@ -24,16 +32,17 @@ export interface LiveAgentPublicValue {
|
|
|
24
32
|
error: string;
|
|
25
33
|
errorCode: number | null;
|
|
26
34
|
agentId: string | null;
|
|
35
|
+
agentMode: AgentMode | null;
|
|
27
36
|
startSession: (opts: {
|
|
28
37
|
agentId: string;
|
|
29
|
-
agentControls?: AgentControls;
|
|
38
|
+
agentControls?: AgentControls | undefined;
|
|
39
|
+
existingSessionId?: string | undefined;
|
|
30
40
|
}) => Promise<void>;
|
|
31
41
|
pauseSession: () => Promise<void>;
|
|
32
42
|
resumeSession: () => Promise<void>;
|
|
33
43
|
disconnect: () => Promise<void>;
|
|
34
44
|
isPaused: boolean;
|
|
35
45
|
resumableSession: ResumableSession | null;
|
|
36
|
-
resumableSessions: ResumableSession[];
|
|
37
46
|
isPanelOpen: boolean;
|
|
38
47
|
openPanel: () => void;
|
|
39
48
|
closePanel: () => void;
|
|
@@ -15,11 +15,8 @@ interface UseSessionParams {
|
|
|
15
15
|
}
|
|
16
16
|
export interface StartSessionOptions {
|
|
17
17
|
agentId: string;
|
|
18
|
-
agentControls?: AgentControls;
|
|
19
|
-
|
|
20
|
-
export interface ResumableSession {
|
|
21
|
-
id: string;
|
|
22
|
-
agentId: string;
|
|
18
|
+
agentControls?: AgentControls | undefined;
|
|
19
|
+
existingSessionId?: string | undefined;
|
|
23
20
|
}
|
|
24
21
|
export declare function useSession({ captureMode, authToken, appKey, userToken, onStart, onStartError, onDisconnect, }: UseSessionParams): {
|
|
25
22
|
connection: LiveKitConnection | null;
|
|
@@ -28,18 +25,12 @@ export declare function useSession({ captureMode, authToken, appKey, userToken,
|
|
|
28
25
|
isDisconnecting: boolean;
|
|
29
26
|
error: string;
|
|
30
27
|
errorCode: number | null;
|
|
31
|
-
startSession: ({ agentId, agentControls }: StartSessionOptions) => Promise<void>;
|
|
28
|
+
startSession: ({ agentId, agentControls, existingSessionId }: StartSessionOptions) => Promise<void>;
|
|
32
29
|
pauseSession: () => Promise<void>;
|
|
33
|
-
resumeSession: ({ sessionId: resumeId, agentControls, }: {
|
|
34
|
-
sessionId: string;
|
|
35
|
-
agentControls?: AgentControls | undefined;
|
|
36
|
-
}) => Promise<void>;
|
|
37
30
|
disconnect: () => Promise<void>;
|
|
38
31
|
isPaused: boolean;
|
|
39
32
|
isPausing: boolean;
|
|
40
|
-
resumableSessions: ResumableSession[];
|
|
41
33
|
historyMessages: Message[];
|
|
42
|
-
refetchResumable: () => Promise<void>;
|
|
43
34
|
pendingScreenStream: MediaStream | null;
|
|
44
35
|
bearerToken: string | null;
|
|
45
36
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AgentMode, Module, ModuleCurrentSession, ResumableSession } from '../context/LiveAgentContext';
|
|
2
|
+
export declare function getResumableSessionId(currentSession: ModuleCurrentSession | null | undefined, mode: AgentMode | null): string | undefined;
|
|
3
|
+
export declare function canResumeSession(currentSession: ModuleCurrentSession | null | undefined, mode: AgentMode | null): boolean;
|
|
4
|
+
export declare function getResumableSession(module: Module | null | undefined): ResumableSession | null;
|