@skippr/live-agent-sdk 0.43.0 → 0.45.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/README.md +10 -4
- package/dist/esm/lib-exports.js +1023 -450
- package/dist/skippr-sdk.css +1 -1
- package/dist/skippr-sdk.js +142 -142
- package/dist/types/capture/a11yTree.d.ts +1 -0
- package/dist/types/capture/agentActionSignal.d.ts +4 -0
- package/dist/types/capture/elementRef.d.ts +2 -0
- package/dist/types/components/AdoptionBubble.d.ts +8 -0
- package/dist/types/components/AgentActivityIndicator.d.ts +7 -0
- package/dist/types/components/PageActionHandler.d.ts +1 -0
- package/dist/types/context/LiveAgentContext.d.ts +14 -0
- package/dist/types/hooks/useAdoptionGoals.d.ts +14 -0
- package/dist/types/hooks/useSession.d.ts +2 -1
- package/dist/types/lib/constants.d.ts +1 -0
- package/dist/types/lib/navigation.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Run the agent's synchronous DOM dispatch with the suppression flag raised. */
|
|
2
|
+
export declare function runAgentAction(dispatch: () => void): void;
|
|
3
|
+
/** True while the agent's synthetic DOM event is dispatching. */
|
|
4
|
+
export declare function isAgentActionInProgress(): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AdoptionGoalMatch } from '../context/LiveAgentContext';
|
|
2
|
+
interface AdoptionBubbleProps {
|
|
3
|
+
goal: AdoptionGoalMatch;
|
|
4
|
+
onAttend: (goal: AdoptionGoalMatch) => void;
|
|
5
|
+
onDismiss: (goalId: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function AdoptionBubble({ goal, onAttend, onDismiss }: AdoptionBubbleProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PageActionHandler(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,6 +5,7 @@ export type SidebarTab = 'chat' | 'agenda';
|
|
|
5
5
|
export type CaptureMode = 'screenshare' | 'auto';
|
|
6
6
|
export interface AgentControls {
|
|
7
7
|
highlight?: boolean;
|
|
8
|
+
actions?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export type { AgentMode, SessionStatus };
|
|
10
11
|
export interface ModuleCurrentSession {
|
|
@@ -25,6 +26,16 @@ export interface ResumableSession {
|
|
|
25
26
|
id: string;
|
|
26
27
|
agentId: string;
|
|
27
28
|
}
|
|
29
|
+
export declare enum AdoptionGoalStatus {
|
|
30
|
+
Attended = "attended",
|
|
31
|
+
Dismissed = "dismissed"
|
|
32
|
+
}
|
|
33
|
+
export interface AdoptionGoalMatch {
|
|
34
|
+
goalId: string;
|
|
35
|
+
agentId: string;
|
|
36
|
+
displayMessage: string;
|
|
37
|
+
priority: number;
|
|
38
|
+
}
|
|
28
39
|
export interface LiveAgentPublicValue {
|
|
29
40
|
isConnected: boolean;
|
|
30
41
|
isStarting: boolean;
|
|
@@ -86,5 +97,8 @@ export interface LiveAgentContextValue extends LiveAgentPublicValue {
|
|
|
86
97
|
historyMessages: Message[];
|
|
87
98
|
phasesSnapshot: unknown[];
|
|
88
99
|
setPhasesSnapshot: (phases: unknown[]) => void;
|
|
100
|
+
adoptionGoals: AdoptionGoalMatch[];
|
|
101
|
+
dismissAdoptionGoal: (goalId: string) => void;
|
|
102
|
+
startAdoptionSession: (goal: AdoptionGoalMatch) => void;
|
|
89
103
|
}
|
|
90
104
|
export declare const LiveAgentContext: import("react").Context<LiveAgentContextValue | null>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type AdoptionGoalMatch } from '../context/LiveAgentContext';
|
|
2
|
+
import type { AuthedFetch } from './useSession';
|
|
3
|
+
interface UseAdoptionGoalsParams {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
bearerToken: string | null;
|
|
6
|
+
authedFetch: AuthedFetch;
|
|
7
|
+
}
|
|
8
|
+
interface UseAdoptionGoalsResult {
|
|
9
|
+
goals: AdoptionGoalMatch[];
|
|
10
|
+
dismissGoal: (goalId: string) => void;
|
|
11
|
+
attendGoal: (goalId: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function useAdoptionGoals({ enabled, bearerToken, authedFetch, }: UseAdoptionGoalsParams): UseAdoptionGoalsResult;
|
|
14
|
+
export {};
|
|
@@ -19,6 +19,7 @@ export interface StartSessionOptions {
|
|
|
19
19
|
agentId: string;
|
|
20
20
|
agentControls?: AgentControls | undefined;
|
|
21
21
|
existingSessionId?: string | undefined;
|
|
22
|
+
adoptionGoalId?: string | undefined;
|
|
22
23
|
}
|
|
23
24
|
export declare function useSession({ captureMode, authToken, appKey, getUserToken, userToken, onStart, onStartError, onDisconnect, }: UseSessionParams): {
|
|
24
25
|
connection: LiveKitConnection | null;
|
|
@@ -27,7 +28,7 @@ export declare function useSession({ captureMode, authToken, appKey, getUserToke
|
|
|
27
28
|
isDisconnecting: boolean;
|
|
28
29
|
error: string;
|
|
29
30
|
errorCode: number | null;
|
|
30
|
-
startSession: ({ agentId, agentControls, existingSessionId }: StartSessionOptions) => Promise<void>;
|
|
31
|
+
startSession: ({ agentId, agentControls, existingSessionId, adoptionGoalId }: StartSessionOptions) => Promise<void>;
|
|
31
32
|
pauseSession: () => Promise<void>;
|
|
32
33
|
disconnect: () => Promise<void>;
|
|
33
34
|
isPaused: boolean;
|
|
@@ -5,4 +5,5 @@ export declare const PRIVATE_ATTR = "data-skippr-private";
|
|
|
5
5
|
export declare const DOM_SNAPSHOT_TOPIC = "skippr.dom-snapshot";
|
|
6
6
|
export declare const DOM_EVENTS_TOPIC = "skippr.dom-events";
|
|
7
7
|
export declare const HIGHLIGHT_TOPIC = "skippr.highlight";
|
|
8
|
+
export declare const PAGE_ACTIONS_TOPIC = "skippr.page-actions";
|
|
8
9
|
export declare const NAME_MAX_CHARS = 80;
|