@pluno/product-agent-web 0.1.134 → 0.1.135
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.d.ts +3 -0
- package/dist/product-agent-sdk.js +115 -102
- package/dist/product-agent-widget.js +1433 -1415
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const Ge = "pluno-product-agent-attachments";
|
|
2
2
|
const _t = "files";
|
|
3
3
|
async function Xe(e) {
|
|
4
|
-
const t = await
|
|
4
|
+
const t = await xt();
|
|
5
5
|
await Ve(t, "readwrite", (s) => s.put(e));
|
|
6
6
|
}
|
|
7
7
|
async function Ke(e, t) {
|
|
8
|
-
const s = await
|
|
8
|
+
const s = await xt();
|
|
9
9
|
await Nt(s, "readwrite", async (n) => {
|
|
10
10
|
const r = await Ot(
|
|
11
11
|
n.get(e)
|
|
@@ -17,13 +17,13 @@ async function Ke(e, t) {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
async function Je(e = 864e5) {
|
|
20
|
-
const t = await
|
|
20
|
+
const t = await xt(), s = Date.now() - e;
|
|
21
21
|
await Nt(t, "readwrite", async (n) => {
|
|
22
22
|
const r = n.index("lastUsedAt");
|
|
23
23
|
(await Ot(r.getAllKeys(IDBKeyRange.upperBound(s)))).forEach((o) => n.delete(o));
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function xt() {
|
|
27
27
|
return typeof indexedDB > "u" ? Promise.reject(new Error("Product Agent attachment storage is unavailable")) : new Promise((e, t) => {
|
|
28
28
|
const s = indexedDB.open(Ge, 1);
|
|
29
29
|
s.onupgradeneeded = () => {
|
|
@@ -88,7 +88,7 @@ function Qe(e, t) {
|
|
|
88
88
|
) : e;
|
|
89
89
|
}
|
|
90
90
|
const It = "pluno.productAgent.transportId", ts = "pluno.productAgent.transportIdentity", wt = "pluno.productAgent.transportIdentity.event", es = 50, ss = globalThis.setTimeout.bind(globalThis);
|
|
91
|
-
let
|
|
91
|
+
let W = null;
|
|
92
92
|
const tt = /* @__PURE__ */ new Set(), At = /* @__PURE__ */ new Map();
|
|
93
93
|
async function ns(e = we()) {
|
|
94
94
|
const t = e.randomUUID(), s = e.storage.getItem(It);
|
|
@@ -127,13 +127,13 @@ async function ns(e = we()) {
|
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
async function rs() {
|
|
130
|
-
|
|
130
|
+
W || (W = ns(we()), W.then((n) => {
|
|
131
131
|
const r = (i) => {
|
|
132
|
-
i.persisted || (n.release(),
|
|
132
|
+
i.persisted || (n.release(), W = null, tt.clear(), window.removeEventListener("pagehide", r));
|
|
133
133
|
};
|
|
134
134
|
window.addEventListener("pagehide", r);
|
|
135
135
|
}));
|
|
136
|
-
const e = await
|
|
136
|
+
const e = await W, t = is();
|
|
137
137
|
tt.add(t);
|
|
138
138
|
let s = !1;
|
|
139
139
|
return {
|
|
@@ -222,7 +222,7 @@ function Ds(e, t = Math.random) {
|
|
|
222
222
|
const s = Math.min(ee, ws * 2 ** e), n = 1 - se + t() * se * 2;
|
|
223
223
|
return Math.min(ee, Math.round(s * n));
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function vs(e, t, s) {
|
|
226
226
|
return new Promise((n, r) => {
|
|
227
227
|
const i = setTimeout(() => r(new Error(s)), t);
|
|
228
228
|
e.then(
|
|
@@ -257,7 +257,7 @@ class Ee {
|
|
|
257
257
|
}), this.queuedClientEvents = ir(
|
|
258
258
|
tr(t.clientId),
|
|
259
259
|
sr(t.clientId)
|
|
260
|
-
),
|
|
260
|
+
), $(t.clientId, this.queuedClientEvents);
|
|
261
261
|
}
|
|
262
262
|
options;
|
|
263
263
|
listeners = {};
|
|
@@ -275,6 +275,7 @@ class Ee {
|
|
|
275
275
|
networkBatchTimer = null;
|
|
276
276
|
queuedNetworkEvents = [];
|
|
277
277
|
queuedClientEvents = [];
|
|
278
|
+
pendingWarmupEvent = null;
|
|
278
279
|
pendingSessionHistoryRequests = /* @__PURE__ */ new Map();
|
|
279
280
|
transportIdentity;
|
|
280
281
|
retryAttemptsByClientMessageId = {};
|
|
@@ -364,7 +365,7 @@ class Ee {
|
|
|
364
365
|
lastError: null
|
|
365
366
|
});
|
|
366
367
|
try {
|
|
367
|
-
if (this.token = this.options.token ?? (this.options.tokenProvider ? await
|
|
368
|
+
if (this.token = this.options.token ?? (this.options.tokenProvider ? await vs(this.options.tokenProvider(), ys, "Pluno token provider timed out") : null), t !== this.connectionAttemptId || this.state.status === "closed")
|
|
368
369
|
return;
|
|
369
370
|
if (!this.token && !this.options.webSocketFactory)
|
|
370
371
|
throw new Error("Pluno requires a token or tokenProvider");
|
|
@@ -415,19 +416,28 @@ class Ee {
|
|
|
415
416
|
}
|
|
416
417
|
}
|
|
417
418
|
disconnect() {
|
|
418
|
-
this.connectionAttemptId += 1, this.setState({ status: "closed", isThinking: !1 }), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.clearStarterPromptUrlRefreshTimer(), this.clearRetryTimers(), this.clearThinkingWatchdog(), this.rejectPendingSessionHistoryRequests("Pluno disconnected."), this.reconnectTimer !== null && (window.clearTimeout(this.reconnectTimer), this.reconnectTimer = null), this.queuedClientEvents = [], this.socket?.close(), this.socket = null;
|
|
419
|
+
this.connectionAttemptId += 1, this.setState({ status: "closed", isThinking: !1 }), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.clearStarterPromptUrlRefreshTimer(), this.clearRetryTimers(), this.clearThinkingWatchdog(), this.rejectPendingSessionHistoryRequests("Pluno disconnected."), this.reconnectTimer !== null && (window.clearTimeout(this.reconnectTimer), this.reconnectTimer = null), this.queuedClientEvents = [], this.pendingWarmupEvent = null, this.socket?.close(), this.socket = null;
|
|
419
420
|
}
|
|
420
421
|
destroy() {
|
|
421
422
|
this.disconnect(), this.locationChangeCleanup?.(), this.locationChangeCleanup = null, this.cleanupSessionUserFilesApi(), this.pageLifecycleCleanup?.(), this.pageLifecycleCleanup = null, this.activeBrowserToolCalls.clear(), or(this.options.clientId), this.transportIdentity.release(), this.networkCaptureCleanup?.(), this.networkCaptureCleanup = null, this.networkBatchTimer !== null && (window.clearTimeout(this.networkBatchTimer), this.networkBatchTimer = null), this.queuedNetworkEvents = [];
|
|
422
423
|
for (const t of Object.values(this.listeners))
|
|
423
424
|
t?.clear();
|
|
424
425
|
}
|
|
426
|
+
warmup(t = "panel_open") {
|
|
427
|
+
const s = {
|
|
428
|
+
type: "runtime.warmup",
|
|
429
|
+
reason: t,
|
|
430
|
+
entrySurface: this.options.entrySurface,
|
|
431
|
+
page: k()
|
|
432
|
+
};
|
|
433
|
+
this.sendNow(s) || (this.pendingWarmupEvent = s);
|
|
434
|
+
}
|
|
425
435
|
async sendMessage(t, s = {}) {
|
|
426
436
|
const n = t.trim(), r = s.attachments ?? [];
|
|
427
|
-
let i = r.map(
|
|
437
|
+
let i = r.map($t);
|
|
428
438
|
if (!n && i.length === 0)
|
|
429
439
|
return null;
|
|
430
|
-
const o =
|
|
440
|
+
const o = k(), a = s.clientMessageId ?? kt(), c = {
|
|
431
441
|
id: `local-${a}`,
|
|
432
442
|
role: "user",
|
|
433
443
|
content: n,
|
|
@@ -508,7 +518,7 @@ class Ee {
|
|
|
508
518
|
mimeType: n.mimeType,
|
|
509
519
|
sizeBytes: n.sizeBytes,
|
|
510
520
|
blob: t,
|
|
511
|
-
origin:
|
|
521
|
+
origin: k().origin,
|
|
512
522
|
sessionId: this.state.sessionId ?? void 0,
|
|
513
523
|
createdAt: r,
|
|
514
524
|
lastUsedAt: r
|
|
@@ -539,7 +549,7 @@ class Ee {
|
|
|
539
549
|
name: t.name || "attachment",
|
|
540
550
|
mimeType: r,
|
|
541
551
|
sizeBytes: t.size,
|
|
542
|
-
page:
|
|
552
|
+
page: k(),
|
|
543
553
|
model: this.options.model,
|
|
544
554
|
metadata: ie(this.options.metadata),
|
|
545
555
|
entrySurface: this.options.entrySurface
|
|
@@ -627,7 +637,7 @@ class Ee {
|
|
|
627
637
|
!this.options.keepRunsActiveOnSessionNavigation && s && this.state.sessionId && this.state.isThinking && this.send({ type: "run.stop", sessionId: this.state.sessionId, reason: "new_chat" }), this.cleanupSessionUserFilesApi(), this.queuedClientEvents = this.queuedClientEvents.filter((n) => n.type !== "chat.user_message"), this.clearThinkingWatchdog(), this.retryableClientMessageId = null, this.lastUserMessagePageUrl = null, this.retryAttemptsByClientMessageId = {}, this.thinkingWatchdogResyncAttemptsByClientMessageId = {}, s && this.send({
|
|
628
638
|
type: "session.reset",
|
|
629
639
|
sessionId: this.state.sessionId ?? void 0,
|
|
630
|
-
page:
|
|
640
|
+
page: k()
|
|
631
641
|
}), this.setState({
|
|
632
642
|
sessionId: null,
|
|
633
643
|
starterPrompts: [...this.state.starterPrompts],
|
|
@@ -650,7 +660,7 @@ class Ee {
|
|
|
650
660
|
}), r = {
|
|
651
661
|
type: "sessions.list",
|
|
652
662
|
requestId: s,
|
|
653
|
-
page:
|
|
663
|
+
page: k(),
|
|
654
664
|
...t.cursor ? { cursor: t.cursor } : {},
|
|
655
665
|
...t.limit ? { limit: t.limit } : {}
|
|
656
666
|
};
|
|
@@ -674,11 +684,11 @@ class Ee {
|
|
|
674
684
|
}), this.send({
|
|
675
685
|
type: "session.load",
|
|
676
686
|
sessionId: t,
|
|
677
|
-
page:
|
|
687
|
+
page: k()
|
|
678
688
|
});
|
|
679
689
|
}
|
|
680
690
|
send(t) {
|
|
681
|
-
this.sendNow(
|
|
691
|
+
this.sendNow(R(t)) || (this.queuedClientEvents.push(t), $(this.options.clientId, this.queuedClientEvents), this.setState({ status: "reconnecting" }), this.scheduleReconnect());
|
|
682
692
|
}
|
|
683
693
|
async getUploadToken() {
|
|
684
694
|
const t = this.options.token ?? await this.options.tokenProvider?.() ?? this.token ?? null;
|
|
@@ -706,7 +716,7 @@ class Ee {
|
|
|
706
716
|
this.transientStarterPromptsRequestInFlight = !0, this.transientStarterPromptsRequestAttempted = !0, this.setState({ starterPromptsLoading: !0 });
|
|
707
717
|
const t = nn();
|
|
708
718
|
this.sendNow(
|
|
709
|
-
|
|
719
|
+
R({
|
|
710
720
|
type: "starter_prompts.page_context",
|
|
711
721
|
pageUrl: t.pageUrl,
|
|
712
722
|
pageTitle: t.pageTitle,
|
|
@@ -736,16 +746,19 @@ class Ee {
|
|
|
736
746
|
if (this.socket?.readyState !== WebSocket.OPEN || this.queuedClientEvents.length === 0)
|
|
737
747
|
return;
|
|
738
748
|
const t = this.queuedClientEvents.splice(0, this.queuedClientEvents.length);
|
|
739
|
-
|
|
749
|
+
$(this.options.clientId, this.queuedClientEvents);
|
|
740
750
|
for (let s = 0; s < t.length; s += 1) {
|
|
741
751
|
const n = t[s];
|
|
742
|
-
if (!this.sendNow(
|
|
743
|
-
this.queuedClientEvents.unshift(n, ...t.slice(s + 1)),
|
|
752
|
+
if (!this.sendNow(R(n))) {
|
|
753
|
+
this.queuedClientEvents.unshift(n, ...t.slice(s + 1)), $(this.options.clientId, this.queuedClientEvents);
|
|
744
754
|
return;
|
|
745
755
|
}
|
|
746
|
-
|
|
756
|
+
$(this.options.clientId, this.queuedClientEvents);
|
|
747
757
|
}
|
|
748
758
|
}
|
|
759
|
+
flushPendingWarmupEvent() {
|
|
760
|
+
!this.pendingWarmupEvent || !this.sendNow(this.pendingWarmupEvent) || (this.pendingWarmupEvent = null);
|
|
761
|
+
}
|
|
749
762
|
handleServerEvent(t) {
|
|
750
763
|
if (t.type === "run.ack") {
|
|
751
764
|
this.handleRunAck(t);
|
|
@@ -756,7 +769,7 @@ class Ee {
|
|
|
756
769
|
return;
|
|
757
770
|
}
|
|
758
771
|
if (Os(t) && this.markThinkingProgress(), t.type === "auth.ok") {
|
|
759
|
-
this.clearSocketAuthTimer(), this.reconnectAttempts = 0, this.flushQueuedClientEvents(), this.startHeartbeat();
|
|
772
|
+
this.clearSocketAuthTimer(), this.reconnectAttempts = 0, this.flushQueuedClientEvents(), this.flushPendingWarmupEvent(), this.startHeartbeat();
|
|
760
773
|
const s = gn(t), n = Object.prototype.hasOwnProperty.call(t, "appearance");
|
|
761
774
|
A("web-sdk.agent", "Received auth.ok appearance", {
|
|
762
775
|
hasAppearance: n,
|
|
@@ -770,7 +783,7 @@ class Ee {
|
|
|
770
783
|
(i || this.state.starterPrompts.length === 0) && (a.starterPrompts = r, a.starterPromptsLoading = r.length > 0 ? !1 : o), i && r.length > 0 && (this.transientStarterPromptsRequestInFlight = !1, this.transientStarterPromptsRequestAttempted = !0), (n || s) && (a.appearance = s), this.setState(a), i && r.length === 0 && !o && !an() && this.requestTransientStarterPrompts(), this.state.sessionId && this.send({
|
|
771
784
|
type: "page.upsert",
|
|
772
785
|
sessionId: this.state.sessionId,
|
|
773
|
-
page:
|
|
786
|
+
page: k(),
|
|
774
787
|
model: this.options.model
|
|
775
788
|
});
|
|
776
789
|
return;
|
|
@@ -787,9 +800,9 @@ class Ee {
|
|
|
787
800
|
t.assistantDraft
|
|
788
801
|
), r = n !== void 0;
|
|
789
802
|
this.rememberUserMessageClientMessageIds(s);
|
|
790
|
-
const i =
|
|
803
|
+
const i = Wn(s);
|
|
791
804
|
if (i) {
|
|
792
|
-
const f =
|
|
805
|
+
const f = $n(s, i);
|
|
793
806
|
this.retryAttemptsByClientMessageId[i] = Math.max(
|
|
794
807
|
this.retryAttemptsByClientMessageId[i] ?? 0,
|
|
795
808
|
f
|
|
@@ -798,7 +811,7 @@ class Ee {
|
|
|
798
811
|
const o = s.filter((f) => {
|
|
799
812
|
const T = L(f);
|
|
800
813
|
return !he(T) && (!i || !Pt(T));
|
|
801
|
-
}), a =
|
|
814
|
+
}), a = xn(
|
|
802
815
|
this.state.messages,
|
|
803
816
|
An(o, this.options.backendUrl)
|
|
804
817
|
), c = de(a), l = !r && s.some(
|
|
@@ -868,7 +881,7 @@ class Ee {
|
|
|
868
881
|
const s = L(t.item);
|
|
869
882
|
if (Pt(s)) {
|
|
870
883
|
typeof s?.runId == "string" && this.retryableFailureRunIdsAwaitingDone.add(s.runId);
|
|
871
|
-
const r = E(t.item, "sessionId") ?? this.state.sessionId, i = s ?
|
|
884
|
+
const r = E(t.item, "sessionId") ?? this.state.sessionId, i = s ? x(s) : null, o = i ? this.clientMessageIdsByUserMessageItemId.get(i) : null, a = typeof s?.clientMessageId == "string" ? s.clientMessageId : o ?? (i ? null : this.activeClientMessageId ?? this.latestRecoverableClientMessageId);
|
|
872
885
|
if (r && a) {
|
|
873
886
|
this.retryAfterInterruptedRun(r, a);
|
|
874
887
|
return;
|
|
@@ -1172,7 +1185,7 @@ class Ee {
|
|
|
1172
1185
|
this.state.sessionId ? this.send({
|
|
1173
1186
|
type: "page.upsert",
|
|
1174
1187
|
sessionId: this.state.sessionId,
|
|
1175
|
-
page:
|
|
1188
|
+
page: k(),
|
|
1176
1189
|
model: this.options.model
|
|
1177
1190
|
}) : (!this.socket || this.socket.readyState !== WebSocket.OPEN) && (this.setState({ status: "reconnecting", lastError: null }), this.scheduleReconnect());
|
|
1178
1191
|
}
|
|
@@ -1190,8 +1203,8 @@ class Ee {
|
|
|
1190
1203
|
callId: n,
|
|
1191
1204
|
toolName: r,
|
|
1192
1205
|
summary: i,
|
|
1193
|
-
rawInput:
|
|
1194
|
-
rawOutput:
|
|
1206
|
+
rawInput: R(o),
|
|
1207
|
+
rawOutput: R({
|
|
1195
1208
|
ok: !1,
|
|
1196
1209
|
toolName: r,
|
|
1197
1210
|
error: `Unsupported browser tool: ${r}`
|
|
@@ -1206,7 +1219,7 @@ class Ee {
|
|
|
1206
1219
|
callId: n,
|
|
1207
1220
|
toolName: r,
|
|
1208
1221
|
summary: i,
|
|
1209
|
-
rawInput:
|
|
1222
|
+
rawInput: R(o),
|
|
1210
1223
|
rawOutput: {
|
|
1211
1224
|
ok: !1,
|
|
1212
1225
|
toolName: r,
|
|
@@ -1223,7 +1236,7 @@ class Ee {
|
|
|
1223
1236
|
callId: n,
|
|
1224
1237
|
toolName: r,
|
|
1225
1238
|
summary: i,
|
|
1226
|
-
rawInput:
|
|
1239
|
+
rawInput: R(o),
|
|
1227
1240
|
rawOutput: null
|
|
1228
1241
|
},
|
|
1229
1242
|
startedAtMs: Date.now(),
|
|
@@ -1245,8 +1258,8 @@ class Ee {
|
|
|
1245
1258
|
callId: n,
|
|
1246
1259
|
toolName: r,
|
|
1247
1260
|
summary: o.summary,
|
|
1248
|
-
rawInput:
|
|
1249
|
-
rawOutput:
|
|
1261
|
+
rawInput: R(o),
|
|
1262
|
+
rawOutput: R(yn(d, l))
|
|
1250
1263
|
}), er(this.options.clientId, this.activeBrowserToolCalls.values());
|
|
1251
1264
|
}
|
|
1252
1265
|
setToolMessageLoading(t, s) {
|
|
@@ -1261,7 +1274,7 @@ class Ee {
|
|
|
1261
1274
|
if (this.pageLifecycleCleanup)
|
|
1262
1275
|
return;
|
|
1263
1276
|
const t = () => {
|
|
1264
|
-
|
|
1277
|
+
ve(this.options.clientId, this.activeBrowserToolCalls.values());
|
|
1265
1278
|
};
|
|
1266
1279
|
window.addEventListener("pagehide", t), window.addEventListener("beforeunload", t), this.pageLifecycleCleanup = () => {
|
|
1267
1280
|
window.removeEventListener("pagehide", t), window.removeEventListener("beforeunload", t);
|
|
@@ -1282,7 +1295,7 @@ class Ee {
|
|
|
1282
1295
|
return t.ok === !1 ? Tn(t) : null;
|
|
1283
1296
|
}
|
|
1284
1297
|
enableNetworkCapture() {
|
|
1285
|
-
this.networkCaptureCleanup || (this.networkCaptureCleanup =
|
|
1298
|
+
this.networkCaptureCleanup || (this.networkCaptureCleanup = xs((t) => {
|
|
1286
1299
|
mr(t.url, this.options.backendUrl) || this.enqueueNetworkEvent(t);
|
|
1287
1300
|
}));
|
|
1288
1301
|
}
|
|
@@ -1293,7 +1306,7 @@ class Ee {
|
|
|
1293
1306
|
s.length === 0 || this.socket?.readyState !== WebSocket.OPEN || this.sendNow({
|
|
1294
1307
|
type: "network.batch",
|
|
1295
1308
|
sessionId: this.state.sessionId ?? void 0,
|
|
1296
|
-
page:
|
|
1309
|
+
page: k(),
|
|
1297
1310
|
events: s
|
|
1298
1311
|
});
|
|
1299
1312
|
}, bs)));
|
|
@@ -1351,7 +1364,7 @@ class Ee {
|
|
|
1351
1364
|
}
|
|
1352
1365
|
}
|
|
1353
1366
|
const Et = /* @__PURE__ */ new WeakMap();
|
|
1354
|
-
function
|
|
1367
|
+
function xs(e) {
|
|
1355
1368
|
const t = window.__plunoProductAgentNetworkCapture ?? Ns();
|
|
1356
1369
|
return t.subscribers.add(e), () => {
|
|
1357
1370
|
t.subscribers.delete(e), !(t.subscribers.size > 0) && (t.destroy(), window.__plunoProductAgentNetworkCapture === t && delete window.__plunoProductAgentNetworkCapture);
|
|
@@ -1374,11 +1387,11 @@ function Ns() {
|
|
|
1374
1387
|
throw T;
|
|
1375
1388
|
}
|
|
1376
1389
|
try {
|
|
1377
|
-
const T = m instanceof Request ? m : null,
|
|
1378
|
-
if (!N(
|
|
1390
|
+
const T = m instanceof Request ? m : null, v = dr(m, T), I = Oe(u?.headers ?? T?.headers);
|
|
1391
|
+
if (!N(v, I, u?.body)) {
|
|
1379
1392
|
const H = {
|
|
1380
1393
|
requestId: Rt("fetch"),
|
|
1381
|
-
url: C(
|
|
1394
|
+
url: C(v, St),
|
|
1382
1395
|
method: (u?.method ?? T?.method ?? "GET").toUpperCase(),
|
|
1383
1396
|
requestHeaders: I,
|
|
1384
1397
|
requestBody: ye(u?.body),
|
|
@@ -1386,19 +1399,19 @@ function Ns() {
|
|
|
1386
1399
|
startedAt: new Date(h).toISOString()
|
|
1387
1400
|
};
|
|
1388
1401
|
f.then(
|
|
1389
|
-
(
|
|
1390
|
-
hr(
|
|
1402
|
+
(_) => {
|
|
1403
|
+
hr(_, H, h, t).catch(() => {
|
|
1391
1404
|
t({
|
|
1392
1405
|
...H,
|
|
1393
|
-
responseStatus:
|
|
1406
|
+
responseStatus: _.status,
|
|
1394
1407
|
durationMs: Date.now() - h
|
|
1395
1408
|
});
|
|
1396
1409
|
});
|
|
1397
1410
|
},
|
|
1398
|
-
(
|
|
1411
|
+
(_) => {
|
|
1399
1412
|
t({
|
|
1400
1413
|
...H,
|
|
1401
|
-
errorText: C(
|
|
1414
|
+
errorText: C(_ instanceof Error ? _.message : String(_)),
|
|
1402
1415
|
durationMs: Date.now() - h
|
|
1403
1416
|
});
|
|
1404
1417
|
}
|
|
@@ -1408,7 +1421,7 @@ function Ns() {
|
|
|
1408
1421
|
}
|
|
1409
1422
|
return f;
|
|
1410
1423
|
}, a = function(m, u, h, f, T) {
|
|
1411
|
-
const
|
|
1424
|
+
const v = n.call(this, m, u, h ?? !0, f ?? void 0, T ?? void 0), I = typeof u == "string" ? u : u.toString();
|
|
1412
1425
|
return Et.set(this, {
|
|
1413
1426
|
requestId: Rt("xhr"),
|
|
1414
1427
|
method: String(m ?? "GET").toUpperCase(),
|
|
@@ -1417,7 +1430,7 @@ function Ns() {
|
|
|
1417
1430
|
startedAtMs: Date.now(),
|
|
1418
1431
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1419
1432
|
excluded: N(I)
|
|
1420
|
-
}),
|
|
1433
|
+
}), v;
|
|
1421
1434
|
}, c = function(m, u) {
|
|
1422
1435
|
const h = r.call(this, m, u), f = Et.get(this);
|
|
1423
1436
|
return f && Object.keys(f.requestHeaders).length < Bt && (f.requestHeaders[m] = jt(m, u), f.excluded = f.excluded || N(f.url, f.requestHeaders)), h;
|
|
@@ -1552,7 +1565,7 @@ function qs(e) {
|
|
|
1552
1565
|
}
|
|
1553
1566
|
function Hs(e, t = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map()) {
|
|
1554
1567
|
const n = [
|
|
1555
|
-
|
|
1568
|
+
Ws(),
|
|
1556
1569
|
Fs()
|
|
1557
1570
|
].filter((r) => typeof r == "function");
|
|
1558
1571
|
return () => {
|
|
@@ -1563,12 +1576,12 @@ function Hs(e, t = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map()) {
|
|
|
1563
1576
|
function Fs() {
|
|
1564
1577
|
return Ie(globalThis, "getPageSnapshot", async () => qt());
|
|
1565
1578
|
}
|
|
1566
|
-
function
|
|
1579
|
+
function Ws() {
|
|
1567
1580
|
return Ie(globalThis, "pageImages", {
|
|
1568
|
-
inspectImage: async (t, s) => await
|
|
1581
|
+
inspectImage: async (t, s) => await $s(t, s)
|
|
1569
1582
|
});
|
|
1570
1583
|
}
|
|
1571
|
-
async function
|
|
1584
|
+
async function $s(e, t = {}) {
|
|
1572
1585
|
const s = Xs(t.name), n = await js(e);
|
|
1573
1586
|
return n.ok ? n.sizeBytes > 8 * 1024 * 1024 ? {
|
|
1574
1587
|
type: "pluno.pageImages.inspectImage",
|
|
@@ -1773,7 +1786,7 @@ function sn(e) {
|
|
|
1773
1786
|
const t = new URL("/api/product-agent/embed/ws", e);
|
|
1774
1787
|
return t.protocol = t.protocol === "https:" ? "wss:" : "ws:", t.toString();
|
|
1775
1788
|
}
|
|
1776
|
-
function
|
|
1789
|
+
function k() {
|
|
1777
1790
|
const e = _e();
|
|
1778
1791
|
return {
|
|
1779
1792
|
url: location.href,
|
|
@@ -1951,7 +1964,7 @@ function ln(e, t) {
|
|
|
1951
1964
|
const U = I.getAttribute("data-testid") || I.getAttribute("data-test") || I.getAttribute("data-qa") || I.getAttribute("data-cy") || "";
|
|
1952
1965
|
return `${I.tagName.toLowerCase()}|${u(I)}|${U}`;
|
|
1953
1966
|
}, f = (I, U, H) => {
|
|
1954
|
-
const
|
|
1967
|
+
const _ = (S, lt) => {
|
|
1955
1968
|
const b = S.tagName.toLowerCase(), ut = window.getComputedStyle(S), z = d.has(S);
|
|
1956
1969
|
if (m >= 1e3 && !z || H.has(S) || i.has(b) || S.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") || ut.display === "none" || ut.visibility === "hidden")
|
|
1957
1970
|
return { lines: [], hasUsefulContent: !1, textPreview: "", containsTextElement: !1 };
|
|
@@ -1973,13 +1986,13 @@ function ln(e, t) {
|
|
|
1973
1986
|
Kt.has(w) || (pt.push([`… ${ht.get(w) ?? 0} similar siblings omitted`]), Kt.add(w));
|
|
1974
1987
|
continue;
|
|
1975
1988
|
}
|
|
1976
|
-
const Qt =
|
|
1989
|
+
const Qt = _(g, lt);
|
|
1977
1990
|
Jt.push(Qt), pt.push(Qt.lines);
|
|
1978
1991
|
}
|
|
1979
1992
|
const ft = [];
|
|
1980
1993
|
if (S.shadowRoot)
|
|
1981
1994
|
for (const g of Array.from(S.shadowRoot.children))
|
|
1982
|
-
g instanceof HTMLElement && ft.push(
|
|
1995
|
+
g instanceof HTMLElement && ft.push(_(g, lt + 1));
|
|
1983
1996
|
const K = [...Jt, ...ft], gt = G.length > 0 || je || K.some((g) => g.hasUsefulContent), Vt = B(
|
|
1984
1997
|
[G, ...K.map((g) => g.textPreview)].filter(Boolean).join(" ")
|
|
1985
1998
|
).slice(0, 180), ze = S.hasAttribute("contenteditable") && (G.length > 0 || !S.querySelector("[contenteditable]")), Yt = l.some((g) => S.hasAttribute(g)) || !!zt || ze, mt = (S.getClientRects().length > 0 || ut.display === "contents") && (s.has(b) || Yt || z) && (gt || z) && (!r.has(b) || gt || Yt || z), yt = mt ? 1 : 0, F = [];
|
|
@@ -2007,11 +2020,11 @@ function ln(e, t) {
|
|
|
2007
2020
|
containsTextElement: n.has(b) || K.some((g) => g.containsTextElement)
|
|
2008
2021
|
};
|
|
2009
2022
|
};
|
|
2010
|
-
return [`--- ${U} ---`, ...
|
|
2023
|
+
return [`--- ${U} ---`, ..._(I, 0).lines].join(`
|
|
2011
2024
|
`);
|
|
2012
|
-
}, T = [],
|
|
2013
|
-
|
|
2014
|
-
${JSON.stringify(
|
|
2025
|
+
}, T = [], v = B(window.getSelection()?.toString() ?? "");
|
|
2026
|
+
v && T.push(`--- selected text ---
|
|
2027
|
+
${JSON.stringify(v)}`), p.length > 0 && T.push(dn(p, s, c, o));
|
|
2015
2028
|
for (const I of e.slice(0, 3))
|
|
2016
2029
|
T.push(f(I, "active overlay DOM", /* @__PURE__ */ new Set()));
|
|
2017
2030
|
if (t && T.push(f(t, "main DOM", /* @__PURE__ */ new Set())), document.body) {
|
|
@@ -2226,7 +2239,7 @@ function wn(e) {
|
|
|
2226
2239
|
}
|
|
2227
2240
|
function An(e, t) {
|
|
2228
2241
|
return Array.isArray(e) ? Dt(
|
|
2229
|
-
|
|
2242
|
+
vt(
|
|
2230
2243
|
e.map((s) => Me(s, t)).filter((s) => s !== null)
|
|
2231
2244
|
)
|
|
2232
2245
|
) : [];
|
|
@@ -2271,9 +2284,9 @@ function Me(e, t) {
|
|
|
2271
2284
|
t
|
|
2272
2285
|
),
|
|
2273
2286
|
createdAt: typeof s.createdAt == "string" ? s.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
2274
|
-
respondsToUserMessageId:
|
|
2287
|
+
respondsToUserMessageId: x(r) ?? void 0,
|
|
2275
2288
|
...M(r) ? { runId: M(r) } : {},
|
|
2276
|
-
attachments:
|
|
2289
|
+
attachments: xe(r.attachments, t)
|
|
2277
2290
|
};
|
|
2278
2291
|
return i === "assistant" && typeof r.id == "string" && Object.defineProperty(o, "assistantDraftItemId", {
|
|
2279
2292
|
value: r.id,
|
|
@@ -2290,7 +2303,7 @@ function Me(e, t) {
|
|
|
2290
2303
|
role: "tool",
|
|
2291
2304
|
content: `Connect ${i.appName} to continue`,
|
|
2292
2305
|
createdAt: typeof s.createdAt == "string" ? s.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
2293
|
-
respondsToUserMessageId:
|
|
2306
|
+
respondsToUserMessageId: x(r) ?? void 0,
|
|
2294
2307
|
...M(r) ? { runId: M(r) } : {},
|
|
2295
2308
|
dataType: "function_call_output",
|
|
2296
2309
|
toolName: "authenticate_pipedream_app",
|
|
@@ -2303,7 +2316,7 @@ function Me(e, t) {
|
|
|
2303
2316
|
role: "tool",
|
|
2304
2317
|
content: r.type === "mcp_call" ? En(r) : Rn(r),
|
|
2305
2318
|
createdAt: typeof s.createdAt == "string" ? s.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
2306
|
-
respondsToUserMessageId:
|
|
2319
|
+
respondsToUserMessageId: x(r) ?? void 0,
|
|
2307
2320
|
...M(r) ? { runId: M(r) } : {},
|
|
2308
2321
|
dataType: String(r.type),
|
|
2309
2322
|
toolName: r.type === "tab_lifecycle_decision" ? "tab_lifecycle_decision" : typeof r.name == "string" ? r.name : void 0,
|
|
@@ -2314,7 +2327,7 @@ function Me(e, t) {
|
|
|
2314
2327
|
role: "system",
|
|
2315
2328
|
content: kn(r),
|
|
2316
2329
|
createdAt: typeof s.createdAt == "string" ? s.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
2317
|
-
respondsToUserMessageId:
|
|
2330
|
+
respondsToUserMessageId: x(r) ?? void 0,
|
|
2318
2331
|
...M(r) ? { runId: M(r) } : {},
|
|
2319
2332
|
dataType: String(r.type),
|
|
2320
2333
|
loading: r.type === "run_status" && (r.status === "running" || r.status === "retrying"),
|
|
@@ -2405,16 +2418,16 @@ function Cn(e) {
|
|
|
2405
2418
|
}).filter(Boolean).join("") : "";
|
|
2406
2419
|
}
|
|
2407
2420
|
function Ce(e, t) {
|
|
2408
|
-
const s = Pe(e, t), n =
|
|
2421
|
+
const s = Pe(e, t), n = vn(
|
|
2409
2422
|
Ln(e, t),
|
|
2410
2423
|
s
|
|
2411
2424
|
), r = n.findIndex((o) => o.id === s.id);
|
|
2412
2425
|
if (r === -1)
|
|
2413
2426
|
return Dt(
|
|
2414
|
-
|
|
2427
|
+
vt([...n, s])
|
|
2415
2428
|
);
|
|
2416
2429
|
const i = [...n];
|
|
2417
|
-
return i[r] = s, Dt(
|
|
2430
|
+
return i[r] = s, Dt(vt(i));
|
|
2418
2431
|
}
|
|
2419
2432
|
function Pn(e, t) {
|
|
2420
2433
|
const s = e.findIndex(
|
|
@@ -2451,7 +2464,7 @@ function Dn(e) {
|
|
|
2451
2464
|
loading: !0
|
|
2452
2465
|
};
|
|
2453
2466
|
}
|
|
2454
|
-
function
|
|
2467
|
+
function vn(e, t) {
|
|
2455
2468
|
if (t.id.startsWith("transient-activity:"))
|
|
2456
2469
|
return e;
|
|
2457
2470
|
const s = t.toolName === "tab_lifecycle";
|
|
@@ -2459,7 +2472,7 @@ function xn(e, t) {
|
|
|
2459
2472
|
(n) => !(n.id === `transient-activity:${t.callId}` && n.callId === t.callId || s && n.id.startsWith("transient-activity:") && n.toolName === "browser_tabs" && n.runId === t.runId && n.respondsToUserMessageId === t.respondsToUserMessageId)
|
|
2460
2473
|
);
|
|
2461
2474
|
}
|
|
2462
|
-
function
|
|
2475
|
+
function xn(e, t) {
|
|
2463
2476
|
const s = t.map(
|
|
2464
2477
|
(n) => Pe(e, n)
|
|
2465
2478
|
);
|
|
@@ -2602,7 +2615,7 @@ function Ut(e) {
|
|
|
2602
2615
|
const r = n.clientMessageId;
|
|
2603
2616
|
return typeof r == "string" ? r : null;
|
|
2604
2617
|
}
|
|
2605
|
-
function
|
|
2618
|
+
function Wn(e) {
|
|
2606
2619
|
const t = ot(e);
|
|
2607
2620
|
if (t === null)
|
|
2608
2621
|
return null;
|
|
@@ -2626,13 +2639,13 @@ function $n(e) {
|
|
|
2626
2639
|
function pe(e, t) {
|
|
2627
2640
|
if (typeof t.clientMessageId == "string")
|
|
2628
2641
|
return t.clientMessageId;
|
|
2629
|
-
const s =
|
|
2642
|
+
const s = x(t);
|
|
2630
2643
|
if (!s)
|
|
2631
2644
|
return null;
|
|
2632
2645
|
const n = e.find((i) => E(i, "id") === s), r = L(n);
|
|
2633
2646
|
return r?.type === "message" && r.role === "user" && typeof r.clientMessageId == "string" ? r.clientMessageId : null;
|
|
2634
2647
|
}
|
|
2635
|
-
function
|
|
2648
|
+
function $n(e, t) {
|
|
2636
2649
|
let s = 0;
|
|
2637
2650
|
for (const n of e) {
|
|
2638
2651
|
if (!n || typeof n != "object")
|
|
@@ -2649,7 +2662,7 @@ function fe(e, t, s, n, r) {
|
|
|
2649
2662
|
if (!t || !jn(e))
|
|
2650
2663
|
return !1;
|
|
2651
2664
|
const i = e;
|
|
2652
|
-
return !(Pt(i) || s !== null && typeof i.id == "string" && i.id !== s || n !== null &&
|
|
2665
|
+
return !(Pt(i) || s !== null && typeof i.id == "string" && i.id !== s || n !== null && x(i) !== n || r !== null && M(i) !== r);
|
|
2653
2666
|
}
|
|
2654
2667
|
function jn(e) {
|
|
2655
2668
|
if (!e || typeof e != "object")
|
|
@@ -2675,7 +2688,7 @@ function Gn(e) {
|
|
|
2675
2688
|
function Ft(e) {
|
|
2676
2689
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
2677
2690
|
}
|
|
2678
|
-
function
|
|
2691
|
+
function vt(e) {
|
|
2679
2692
|
const t = new Set(e.filter((i) => i.role === "user").map((i) => i.id)), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
|
|
2680
2693
|
for (const i of e) {
|
|
2681
2694
|
if (i.role === "user" || !i.respondsToUserMessageId || !t.has(i.respondsToUserMessageId))
|
|
@@ -2778,14 +2791,14 @@ function tr(e) {
|
|
|
2778
2791
|
if (!t)
|
|
2779
2792
|
return [];
|
|
2780
2793
|
const s = JSON.parse(t);
|
|
2781
|
-
return Array.isArray(s) ? s.filter(
|
|
2794
|
+
return Array.isArray(s) ? s.filter(Wt) : [];
|
|
2782
2795
|
} catch {
|
|
2783
2796
|
return [];
|
|
2784
2797
|
}
|
|
2785
2798
|
}
|
|
2786
|
-
function
|
|
2799
|
+
function $(e, t) {
|
|
2787
2800
|
try {
|
|
2788
|
-
const s = t.filter(
|
|
2801
|
+
const s = t.filter(Wt);
|
|
2789
2802
|
if (s.length === 0) {
|
|
2790
2803
|
window.localStorage.removeItem(`${Ct}${e}`);
|
|
2791
2804
|
return;
|
|
@@ -2798,7 +2811,7 @@ function W(e, t) {
|
|
|
2798
2811
|
return;
|
|
2799
2812
|
}
|
|
2800
2813
|
}
|
|
2801
|
-
function
|
|
2814
|
+
function ve(e, t) {
|
|
2802
2815
|
try {
|
|
2803
2816
|
const s = `${it}${e}`, n = location.href, r = location.origin, i = Array.from(t, (o) => ({
|
|
2804
2817
|
...o,
|
|
@@ -2821,7 +2834,7 @@ function er(e, t) {
|
|
|
2821
2834
|
} catch {
|
|
2822
2835
|
return;
|
|
2823
2836
|
}
|
|
2824
|
-
|
|
2837
|
+
ve(e, t);
|
|
2825
2838
|
}
|
|
2826
2839
|
function sr(e) {
|
|
2827
2840
|
try {
|
|
@@ -2831,7 +2844,7 @@ function sr(e) {
|
|
|
2831
2844
|
const n = JSON.parse(s);
|
|
2832
2845
|
return Array.isArray(n) ? n.flatMap((r) => rr(r) ? [{
|
|
2833
2846
|
...r.event,
|
|
2834
|
-
page:
|
|
2847
|
+
page: k(),
|
|
2835
2848
|
rawOutput: {
|
|
2836
2849
|
pageContextRestarted: !0,
|
|
2837
2850
|
outcome: "unknown",
|
|
@@ -2860,7 +2873,7 @@ function rr(e) {
|
|
|
2860
2873
|
if (!e || typeof e != "object")
|
|
2861
2874
|
return !1;
|
|
2862
2875
|
const t = e, s = t.event;
|
|
2863
|
-
return typeof t.startedAtMs == "number" && typeof t.startedAtUrl == "string" && t.startedAtOrigin === location.origin && t.unloadOrigin === location.origin && typeof t.unloadUrl == "string" &&
|
|
2876
|
+
return typeof t.startedAtMs == "number" && typeof t.startedAtUrl == "string" && t.startedAtOrigin === location.origin && t.unloadOrigin === location.origin && typeof t.unloadUrl == "string" && Wt(s) && s.type === "tool.result";
|
|
2864
2877
|
}
|
|
2865
2878
|
function ir(e, t) {
|
|
2866
2879
|
const s = new Set(
|
|
@@ -2878,7 +2891,7 @@ function or(e) {
|
|
|
2878
2891
|
return;
|
|
2879
2892
|
}
|
|
2880
2893
|
}
|
|
2881
|
-
function
|
|
2894
|
+
function Wt(e) {
|
|
2882
2895
|
if (!e || typeof e != "object")
|
|
2883
2896
|
return !1;
|
|
2884
2897
|
const t = e;
|
|
@@ -2890,7 +2903,7 @@ function ge(e) {
|
|
|
2890
2903
|
const t = e;
|
|
2891
2904
|
return typeof t.url == "string" && typeof t.title == "string" && typeof t.origin == "string";
|
|
2892
2905
|
}
|
|
2893
|
-
function
|
|
2906
|
+
function xe(e, t) {
|
|
2894
2907
|
if (!Array.isArray(e))
|
|
2895
2908
|
return;
|
|
2896
2909
|
const s = e.filter((r) => {
|
|
@@ -2927,17 +2940,17 @@ function cr(e) {
|
|
|
2927
2940
|
...typeof t.runId == "string" ? { runId: t.runId } : {},
|
|
2928
2941
|
dataType: typeof t.dataType == "string" ? t.dataType : void 0,
|
|
2929
2942
|
securitySettingsUrl: typeof t.securitySettingsUrl == "string" ? t.securitySettingsUrl : void 0,
|
|
2930
|
-
attachments:
|
|
2943
|
+
attachments: xe(t.attachments)?.map($t),
|
|
2931
2944
|
loading: typeof t.loading == "boolean" ? t.loading : void 0
|
|
2932
2945
|
};
|
|
2933
2946
|
}
|
|
2934
2947
|
function lr(e) {
|
|
2935
2948
|
return e.attachments?.length ? {
|
|
2936
2949
|
...e,
|
|
2937
|
-
attachments: e.attachments.map(
|
|
2950
|
+
attachments: e.attachments.map($t)
|
|
2938
2951
|
} : e;
|
|
2939
2952
|
}
|
|
2940
|
-
function
|
|
2953
|
+
function $t(e) {
|
|
2941
2954
|
const {
|
|
2942
2955
|
dataUrl: t,
|
|
2943
2956
|
objectUrl: s,
|
|
@@ -2946,7 +2959,7 @@ function Wt(e) {
|
|
|
2946
2959
|
} = e;
|
|
2947
2960
|
return r;
|
|
2948
2961
|
}
|
|
2949
|
-
function
|
|
2962
|
+
function x(e) {
|
|
2950
2963
|
const t = e.respondsToUserMessageId;
|
|
2951
2964
|
return typeof t == "string" && t ? t : null;
|
|
2952
2965
|
}
|
|
@@ -2970,7 +2983,7 @@ function Oe(e) {
|
|
|
2970
2983
|
return t;
|
|
2971
2984
|
}
|
|
2972
2985
|
function jt(e, t) {
|
|
2973
|
-
return
|
|
2986
|
+
return We(e) ? ct : C(rt(t), Ms);
|
|
2974
2987
|
}
|
|
2975
2988
|
function dr(e, t) {
|
|
2976
2989
|
return typeof e == "string" ? e : e instanceof URL ? e.toString() : t?.url ?? "";
|
|
@@ -3030,7 +3043,7 @@ function ye(e) {
|
|
|
3030
3043
|
return C(e);
|
|
3031
3044
|
}
|
|
3032
3045
|
function gr(e) {
|
|
3033
|
-
return
|
|
3046
|
+
return R({
|
|
3034
3047
|
...e,
|
|
3035
3048
|
requestBody: Te(e.requestBody),
|
|
3036
3049
|
responseBody: Te(e.responseBody)
|
|
@@ -3043,7 +3056,7 @@ function Te(e) {
|
|
|
3043
3056
|
if (!t.startsWith("{") && !t.startsWith("["))
|
|
3044
3057
|
return rt(e);
|
|
3045
3058
|
try {
|
|
3046
|
-
return JSON.stringify(
|
|
3059
|
+
return JSON.stringify(R(JSON.parse(e)));
|
|
3047
3060
|
} catch {
|
|
3048
3061
|
return rt(e);
|
|
3049
3062
|
}
|
|
@@ -3135,7 +3148,7 @@ function Sr(e) {
|
|
|
3135
3148
|
return e === 401 || e === 403;
|
|
3136
3149
|
}
|
|
3137
3150
|
const ct = "[REDACTED_SECRET]", P = "[REDACTED_TOKEN]", Er = "[REDACTED_SIGNED_URL]", br = 20, kr = /^(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|token|api_key|apiKey|apikey|key|secret|signature|sig|password|passwd|pwd|code|state|session|jwt|csrf|csrfToken|xsrf|xsrfToken)$/i, Be = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, qe = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, He = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, Fe = /\b(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|api_key|apiKey|apikey|client_secret|clientSecret|password|secret|token|jwt|csrf|csrfToken|xsrf|xsrfToken)\b\s*[:=]\s*["']?[^"',&\s}]+/gi, Rr = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, _r = /\bhttps?:\/\/[^\s"'<>]+/gi, Mr = /[),.;\]]+$/;
|
|
3138
|
-
function
|
|
3151
|
+
function R(e) {
|
|
3139
3152
|
return nt(e, 0, /* @__PURE__ */ new WeakSet());
|
|
3140
3153
|
}
|
|
3141
3154
|
function nt(e, t, s) {
|
|
@@ -3151,17 +3164,17 @@ function nt(e, t, s) {
|
|
|
3151
3164
|
return e.map((r) => nt(r, t + 1, s));
|
|
3152
3165
|
const n = {};
|
|
3153
3166
|
for (const [r, i] of Object.entries(e))
|
|
3154
|
-
r === "pageContent" ? n[r] = i :
|
|
3167
|
+
r === "pageContent" ? n[r] = i : We(r) ? n[r] = ct : n[r] = r.toLowerCase() === "url" ? Cr(i) : nt(i, t + 1, s);
|
|
3155
3168
|
return n;
|
|
3156
3169
|
}
|
|
3157
|
-
function
|
|
3170
|
+
function We(e) {
|
|
3158
3171
|
const t = e.replace(/[^a-z0-9]/gi, "").toLowerCase();
|
|
3159
3172
|
return t.includes("authorization") || t.includes("cookie") || t.includes("password") || t.includes("passwd") || t === "pwd" || t.includes("secret") || t === "token" || t.endsWith("token") || t.includes("apikey") || t.includes("csrf") || t.includes("xsrf") || t === "jwt" || t === "session" || t === "signature" || t.includes("privatekey");
|
|
3160
3173
|
}
|
|
3161
3174
|
function Cr(e) {
|
|
3162
|
-
return typeof e == "string" ?
|
|
3175
|
+
return typeof e == "string" ? $e(e) : nt(e, 0, /* @__PURE__ */ new WeakSet());
|
|
3163
3176
|
}
|
|
3164
|
-
function
|
|
3177
|
+
function $e(e) {
|
|
3165
3178
|
try {
|
|
3166
3179
|
const t = new URL(e, location.href);
|
|
3167
3180
|
for (const s of Array.from(t.searchParams.keys()))
|
|
@@ -3179,7 +3192,7 @@ function Pr(e) {
|
|
|
3179
3192
|
}
|
|
3180
3193
|
function Ur(e) {
|
|
3181
3194
|
const t = e.match(Mr)?.[0] ?? "", s = t ? e.slice(0, -t.length) : e;
|
|
3182
|
-
return `${
|
|
3195
|
+
return `${$e(s)}${t}`;
|
|
3183
3196
|
}
|
|
3184
3197
|
export {
|
|
3185
3198
|
te as PLUNO_PRODUCT_AGENT_SDK_PREVIEW_HOST_SELECTOR,
|