@skippr/live-agent-sdk 0.33.0 → 0.34.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.
@@ -1,7 +1,7 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type AgentControls } from '../context/LiveAgentContext';
3
3
  interface LiveAgentBaseProps {
4
- agentId: string;
4
+ agentId?: string | undefined;
5
5
  authToken?: string | undefined;
6
6
  appKey?: string | undefined;
7
7
  userToken?: string | undefined;
@@ -0,0 +1 @@
1
+ export declare function ModuleSelector(): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,14 @@
1
+ import type { AgentControls } from '../context/LiveAgentContext';
1
2
  interface StartSessionPromptProps {
2
- onStartSession: () => void;
3
+ onStartSession: (opts: {
4
+ agentId: string;
5
+ agentControls?: AgentControls;
6
+ }) => void;
7
+ agentId: string | null;
8
+ agentControls?: AgentControls | undefined;
3
9
  isStarting?: boolean;
4
10
  error?: string;
5
11
  label?: string;
6
12
  }
7
- export declare function StartSessionPrompt({ onStartSession, isStarting, error, label, }: StartSessionPromptProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function StartSessionPrompt({ onStartSession, agentId, agentControls, isStarting, error, label, }: StartSessionPromptProps): import("react/jsx-runtime").JSX.Element;
8
14
  export {};
@@ -3,12 +3,25 @@ export type CaptureMode = 'screenshare' | 'auto';
3
3
  export interface AgentControls {
4
4
  highlight?: boolean;
5
5
  }
6
+ export interface Module {
7
+ id: string;
8
+ name: string;
9
+ description: string | null;
10
+ type: string;
11
+ priority: number;
12
+ controls: AgentControls;
13
+ }
6
14
  export interface LiveAgentPublicValue {
7
15
  isConnected: boolean;
8
16
  isStarting: boolean;
17
+ isDisconnecting: boolean;
9
18
  error: string;
10
19
  errorCode: number | null;
11
- startSession: () => Promise<void>;
20
+ agentId: string | null;
21
+ startSession: (opts: {
22
+ agentId: string;
23
+ agentControls?: AgentControls;
24
+ }) => Promise<void>;
12
25
  disconnect: () => Promise<void>;
13
26
  isPanelOpen: boolean;
14
27
  openPanel: () => void;
@@ -33,6 +46,13 @@ export interface LiveAgentPublicValue {
33
46
  autoFocusChat: boolean;
34
47
  captureMode: CaptureMode;
35
48
  agentControls?: AgentControls | undefined;
49
+ hasModuleSelector: boolean;
50
+ availableModules: Module[];
51
+ activeModule: Module | null;
52
+ isLoadingModules: boolean;
53
+ modulesError: string | null;
54
+ refetchModules: () => Promise<void>;
55
+ selectModule: (id: string) => void;
36
56
  }
37
57
  export interface LiveAgentContextValue extends LiveAgentPublicValue {
38
58
  connection: {
@@ -0,0 +1,13 @@
1
+ import type { Module } from '../context/LiveAgentContext';
2
+ interface UseAvailableModulesParams {
3
+ enabled: boolean;
4
+ bearerToken: string | null;
5
+ }
6
+ interface UseAvailableModulesResult {
7
+ modules: Module[];
8
+ isLoading: boolean;
9
+ error: string | null;
10
+ refetch: () => Promise<void>;
11
+ }
12
+ export declare function useAvailableModules({ enabled, bearerToken, }: UseAvailableModulesParams): UseAvailableModulesResult;
13
+ export {};
@@ -4,21 +4,28 @@ interface LiveKitConnection {
4
4
  token: string;
5
5
  }
6
6
  interface UseSessionParams {
7
- agentId: string;
8
7
  captureMode?: CaptureMode | undefined;
9
- agentControls?: AgentControls | undefined;
10
8
  authToken?: string | undefined;
11
9
  appKey?: string | undefined;
12
10
  userToken?: string | undefined;
11
+ onStart?: () => void;
12
+ onStartError?: () => void;
13
+ onDisconnect?: () => void;
14
+ }
15
+ export interface StartSessionOptions {
16
+ agentId: string;
17
+ agentControls?: AgentControls;
13
18
  }
14
- export declare function useSession({ agentId, captureMode, agentControls, authToken, appKey, userToken, }: UseSessionParams): {
19
+ export declare function useSession({ captureMode, authToken, appKey, userToken, onStart, onStartError, onDisconnect, }: UseSessionParams): {
15
20
  connection: LiveKitConnection | null;
16
21
  shouldConnect: boolean;
17
22
  isStarting: boolean;
23
+ isDisconnecting: boolean;
18
24
  error: string;
19
25
  errorCode: number | null;
20
- startSession: () => Promise<void>;
26
+ startSession: ({ agentId, agentControls }: StartSessionOptions) => Promise<void>;
21
27
  disconnect: () => Promise<void>;
22
28
  pendingScreenStream: MediaStream | null;
29
+ bearerToken: string | null;
23
30
  };
24
31
  export {};
@@ -1,4 +1,5 @@
1
1
  export * from './components/LiveAgent';
2
+ export type { Module } from './context/LiveAgentContext';
2
3
  export * from './hooks/useAgentVoiceState';
3
4
  export * from './hooks/useElapsedSeconds';
4
5
  export * from './hooks/useIsLocalSpeaking';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skippr/live-agent-sdk",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "type": "module",
5
5
  "main": "dist/esm/lib-exports.js",
6
6
  "module": "dist/esm/lib-exports.js",