@skippr/live-agent-sdk 0.74.0 → 0.75.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';
@@ -34,6 +35,15 @@ export interface ResumableSession {
34
35
  id: string;
35
36
  agentId: string;
36
37
  }
38
+ export interface ModuleDefault {
39
+ agentId: string | null;
40
+ sessionId: string | null;
41
+ }
42
+ export interface IdleSessionHistory {
43
+ messages: Message[];
44
+ phases: PhaseStatus[];
45
+ isLoading: boolean;
46
+ }
37
47
  export declare enum AdoptionGoalStatus {
38
48
  Attended = "attended",
39
49
  Dismissed = "dismissed"
@@ -101,6 +111,8 @@ export interface LiveAgentPublicValue {
101
111
  selectModule: (id: string) => void;
102
112
  }
103
113
  export interface LiveAgentContextValue extends LiveAgentPublicValue {
114
+ defaultAgentId: string | null;
115
+ startDefaultSession: () => void;
104
116
  pauseTimeoutSeconds: number | null;
105
117
  usesHostAuth: boolean;
106
118
  authFailed: boolean;
@@ -110,6 +122,7 @@ export interface LiveAgentContextValue extends LiveAgentPublicValue {
110
122
  } | null;
111
123
  shouldConnect: boolean;
112
124
  historyMessages: Message[];
125
+ idleHistory: IdleSessionHistory;
113
126
  phasesSnapshot: unknown[];
114
127
  setPhasesSnapshot: (phases: unknown[]) => void;
115
128
  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 };
@@ -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 {};
@@ -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.75.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 {};