@glydeunity/voice-sdk 1.5.2 → 1.5.4

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
@@ -93,8 +93,7 @@ export declare interface ChatWidgetConfig extends BaseGlydeConfig {
93
93
  /** Voice context type */
94
94
  contextType?: VoiceContextType;
95
95
  /**
96
- * Default chat mode. If not set, shows mode selection screen first.
97
- * Set to 'voice' or 'text' to skip mode selection.
96
+ * Default chat mode. If not set, defaults to 'voice' with option to switch to text.
98
97
  */
99
98
  defaultMode?: ChatMode;
100
99
  /** Widget position (for floating mode) */
@@ -319,6 +318,18 @@ export declare const componentStyles: {
319
318
  };
320
319
  };
321
320
 
321
+ /**
322
+ * Conversation summary from Unity API
323
+ */
324
+ declare interface ConversationSummaryResponse {
325
+ application_uuid: string;
326
+ has_history: boolean;
327
+ message_count: number;
328
+ last_message_date: string | null;
329
+ summary_text: string;
330
+ greeting: string;
331
+ }
332
+
322
333
  /**
323
334
  * Deepgram agent configuration for LLM and voice settings
324
335
  */
@@ -508,6 +519,9 @@ export declare const GlydeChat: {
508
519
  *
509
520
  * Connects to GLYDE Unity API for text-based conversations.
510
521
  * Uses the screening chat endpoints for candidate interactions.
522
+ *
523
+ * Note: By default, initializes with a summary instead of loading full history.
524
+ * The AI greeting will acknowledge previous conversations when resuming.
511
525
  */
512
526
  export declare class GlydeText {
513
527
  private config;
@@ -515,6 +529,7 @@ export declare class GlydeText {
515
529
  private history;
516
530
  private isTyping;
517
531
  private initialized;
532
+ private conversationSummary;
518
533
  /**
519
534
  * Create a new GlydeText instance
520
535
  * @param config - Configuration options
@@ -534,10 +549,22 @@ export declare class GlydeText {
534
549
  */
535
550
  private setTyping;
536
551
  /**
537
- * Initialize the chat session and load existing history
538
- * @returns The loaded message history
552
+ * Initialize the chat session with a summary (not full history).
553
+ * Returns the greeting message to show the user.
554
+ *
555
+ * The summary includes:
556
+ * - has_history: whether there's previous conversation
557
+ * - message_count: number of previous messages
558
+ * - summary_text: brief summary of previous conversation
559
+ * - greeting: personalized greeting for the candidate
560
+ *
561
+ * @returns Array with the greeting message
539
562
  */
540
563
  initialize(): Promise<ChatMessage[]>;
564
+ /**
565
+ * Get the conversation summary (available after initialize)
566
+ */
567
+ getSummary(): ConversationSummaryResponse | null;
541
568
  /**
542
569
  * Send a message and get the agent's response
543
570
  * @param message - The message content to send
@@ -1136,6 +1163,8 @@ export declare interface VoiceChatProps {
1136
1163
  onCallEnd?: () => void;
1137
1164
  /** Callback when error occurs */
1138
1165
  onError?: (error: Error) => void;
1166
+ /** Callback to switch to text mode (shows "Prefer text?" link) */
1167
+ onSwitchToText?: () => void;
1139
1168
  }
1140
1169
 
1141
1170
  /**