@floe-ai/sdk 0.1.0-dev.21 → 0.1.0-dev.22

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.
@@ -137,6 +137,7 @@ declare class OnboardingSDK extends EventEmitter {
137
137
  private isReturningUser;
138
138
  private hasSkippedOnboarding;
139
139
  private _isMinimized;
140
+ private textModeEnabled;
140
141
  constructor(config: SDKConfig);
141
142
  /**
142
143
  * Generate unique session ID
@@ -155,10 +156,20 @@ declare class OnboardingSDK extends EventEmitter {
155
156
  * Initialize the SDK and connect to servers
156
157
  */
157
158
  init(): Promise<void>;
159
+ /**
160
+ * Setup navigation detection for page navigation events.
161
+ * Ensures navigationCompleteDetector is instantiated and started regardless
162
+ * of text/voice mode — navigation tracking is needed in both modes so the
163
+ * server always knows the current page context.
164
+ */
165
+ private setupNavigationDetection;
158
166
  /**
159
167
  * Setup audio playback for bot audio tracks with real-time level analysis.
160
- * Centralizes all audio element handling, analyzer instantiation, and navigation detector setup.
161
- * This is the single source of truth for audio/navigation initialization to prevent duplicates.
168
+ * Centralizes all audio element handling and analyzer instantiation.
169
+ * This is the single source of truth for audio initialization to prevent duplicates.
170
+ *
171
+ * Note: Navigation detection is handled separately by setupNavigationDetection()
172
+ * so it works in both voice and text modes.
162
173
  */
163
174
  private setupAudioPlayback;
164
175
  /**
@@ -434,9 +445,25 @@ declare class OnboardingSDK extends EventEmitter {
434
445
  * Public API Methods
435
446
  */
436
447
  /**
437
- * Send text message
448
+ * Send text message (low-level)
438
449
  */
439
450
  sendText(text: string): Promise<void>;
451
+ /**
452
+ * Toggle text mode on/off
453
+ * When text mode is enabled, mic is muted and user types messages.
454
+ * When disabled, mic is re-enabled and voice mode resumes.
455
+ */
456
+ toggleTextMode(): void;
457
+ /**
458
+ * Send a text message with optimistic UI update.
459
+ * Uses custom 'text_message' RTVI message type (Approach B) instead of
460
+ * Pipecat's native send-text, so the server-side handler can run the full
461
+ * processing pipeline (state machine, system prompt refresh, activity
462
+ * recording, goal extraction, transcript recording) — not just LLM injection.
463
+ *
464
+ * In text mode, TTS is skipped (audio_response: false).
465
+ */
466
+ sendTextMessage(text: string): Promise<void>;
440
467
  /**
441
468
  * Toggle microphone mute
442
469
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floe-ai/sdk",
3
- "version": "0.1.0-dev.21",
3
+ "version": "0.1.0-dev.22",
4
4
  "description": "Floe AI Onboarding SDK for React applications",
5
5
  "type": "module",
6
6
  "main": "./dist-sdk/floe-sdk.es.js",