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

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.
@@ -272,6 +272,32 @@ declare class OnboardingSDK extends EventEmitter {
272
272
  * Actions: highlight, click, type, focus, hover, scroll
273
273
  */
274
274
  private handleHybridAction;
275
+ /**
276
+ * Wait for navigation to complete by polling the current URL.
277
+ * Compares normalized URL components (origin, pathname, search, hash)
278
+ * to avoid false positives from substring matching.
279
+ *
280
+ * @param expectedUrl - Absolute URL we're navigating to (already resolved)
281
+ * @param timeoutMs - Maximum time to wait in milliseconds
282
+ * @returns true if navigation was observed, false if timed out
283
+ */
284
+ private waitForNavigation;
285
+ /**
286
+ * Finalize any pending bot navigation that was interrupted by a full-page load.
287
+ *
288
+ * When navigate sets `window.location.href` for a cross-origin or MPA target the
289
+ * entire JS context is destroyed, so the optimistic sendMetadata never fires.
290
+ * The navigate handler persists a record to sessionStorage before triggering
291
+ * the navigation. On the next page load this method reads it back, validates
292
+ * that we actually arrived at the expected destination, and sends the final
293
+ * bot_action_complete metadata so the server can auto-advance the task.
294
+ *
295
+ * Called once during init() — safe to call before the WebRTC transport is
296
+ * connected because sendMetadata already guards on `this.isConnected`.
297
+ * We retry briefly after init to cover the case where the transport
298
+ * connects a moment later.
299
+ */
300
+ private _finalizePendingNavigation;
275
301
  /**
276
302
  * Check a precondition and report the result to the server.
277
303
  * Used for conditional task execution (e.g., check if an option exists before selecting it).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floe-ai/sdk",
3
- "version": "0.1.0-dev.20",
3
+ "version": "0.1.0-dev.21",
4
4
  "description": "Floe AI Onboarding SDK for React applications",
5
5
  "type": "module",
6
6
  "main": "./dist-sdk/floe-sdk.es.js",