@skippr/live-agent-sdk 0.87.0 → 0.88.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 +2426 -439
- package/dist/skippr-sdk.css +1 -1
- package/dist/skippr-sdk.js +147 -147
- package/dist/types/components/LauncherNotification.d.ts +11 -0
- package/dist/types/components/MessageList.d.ts +1 -1
- package/dist/types/components/PlanCard.d.ts +3 -0
- package/dist/types/components/VoiceBar.d.ts +5 -0
- package/dist/types/components/VoiceBarChatLine.d.ts +8 -0
- package/dist/types/components/VoiceBarFrame.d.ts +11 -0
- package/dist/types/components/VoiceBarLauncher.d.ts +15 -0
- package/dist/types/components/VoiceBarNotification.d.ts +9 -0
- package/dist/types/components/VoiceBarPlanCard.d.ts +8 -0
- package/dist/types/context/LiveAgentContext.d.ts +11 -2
- package/dist/types/hooks/useAdoptionTips.d.ts +2 -0
- package/dist/types/hooks/useBarNotifications.d.ts +9 -0
- package/dist/types/hooks/useIdleAutoOff.d.ts +9 -0
- package/dist/types/hooks/useKeyboardPushToTalk.d.ts +3 -1
- package/dist/types/hooks/useKeyboardStop.d.ts +6 -0
- package/dist/types/hooks/usePlanUpdates.d.ts +1 -0
- package/dist/types/hooks/usePointerHold.d.ts +1 -0
- package/dist/types/hooks/useSessionTimer.d.ts +5 -0
- package/dist/types/hooks/useVoiceBarDrag.d.ts +6 -0
- package/dist/types/lib/constants.d.ts +33 -1
- package/dist/types/lib/utils.d.ts +1 -0
- package/dist/types/lib/voiceBar.d.ts +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BarNotification } from '../hooks/useBarNotifications';
|
|
2
|
+
import { type LauncherMode } from '../lib/constants';
|
|
3
|
+
import { type BarDock } from '../lib/voiceBar';
|
|
4
|
+
interface LauncherNotificationProps {
|
|
5
|
+
notifications: BarNotification[];
|
|
6
|
+
dock: BarDock;
|
|
7
|
+
mode: Exclude<LauncherMode, 'none'>;
|
|
8
|
+
onDismiss: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function LauncherNotification({ notifications, dock, mode, onDismiss, }: LauncherNotificationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -4,5 +4,8 @@ interface PlanCardProps {
|
|
|
4
4
|
sendChatMessage: (message: string) => Promise<unknown>;
|
|
5
5
|
onDismiss: () => void;
|
|
6
6
|
}
|
|
7
|
+
export declare const APPROVE_MESSAGE = "Yes, go ahead.";
|
|
8
|
+
export declare const CANCEL_MESSAGE = "No, cancel that.";
|
|
9
|
+
export declare const COMPLETED_CARD_VISIBLE_MS = 2500;
|
|
7
10
|
export declare function PlanCard({ plan, sendChatMessage, onDismiss }: PlanCardProps): import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BarDock } from '../lib/voiceBar';
|
|
2
|
+
interface VoiceBarChatLineProps {
|
|
3
|
+
dock: BarDock;
|
|
4
|
+
canSend: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function VoiceBarChatLine({ dock, canSend, onClose }: VoiceBarChatLineProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BarNotification } from '../hooks/useBarNotifications';
|
|
2
|
+
import { type BarDock } from '../lib/voiceBar';
|
|
3
|
+
interface VoiceBarFrameProps {
|
|
4
|
+
dock: BarDock;
|
|
5
|
+
canFold: boolean;
|
|
6
|
+
notifications: BarNotification[];
|
|
7
|
+
onDrop: (dock: BarDock) => void;
|
|
8
|
+
setDragging: (dragging: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function VoiceBarFrame({ dock, canFold, notifications, onDrop, setDragging, }: VoiceBarFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BarNotification } from '../hooks/useBarNotifications';
|
|
2
|
+
import { type LauncherMode } from '../lib/constants';
|
|
3
|
+
import { type BarDock } from '../lib/voiceBar';
|
|
4
|
+
interface VoiceBarLauncherProps {
|
|
5
|
+
dock: BarDock;
|
|
6
|
+
mode: Exclude<LauncherMode, 'none'>;
|
|
7
|
+
logoUrl: string | null;
|
|
8
|
+
notifications: BarNotification[];
|
|
9
|
+
onOpen: () => void;
|
|
10
|
+
onChat: (() => void) | null;
|
|
11
|
+
onDrop: (dock: BarDock) => void;
|
|
12
|
+
setDragging: (dragging: boolean) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function VoiceBarLauncher({ dock, mode, logoUrl, notifications, onOpen, onChat, onDrop, setDragging, }: VoiceBarLauncherProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BarNotification } from '../hooks/useBarNotifications';
|
|
2
|
+
import { type BarDock } from '../lib/voiceBar';
|
|
3
|
+
interface VoiceBarNotificationProps {
|
|
4
|
+
notifications: BarNotification[];
|
|
5
|
+
dock: BarDock;
|
|
6
|
+
onDismiss: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function VoiceBarNotification({ notifications, dock, onDismiss, }: VoiceBarNotificationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PlanCardData } from '../hooks/usePlanUpdates';
|
|
2
|
+
interface VoiceBarPlanCardProps {
|
|
3
|
+
plan: PlanCardData;
|
|
4
|
+
sendChatMessage: (message: string) => Promise<unknown>;
|
|
5
|
+
onDismiss: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function VoiceBarPlanCard({ plan, sendChatMessage, onDismiss }: VoiceBarPlanCardProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { LauncherDropTarget } from '../hooks/useLauncherDrag';
|
|
2
2
|
import type { PhaseStatus } from '../hooks/usePhaseUpdates';
|
|
3
3
|
import type { AgentMode } from '../lib/agentMode';
|
|
4
|
-
import { CAPTURE_MODE, type CaptureMode, DEFAULT_CAPTURE_MODE, MIC_MODE, type MicMode } from '../lib/constants';
|
|
4
|
+
import { CAPTURE_MODE, type CaptureMode, type ChatSurface, DEFAULT_CAPTURE_MODE, type LauncherMode, MIC_MODE, type MicMode } from '../lib/constants';
|
|
5
5
|
import type { SessionStatus } from '../lib/sessionStatus';
|
|
6
|
+
import type { BarDock } from '../lib/voiceBar';
|
|
6
7
|
import type { Message } from '../types';
|
|
7
8
|
export type SidebarTab = 'chat' | 'agenda';
|
|
8
9
|
export { CAPTURE_MODE, type CaptureMode, DEFAULT_CAPTURE_MODE, MIC_MODE, type MicMode };
|
|
@@ -10,6 +11,7 @@ export interface AgentControls {
|
|
|
10
11
|
highlight?: boolean;
|
|
11
12
|
actions?: boolean;
|
|
12
13
|
micMode?: MicMode;
|
|
14
|
+
chat?: ChatSurface;
|
|
13
15
|
}
|
|
14
16
|
export interface UiPreferences {
|
|
15
17
|
animateCursor?: boolean;
|
|
@@ -46,6 +48,7 @@ export interface WidgetAppearance {
|
|
|
46
48
|
logoUrl: string | null;
|
|
47
49
|
position: 'left' | 'right' | null;
|
|
48
50
|
verticalAlign: 'top' | 'middle' | 'bottom' | null;
|
|
51
|
+
launcherMode: LauncherMode | null;
|
|
49
52
|
}
|
|
50
53
|
export interface IdleSessionHistory {
|
|
51
54
|
messages: Message[];
|
|
@@ -65,6 +68,7 @@ export interface AdoptionGoalMatch {
|
|
|
65
68
|
goalId: string;
|
|
66
69
|
agentId: string;
|
|
67
70
|
displayMessage: string;
|
|
71
|
+
objective: string;
|
|
68
72
|
matchType: AdoptionMatchType;
|
|
69
73
|
hashPattern: string | null;
|
|
70
74
|
priority: number;
|
|
@@ -117,6 +121,7 @@ export interface LiveAgentPublicValue {
|
|
|
117
121
|
modulesError: string | null;
|
|
118
122
|
refetchModules: () => Promise<void>;
|
|
119
123
|
selectModule: (id: string) => void;
|
|
124
|
+
textMode: boolean;
|
|
120
125
|
}
|
|
121
126
|
export interface LiveAgentContextValue extends LiveAgentPublicValue {
|
|
122
127
|
defaultAgentId: string | null;
|
|
@@ -137,17 +142,21 @@ export interface LiveAgentContextValue extends LiveAgentPublicValue {
|
|
|
137
142
|
appearance: WidgetAppearance | null;
|
|
138
143
|
adoptionGoals: AdoptionGoalMatch[];
|
|
139
144
|
startAdoptionSession: (goal: AdoptionGoalMatch) => void;
|
|
140
|
-
|
|
145
|
+
attendGoal: (goalId: string) => void;
|
|
141
146
|
setTextModeState: (enabled: boolean) => void;
|
|
142
147
|
launcherBottomPx: number;
|
|
143
148
|
setLauncherBottomPx: (px: number) => void;
|
|
144
149
|
commitLauncherDrop: (target: LauncherDropTarget) => void;
|
|
145
150
|
popsDown: boolean;
|
|
151
|
+
barDock: BarDock | null;
|
|
152
|
+
setBarDock: (next: BarDock) => void;
|
|
146
153
|
panelExpanded: boolean;
|
|
147
154
|
togglePanelExpanded: () => void;
|
|
148
155
|
panelRef: React.RefObject<HTMLDivElement | null>;
|
|
149
156
|
controlBarRef: React.RefObject<HTMLDivElement | null>;
|
|
150
157
|
isDragging: boolean;
|
|
151
158
|
setIsDragging: (dragging: boolean) => void;
|
|
159
|
+
chatActivityAt: number;
|
|
160
|
+
reportChatActivity: () => void;
|
|
152
161
|
}
|
|
153
162
|
export declare const LiveAgentContext: import("react").Context<LiveAgentContextValue | null>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type NotificationKind } from '../lib/constants';
|
|
2
|
+
export interface BarNotification {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: NotificationKind;
|
|
5
|
+
message: string;
|
|
6
|
+
accentColor: string;
|
|
7
|
+
activate: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useBarNotifications(): BarNotification[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface UseIdleAutoOffOptions {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
active: boolean;
|
|
4
|
+
onExpire: () => void;
|
|
5
|
+
}
|
|
6
|
+
export interface UseIdleAutoOffValue {
|
|
7
|
+
reportActivity: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useIdleAutoOff({ enabled, active, onExpire, }: UseIdleAutoOffOptions): UseIdleAutoOffValue;
|
|
@@ -3,6 +3,8 @@ interface UseKeyboardPushToTalkOptions {
|
|
|
3
3
|
onStart: () => void;
|
|
4
4
|
onCommit: () => void;
|
|
5
5
|
onKeyUsed?: () => void;
|
|
6
|
+
code?: string;
|
|
7
|
+
requireCtrl?: boolean;
|
|
6
8
|
}
|
|
7
|
-
export declare function useKeyboardPushToTalk({ enabled, onStart, onCommit, onKeyUsed, }: UseKeyboardPushToTalkOptions): void;
|
|
9
|
+
export declare function useKeyboardPushToTalk({ enabled, onStart, onCommit, onKeyUsed, code, requireCtrl, }: UseKeyboardPushToTalkOptions): void;
|
|
8
10
|
export {};
|
|
@@ -11,4 +11,5 @@ export interface PlanCardData {
|
|
|
11
11
|
state: PlanState;
|
|
12
12
|
}
|
|
13
13
|
export declare function parsePlan(json: string): PlanCardData | null;
|
|
14
|
+
export declare function isPlanVisible(plan: PlanCardData | null | undefined): plan is PlanCardData;
|
|
14
15
|
export declare function usePlanUpdates(): PlanCardData | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function usePointerHold(onStart: () => void, onCommit: () => void): (event: React.PointerEvent) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type BarDock } from '../lib/voiceBar';
|
|
2
|
+
type FollowerRef = React.RefObject<HTMLElement | null>;
|
|
3
|
+
export declare function useVoiceBarDrag(containerRef: React.RefObject<HTMLElement | null>, onDrop: (dock: BarDock) => void, followRefs?: FollowerRef[] | null, reportDragging?: (dragging: boolean) => void): {
|
|
4
|
+
wasDraggedRef: React.RefObject<boolean>;
|
|
5
|
+
};
|
|
6
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SIDEBAR_WIDTH =
|
|
1
|
+
export declare const SIDEBAR_WIDTH = 255;
|
|
2
2
|
export declare const CAPTURE_MODE: {
|
|
3
3
|
readonly Screenshare: "screenshare";
|
|
4
4
|
readonly Auto: "auto";
|
|
@@ -8,6 +8,7 @@ export declare const DEFAULT_CAPTURE_MODE: CaptureMode;
|
|
|
8
8
|
export declare const WIDGET_ROOT_ID = "skippr-sdk-root";
|
|
9
9
|
export declare const REF_ATTR = "data-skippr-ref";
|
|
10
10
|
export declare const PRIVATE_ATTR = "data-skippr-private";
|
|
11
|
+
export declare const NO_DRAG_ATTR = "data-skippr-no-drag";
|
|
11
12
|
export declare const DOM_SNAPSHOT_TOPIC = "skippr.dom-snapshot";
|
|
12
13
|
export declare const DOM_EVENTS_TOPIC = "skippr.dom-events";
|
|
13
14
|
export declare const HIGHLIGHT_TOPIC = "skippr.highlight";
|
|
@@ -24,8 +25,39 @@ export declare const MIC_MODE: {
|
|
|
24
25
|
export type MicMode = (typeof MIC_MODE)[keyof typeof MIC_MODE];
|
|
25
26
|
export declare const DEFAULT_MIC_MODE: MicMode;
|
|
26
27
|
export declare function isRequestResponseMicMode(micMode: MicMode | undefined): micMode is typeof MIC_MODE.PushToTalk | typeof MIC_MODE.TapToTalk;
|
|
28
|
+
export declare const CHAT_SURFACE: {
|
|
29
|
+
readonly Line: "line";
|
|
30
|
+
readonly Room: "room";
|
|
31
|
+
};
|
|
32
|
+
export type ChatSurface = (typeof CHAT_SURFACE)[keyof typeof CHAT_SURFACE];
|
|
33
|
+
export declare const DEFAULT_CHAT_SURFACE: ChatSurface;
|
|
34
|
+
export declare const LAUNCHER_MODE: {
|
|
35
|
+
readonly Avatar: "avatar";
|
|
36
|
+
readonly Strip: "strip";
|
|
37
|
+
readonly None: "none";
|
|
38
|
+
readonly Custom: "custom";
|
|
39
|
+
};
|
|
40
|
+
export type LauncherMode = (typeof LAUNCHER_MODE)[keyof typeof LAUNCHER_MODE];
|
|
41
|
+
export declare const DEFAULT_LAUNCHER_MODE: LauncherMode;
|
|
27
42
|
export declare const PUSH_TO_TALK_KEY = "Backquote";
|
|
28
43
|
export declare const PUSH_TO_TALK_KEY_LABEL = "`";
|
|
44
|
+
export declare const STOP_AGENT_KEY = "KeyX";
|
|
29
45
|
export declare const IDLE_AUTO_PAUSE_MS: number;
|
|
46
|
+
export declare const IDLE_AUTO_OFF_MS: number;
|
|
47
|
+
export declare const AUTO_OFF_NOTICE_MS = 3500;
|
|
48
|
+
export declare const CHAT_ACTIVITY_THROTTLE_MS = 15000;
|
|
49
|
+
export declare const MAX_ADOPTION_TIPS = 3;
|
|
50
|
+
export declare const TIP_ROTATE_MS = 2000;
|
|
51
|
+
export declare const TIP_HIDE_MS = 6000;
|
|
52
|
+
export declare const SESSION_TIMER_WARNING_S = 120;
|
|
53
|
+
export declare const SESSION_TIMER_HOLD_MS = 6000;
|
|
54
|
+
export declare const SESSION_TIMER_INTERVAL_MS: number;
|
|
55
|
+
export declare const NOTIF_ACCENT_COLOR = "#199a89";
|
|
56
|
+
export declare const MODULE_ACCENT_COLOR = "#e0574f";
|
|
57
|
+
export declare const NOTIFICATION_KIND: {
|
|
58
|
+
readonly Tip: "tip";
|
|
59
|
+
readonly Module: "module";
|
|
60
|
+
};
|
|
61
|
+
export type NotificationKind = (typeof NOTIFICATION_KIND)[keyof typeof NOTIFICATION_KIND];
|
|
30
62
|
export declare const PLAN_ATTR = "skippr.action-plan";
|
|
31
63
|
export declare const NAME_MAX_CHARS = 80;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type BarEdge = 'left' | 'right' | 'top' | 'bottom';
|
|
2
|
+
export declare const VOICE_BAR_EDGE_MARGIN_PX = 16;
|
|
3
|
+
export declare const VOICE_BAR_HEIGHT_PX = 46;
|
|
4
|
+
export declare const VOICE_BAR_WIDTH_PX = 255;
|
|
5
|
+
export interface BarDock {
|
|
6
|
+
edge: BarEdge;
|
|
7
|
+
offsetPx: number;
|
|
8
|
+
}
|
|
9
|
+
export type DockKind = 'bar' | 'launcher';
|
|
10
|
+
export declare function isHorizontalEdge(edge: BarEdge): boolean;
|
|
11
|
+
export declare function readSavedDock(kind: DockKind): BarDock | null;
|
|
12
|
+
export declare function persistDock(kind: DockKind, dock: BarDock): void;
|
|
13
|
+
export declare function clampOffset(edge: BarEdge, offsetPx: number): number;
|
|
14
|
+
export declare function defaultOffset(edge: BarEdge): number;
|
|
15
|
+
export declare function nearestEdge(clientX: number, clientY: number): BarEdge;
|
|
16
|
+
export declare function dropTargetFromPointer(clientX: number, clientY: number): BarDock;
|
|
17
|
+
export declare function dockStyle(dock: BarDock): React.CSSProperties;
|
|
18
|
+
export declare function dockStyleFlush(dock: BarDock): React.CSSProperties;
|