@skippr/live-agent-sdk 0.89.0 → 0.91.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 +1950 -1287
- package/dist/skippr-sdk.css +1 -1
- package/dist/skippr-sdk.js +146 -146
- package/dist/types/buddy/BuddyFamilyFace.d.ts +10 -0
- package/dist/types/buddy/buddy.d.ts +17 -0
- package/dist/types/buddy/hooks/useBuddyEdgeDrag.d.ts +14 -0
- package/dist/types/buddy/shapes/colorful.d.ts +2 -2
- 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/VoiceBarLinkCard.d.ts +7 -0
- package/dist/types/context/LiveAgentContext.d.ts +1 -0
- 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 +3 -2
- package/dist/types/lib-exports.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface FamilyFaceProps {
|
|
2
|
+
eyeDx: number;
|
|
3
|
+
eyeDy: number;
|
|
4
|
+
asleep: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function ColorfulFace({ eyeDx, eyeDy, asleep, animated, }: FamilyFaceProps & {
|
|
7
|
+
animated?: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function PixelFace({ eyeDx, eyeDy, asleep }: FamilyFaceProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import type { AgentControls, WidgetAppearance } from '../context/LiveAgentContext';
|
|
2
2
|
export declare const SKIPPR_BUDDY_POS_KEY = "skippr_buddy_pos";
|
|
3
|
+
export declare const SKIPPR_BUDDY_EDGE_KEY = "skippr_buddy_edge";
|
|
3
4
|
export declare const BUDDY_SLEEP_MS = 14000;
|
|
4
5
|
export declare const BUDDY_HAPPY_MS = 1300;
|
|
5
6
|
export declare const BUDDY_SIZE_PX = 96;
|
|
6
7
|
export declare const BUDDY_EDGE_MARGIN_PX = 16;
|
|
7
8
|
export declare const BUDDY_DRAG_THRESHOLD_PX = 5;
|
|
9
|
+
export type BuddyEdge = 'left' | 'right' | 'top' | 'bottom';
|
|
10
|
+
export interface BuddyEdgePos {
|
|
11
|
+
edge: BuddyEdge;
|
|
12
|
+
top: number;
|
|
13
|
+
left: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function isVerticalEdge(edge: BuddyEdge): boolean;
|
|
8
16
|
export interface BuddyPos {
|
|
9
17
|
x: number;
|
|
10
18
|
y: number;
|
|
@@ -18,3 +26,12 @@ export declare function seedBuddyPosFromAppearance(position: 'left' | 'right' |
|
|
|
18
26
|
innerWidth: number;
|
|
19
27
|
innerHeight: number;
|
|
20
28
|
}, sizePx?: number): BuddyPos;
|
|
29
|
+
export declare function clampBuddyTop(top: number, sizePx?: number): number;
|
|
30
|
+
export declare function clampBuddyLeft(left: number, sizePx?: number): number;
|
|
31
|
+
export declare function nearestBuddyEdge(pointerX: number, pointerY: number): BuddyEdge;
|
|
32
|
+
export declare function readSavedBuddyEdgePos(sizePx?: number): BuddyEdgePos | null;
|
|
33
|
+
export declare function persistBuddyEdgePos(pos: BuddyEdgePos): void;
|
|
34
|
+
export declare function seedBuddyEdgePosFromAppearance(position: 'left' | 'right' | null, verticalAlign: 'top' | 'middle' | 'bottom' | null, viewport: {
|
|
35
|
+
innerWidth: number;
|
|
36
|
+
innerHeight: number;
|
|
37
|
+
}, sizePx?: number): BuddyEdgePos;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type BuddyEdgePos } from '../buddy';
|
|
2
|
+
export interface UseBuddyEdgeDragOptions {
|
|
3
|
+
appearancePosition: 'left' | 'right' | null;
|
|
4
|
+
appearanceVerticalAlign: 'top' | 'middle' | 'bottom' | null;
|
|
5
|
+
sizePx?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface UseBuddyEdgeDragValue {
|
|
8
|
+
pos: BuddyEdgePos;
|
|
9
|
+
isDragging: boolean;
|
|
10
|
+
startDrag: (event: React.PointerEvent) => {
|
|
11
|
+
didDrag: () => boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare function useBuddyEdgeDrag({ appearancePosition, appearanceVerticalAlign, sizePx, }: UseBuddyEdgeDragOptions): UseBuddyEdgeDragValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function BloomBody(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export declare function WobbleBody(): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare function SplatBody(): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
4
|
+
export declare function PopBody(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function RoboBody(): 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 {};
|
|
@@ -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 {};
|
|
@@ -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>;
|
|
@@ -7,8 +7,8 @@ export declare const BUDDY_SHAPE: {
|
|
|
7
7
|
readonly Bloom: "bloom";
|
|
8
8
|
readonly Wobble: "wobble";
|
|
9
9
|
readonly Splat: "splat";
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
10
|
+
readonly Pop: "pop";
|
|
11
|
+
readonly Robo: "robo";
|
|
12
12
|
readonly Boulder: "boulder";
|
|
13
13
|
readonly Kite: "kite";
|
|
14
14
|
readonly Loaf: "loaf";
|
|
@@ -92,4 +92,5 @@ export declare const NOTIFICATION_KIND: {
|
|
|
92
92
|
};
|
|
93
93
|
export type NotificationKind = (typeof NOTIFICATION_KIND)[keyof typeof NOTIFICATION_KIND];
|
|
94
94
|
export declare const PLAN_ATTR = "skippr.action-plan";
|
|
95
|
+
export declare const LINK_CARD_ATTR = "skippr.link-card";
|
|
95
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';
|