@skippr/live-agent-sdk 0.88.0 → 0.90.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 +1 -0
- package/dist/esm/lib-exports.js +4692 -2707
- package/dist/skippr-sdk.css +1 -1
- package/dist/skippr-sdk.js +155 -155
- package/dist/types/buddy/BuddyCreature.d.ts +10 -0
- package/dist/types/buddy/BuddyFace.d.ts +10 -0
- package/dist/types/buddy/BuddyVoiceBar.d.ts +5 -0
- package/dist/types/buddy/buddy.d.ts +20 -0
- package/dist/types/buddy/hooks/useBuddyEyeTracking.d.ts +9 -0
- package/dist/types/buddy/hooks/useBuddyFreeDrag.d.ts +14 -0
- package/dist/types/buddy/hooks/useBuddyIdleMode.d.ts +12 -0
- package/dist/types/buddy/index.d.ts +3 -0
- package/dist/types/buddy/shapes/bespoke.d.ts +1 -0
- package/dist/types/buddy/shapes/colorful.d.ts +5 -0
- package/dist/types/buddy/shapes/constants.d.ts +6 -0
- package/dist/types/buddy/shapes/glass.d.ts +5 -0
- package/dist/types/buddy/shapes/index.d.ts +9 -0
- package/dist/types/buddy/shapes/original.d.ts +4 -0
- package/dist/types/buddy/shapes/pixel.d.ts +5 -0
- package/dist/types/capture/widgetAnchor.d.ts +6 -0
- package/dist/types/components/LinkCard.d.ts +7 -0
- package/dist/types/components/LiveAgent.d.ts +2 -1
- package/dist/types/components/MessageList.d.ts +3 -1
- package/dist/types/components/VoiceBarChatLine.d.ts +2 -1
- package/dist/types/components/VoiceBarLinkCard.d.ts +7 -0
- package/dist/types/components/VoiceBarPlanCard.d.ts +2 -1
- package/dist/types/context/LiveAgentContext.d.ts +11 -1
- package/dist/types/hooks/useAutoStart.d.ts +2 -2
- package/dist/types/hooks/useLinkCard.d.ts +7 -0
- package/dist/types/hooks/useSession.d.ts +3 -2
- package/dist/types/lib/clipboard.d.ts +1 -0
- package/dist/types/lib/constants.d.ts +33 -0
- package/dist/types/lib-exports.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type BuddyMode, type BuddyShape } from '../lib/constants';
|
|
2
|
+
interface BuddyCreatureProps {
|
|
3
|
+
shape: BuddyShape;
|
|
4
|
+
mode: BuddyMode;
|
|
5
|
+
eyeDx: number;
|
|
6
|
+
eyeDy: number;
|
|
7
|
+
isTalking: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function BuddyCreature({ shape, mode, eyeDx, eyeDy, isTalking }: BuddyCreatureProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface BuddyFaceProps {
|
|
2
|
+
eyeDx: number;
|
|
3
|
+
eyeDy: number;
|
|
4
|
+
mouthPath: string;
|
|
5
|
+
mouthFill: string;
|
|
6
|
+
lidsPath: string;
|
|
7
|
+
pupilOpacity: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function BuddyFace({ eyeDx, eyeDy, mouthPath, mouthFill, lidsPath, pupilOpacity, }: BuddyFaceProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AgentControls, WidgetAppearance } from '../context/LiveAgentContext';
|
|
2
|
+
export declare const SKIPPR_BUDDY_POS_KEY = "skippr_buddy_pos";
|
|
3
|
+
export declare const BUDDY_SLEEP_MS = 14000;
|
|
4
|
+
export declare const BUDDY_HAPPY_MS = 1300;
|
|
5
|
+
export declare const BUDDY_SIZE_PX = 96;
|
|
6
|
+
export declare const BUDDY_EDGE_MARGIN_PX = 16;
|
|
7
|
+
export declare const BUDDY_DRAG_THRESHOLD_PX = 5;
|
|
8
|
+
export interface BuddyPos {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function isBuddyActive(appearance: WidgetAppearance | null): boolean;
|
|
13
|
+
export declare function buddyEffectiveControls(base: AgentControls | undefined): AgentControls;
|
|
14
|
+
export declare function clampBuddyPos(pos: BuddyPos, sizePx?: number): BuddyPos;
|
|
15
|
+
export declare function readSavedBuddyPos(): BuddyPos | null;
|
|
16
|
+
export declare function persistBuddyPos(pos: BuddyPos): void;
|
|
17
|
+
export declare function seedBuddyPosFromAppearance(position: 'left' | 'right' | null, verticalAlign: 'top' | 'middle' | 'bottom' | null, viewport: {
|
|
18
|
+
innerWidth: number;
|
|
19
|
+
innerHeight: number;
|
|
20
|
+
}, sizePx?: number): BuddyPos;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface BuddyEyeDeltas {
|
|
2
|
+
eyeDx: number;
|
|
3
|
+
eyeDy: number;
|
|
4
|
+
}
|
|
5
|
+
export interface UseBuddyEyeTrackingOptions {
|
|
6
|
+
containerRef: React.RefObject<HTMLElement | null>;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function useBuddyEyeTracking({ containerRef, disabled, }: UseBuddyEyeTrackingOptions): BuddyEyeDeltas;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type BuddyPos } from '../buddy';
|
|
2
|
+
export interface UseBuddyFreeDragOptions {
|
|
3
|
+
appearancePosition: 'left' | 'right' | null;
|
|
4
|
+
appearanceVerticalAlign: 'top' | 'middle' | 'bottom' | null;
|
|
5
|
+
sizePx?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface UseBuddyFreeDragValue {
|
|
8
|
+
pos: BuddyPos;
|
|
9
|
+
isDragging: boolean;
|
|
10
|
+
startDrag: (event: React.PointerEvent) => {
|
|
11
|
+
didDrag: () => boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare function useBuddyFreeDrag({ appearancePosition, appearanceVerticalAlign, sizePx, }: UseBuddyFreeDragOptions): UseBuddyFreeDragValue;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type BuddyMode } from '../../lib/constants';
|
|
2
|
+
export interface UseBuddyIdleModeOptions {
|
|
3
|
+
isConnected: boolean;
|
|
4
|
+
isSpeaking: boolean;
|
|
5
|
+
isListening: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface UseBuddyIdleModeValue {
|
|
8
|
+
mode: BuddyMode;
|
|
9
|
+
reportActivity: () => void;
|
|
10
|
+
reportHover: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function useBuddyIdleMode({ isConnected, isSpeaking, isListening, }: UseBuddyIdleModeOptions): UseBuddyIdleModeValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PeekBody(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function BloomBody(): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function WobbleBody(): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function SplatBody(): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function CloudBody(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function BoopBody(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function BoulderBody(): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function KiteBody(): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function LoafBody(): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function FacetBody(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function BellBody(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import { type BuddyShape } from '../../lib/constants';
|
|
3
|
+
export { BODY_SIZE } from './constants';
|
|
4
|
+
export declare const SHAPE_BODY: Record<BuddyShape, () => ReactElement>;
|
|
5
|
+
export interface ShapeFaceOffset {
|
|
6
|
+
left: number;
|
|
7
|
+
top: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const SHAPE_FACE_OFFSET: Record<BuddyShape, ShapeFaceOffset>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function BoltBody(): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function TermBody(): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function HexBody(): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function BubBody(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function TotemBody(): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function MelonBody(): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function SunnyBody(): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function StormBody(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function ReedBody(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type AgentControls } from '../context/LiveAgentContext';
|
|
2
|
+
import { type AgentControls, type UserContext } from '../context/LiveAgentContext';
|
|
3
3
|
import { CAPTURE_MODE } from '../lib/constants';
|
|
4
4
|
import { type VerticalAlign } from '../lib/launcher';
|
|
5
5
|
interface LiveAgentBaseProps {
|
|
@@ -8,6 +8,7 @@ interface LiveAgentBaseProps {
|
|
|
8
8
|
appKey?: string | undefined;
|
|
9
9
|
getUserToken?: (() => Promise<string>) | undefined;
|
|
10
10
|
userToken?: string | undefined;
|
|
11
|
+
userContext?: UserContext | undefined;
|
|
11
12
|
verticalAlign?: VerticalAlign | undefined;
|
|
12
13
|
variant?: 'floating' | 'sidebar' | undefined;
|
|
13
14
|
minimizable?: boolean | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LinkCardData } from '../hooks/useLinkCard';
|
|
1
2
|
import { type PlanCardData } from '../hooks/usePlanUpdates';
|
|
2
3
|
import type { Message } from '../types';
|
|
3
4
|
interface MessageListProps {
|
|
@@ -6,8 +7,9 @@ interface MessageListProps {
|
|
|
6
7
|
sendChatMessage?: (message: string) => Promise<unknown>;
|
|
7
8
|
isSendingChat?: boolean;
|
|
8
9
|
plan?: PlanCardData | null;
|
|
10
|
+
linkCard?: LinkCardData | null;
|
|
9
11
|
autoFocus?: boolean;
|
|
10
12
|
readOnly?: boolean;
|
|
11
13
|
}
|
|
12
|
-
export declare function MessageList({ messages, isStreaming, sendChatMessage, isSendingChat, plan, autoFocus, readOnly, }: MessageListProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function MessageList({ messages, isStreaming, sendChatMessage, isSendingChat, plan, linkCard, autoFocus, readOnly, }: MessageListProps): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export {};
|
|
@@ -3,6 +3,7 @@ interface VoiceBarChatLineProps {
|
|
|
3
3
|
dock: BarDock;
|
|
4
4
|
canSend: boolean;
|
|
5
5
|
onClose: () => void;
|
|
6
|
+
embedded?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare function VoiceBarChatLine({ dock, canSend, onClose }: VoiceBarChatLineProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function VoiceBarChatLine({ dock, canSend, onClose, embedded, }: VoiceBarChatLineProps): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LinkCardData } from '../hooks/useLinkCard';
|
|
2
|
+
interface VoiceBarLinkCardProps {
|
|
3
|
+
card: LinkCardData;
|
|
4
|
+
onDismiss: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function VoiceBarLinkCard({ card, onDismiss }: VoiceBarLinkCardProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -3,6 +3,7 @@ interface VoiceBarPlanCardProps {
|
|
|
3
3
|
plan: PlanCardData;
|
|
4
4
|
sendChatMessage: (message: string) => Promise<unknown>;
|
|
5
5
|
onDismiss: () => void;
|
|
6
|
+
embedded?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare function VoiceBarPlanCard({ plan, sendChatMessage, onDismiss }: VoiceBarPlanCardProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function VoiceBarPlanCard({ plan, sendChatMessage, onDismiss, embedded, }: VoiceBarPlanCardProps): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
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, type ChatSurface, DEFAULT_CAPTURE_MODE, type LauncherMode, MIC_MODE, type MicMode } from '../lib/constants';
|
|
4
|
+
import { type BuddyShape, 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
6
|
import type { BarDock } from '../lib/voiceBar';
|
|
7
7
|
import type { Message } from '../types';
|
|
@@ -13,6 +13,7 @@ export interface AgentControls {
|
|
|
13
13
|
micMode?: MicMode;
|
|
14
14
|
chat?: ChatSurface;
|
|
15
15
|
}
|
|
16
|
+
export type UserContext = Record<string, string | number | boolean>;
|
|
16
17
|
export interface UiPreferences {
|
|
17
18
|
animateCursor?: boolean;
|
|
18
19
|
autoStart?: boolean;
|
|
@@ -43,12 +44,17 @@ export interface ModuleDefault {
|
|
|
43
44
|
agentId: string | null;
|
|
44
45
|
sessionId: string | null;
|
|
45
46
|
}
|
|
47
|
+
export interface BuddyAppearance {
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
shape: BuddyShape;
|
|
50
|
+
}
|
|
46
51
|
export interface WidgetAppearance {
|
|
47
52
|
accentColor: string | null;
|
|
48
53
|
logoUrl: string | null;
|
|
49
54
|
position: 'left' | 'right' | null;
|
|
50
55
|
verticalAlign: 'top' | 'middle' | 'bottom' | null;
|
|
51
56
|
launcherMode: LauncherMode | null;
|
|
57
|
+
buddy: BuddyAppearance | null;
|
|
52
58
|
}
|
|
53
59
|
export interface IdleSessionHistory {
|
|
54
60
|
messages: Message[];
|
|
@@ -126,6 +132,8 @@ export interface LiveAgentPublicValue {
|
|
|
126
132
|
export interface LiveAgentContextValue extends LiveAgentPublicValue {
|
|
127
133
|
defaultAgentId: string | null;
|
|
128
134
|
startDefaultSession: () => void;
|
|
135
|
+
buddyActive: boolean;
|
|
136
|
+
buddyShape: BuddyShape;
|
|
129
137
|
pauseTimeoutSeconds: number | null;
|
|
130
138
|
usesHostAuth: boolean;
|
|
131
139
|
authFailed: boolean;
|
|
@@ -158,5 +166,7 @@ export interface LiveAgentContextValue extends LiveAgentPublicValue {
|
|
|
158
166
|
setIsDragging: (dragging: boolean) => void;
|
|
159
167
|
chatActivityAt: number;
|
|
160
168
|
reportChatActivity: () => void;
|
|
169
|
+
chatDraft: string;
|
|
170
|
+
setChatDraft: (text: string) => void;
|
|
161
171
|
}
|
|
162
172
|
export declare const LiveAgentContext: import("react").Context<LiveAgentContextValue | null>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Module } from '../context/LiveAgentContext';
|
|
2
2
|
interface UseAutoStartParams {
|
|
3
3
|
availableModules: Module[];
|
|
4
|
-
|
|
4
|
+
suppressed: boolean;
|
|
5
5
|
bearerToken: string | null;
|
|
6
6
|
selectModule: (id: string, opts?: {
|
|
7
7
|
autoStarted?: boolean;
|
|
8
8
|
}) => void;
|
|
9
9
|
}
|
|
10
|
-
export declare function useAutoStart({ availableModules,
|
|
10
|
+
export declare function useAutoStart({ availableModules, suppressed, bearerToken, selectModule, }: UseAutoStartParams): void;
|
|
11
11
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentControls, CaptureMode } from '../context/LiveAgentContext';
|
|
1
|
+
import type { AgentControls, CaptureMode, UserContext } from '../context/LiveAgentContext';
|
|
2
2
|
import type { Message } from '../types';
|
|
3
3
|
export type AuthedFetch = (input: string, init?: RequestInit) => Promise<Response>;
|
|
4
4
|
interface LiveKitConnection {
|
|
@@ -11,6 +11,7 @@ interface UseSessionParams {
|
|
|
11
11
|
appKey?: string | undefined;
|
|
12
12
|
getUserToken?: (() => Promise<string>) | undefined;
|
|
13
13
|
userToken?: string | undefined;
|
|
14
|
+
userContext?: UserContext | undefined;
|
|
14
15
|
onStart?: () => void;
|
|
15
16
|
onStartError?: () => void;
|
|
16
17
|
onDisconnect?: () => void;
|
|
@@ -22,7 +23,7 @@ export interface StartSessionOptions {
|
|
|
22
23
|
adoptionGoalId?: string | undefined;
|
|
23
24
|
autoStarted?: boolean | undefined;
|
|
24
25
|
}
|
|
25
|
-
export declare function useSession({ captureMode, authToken, appKey, getUserToken, userToken, onStart, onStartError, onDisconnect, }: UseSessionParams): {
|
|
26
|
+
export declare function useSession({ captureMode, authToken, appKey, getUserToken, userToken, userContext, onStart, onStartError, onDisconnect, }: UseSessionParams): {
|
|
26
27
|
connection: LiveKitConnection | null;
|
|
27
28
|
shouldConnect: boolean;
|
|
28
29
|
isStarting: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function copyToClipboard(text: string): Promise<boolean>;
|
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
export declare const BUDDY_SHAPE: {
|
|
2
|
+
readonly Bolt: "bolt";
|
|
3
|
+
readonly Term: "term";
|
|
4
|
+
readonly Bub: "bub";
|
|
5
|
+
readonly Hex: "hex";
|
|
6
|
+
readonly Peek: "peek";
|
|
7
|
+
readonly Bloom: "bloom";
|
|
8
|
+
readonly Wobble: "wobble";
|
|
9
|
+
readonly Splat: "splat";
|
|
10
|
+
readonly Cloud: "cloud";
|
|
11
|
+
readonly Boop: "boop";
|
|
12
|
+
readonly Boulder: "boulder";
|
|
13
|
+
readonly Kite: "kite";
|
|
14
|
+
readonly Loaf: "loaf";
|
|
15
|
+
readonly Facet: "facet";
|
|
16
|
+
readonly Bell: "bell";
|
|
17
|
+
readonly Totem: "totem";
|
|
18
|
+
readonly Melon: "melon";
|
|
19
|
+
readonly Sunny: "sunny";
|
|
20
|
+
readonly Storm: "storm";
|
|
21
|
+
readonly Reed: "reed";
|
|
22
|
+
};
|
|
23
|
+
export type BuddyShape = (typeof BUDDY_SHAPE)[keyof typeof BUDDY_SHAPE];
|
|
24
|
+
export declare const DEFAULT_BUDDY_SHAPE: BuddyShape;
|
|
25
|
+
export declare const BUDDY_MODE: {
|
|
26
|
+
readonly Idle: "idle";
|
|
27
|
+
readonly Happy: "happy";
|
|
28
|
+
readonly Sleep: "sleep";
|
|
29
|
+
readonly Talking: "talking";
|
|
30
|
+
readonly Listening: "listening";
|
|
31
|
+
};
|
|
32
|
+
export type BuddyMode = (typeof BUDDY_MODE)[keyof typeof BUDDY_MODE];
|
|
1
33
|
export declare const SIDEBAR_WIDTH = 255;
|
|
2
34
|
export declare const CAPTURE_MODE: {
|
|
3
35
|
readonly Screenshare: "screenshare";
|
|
@@ -60,4 +92,5 @@ export declare const NOTIFICATION_KIND: {
|
|
|
60
92
|
};
|
|
61
93
|
export type NotificationKind = (typeof NOTIFICATION_KIND)[keyof typeof NOTIFICATION_KIND];
|
|
62
94
|
export declare const PLAN_ATTR = "skippr.action-plan";
|
|
95
|
+
export declare const LINK_CARD_ATTR = "skippr.link-card";
|
|
63
96
|
export declare const NAME_MAX_CHARS = 80;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './components/LiveAgent';
|
|
2
|
-
export type { Module } from './context/LiveAgentContext';
|
|
2
|
+
export type { Module, UserContext } from './context/LiveAgentContext';
|
|
3
3
|
export * from './hooks/useAgentVoiceState';
|
|
4
4
|
export * from './hooks/useElapsedSeconds';
|
|
5
5
|
export * from './hooks/useIsLocalSpeaking';
|