@glydeunity/voice-sdk 1.6.26 → 1.6.27

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/dist/index.d.ts CHANGED
@@ -39,6 +39,21 @@ import { default as default_2 } from 'react';
39
39
  */
40
40
  export declare const ActivityIcon: default_2.FC<IconProps>;
41
41
 
42
+ /**
43
+ * Agent metadata returned by the voice config endpoint.
44
+ * Used to populate dynamic headers in both VoiceChat and TextChat.
45
+ */
46
+ export declare interface AgentMetadata {
47
+ /** Display name for the AI agent (e.g. "Chris") */
48
+ agent_name?: string;
49
+ /** Company or staffing agency name (e.g. "Acme Staffing") */
50
+ company_name?: string;
51
+ /** Job title when in a job-specific context */
52
+ job_title?: string;
53
+ /** Greeting phrase (server-controlled first message) */
54
+ greeting?: string;
55
+ }
56
+
42
57
  /**
43
58
  * Authentication method used by the client
44
59
  */
@@ -720,6 +735,7 @@ export declare class GlydeText extends BaseGlydeClient<GlydeTextConfig, TextChat
720
735
  private conversationSummary;
721
736
  private contextSwitchManager;
722
737
  private currentContextType;
738
+ private agentMetadata;
723
739
  /**
724
740
  * Create a new GlydeText instance
725
741
  * @param config - Configuration options
@@ -805,6 +821,16 @@ export declare class GlydeText extends BaseGlydeClient<GlydeTextConfig, TextChat
805
821
  * Get the current context type
806
822
  */
807
823
  getContextType(): VoiceContextType;
824
+ /**
825
+ * Fetch agent metadata from the voice config endpoint.
826
+ * Populates `agentMetadata` with agent name, company, job title, and greeting.
827
+ * Called during initialize(); failures are non-fatal.
828
+ */
829
+ fetchMetadata(): Promise<AgentMetadata | null>;
830
+ /**
831
+ * Get the agent metadata (available after initialize or fetchMetadata)
832
+ */
833
+ getAgentMetadata(): AgentMetadata | null;
808
834
  /**
809
835
  * Perform smooth context update (no full reinit)
810
836
  * For text chat, this just updates internal state
@@ -1228,8 +1254,6 @@ export declare interface TextChatProps {
1228
1254
  unityApiUrl?: string;
1229
1255
  /** Fixed height for the component */
1230
1256
  height?: string | number;
1231
- /** Header title */
1232
- title?: string;
1233
1257
  /** Placeholder text for input */
1234
1258
  placeholder?: string;
1235
1259
  /** Auto-initialize chat on mount */
@@ -1238,6 +1262,8 @@ export declare interface TextChatProps {
1238
1262
  onMessage?: (message: ChatMessage) => void;
1239
1263
  /** Callback when error occurs */
1240
1264
  onError?: (error: Error) => void;
1265
+ /** Callback when context switches (e.g. screening -> candidate_discover) */
1266
+ onContextSwitch?: (contextType: string, contextId: string) => void;
1241
1267
  }
1242
1268
 
1243
1269
  /**
@@ -1337,6 +1363,8 @@ export declare function useTextChat(config: UseTextChatConfig): UseTextChatRetur
1337
1363
  export declare interface UseTextChatConfig extends Omit<GlydeTextConfig, 'onEvent' | 'onMessage' | 'onTyping'> {
1338
1364
  /** Auto-initialize the chat on mount */
1339
1365
  autoInit?: boolean;
1366
+ /** Callback when context switches (e.g. screening -> candidate_discover) */
1367
+ onContextSwitch?: (payload: ContextSwitchPayload) => void;
1340
1368
  }
1341
1369
 
1342
1370
  /**
@@ -1351,6 +1379,8 @@ export declare interface UseTextChatReturn {
1351
1379
  isLoading: boolean;
1352
1380
  /** Error message if status is 'error' */
1353
1381
  errorMessage: string | null;
1382
+ /** Agent metadata from voice config (agent_name, company_name, etc.) */
1383
+ agentMetadata: AgentMetadata | null;
1354
1384
  /** Initialize the chat session */
1355
1385
  initialize: () => Promise<void>;
1356
1386
  /** Send a message */
@@ -1393,6 +1423,8 @@ export declare interface UseVoiceAgentReturn {
1393
1423
  isMuted: boolean;
1394
1424
  /** Error message if status is 'error' */
1395
1425
  errorMessage: string | null;
1426
+ /** Agent metadata from voice config (agent_name, company_name, etc.) */
1427
+ agentMetadata: AgentMetadata | null;
1396
1428
  /** Start the voice session */
1397
1429
  start: () => Promise<void>;
1398
1430
  /** Stop the voice session */
@@ -1466,6 +1498,8 @@ export declare interface VoiceConfig {
1466
1498
  type: VoiceContextType;
1467
1499
  id: string | null;
1468
1500
  };
1501
+ /** Agent/company metadata for dynamic UI headers */
1502
+ metadata?: AgentMetadata;
1469
1503
  }
1470
1504
 
1471
1505
  /**