@skippr/live-agent-sdk 0.88.0 → 0.89.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.
@@ -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,5 @@
1
+ interface BuddyVoiceBarProps {
2
+ revealed: boolean;
3
+ }
4
+ export declare function BuddyVoiceBar({ revealed }: BuddyVoiceBarProps): import("react/jsx-runtime").JSX.Element | null;
5
+ 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,3 @@
1
+ export { BuddyCreature } from './BuddyCreature';
2
+ export { BuddyVoiceBar } from './BuddyVoiceBar';
3
+ export { buddyEffectiveControls, isBuddyActive } from './buddy';
@@ -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,6 @@
1
+ import type { CSSProperties } from 'react';
2
+ export declare const BODY_SIZE: {
3
+ readonly width: 96;
4
+ readonly height: 92;
5
+ };
6
+ export declare const BOX_ANIM_STYLE: CSSProperties;
@@ -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;
@@ -0,0 +1,6 @@
1
+ export interface WidgetAnchor {
2
+ x: number;
3
+ y: number;
4
+ }
5
+ export declare function setWidgetAnchor(next: WidgetAnchor | null): void;
6
+ export declare function getWidgetAnchor(): WidgetAnchor | null;
@@ -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 {};
@@ -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';
@@ -43,12 +43,17 @@ export interface ModuleDefault {
43
43
  agentId: string | null;
44
44
  sessionId: string | null;
45
45
  }
46
+ export interface BuddyAppearance {
47
+ enabled: boolean;
48
+ shape: BuddyShape;
49
+ }
46
50
  export interface WidgetAppearance {
47
51
  accentColor: string | null;
48
52
  logoUrl: string | null;
49
53
  position: 'left' | 'right' | null;
50
54
  verticalAlign: 'top' | 'middle' | 'bottom' | null;
51
55
  launcherMode: LauncherMode | null;
56
+ buddy: BuddyAppearance | null;
52
57
  }
53
58
  export interface IdleSessionHistory {
54
59
  messages: Message[];
@@ -126,6 +131,8 @@ export interface LiveAgentPublicValue {
126
131
  export interface LiveAgentContextValue extends LiveAgentPublicValue {
127
132
  defaultAgentId: string | null;
128
133
  startDefaultSession: () => void;
134
+ buddyActive: boolean;
135
+ buddyShape: BuddyShape;
129
136
  pauseTimeoutSeconds: number | null;
130
137
  usesHostAuth: boolean;
131
138
  authFailed: boolean;
@@ -158,5 +165,7 @@ export interface LiveAgentContextValue extends LiveAgentPublicValue {
158
165
  setIsDragging: (dragging: boolean) => void;
159
166
  chatActivityAt: number;
160
167
  reportChatActivity: () => void;
168
+ chatDraft: string;
169
+ setChatDraft: (text: string) => void;
161
170
  }
162
171
  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
- isSessionLive: boolean;
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, isSessionLive, bearerToken, selectModule, }: UseAutoStartParams): void;
10
+ export declare function useAutoStart({ availableModules, suppressed, bearerToken, selectModule, }: UseAutoStartParams): void;
11
11
  export {};
@@ -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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skippr/live-agent-sdk",
3
- "version": "0.88.0",
3
+ "version": "0.89.0",
4
4
  "type": "module",
5
5
  "main": "dist/esm/lib-exports.js",
6
6
  "module": "dist/esm/lib-exports.js",