@prodact.ai/sdk 0.0.8 → 0.0.10
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/cdn/sdk.global.js +2 -2
- package/dist/cdn/sdk.global.js.map +1 -1
- package/dist/index.js +36 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react.js +110 -2
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +110 -2
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1234,7 +1234,15 @@ var UserFlowTracker = class {
|
|
|
1234
1234
|
console.warn("[UserFlow] Cannot track outside browser environment");
|
|
1235
1235
|
return null;
|
|
1236
1236
|
}
|
|
1237
|
+
console.log("[UserFlow] start() called", {
|
|
1238
|
+
enabled: this.config.enabled,
|
|
1239
|
+
samplingRate: this.config.samplingRate,
|
|
1240
|
+
currentState: this.state,
|
|
1241
|
+
apiUrl: this.apiUrl,
|
|
1242
|
+
hasSessionToken: !!this.sessionToken
|
|
1243
|
+
});
|
|
1237
1244
|
if (!this.config.enabled) {
|
|
1245
|
+
console.warn("[UserFlow] Tracking disabled by config");
|
|
1238
1246
|
return null;
|
|
1239
1247
|
}
|
|
1240
1248
|
if (this.state === "tracking") {
|
|
@@ -2018,11 +2026,13 @@ Check the Network tab in DevTools for more details.`
|
|
|
2018
2026
|
role: "assistant",
|
|
2019
2027
|
content: result.message?.content || result.response || "",
|
|
2020
2028
|
visualFlows: result.flows || [],
|
|
2021
|
-
images: result.images || []
|
|
2029
|
+
images: result.images || [],
|
|
2030
|
+
userFlows: result.userFlows || []
|
|
2022
2031
|
};
|
|
2023
2032
|
await this.log("info", "Chat response received", {
|
|
2024
2033
|
hasFlows: (result.flows || []).length > 0,
|
|
2025
|
-
hasImages: (result.images || []).length > 0
|
|
2034
|
+
hasImages: (result.images || []).length > 0,
|
|
2035
|
+
hasUserFlows: (result.userFlows || []).length > 0
|
|
2026
2036
|
});
|
|
2027
2037
|
this.emit("message", chatMessage);
|
|
2028
2038
|
return chatMessage;
|
|
@@ -2588,6 +2598,15 @@ Check the Network tab in DevTools for more details.`
|
|
|
2588
2598
|
*/
|
|
2589
2599
|
async initUserFlowTracking() {
|
|
2590
2600
|
try {
|
|
2601
|
+
console.log(
|
|
2602
|
+
"%c\u{1F4CA} Initializing User Flow Tracking",
|
|
2603
|
+
"background: #8b5cf6; color: #fff; padding: 2px 6px; border-radius: 3px;",
|
|
2604
|
+
{
|
|
2605
|
+
config: this.config.userFlows,
|
|
2606
|
+
apiUrl: this.config.apiUrl,
|
|
2607
|
+
sdkKey: this.config.sdkKey ? "present" : "missing"
|
|
2608
|
+
}
|
|
2609
|
+
);
|
|
2591
2610
|
this.userFlowTracker = new UserFlowTracker(this.config.userFlows);
|
|
2592
2611
|
this.userFlowTracker.initialize(
|
|
2593
2612
|
this.sessionToken,
|
|
@@ -2597,12 +2616,27 @@ Check the Network tab in DevTools for more details.`
|
|
|
2597
2616
|
const recordingSessionId = this.recorder?.getSessionId?.() || null;
|
|
2598
2617
|
const sessionId = await this.userFlowTracker.start(recordingSessionId);
|
|
2599
2618
|
if (sessionId) {
|
|
2619
|
+
console.log(
|
|
2620
|
+
"%c\u2705 User Flow Tracking Started",
|
|
2621
|
+
"background: #10b981; color: #fff; padding: 2px 6px; border-radius: 3px;",
|
|
2622
|
+
{ flowSessionId: sessionId, linkedRecordingSession: recordingSessionId }
|
|
2623
|
+
);
|
|
2600
2624
|
await this.log("info", "User flow tracking started", {
|
|
2601
2625
|
flowSessionId: sessionId,
|
|
2602
2626
|
linkedRecordingSession: recordingSessionId
|
|
2603
2627
|
});
|
|
2628
|
+
} else {
|
|
2629
|
+
console.warn(
|
|
2630
|
+
"%c\u26A0\uFE0F User Flow Tracking: No session ID returned",
|
|
2631
|
+
"background: #f59e0b; color: #000; padding: 2px 6px; border-radius: 3px;"
|
|
2632
|
+
);
|
|
2604
2633
|
}
|
|
2605
2634
|
} catch (error) {
|
|
2635
|
+
console.error(
|
|
2636
|
+
"%c\u274C User Flow Tracking Failed",
|
|
2637
|
+
"background: #ef4444; color: #fff; padding: 2px 6px; border-radius: 3px;",
|
|
2638
|
+
error
|
|
2639
|
+
);
|
|
2606
2640
|
await this.log("warn", "Failed to initialize user flow tracking", {
|
|
2607
2641
|
error: error instanceof Error ? error.message : String(error)
|
|
2608
2642
|
});
|