@modelnex/sdk 0.5.37 → 0.5.38
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 +39 -5
- package/dist/index.mjs +39 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -920,10 +920,7 @@ function useModelNexSocket({
|
|
|
920
920
|
contexts: serializeContexts(contextsRef.current),
|
|
921
921
|
documentation: documentationRef.current ?? void 0,
|
|
922
922
|
domSummary: captureDomSummary(tagsRef.current),
|
|
923
|
-
websiteId
|
|
924
|
-
// All tagged elements across every page — not just what's visible now.
|
|
925
|
-
// The server uses this to pre-search relevant elements for each user query.
|
|
926
|
-
allTaggedElements: tagsRef.current ? Array.from(tagsRef.current.values()) : void 0
|
|
923
|
+
websiteId
|
|
927
924
|
});
|
|
928
925
|
socket.on("connect", () => {
|
|
929
926
|
emitSdkDebugLog("[ModelNex SDK] Connected to agent server", {
|
|
@@ -3308,6 +3305,43 @@ function createTourSocketPool({
|
|
|
3308
3305
|
}
|
|
3309
3306
|
var tourSocketPool = createTourSocketPool();
|
|
3310
3307
|
|
|
3308
|
+
// src/utils/tourTransport.ts
|
|
3309
|
+
function compactCaptureEventForTransport(event) {
|
|
3310
|
+
return {
|
|
3311
|
+
id: event.id,
|
|
3312
|
+
type: event.type,
|
|
3313
|
+
order: event.order,
|
|
3314
|
+
timestamp: event.timestamp,
|
|
3315
|
+
url: event.url,
|
|
3316
|
+
label: event.label,
|
|
3317
|
+
tagName: event.tagName,
|
|
3318
|
+
testId: event.testId,
|
|
3319
|
+
fingerprint: event.fingerprint,
|
|
3320
|
+
textContaining: event.textContaining,
|
|
3321
|
+
fieldType: event.fieldType,
|
|
3322
|
+
valueSample: event.valueSample,
|
|
3323
|
+
note: event.note,
|
|
3324
|
+
stepTypeHint: event.stepTypeHint
|
|
3325
|
+
};
|
|
3326
|
+
}
|
|
3327
|
+
function compactTourForTransport(tour) {
|
|
3328
|
+
const capture = tour.capture;
|
|
3329
|
+
if (!capture || typeof capture !== "object") {
|
|
3330
|
+
return tour;
|
|
3331
|
+
}
|
|
3332
|
+
return {
|
|
3333
|
+
...tour,
|
|
3334
|
+
capture: {
|
|
3335
|
+
...capture.experienceType ? { experienceType: capture.experienceType } : {},
|
|
3336
|
+
...capture.onboardingHints ? { onboardingHints: capture.onboardingHints } : {},
|
|
3337
|
+
...capture.generation ? { generation: capture.generation } : {},
|
|
3338
|
+
...Array.isArray(capture.events) ? {
|
|
3339
|
+
events: capture.events.map((event) => compactCaptureEventForTransport(event))
|
|
3340
|
+
} : {}
|
|
3341
|
+
}
|
|
3342
|
+
};
|
|
3343
|
+
}
|
|
3344
|
+
|
|
3311
3345
|
// src/utils/tour-playback-guards.ts
|
|
3312
3346
|
var playbackOwners = /* @__PURE__ */ new Map();
|
|
3313
3347
|
function shouldExecuteTourCommandBatch(isPlaybackActive) {
|
|
@@ -4824,7 +4858,7 @@ function useTourPlayback({
|
|
|
4824
4858
|
emitSocketEvent(socketRef.current, "tour:request_start", {
|
|
4825
4859
|
tourId: tour.id,
|
|
4826
4860
|
previewRunId: previewRunIdRef.current,
|
|
4827
|
-
tourContext: tour
|
|
4861
|
+
tourContext: compactTourForTransport(tour)
|
|
4828
4862
|
});
|
|
4829
4863
|
}, [serverUrl, websiteId]);
|
|
4830
4864
|
(0, import_react12.useEffect)(() => {
|
package/dist/index.mjs
CHANGED
|
@@ -709,10 +709,7 @@ function useModelNexSocket({
|
|
|
709
709
|
contexts: serializeContexts(contextsRef.current),
|
|
710
710
|
documentation: documentationRef.current ?? void 0,
|
|
711
711
|
domSummary: captureDomSummary(tagsRef.current),
|
|
712
|
-
websiteId
|
|
713
|
-
// All tagged elements across every page — not just what's visible now.
|
|
714
|
-
// The server uses this to pre-search relevant elements for each user query.
|
|
715
|
-
allTaggedElements: tagsRef.current ? Array.from(tagsRef.current.values()) : void 0
|
|
712
|
+
websiteId
|
|
716
713
|
});
|
|
717
714
|
socket.on("connect", () => {
|
|
718
715
|
emitSdkDebugLog("[ModelNex SDK] Connected to agent server", {
|
|
@@ -3097,6 +3094,43 @@ function createTourSocketPool({
|
|
|
3097
3094
|
}
|
|
3098
3095
|
var tourSocketPool = createTourSocketPool();
|
|
3099
3096
|
|
|
3097
|
+
// src/utils/tourTransport.ts
|
|
3098
|
+
function compactCaptureEventForTransport(event) {
|
|
3099
|
+
return {
|
|
3100
|
+
id: event.id,
|
|
3101
|
+
type: event.type,
|
|
3102
|
+
order: event.order,
|
|
3103
|
+
timestamp: event.timestamp,
|
|
3104
|
+
url: event.url,
|
|
3105
|
+
label: event.label,
|
|
3106
|
+
tagName: event.tagName,
|
|
3107
|
+
testId: event.testId,
|
|
3108
|
+
fingerprint: event.fingerprint,
|
|
3109
|
+
textContaining: event.textContaining,
|
|
3110
|
+
fieldType: event.fieldType,
|
|
3111
|
+
valueSample: event.valueSample,
|
|
3112
|
+
note: event.note,
|
|
3113
|
+
stepTypeHint: event.stepTypeHint
|
|
3114
|
+
};
|
|
3115
|
+
}
|
|
3116
|
+
function compactTourForTransport(tour) {
|
|
3117
|
+
const capture = tour.capture;
|
|
3118
|
+
if (!capture || typeof capture !== "object") {
|
|
3119
|
+
return tour;
|
|
3120
|
+
}
|
|
3121
|
+
return {
|
|
3122
|
+
...tour,
|
|
3123
|
+
capture: {
|
|
3124
|
+
...capture.experienceType ? { experienceType: capture.experienceType } : {},
|
|
3125
|
+
...capture.onboardingHints ? { onboardingHints: capture.onboardingHints } : {},
|
|
3126
|
+
...capture.generation ? { generation: capture.generation } : {},
|
|
3127
|
+
...Array.isArray(capture.events) ? {
|
|
3128
|
+
events: capture.events.map((event) => compactCaptureEventForTransport(event))
|
|
3129
|
+
} : {}
|
|
3130
|
+
}
|
|
3131
|
+
};
|
|
3132
|
+
}
|
|
3133
|
+
|
|
3100
3134
|
// src/utils/tour-playback-guards.ts
|
|
3101
3135
|
var playbackOwners = /* @__PURE__ */ new Map();
|
|
3102
3136
|
function shouldExecuteTourCommandBatch(isPlaybackActive) {
|
|
@@ -4613,7 +4647,7 @@ function useTourPlayback({
|
|
|
4613
4647
|
emitSocketEvent(socketRef.current, "tour:request_start", {
|
|
4614
4648
|
tourId: tour.id,
|
|
4615
4649
|
previewRunId: previewRunIdRef.current,
|
|
4616
|
-
tourContext: tour
|
|
4650
|
+
tourContext: compactTourForTransport(tour)
|
|
4617
4651
|
});
|
|
4618
4652
|
}, [serverUrl, websiteId]);
|
|
4619
4653
|
useEffect11(() => {
|