@modelnex/sdk 0.5.48 → 0.5.49

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.js CHANGED
@@ -4572,16 +4572,23 @@ function useTourPlayback({
4572
4572
  claimedPlaybackOwnerKeyRef.current = null;
4573
4573
  }, []);
4574
4574
  const emitTourInit = (0, import_react12.useCallback)((socket, currentWebsiteId, profile) => {
4575
- if (!currentWebsiteId || !profile?.type) return;
4576
4575
  const persistedRunId = runIdRef.current ?? readPersistedActiveTourSession()?.runId ?? null;
4577
- const payload = {
4578
- websiteId: currentWebsiteId,
4579
- userId: profile.userId,
4580
- userType: profile.type
4581
- };
4576
+ const payload = {};
4577
+ if (currentWebsiteId) {
4578
+ payload.websiteId = currentWebsiteId;
4579
+ }
4580
+ if (profile?.userId) {
4581
+ payload.userId = profile.userId;
4582
+ }
4583
+ if (profile?.type) {
4584
+ payload.userType = profile.type;
4585
+ }
4582
4586
  if (typeof persistedRunId === "number") {
4583
4587
  payload.resumeRunId = persistedRunId;
4584
4588
  }
4589
+ if (!payload.resumeRunId && (!payload.websiteId || !payload.userType)) {
4590
+ return;
4591
+ }
4585
4592
  emitSocketEvent(socket, "tour:init", payload);
4586
4593
  }, []);
4587
4594
  (0, import_react12.useEffect)(() => {
package/dist/index.mjs CHANGED
@@ -3743,16 +3743,23 @@ function useTourPlayback({
3743
3743
  claimedPlaybackOwnerKeyRef.current = null;
3744
3744
  }, []);
3745
3745
  const emitTourInit = useCallback6((socket, currentWebsiteId, profile) => {
3746
- if (!currentWebsiteId || !profile?.type) return;
3747
3746
  const persistedRunId = runIdRef.current ?? readPersistedActiveTourSession()?.runId ?? null;
3748
- const payload = {
3749
- websiteId: currentWebsiteId,
3750
- userId: profile.userId,
3751
- userType: profile.type
3752
- };
3747
+ const payload = {};
3748
+ if (currentWebsiteId) {
3749
+ payload.websiteId = currentWebsiteId;
3750
+ }
3751
+ if (profile?.userId) {
3752
+ payload.userId = profile.userId;
3753
+ }
3754
+ if (profile?.type) {
3755
+ payload.userType = profile.type;
3756
+ }
3753
3757
  if (typeof persistedRunId === "number") {
3754
3758
  payload.resumeRunId = persistedRunId;
3755
3759
  }
3760
+ if (!payload.resumeRunId && (!payload.websiteId || !payload.userType)) {
3761
+ return;
3762
+ }
3756
3763
  emitSocketEvent(socket, "tour:init", payload);
3757
3764
  }, []);
3758
3765
  useEffect10(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelnex/sdk",
3
- "version": "0.5.48",
3
+ "version": "0.5.49",
4
4
  "description": "React SDK for natural language control of web apps via AI agents",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",