@skippr/live-agent-sdk 0.74.0 → 0.76.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.
@@ -3,10 +3,11 @@ import type { Message } from '../types';
3
3
  interface MessageListProps {
4
4
  messages: Message[];
5
5
  isStreaming: boolean;
6
- sendChatMessage: (message: string) => Promise<unknown>;
7
- isSendingChat: boolean;
6
+ sendChatMessage?: (message: string) => Promise<unknown>;
7
+ isSendingChat?: boolean;
8
8
  plan?: PlanCardData | null;
9
9
  autoFocus?: boolean;
10
+ readOnly?: boolean;
10
11
  }
11
- export declare function MessageList({ messages, isStreaming, sendChatMessage, isSendingChat, plan, autoFocus, }: MessageListProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function MessageList({ messages, isStreaming, sendChatMessage, isSendingChat, plan, autoFocus, readOnly, }: MessageListProps): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -2,12 +2,6 @@ import type { Module } from '../context/LiveAgentContext';
2
2
  interface ModulePillProps {
3
3
  module: Module;
4
4
  onSelect: (id: string) => void;
5
- progress?: {
6
- completed: number;
7
- total: number;
8
- };
9
- isLive?: boolean;
10
- label?: string;
11
5
  }
12
- export declare function ModulePill({ module, onSelect, progress, isLive, label }: ModulePillProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function ModulePill({ module, onSelect }: ModulePillProps): import("react/jsx-runtime").JSX.Element;
13
7
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { LauncherDropTarget } from '../hooks/useLauncherDrag';
2
+ import type { PhaseStatus } from '../hooks/usePhaseUpdates';
2
3
  import type { AgentMode } from '../lib/agentMode';
3
4
  import { CAPTURE_MODE, type CaptureMode, DEFAULT_CAPTURE_MODE } from '../lib/constants';
4
5
  import type { SessionStatus } from '../lib/sessionStatus';
@@ -11,6 +12,7 @@ export interface AgentControls {
11
12
  }
12
13
  export interface UiPreferences {
13
14
  animateCursor?: boolean;
15
+ autoStart?: boolean;
14
16
  }
15
17
  export type { AgentMode, SessionStatus };
16
18
  export interface ModuleCurrentSession {
@@ -34,6 +36,15 @@ export interface ResumableSession {
34
36
  id: string;
35
37
  agentId: string;
36
38
  }
39
+ export interface ModuleDefault {
40
+ agentId: string | null;
41
+ sessionId: string | null;
42
+ }
43
+ export interface IdleSessionHistory {
44
+ messages: Message[];
45
+ phases: PhaseStatus[];
46
+ isLoading: boolean;
47
+ }
37
48
  export declare enum AdoptionGoalStatus {
38
49
  Attended = "attended",
39
50
  Dismissed = "dismissed"
@@ -101,6 +112,8 @@ export interface LiveAgentPublicValue {
101
112
  selectModule: (id: string) => void;
102
113
  }
103
114
  export interface LiveAgentContextValue extends LiveAgentPublicValue {
115
+ defaultAgentId: string | null;
116
+ startDefaultSession: () => void;
104
117
  pauseTimeoutSeconds: number | null;
105
118
  usesHostAuth: boolean;
106
119
  authFailed: boolean;
@@ -110,6 +123,7 @@ export interface LiveAgentContextValue extends LiveAgentPublicValue {
110
123
  } | null;
111
124
  shouldConnect: boolean;
112
125
  historyMessages: Message[];
126
+ idleHistory: IdleSessionHistory;
113
127
  phasesSnapshot: unknown[];
114
128
  setPhasesSnapshot: (phases: unknown[]) => void;
115
129
  hasResolvedModules: boolean;
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type UseSessionHoldValue } from '../hooks/useSessionHold';
3
+ declare const SessionHoldContext: import("react").Context<UseSessionHoldValue>;
4
+ export declare function SessionHoldProvider({ children }: {
5
+ children: ReactNode;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ export declare function useSessionHoldContext(): UseSessionHoldValue;
8
+ export { SessionHoldContext };
@@ -0,0 +1,11 @@
1
+ import type { Module } from '../context/LiveAgentContext';
2
+ interface UseAutoStartParams {
3
+ availableModules: Module[];
4
+ isSessionLive: boolean;
5
+ bearerToken: string | null;
6
+ selectModule: (id: string, opts?: {
7
+ autoStarted?: boolean;
8
+ }) => void;
9
+ }
10
+ export declare function useAutoStart({ availableModules, isSessionLive, bearerToken, selectModule, }: UseAutoStartParams): void;
11
+ export {};
@@ -1,16 +1,18 @@
1
- import type { Module } from '../context/LiveAgentContext';
1
+ import type { Module, ModuleDefault } from '../context/LiveAgentContext';
2
2
  import type { AuthedFetch } from './useSession';
3
3
  interface UseAvailableModulesParams {
4
4
  enabled: boolean;
5
5
  bearerToken: string | null;
6
6
  authedFetch: AuthedFetch;
7
+ agentId?: string | undefined;
7
8
  }
8
9
  interface UseAvailableModulesResult {
9
10
  modules: Module[];
11
+ defaultSelection: ModuleDefault;
10
12
  isLoading: boolean;
11
13
  hasResolved: boolean;
12
14
  error: string | null;
13
15
  refetch: () => Promise<void>;
14
16
  }
15
- export declare function useAvailableModules({ enabled, bearerToken, authedFetch, }: UseAvailableModulesParams): UseAvailableModulesResult;
17
+ export declare function useAvailableModules({ enabled, bearerToken, authedFetch, agentId, }: UseAvailableModulesParams): UseAvailableModulesResult;
16
18
  export {};
@@ -20,6 +20,7 @@ export interface StartSessionOptions {
20
20
  agentControls?: AgentControls | undefined;
21
21
  existingSessionId?: string | undefined;
22
22
  adoptionGoalId?: string | undefined;
23
+ autoStarted?: boolean | undefined;
23
24
  }
24
25
  export declare function useSession({ captureMode, authToken, appKey, getUserToken, userToken, onStart, onStartError, onDisconnect, }: UseSessionParams): {
25
26
  connection: LiveKitConnection | null;
@@ -28,7 +29,7 @@ export declare function useSession({ captureMode, authToken, appKey, getUserToke
28
29
  isDisconnecting: boolean;
29
30
  error: string;
30
31
  errorCode: number | null;
31
- startSession: ({ agentId, agentControls, existingSessionId, adoptionGoalId }: StartSessionOptions) => Promise<void>;
32
+ startSession: ({ agentId, agentControls, existingSessionId, adoptionGoalId, autoStarted, }: StartSessionOptions) => Promise<void>;
32
33
  pauseSession: () => Promise<void>;
33
34
  disconnect: () => Promise<void>;
34
35
  isPaused: boolean;
@@ -0,0 +1,15 @@
1
+ import type { Message } from '../types';
2
+ import type { PhaseStatus } from './usePhaseUpdates';
3
+ import type { AuthedFetch } from './useSession';
4
+ export interface SessionHistory {
5
+ messages: Message[];
6
+ phases: PhaseStatus[];
7
+ isLoading: boolean;
8
+ }
9
+ interface UseSessionHistoryParams {
10
+ agentId: string | undefined;
11
+ enabled: boolean;
12
+ authedFetch: AuthedFetch;
13
+ }
14
+ export declare function useSessionHistory({ agentId, enabled, authedFetch, }: UseSessionHistoryParams): SessionHistory;
15
+ export {};
@@ -1,4 +1,12 @@
1
1
  import type { AgentMode, Module, ModuleCurrentSession, ResumableSession } from '../context/LiveAgentContext';
2
+ import type { Message } from '../types';
3
+ export interface ApiSessionMessage {
4
+ id: string;
5
+ role: 'agent' | 'user' | 'system';
6
+ content: string;
7
+ createdAt: string;
8
+ }
9
+ export declare function mapApiMessages(messages: ApiSessionMessage[]): Message[];
2
10
  export declare function getResumableSessionId(currentSession: ModuleCurrentSession | null | undefined, mode: AgentMode | null): string | undefined;
3
11
  export declare function canResumeSession(currentSession: ModuleCurrentSession | null | undefined, mode: AgentMode | null): boolean;
4
12
  export declare function getResumableSession(module: Module | null | undefined): ResumableSession | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skippr/live-agent-sdk",
3
- "version": "0.74.0",
3
+ "version": "0.76.0",
4
4
  "type": "module",
5
5
  "main": "dist/esm/lib-exports.js",
6
6
  "module": "dist/esm/lib-exports.js",
@@ -1,16 +0,0 @@
1
- import type { AgentControls } from '../context/LiveAgentContext';
2
- interface StartSessionPromptProps {
3
- onStartSession: (opts: {
4
- agentId: string;
5
- agentControls?: AgentControls;
6
- }) => void;
7
- agentId: string | null;
8
- agentControls?: AgentControls | undefined;
9
- isStarting?: boolean;
10
- error?: string;
11
- label?: string;
12
- canResume?: boolean;
13
- onResume?: () => void;
14
- }
15
- export declare function StartSessionPrompt({ onStartSession, agentId, agentControls, isStarting, error, label, canResume, onResume, }: StartSessionPromptProps): import("react/jsx-runtime").JSX.Element;
16
- export {};