@pluno/product-agent-web 0.1.209 → 0.1.210
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/product-agent-runtime.cjs +1 -1
- package/dist/product-agent-runtime.js +336 -322
- package/dist/product-agent-sdk.js +298 -283
- package/dist/product-agent-widget.js +2956 -2799
- package/dist/uiFlightRecorder.d.ts +42 -0
- package/dist/uiInvariants.d.ts +31 -0
- package/package.json +1 -1
|
@@ -477,7 +477,7 @@ function Mn(s, e, t) {
|
|
|
477
477
|
function Ss(s) {
|
|
478
478
|
return s ? s.ids.map((e) => s.entitiesById[e]).filter((e) => !!e) : [];
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function ko(s) {
|
|
481
481
|
return s.visible ? s.minimized ? { state: "minimized" } : { state: s.open ? "visible_open" : "visible_closed" } : { state: "hidden" };
|
|
482
482
|
}
|
|
483
483
|
function bn(s, e) {
|
|
@@ -488,7 +488,7 @@ function Rn(s) {
|
|
|
488
488
|
const e = s.paidCreditFallbackModel;
|
|
489
489
|
return typeof e == "string" && e.length > 0;
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function Co(s) {
|
|
492
492
|
const e = s.hasDraftMessage || s.hasPreSubmittedAttachment;
|
|
493
493
|
return s.hasRunningAssistantTurn && !e ? {
|
|
494
494
|
action: "stop",
|
|
@@ -838,7 +838,7 @@ class _n {
|
|
|
838
838
|
return `${Xe(e.scope)}:category:${e.category}`;
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
|
-
function
|
|
841
|
+
function _o(s, e) {
|
|
842
842
|
return {
|
|
843
843
|
load: async () => Pn(s, e),
|
|
844
844
|
save: async (t) => s.setItem(e, JSON.stringify(t))
|
|
@@ -872,7 +872,7 @@ function Dn(s, e) {
|
|
|
872
872
|
const t = ve(s), n = `${vn[e]} Pluno`;
|
|
873
873
|
return t ? `${n}: ${t}` : n;
|
|
874
874
|
}
|
|
875
|
-
class
|
|
875
|
+
class Po {
|
|
876
876
|
constructor(e) {
|
|
877
877
|
this.titleDocument = e;
|
|
878
878
|
}
|
|
@@ -910,7 +910,7 @@ class Co {
|
|
|
910
910
|
this.lastAppliedTitle = e, this.titleDocument.getTitle() !== e && this.titleDocument.setTitle(e);
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
|
-
function
|
|
913
|
+
function vo(s) {
|
|
914
914
|
return {
|
|
915
915
|
getTitle: () => s.title,
|
|
916
916
|
setTitle: (e) => {
|
|
@@ -929,7 +929,21 @@ function _o(s) {
|
|
|
929
929
|
function ve(s) {
|
|
930
930
|
return s.replace(Un, "");
|
|
931
931
|
}
|
|
932
|
-
|
|
932
|
+
const qn = {
|
|
933
|
+
"duplicate-message-item": "A canonical message rendered more than once.",
|
|
934
|
+
"duplicate-canonical-item": "A canonical session item rendered more than once.",
|
|
935
|
+
"duplicate-tool-call": "A tool call rendered more than once.",
|
|
936
|
+
"duplicate-attachment": "An attachment rendered more than once.",
|
|
937
|
+
"duplicate-terminal-outcome": "A response rendered more than one terminal outcome.",
|
|
938
|
+
"foreign-session-item-visible": "The visible transcript contains state owned by another session.",
|
|
939
|
+
"terminal-response-reactivated": "A terminal response became active again.",
|
|
940
|
+
"terminal-history-not-append-only": "An established terminal outcome disappeared or changed order.",
|
|
941
|
+
"runtime-transcript-not-rendered": "A nonempty runtime transcript is displaying starter prompts."
|
|
942
|
+
};
|
|
943
|
+
function On(s) {
|
|
944
|
+
return typeof s == "string" && s.startsWith("ui_invariant:") && Object.prototype.hasOwnProperty.call(qn, s.slice(13));
|
|
945
|
+
}
|
|
946
|
+
function Uo(s) {
|
|
933
947
|
if (!s || typeof s != "object" || !("type" in s)) return !1;
|
|
934
948
|
const e = s;
|
|
935
949
|
switch (e.type) {
|
|
@@ -943,7 +957,7 @@ function Po(s) {
|
|
|
943
957
|
case "runtime.report_displayed_error":
|
|
944
958
|
return (e.reason === "conversation_error" || e.reason === "attachment_error" || e.reason === "history_error" || e.reason === "action_error") && typeof e.errorFingerprint == "string" && /^fnv1a-[0-9a-f]{8}$/.test(e.errorFingerprint) && (e.displayedMessage === void 0 || typeof e.displayedMessage == "string" && e.displayedMessage.length <= 500);
|
|
945
959
|
case "runtime.report_invalid_state_transition":
|
|
946
|
-
return (e.reason === "submitted_turn_returned_to_welcome_without_new_chat" || e.reason === "new_messages_button_without_user_scroll") && (e.clientMessageId === void 0 || typeof e.clientMessageId == "string");
|
|
960
|
+
return (e.reason === "submitted_turn_returned_to_welcome_without_new_chat" || e.reason === "new_messages_button_without_user_scroll" || On(e.reason)) && (e.clientMessageId === void 0 || typeof e.clientMessageId == "string");
|
|
947
961
|
case "runtime.widget_lifecycle":
|
|
948
962
|
return (e.action === "opened" || e.action === "closed" || e.action === "minimized") && typeof e.trigger == "string";
|
|
949
963
|
case "session.load":
|
|
@@ -970,7 +984,7 @@ function Po(s) {
|
|
|
970
984
|
return !1;
|
|
971
985
|
}
|
|
972
986
|
}
|
|
973
|
-
class
|
|
987
|
+
class Do {
|
|
974
988
|
constructor(e, t, n) {
|
|
975
989
|
this.adapter = t, this.state = Je(e), this.model = n;
|
|
976
990
|
}
|
|
@@ -1275,7 +1289,7 @@ function Nt(s) {
|
|
|
1275
1289
|
}) : null
|
|
1276
1290
|
};
|
|
1277
1291
|
}
|
|
1278
|
-
const
|
|
1292
|
+
const xn = globalThis.fetch.bind(globalThis), Ht = '.pluno-pa-widget-host[data-pluno-product-agent-ui="widget"]', Ln = '.pluno-pa-widget[data-pluno-product-agent-ui-root="widget"]', Nn = ".pluno-pa-widget__panel", Hn = ".pluno-pa-widget__timeline", Bn = "__plunoExtensionWidgetOwner";
|
|
1279
1293
|
class X extends Error {
|
|
1280
1294
|
constructor(e, t, n, i) {
|
|
1281
1295
|
super(e), this.retryable = t, this.status = n, this.retryAfterMs = i, this.name = "ProductAgentTokenProviderError";
|
|
@@ -1284,10 +1298,10 @@ class X extends Error {
|
|
|
1284
1298
|
status;
|
|
1285
1299
|
retryAfterMs;
|
|
1286
1300
|
}
|
|
1287
|
-
function
|
|
1301
|
+
function Fn(s) {
|
|
1288
1302
|
return s === "dismiss" || s === "later" || s === "snooze" || s === "never" || s === "dont_show_again";
|
|
1289
1303
|
}
|
|
1290
|
-
let
|
|
1304
|
+
let Wn = 0;
|
|
1291
1305
|
function Bt(s) {
|
|
1292
1306
|
const e = {};
|
|
1293
1307
|
for (const l of [
|
|
@@ -1330,7 +1344,8 @@ function Bt(s) {
|
|
|
1330
1344
|
status: typeof d.status == "string" ? d.status : null,
|
|
1331
1345
|
stage: typeof d.stage == "string" ? d.stage : null,
|
|
1332
1346
|
retryable: d.retryable === !0,
|
|
1333
|
-
visible: !!(g &&
|
|
1347
|
+
visible: !!(g && // Recovery-only failures are intentionally hidden, not missing transcript items.
|
|
1348
|
+
!(d.type === "run_error" && d.retryable === !0) && !g.scheduledCheckInAt && g.toolName !== St && (d.type !== "run_status" || ["failed", "interrupted", "stopped"].includes(String(d.status))))
|
|
1334
1349
|
};
|
|
1335
1350
|
}, o = r(s.item);
|
|
1336
1351
|
if (o?.id && (e.itemId = o.id, o.type && (e.itemType = o.type), o.role && (e.itemRole = o.role), o.sessionId && typeof e.sessionId != "string" && (e.sessionId = o.sessionId), o.runId && typeof e.runId != "string" && (e.runId = o.runId), o.respondsToUserMessageId && typeof e.respondsToUserMessageId != "string" && (e.respondsToUserMessageId = o.respondsToUserMessageId), o.status && (e.itemStatus = o.status), o.stage && (e.itemStage = o.stage), o.retryable && (e.itemRetryable = !0), o.visible && (e.visibleItemId = o.id, o.streamId && (e.visibleItemAliases = JSON.stringify([[o.streamId, o.id]])))), Array.isArray(s.items)) {
|
|
@@ -1365,7 +1380,7 @@ function Se(s, e, t) {
|
|
|
1365
1380
|
source: "web_sdk",
|
|
1366
1381
|
category: s,
|
|
1367
1382
|
name: e,
|
|
1368
|
-
sequence: ++
|
|
1383
|
+
sequence: ++Wn,
|
|
1369
1384
|
wallTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1370
1385
|
monotonicMs: performance.now(),
|
|
1371
1386
|
data: t
|
|
@@ -1374,27 +1389,27 @@ function Se(s, e, t) {
|
|
|
1374
1389
|
}
|
|
1375
1390
|
class Te extends Error {
|
|
1376
1391
|
}
|
|
1377
|
-
function
|
|
1392
|
+
function $n(s) {
|
|
1378
1393
|
return s === 408 || s === 425 || s === 429 || s >= 500;
|
|
1379
1394
|
}
|
|
1380
|
-
const
|
|
1395
|
+
const jn = "https://app.pluno.ai", zn = 2e4, Kn = 1e4, Gn = 6e4, Qn = 6e4, Vn = 1e4, Xn = 1e4, Jn = 3e3, Yn = 3e4, Zn = 1e3, ot = 3e4, Ft = 0.2, ei = 6e4, Wt = 15e3, ti = 6e4, si = 8, ni = "Browser connection was interrupted.", $t = 15e3, ii = "Pluno could not send this message. Try it again.", ri = "Still connecting to Pluno. Retrying automatically.", oi = 2e3, ai = 1e3, li = 100, jt = 8e3, zt = 3, ci = [300, 1e3], ws = 50 * 1024 * 1024, ui = /* @__PURE__ */ new Set([
|
|
1381
1396
|
".jpeg:image/jpeg",
|
|
1382
1397
|
".jpg:image/jpeg",
|
|
1383
1398
|
".pdf:application/pdf",
|
|
1384
1399
|
".png:image/png",
|
|
1385
1400
|
".webp:image/webp"
|
|
1386
|
-
]),
|
|
1387
|
-
function
|
|
1401
|
+
]), qo = ".pdf,.png,.jpg,.jpeg,.webp", Tt = 64e3, Ye = 4e3, wt = 30, di = 2e3, hi = 1e3, As = "Image is too large for model vision input.", pi = 100, gi = 20, Ms = "pluno.productAgent.state.", at = "pluno.productAgent.pendingEvents.", Le = "pluno.productAgent.activeToolCalls.", fi = 100;
|
|
1402
|
+
function mi(s, e = 0) {
|
|
1388
1403
|
const t = s === 0 ? 0 : Math.min(3e4, 1e3 * 2 ** (s - 1));
|
|
1389
1404
|
return Math.max(e, t);
|
|
1390
1405
|
}
|
|
1391
1406
|
const Ce = /* @__PURE__ */ new Set();
|
|
1392
1407
|
let we = null;
|
|
1393
|
-
function
|
|
1394
|
-
const t = Math.min(ot,
|
|
1408
|
+
function yi(s, e = Math.random) {
|
|
1409
|
+
const t = Math.min(ot, Zn * 2 ** s), n = 1 - Ft + e() * Ft * 2;
|
|
1395
1410
|
return Math.min(ot, Math.round(t * n));
|
|
1396
1411
|
}
|
|
1397
|
-
function
|
|
1412
|
+
function Ii(s) {
|
|
1398
1413
|
const e = s.split(".")[1];
|
|
1399
1414
|
if (!e)
|
|
1400
1415
|
return null;
|
|
@@ -1405,7 +1420,7 @@ function mi(s) {
|
|
|
1405
1420
|
return null;
|
|
1406
1421
|
}
|
|
1407
1422
|
}
|
|
1408
|
-
function
|
|
1423
|
+
function Si(s) {
|
|
1409
1424
|
if (s instanceof X)
|
|
1410
1425
|
return s.retryable;
|
|
1411
1426
|
if (s && typeof s == "object") {
|
|
@@ -1415,7 +1430,7 @@ function yi(s) {
|
|
|
1415
1430
|
}
|
|
1416
1431
|
return !0;
|
|
1417
1432
|
}
|
|
1418
|
-
function
|
|
1433
|
+
function Ti(s) {
|
|
1419
1434
|
if (s instanceof Error)
|
|
1420
1435
|
return s;
|
|
1421
1436
|
if (s && typeof s == "object") {
|
|
@@ -1472,9 +1487,9 @@ class Ne {
|
|
|
1472
1487
|
maxFailureIntervalMs: 3e4
|
|
1473
1488
|
}), this.personalModelSelectionOverride = e.productVariant === "personal" && Ve(e.model) ? e.model : null, this.state = {
|
|
1474
1489
|
...this.state,
|
|
1475
|
-
starterPrompts:
|
|
1490
|
+
starterPrompts: tr(e.initialStarterPrompts)
|
|
1476
1491
|
}, this.account = e.initialAccount ? { ...e.initialAccount } : null;
|
|
1477
|
-
const n = e.restorePersistedState === !1 ? null :
|
|
1492
|
+
const n = e.restorePersistedState === !1 ? null : zr(e.clientId, e.expectedPersistedSessionId);
|
|
1478
1493
|
n && (this.state = {
|
|
1479
1494
|
...this.state,
|
|
1480
1495
|
...n,
|
|
@@ -1495,9 +1510,9 @@ class Ne {
|
|
|
1495
1510
|
taskStatus: null,
|
|
1496
1511
|
isRetrying: !1,
|
|
1497
1512
|
lastError: null
|
|
1498
|
-
}, n.sessionId && this.rememberSessionTimeline(n.sessionId, this.state.messages)), this.queuedClientEvents =
|
|
1499
|
-
|
|
1500
|
-
|
|
1513
|
+
}, n.sessionId && this.rememberSessionTimeline(n.sessionId, this.state.messages)), this.queuedClientEvents = Jr(
|
|
1514
|
+
Gr(e.clientId),
|
|
1515
|
+
Qr(e.clientId)
|
|
1501
1516
|
);
|
|
1502
1517
|
const i = [...this.queuedClientEvents].reverse().find(
|
|
1503
1518
|
(r) => r.type === "chat.user_message" && typeof r.clientMessageId == "string"
|
|
@@ -1647,10 +1662,10 @@ class Ne {
|
|
|
1647
1662
|
t.skipStoredTransportIdentityCollisionCheck === !0
|
|
1648
1663
|
), i = new Ne({
|
|
1649
1664
|
...e,
|
|
1650
|
-
backendUrl:
|
|
1651
|
-
clientId: e.clientId ??
|
|
1665
|
+
backendUrl: Bi(e.backendUrl ?? jn),
|
|
1666
|
+
clientId: e.clientId ?? or(),
|
|
1652
1667
|
productVariant: e.productVariant ?? "customer_embedded",
|
|
1653
|
-
entrySurface:
|
|
1668
|
+
entrySurface: Fi(e.entrySurface)
|
|
1654
1669
|
}, n);
|
|
1655
1670
|
try {
|
|
1656
1671
|
Js().catch((r) => {
|
|
@@ -1699,7 +1714,7 @@ class Ne {
|
|
|
1699
1714
|
return this.options.token;
|
|
1700
1715
|
if (!this.options.tokenProvider)
|
|
1701
1716
|
return this.token;
|
|
1702
|
-
const n = Date.now(), i = this.token !== null && this.tokenExpiresAtMs !== null && this.tokenExpiresAtMs -
|
|
1717
|
+
const n = Date.now(), i = this.token !== null && this.tokenExpiresAtMs !== null && this.tokenExpiresAtMs - Qn > n;
|
|
1703
1718
|
if (!t.forceRefresh && (i || t.preferCached && this.token !== null))
|
|
1704
1719
|
return this.token;
|
|
1705
1720
|
if (this.tokenRequest && !t.forceRefresh)
|
|
@@ -1712,7 +1727,7 @@ class Ne {
|
|
|
1712
1727
|
const l = new Promise((c, u) => {
|
|
1713
1728
|
a = window.setTimeout(() => {
|
|
1714
1729
|
r.abort(), u(new X("Pluno token provider timed out", !0));
|
|
1715
|
-
},
|
|
1730
|
+
}, Gn);
|
|
1716
1731
|
});
|
|
1717
1732
|
try {
|
|
1718
1733
|
const c = await Promise.race([
|
|
@@ -1723,7 +1738,7 @@ class Ne {
|
|
|
1723
1738
|
throw new X("Pluno token request was cancelled", !0);
|
|
1724
1739
|
if (!c)
|
|
1725
1740
|
throw new X("Pluno token provider did not return a token", !1);
|
|
1726
|
-
return this.token = c, this.tokenExpiresAtMs =
|
|
1741
|
+
return this.token = c, this.tokenExpiresAtMs = Ii(c), c;
|
|
1727
1742
|
} finally {
|
|
1728
1743
|
a !== null && window.clearTimeout(a);
|
|
1729
1744
|
}
|
|
@@ -1748,10 +1763,10 @@ class Ne {
|
|
|
1748
1763
|
return;
|
|
1749
1764
|
if (!this.token && !this.options.webSocketFactory)
|
|
1750
1765
|
throw new X("Pluno requires a token or tokenProvider", !1);
|
|
1751
|
-
const t =
|
|
1766
|
+
const t = ji(this.options.backendUrl), n = this.options.webSocketFactory?.(t) ?? new WebSocket(t);
|
|
1752
1767
|
this.socket = n, this.socketConnectTimer = window.setTimeout(() => {
|
|
1753
1768
|
this.socket === n && n.readyState === WebSocket.CONNECTING && (b("web-sdk.agent", "Pluno socket opening timed out; reconnecting"), this.reportTransportDiagnostic("connect_timeout"), this.replaceTimedOutSocket(n));
|
|
1754
|
-
},
|
|
1769
|
+
}, Vn), n.addEventListener("open", () => {
|
|
1755
1770
|
this.socket !== n || (this.clearSocketConnectTimer(), b("web-sdk.agent", "Pluno socket opened", {
|
|
1756
1771
|
queuedClientEventCount: this.queuedClientEvents.length,
|
|
1757
1772
|
isThinking: this.state.isThinking
|
|
@@ -1763,13 +1778,13 @@ class Ne {
|
|
|
1763
1778
|
pageUrl: location.href
|
|
1764
1779
|
}) : !0)) || (this.socketAuthTimer = window.setTimeout(() => {
|
|
1765
1780
|
this.socket === n && (b("web-sdk.agent", "Pluno socket authentication timed out; reconnecting"), this.reportTransportDiagnostic("auth_timeout"), this.replaceTimedOutSocket(n));
|
|
1766
|
-
},
|
|
1781
|
+
}, Xn));
|
|
1767
1782
|
}), n.addEventListener("message", (i) => {
|
|
1768
|
-
this.socket === n && this.handleServerEvent(
|
|
1783
|
+
this.socket === n && this.handleServerEvent(Zi(i.data));
|
|
1769
1784
|
}), n.addEventListener("sendfailure", (i) => {
|
|
1770
1785
|
if (this.socket !== n)
|
|
1771
1786
|
return;
|
|
1772
|
-
const r =
|
|
1787
|
+
const r = er(i?.detail?.data);
|
|
1773
1788
|
r?.type === "chat.user_message" && r.clientMessageId === this.pendingClientMessageId && !this.queuedClientEvents.some(
|
|
1774
1789
|
(o) => o.type === "chat.user_message" && o.clientMessageId === r.clientMessageId
|
|
1775
1790
|
) && (this.queuedClientEvents.push(r), V(this.options.clientId, this.queuedClientEvents), this.setState({ pendingMessageStatus: "reconnecting" })), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.socket = null, this.setReconnectingState(), this.scheduleReconnect(), n.readyState !== WebSocket.CLOSED && n.readyState !== WebSocket.CLOSING && n.close();
|
|
@@ -1793,14 +1808,14 @@ class Ne {
|
|
|
1793
1808
|
} catch (t) {
|
|
1794
1809
|
if (e !== this.connectionAttemptId || this.state.status === "closed")
|
|
1795
1810
|
return;
|
|
1796
|
-
const n =
|
|
1797
|
-
if (
|
|
1811
|
+
const n = Ti(t);
|
|
1812
|
+
if (Si(t)) {
|
|
1798
1813
|
b("web-sdk.agent", "Pluno connection attempt failed; retrying", {
|
|
1799
1814
|
message: n.message,
|
|
1800
1815
|
reconnectAttempt: this.reconnectAttempts
|
|
1801
1816
|
}), t instanceof X && this.reportTransportDiagnostic("auth_timeout"), this.setState({
|
|
1802
1817
|
status: "reconnecting",
|
|
1803
|
-
lastError:
|
|
1818
|
+
lastError: ri,
|
|
1804
1819
|
lastErrorCode: "connection_failed"
|
|
1805
1820
|
}), this.emit("error", n), this.scheduleReconnect(
|
|
1806
1821
|
t instanceof X ? t.retryAfterMs : void 0
|
|
@@ -1820,7 +1835,7 @@ class Ne {
|
|
|
1820
1835
|
this.stopSessionRecoveryPolling(), this.connectionAttemptId += 1, this.setState({ status: "closed", pendingMessageStatus: null, isThinking: !1, isRetrying: !1 }), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.clearStarterPromptUrlRefreshTimer(), this.clearRetryTimers(), this.clearThinkingWatchdog(), this.clearAllFirstResponseTimers(), this.clearPendingDeliveryTimers(), this.pendingClientMessageId = null, this.pendingUserMessageEvent = null, this.failedUserMessageEvent = null, this.clearSessionLoadRequest(), this.rejectPendingSessionHistoryRequests("Pluno disconnected."), this.rejectPendingSessionMutationRequests(this.pendingSessionPinRequests, "Pluno disconnected."), this.rejectPendingSessionMutationRequests(this.pendingSessionRenameRequests, "Pluno disconnected."), this.tokenAbortController?.abort(), this.tokenAbortController = null, this.tokenRequest = null, this.reconnectTimer !== null && (window.clearTimeout(this.reconnectTimer), this.reconnectTimer = null), this.clientDiagnosticsRetryTimer !== null && (window.clearTimeout(this.clientDiagnosticsRetryTimer), this.clientDiagnosticsRetryTimer = null), this.pendingTransportDiagnostics = [], this.pendingHealthDiagnostics = [], this.queuedClientEvents = [], this.pendingWidgetLifecycleEvents = [], this.clearPendingWarmupAckTimer(), this.pendingPassiveWarmupEvent = null, this.pendingComposerWarmup = null, this.activeComposerWarmupId = null, this.activeComposerWarmupScope = null, this.nonTranscriptToolCallIds.clear(), this.socket?.close(), this.socket = null;
|
|
1821
1836
|
}
|
|
1822
1837
|
destroy() {
|
|
1823
|
-
this.disconnect(), this.clearAllFirstResponseTimers(), this.locationChangeCleanup?.(), this.locationChangeCleanup = null, this.cleanupSessionBrowserApis(), this.pageLifecycleCleanup?.(), this.pageLifecycleCleanup = null, this.activeBrowserToolCalls.clear(),
|
|
1838
|
+
this.disconnect(), this.clearAllFirstResponseTimers(), this.locationChangeCleanup?.(), this.locationChangeCleanup = null, this.cleanupSessionBrowserApis(), this.pageLifecycleCleanup?.(), this.pageLifecycleCleanup = null, this.activeBrowserToolCalls.clear(), Yr(this.options.clientId), this.transportIdentity.release(), this.networkCaptureCleanup?.(), this.networkCaptureCleanup = null, this.networkBatchTimer !== null && (window.clearTimeout(this.networkBatchTimer), this.networkBatchTimer = null), this.queuedNetworkEvents = [], this.detachedSessionIds.clear(), this.detachedClientMessageIds.clear(), this.deferredDetachedSessionEvents.clear();
|
|
1824
1839
|
for (const e of Object.values(this.listeners))
|
|
1825
1840
|
e?.clear();
|
|
1826
1841
|
this.accountListeners.clear(), this.interactionListeners.clear();
|
|
@@ -1956,7 +1971,7 @@ class Ne {
|
|
|
1956
1971
|
sessionId: this.state.sessionId ?? void 0,
|
|
1957
1972
|
clientMessageId: a,
|
|
1958
1973
|
initiatedBy: t.initiatedBy,
|
|
1959
|
-
invocation:
|
|
1974
|
+
invocation: Wi(t.invocation ?? t.initiatedBy),
|
|
1960
1975
|
entrySurface: this.options.entrySurface,
|
|
1961
1976
|
content: n,
|
|
1962
1977
|
proactiveSuggestionQuestion: t.proactiveSuggestionQuestion,
|
|
@@ -2003,7 +2018,7 @@ class Ne {
|
|
|
2003
2018
|
return e ? (this.retryAttemptsByClientMessageId[t] = 0, this.retryableClientMessageId = null, this.stagedProactiveSuggestionQuestionMessageId = null, this.activeClientMessageId = t, this.latestRecoverableClientMessageId = t, this.setState({ status: "connected", isThinking: !0, isRetrying: !0, lastError: null, lastErrorCode: null }), this.markThinkingProgress(), this.send({ type: "chat.retry_last_user_message", sessionId: e, clientMessageId: t, automatic: !1 }), !0) : !1;
|
|
2004
2019
|
}
|
|
2005
2020
|
createLocalAttachment(e) {
|
|
2006
|
-
this.options.productVariant === "customer_embedded" &&
|
|
2021
|
+
this.options.productVariant === "customer_embedded" && Zr(e);
|
|
2007
2022
|
const t = x(), n = {
|
|
2008
2023
|
id: t,
|
|
2009
2024
|
name: e.name || "attachment",
|
|
@@ -2109,7 +2124,7 @@ class Ne {
|
|
|
2109
2124
|
const n = await this.fetchEmbedAttachmentUpload(e, !1);
|
|
2110
2125
|
if (n.ok)
|
|
2111
2126
|
return await n.json();
|
|
2112
|
-
if (
|
|
2127
|
+
if (yo(n.status) && this.options.tokenProvider && !t) {
|
|
2113
2128
|
t = !0;
|
|
2114
2129
|
const i = await this.fetchEmbedAttachmentUpload(e, !0);
|
|
2115
2130
|
if (i.ok)
|
|
@@ -2134,7 +2149,7 @@ class Ne {
|
|
|
2134
2149
|
if (!this.state.sessionId)
|
|
2135
2150
|
return;
|
|
2136
2151
|
this.send({ type: "run.stop", sessionId: this.state.sessionId, reason: "user_requested" });
|
|
2137
|
-
const e =
|
|
2152
|
+
const e = Or(
|
|
2138
2153
|
this.state.messages,
|
|
2139
2154
|
this.state.assistantDraftRespondsToUserMessageId,
|
|
2140
2155
|
this.state.assistantDraftRunId,
|
|
@@ -2269,7 +2284,7 @@ class Ne {
|
|
|
2269
2284
|
throw new Error("This interaction is no longer available.");
|
|
2270
2285
|
if (!r.allowedActions.includes(t))
|
|
2271
2286
|
throw new Error("This action is not available for the interaction.");
|
|
2272
|
-
if (
|
|
2287
|
+
if (Fn(t) && await this.interactionManager.act(
|
|
2273
2288
|
{
|
|
2274
2289
|
key: r.id,
|
|
2275
2290
|
category: r.category,
|
|
@@ -2446,7 +2461,7 @@ class Ne {
|
|
|
2446
2461
|
loadSession(e) {
|
|
2447
2462
|
const t = x(), n = this.activeComposerWarmupId;
|
|
2448
2463
|
this.state.sessionId && this.rememberSessionTimeline(this.state.sessionId, this.state.messages);
|
|
2449
|
-
const i = this.getCachedSessionTimeline(e), r = [...i ?? []].reverse().find((a) => a.dataType === "assistant_draft" && a.steered !== !0), o =
|
|
2464
|
+
const i = this.getCachedSessionTimeline(e), r = [...i ?? []].reverse().find((a) => a.dataType === "assistant_draft" && a.steered !== !0), o = Dr(i ?? []);
|
|
2450
2465
|
!this.options.keepRunsActiveOnSessionNavigation && this.state.sessionId !== e && this.rememberCurrentRunAsDetached(), this.detachedSessionIds.delete(e), this.deferredDetachedSessionEvents.delete(e), !this.options.keepRunsActiveOnSessionNavigation && this.state.sessionId && (this.state.isThinking || this.state.pendingMessageStatus !== null) && this.send({ type: "run.stop", sessionId: this.state.sessionId, reason: "session_switch" }), this.options.keepRunsActiveOnSessionNavigation && (this.rememberCurrentRunAsBackground(), this.backgroundSessionIds.delete(e), this.deferredSessionUpdatedSessionIds.delete(e)), this.clearPendingComposerWarmup(), n && this.send({
|
|
2451
2466
|
type: "session.reset",
|
|
2452
2467
|
warmupId: n,
|
|
@@ -2580,7 +2595,7 @@ class Ne {
|
|
|
2580
2595
|
});
|
|
2581
2596
|
if (!c.ok) {
|
|
2582
2597
|
const d = await c.text() || `History request failed (${c.status})`;
|
|
2583
|
-
throw
|
|
2598
|
+
throw $n(c.status) ? new Error(d) : new Te(d);
|
|
2584
2599
|
}
|
|
2585
2600
|
const u = await c.json();
|
|
2586
2601
|
if (!u?.session || !Array.isArray(u.items))
|
|
@@ -2685,7 +2700,7 @@ class Ne {
|
|
|
2685
2700
|
clientMessageId: e,
|
|
2686
2701
|
durationMs: Date.now() - n
|
|
2687
2702
|
});
|
|
2688
|
-
}, Math.max(0,
|
|
2703
|
+
}, Math.max(0, ti - (Date.now() - n)));
|
|
2689
2704
|
this.firstResponseTimersByClientMessageId.set(e, { submittedAt: n, timer: i });
|
|
2690
2705
|
}
|
|
2691
2706
|
clearFirstResponseTimer(e) {
|
|
@@ -2795,7 +2810,7 @@ class Ne {
|
|
|
2795
2810
|
if (this.state.starterPromptsLoading || this.transientStarterPromptsRequestInFlight || this.transientStarterPromptsRequestAttempted)
|
|
2796
2811
|
return;
|
|
2797
2812
|
this.transientStarterPromptsRequestInFlight = !0, this.transientStarterPromptsRequestAttempted = !0, this.setState({ starterPromptsLoading: !0 });
|
|
2798
|
-
const e =
|
|
2813
|
+
const e = zi();
|
|
2799
2814
|
this.sendNow(
|
|
2800
2815
|
L({
|
|
2801
2816
|
type: "starter_prompts.page_context",
|
|
@@ -2806,13 +2821,13 @@ class Ne {
|
|
|
2806
2821
|
) || (this.transientStarterPromptsRequestInFlight = !1, this.transientStarterPromptsRequestAttempted = !1, this.setState({ starterPromptsLoading: !1 }));
|
|
2807
2822
|
}
|
|
2808
2823
|
startStarterPromptUrlWatcher() {
|
|
2809
|
-
this.locationChangeCleanup || (this.locationChangeCleanup =
|
|
2824
|
+
this.locationChangeCleanup || (this.locationChangeCleanup = Ki(() => this.handleStarterPromptUrlChange()));
|
|
2810
2825
|
}
|
|
2811
2826
|
handleStarterPromptUrlChange() {
|
|
2812
2827
|
const e = location.href;
|
|
2813
2828
|
e !== this.lastStarterPromptPageUrl && (this.activeComposerWarmupScope && !this.activeComposerWarmupScope.endsWith(`:${e}`) && this.clearPendingComposerWarmup(), this.lastStarterPromptPageUrl = e, this.clearStarterPromptUrlRefreshTimer(), this.starterPromptUrlRefreshTimer = window.setTimeout(() => {
|
|
2814
2829
|
this.starterPromptUrlRefreshTimer = null, this.refreshStarterPromptsForCurrentUrl();
|
|
2815
|
-
},
|
|
2830
|
+
}, fi));
|
|
2816
2831
|
}
|
|
2817
2832
|
refreshStarterPromptsForCurrentUrl() {
|
|
2818
2833
|
this.socket?.readyState !== WebSocket.OPEN || this.state.status === "closed" || (this.setState({ starterPromptsLoading: this.state.messages.length === 0 }), this.sendNow({
|
|
@@ -2842,7 +2857,7 @@ class Ne {
|
|
|
2842
2857
|
}
|
|
2843
2858
|
rememberSessionTimeline(e, t) {
|
|
2844
2859
|
const n = [...t];
|
|
2845
|
-
for (this.sessionTimelineCache.delete(e), this.sessionTimelineCache.set(e, n); this.sessionTimelineCache.size >
|
|
2860
|
+
for (this.sessionTimelineCache.delete(e), this.sessionTimelineCache.set(e, n); this.sessionTimelineCache.size > gi; ) {
|
|
2846
2861
|
const i = this.sessionTimelineCache.keys().next().value;
|
|
2847
2862
|
if (!i)
|
|
2848
2863
|
break;
|
|
@@ -2872,8 +2887,8 @@ class Ne {
|
|
|
2872
2887
|
return;
|
|
2873
2888
|
this.clearPendingWarmupAckTimer();
|
|
2874
2889
|
const t = Math.min(
|
|
2875
|
-
|
|
2876
|
-
|
|
2890
|
+
Jn * 2 ** e.retryAttempt,
|
|
2891
|
+
Yn
|
|
2877
2892
|
);
|
|
2878
2893
|
e.retryAttempt += 1, this.pendingWarmupAckTimer = window.setTimeout(() => {
|
|
2879
2894
|
this.pendingWarmupAckTimer = null, this.flushPendingComposerWarmup();
|
|
@@ -2996,7 +3011,7 @@ class Ne {
|
|
|
2996
3011
|
}
|
|
2997
3012
|
}
|
|
2998
3013
|
if (!this.shouldIgnoreStoppedTurnEvent(e) && (this.updateInactiveSessionTimelineCache(e), !this.shouldIgnoreBackgroundSessionEvent(e))) {
|
|
2999
|
-
if (
|
|
3014
|
+
if (bi(e) && this.clearFirstResponseTimer(this.activeClientMessageId), e.type === "run.steered") {
|
|
3000
3015
|
this.handleRunSteered(e);
|
|
3001
3016
|
return;
|
|
3002
3017
|
}
|
|
@@ -3011,16 +3026,16 @@ class Ne {
|
|
|
3011
3026
|
this.activeResponseRunId = t, this.setState({ turnPhase: "thinking", lastError: null }), this.markThinkingProgress();
|
|
3012
3027
|
return;
|
|
3013
3028
|
}
|
|
3014
|
-
if (
|
|
3029
|
+
if (Mi(e) && this.markThinkingProgress(), e.type === "auth.ok") {
|
|
3015
3030
|
this.clearSocketAuthTimer(), this.reconnectAttempts = 0, this.transportDiagnosticEpisodes.clear();
|
|
3016
|
-
const t =
|
|
3031
|
+
const t = ar(e.user);
|
|
3017
3032
|
this.authenticatedSocket !== this.socket && this.authenticatedUserId && t && t.id !== this.authenticatedUserId && this.resetForAuthenticationScopeChange(), this.authenticatedUserId = t?.id ?? null, this.authenticatedSocket = this.socket, this.flushPendingWidgetLifecycleEvents(), this.flushPendingComposerWarmup(), this.flushQueuedClientEvents(), this.pendingClientMessageId && (this.setState({ pendingMessageStatus: "sending" }), this.schedulePendingDeliveryAck(this.pendingClientMessageId)), this.flushPendingPassiveWarmup(), this.startHeartbeat();
|
|
3018
|
-
const n =
|
|
3033
|
+
const n = sr(e), i = Object.prototype.hasOwnProperty.call(e, "appearance");
|
|
3019
3034
|
b("web-sdk.agent", "Received auth.ok appearance", {
|
|
3020
3035
|
hasAppearance: i,
|
|
3021
3036
|
rawAppearance: e.appearance,
|
|
3022
3037
|
normalizedAppearance: n
|
|
3023
|
-
}), this.runtimeHelperJavascript =
|
|
3038
|
+
}), this.runtimeHelperJavascript = nr(e.runtimeHelpers)?.javascript ?? null;
|
|
3024
3039
|
const r = Vt(e, "starterPrompts"), o = Object.prototype.hasOwnProperty.call(e, "starterPrompts"), a = e.starterPromptsLoading === !0, l = {
|
|
3025
3040
|
user: t,
|
|
3026
3041
|
status: "connected",
|
|
@@ -3071,7 +3086,7 @@ class Ne {
|
|
|
3071
3086
|
runId: u?.runId
|
|
3072
3087
|
}), g = this.filterStoppedSnapshotItems(n, r), f = e.pendingMessageStatus === "sending" ? "sending" : e.pendingMessageStatus === "queued" ? "reconnecting" : null, h = typeof e.pendingClientMessageId == "string" ? e.pendingClientMessageId : null, p = e.isRetrying === !0, y = e.turnPhase === "sending" || e.turnPhase === "starting" || e.turnPhase === "thinking" ? e.turnPhase : null;
|
|
3073
3088
|
f && h && (this.pendingClientMessageId = h);
|
|
3074
|
-
let m =
|
|
3089
|
+
let m = fr(
|
|
3075
3090
|
e.assistantDraft
|
|
3076
3091
|
);
|
|
3077
3092
|
m && this.findStoppedTurn(r, {
|
|
@@ -3080,9 +3095,9 @@ class Ne {
|
|
|
3080
3095
|
}) && (m = void 0);
|
|
3081
3096
|
const M = m !== void 0;
|
|
3082
3097
|
this.rememberUserMessageClientMessageIds(g);
|
|
3083
|
-
const w =
|
|
3098
|
+
const w = Cr(g), D = g.filter((U) => {
|
|
3084
3099
|
const q = C(U);
|
|
3085
|
-
return
|
|
3100
|
+
return Er(q) ? !1 : !q || !w || !pe(q) ? !0 : dt(g, q) !== w;
|
|
3086
3101
|
}), S = lt(
|
|
3087
3102
|
this.state.messages,
|
|
3088
3103
|
st(D, this.options.backendUrl)
|
|
@@ -3093,12 +3108,12 @@ class Ne {
|
|
|
3093
3108
|
v,
|
|
3094
3109
|
re,
|
|
3095
3110
|
Y,
|
|
3096
|
-
|
|
3111
|
+
_r(g, q)
|
|
3097
3112
|
)
|
|
3098
|
-
), ee = M ? m?.content ?? "" : this.state.assistantDraft, fe = !!m?.content && !Z, B = T && (!ee || Z), Q =
|
|
3099
|
-
if (!T &&
|
|
3113
|
+
), ee = M ? m?.content ?? "" : this.state.assistantDraft, fe = !!m?.content && !Z, B = T && (!ee || Z), Q = br(S), oe = B && Q ? "completed" : d ? "stopped" : B ? "failed" : null;
|
|
3114
|
+
if (!T && kr(this.state.messages, g))
|
|
3100
3115
|
return;
|
|
3101
|
-
this.lastUserMessagePageUrl =
|
|
3116
|
+
this.lastUserMessagePageUrl = Rr(g);
|
|
3102
3117
|
const j = B || d ? null : ut(g);
|
|
3103
3118
|
if (this.latestRecoverableClientMessageId = j, Q && this.clearRetryTimers(), this.setState({
|
|
3104
3119
|
sessionId: A(e.session, "id") ?? this.state.sessionId,
|
|
@@ -3171,14 +3186,14 @@ class Ne {
|
|
|
3171
3186
|
this.options.backendUrl
|
|
3172
3187
|
);
|
|
3173
3188
|
t === this.sessionActivityRequestId && (this.sessionActivityRequestId = null), this.setState({
|
|
3174
|
-
messages:
|
|
3189
|
+
messages: Sr(this.state.messages, i)
|
|
3175
3190
|
});
|
|
3176
3191
|
return;
|
|
3177
3192
|
}
|
|
3178
3193
|
if (e.type === "sessions.page") {
|
|
3179
3194
|
const t = typeof e.requestId == "string" ? e.requestId : null, n = t ? this.pendingSessionHistoryRequests.get(t) : null;
|
|
3180
3195
|
t && n && (window.clearTimeout(n.timeout), this.pendingSessionHistoryRequests.delete(t), n.resolve({
|
|
3181
|
-
sessions:
|
|
3196
|
+
sessions: lr(e.sessions),
|
|
3182
3197
|
nextCursor: typeof e.nextCursor == "string" ? e.nextCursor : null
|
|
3183
3198
|
}));
|
|
3184
3199
|
return;
|
|
@@ -3213,8 +3228,8 @@ class Ne {
|
|
|
3213
3228
|
}
|
|
3214
3229
|
const n = Ue(e.item, this.options.backendUrl);
|
|
3215
3230
|
if (n) {
|
|
3216
|
-
const i =
|
|
3217
|
-
n.callId && r !== void 0 && (n.loading = r, this.pendingToolLoadingByCallId.delete(n.callId)), W(n) && (this.retryableClientMessageId = null, this.clearRetryTimers(), this.clearRunAckResyncRetryTimer()),
|
|
3231
|
+
const i = xr(t, n), r = n.callId ? this.pendingToolLoadingByCallId.get(n.callId) : void 0;
|
|
3232
|
+
n.callId && r !== void 0 && (n.loading = r, this.pendingToolLoadingByCallId.delete(n.callId)), W(n) && (this.retryableClientMessageId = null, this.clearRetryTimers(), this.clearRunAckResyncRetryTimer()), vr(t) && this.clearRunAckResyncRetryTimer();
|
|
3218
3233
|
const o = de(this.state.messages, n), a = ss(o), l = ns(
|
|
3219
3234
|
t,
|
|
3220
3235
|
this.state.assistantDraft,
|
|
@@ -3390,13 +3405,13 @@ class Ne {
|
|
|
3390
3405
|
return;
|
|
3391
3406
|
}
|
|
3392
3407
|
o && i && r && (this.retryableClientMessageId = r);
|
|
3393
|
-
const a = new Error(typeof e.message == "string" ? e.message : "Pluno error"), l =
|
|
3408
|
+
const a = new Error(typeof e.message == "string" ? e.message : "Pluno error"), l = $i(a.message);
|
|
3394
3409
|
l && console.error(l);
|
|
3395
3410
|
const c = r ?? this.activeClientMessageId, u = typeof e.runId == "string" ? e.runId : null, d = rs(
|
|
3396
3411
|
this.state.messages,
|
|
3397
3412
|
c,
|
|
3398
3413
|
u
|
|
3399
|
-
), g =
|
|
3414
|
+
), g = Mr(
|
|
3400
3415
|
d,
|
|
3401
3416
|
c,
|
|
3402
3417
|
u
|
|
@@ -3563,7 +3578,7 @@ class Ne {
|
|
|
3563
3578
|
}
|
|
3564
3579
|
e.type === "error" && typeof e.requestId != "string" && !is(e, t) && this.rememberSessionTimeline(
|
|
3565
3580
|
t,
|
|
3566
|
-
|
|
3581
|
+
qr(n, e)
|
|
3567
3582
|
);
|
|
3568
3583
|
}
|
|
3569
3584
|
}
|
|
@@ -3661,7 +3676,7 @@ class Ne {
|
|
|
3661
3676
|
e.clear();
|
|
3662
3677
|
}
|
|
3663
3678
|
markThinkingProgress() {
|
|
3664
|
-
!this.state.isThinking || this.state.status === "closed" || (this.scheduleThinkingWatchdog(
|
|
3679
|
+
!this.state.isThinking || this.state.status === "closed" || (this.scheduleThinkingWatchdog(ei), this.activeClientMessageId && this.scheduleRunAckWatchdog(this.activeClientMessageId));
|
|
3665
3680
|
}
|
|
3666
3681
|
scheduleThinkingWatchdog(e) {
|
|
3667
3682
|
this.thinkingWatchdogTimer !== null && window.clearTimeout(this.thinkingWatchdogTimer), this.thinkingWatchdogTimer = window.setTimeout(() => {
|
|
@@ -3725,13 +3740,13 @@ class Ne {
|
|
|
3725
3740
|
if (this.state.status === "closed" || this.pendingClientMessageId !== e || !this.pendingUserMessageEvent)
|
|
3726
3741
|
return;
|
|
3727
3742
|
const t = this.retryAttemptsByClientMessageId[e] ?? 0;
|
|
3728
|
-
if (t >=
|
|
3743
|
+
if (t >= si) {
|
|
3729
3744
|
this.failPendingDelivery(e);
|
|
3730
3745
|
return;
|
|
3731
3746
|
}
|
|
3732
3747
|
t === 0 && this.reportHealthSignal("run_ack_missed", { clientMessageId: e }), this.retryAttemptsByClientMessageId[e] = t + 1, this.setState({ pendingMessageStatus: "reconnecting" }), this.pendingDeliveryRetryTimer = window.setTimeout(() => {
|
|
3733
3748
|
this.pendingDeliveryRetryTimer = null, !(this.pendingClientMessageId !== e || !this.pendingUserMessageEvent) && (this.send(this.pendingUserMessageEvent), this.setState({ pendingMessageStatus: "sending" }), this.schedulePendingDeliveryAck(e));
|
|
3734
|
-
},
|
|
3749
|
+
}, mi(t, oi));
|
|
3735
3750
|
}
|
|
3736
3751
|
failPendingDelivery(e) {
|
|
3737
3752
|
if (this.pendingClientMessageId !== e)
|
|
@@ -3744,7 +3759,7 @@ class Ne {
|
|
|
3744
3759
|
...this.state.isThinking ? {} : { turnPhase: null },
|
|
3745
3760
|
isRetrying: !1,
|
|
3746
3761
|
...this.state.isThinking ? {} : { taskStatus: "failed" },
|
|
3747
|
-
lastError:
|
|
3762
|
+
lastError: ii,
|
|
3748
3763
|
lastErrorCode: "message_delivery_failed"
|
|
3749
3764
|
});
|
|
3750
3765
|
}
|
|
@@ -3811,7 +3826,7 @@ class Ne {
|
|
|
3811
3826
|
),
|
|
3812
3827
|
isThinking: !1,
|
|
3813
3828
|
taskStatus: "failed",
|
|
3814
|
-
lastError:
|
|
3829
|
+
lastError: ni,
|
|
3815
3830
|
lastErrorCode: "run_recovery_exhausted"
|
|
3816
3831
|
}), this.clearThinkingWatchdog();
|
|
3817
3832
|
return;
|
|
@@ -3838,7 +3853,7 @@ class Ne {
|
|
|
3838
3853
|
if (!t || !n || !i)
|
|
3839
3854
|
return;
|
|
3840
3855
|
const a = i === "execute_code", l = i === "execute_code_in_browser_tab" && o !== null && typeof o == "object" && o.tabId === "local:current";
|
|
3841
|
-
if (!a && !l || !
|
|
3856
|
+
if (!a && !l || !io(o)) {
|
|
3842
3857
|
this.setToolMessageLoading(n, !1), this.send({
|
|
3843
3858
|
type: "tool.result",
|
|
3844
3859
|
sessionId: t,
|
|
@@ -3887,7 +3902,7 @@ class Ne {
|
|
|
3887
3902
|
let c = null, u;
|
|
3888
3903
|
c = await this.executeRuntimeHelper(), u = await Gt(
|
|
3889
3904
|
o,
|
|
3890
|
-
|
|
3905
|
+
Ni(e.runtimeContext, this.options.backendUrl)
|
|
3891
3906
|
).catch((d) => ({
|
|
3892
3907
|
ok: !1,
|
|
3893
3908
|
exception: {
|
|
@@ -3900,7 +3915,7 @@ class Ne {
|
|
|
3900
3915
|
toolName: i,
|
|
3901
3916
|
summary: o.summary,
|
|
3902
3917
|
rawInput: L(o),
|
|
3903
|
-
rawOutput: L(
|
|
3918
|
+
rawOutput: L(ir(u, c))
|
|
3904
3919
|
}), ls(this.options.clientId, this.activeBrowserToolCalls.values()));
|
|
3905
3920
|
}
|
|
3906
3921
|
setToolMessageLoading(e, t) {
|
|
@@ -3922,10 +3937,10 @@ class Ne {
|
|
|
3922
3937
|
};
|
|
3923
3938
|
}
|
|
3924
3939
|
installSessionBrowserApis() {
|
|
3925
|
-
this.cleanupSessionBrowserApis(), this.sessionBrowserApisCleanup =
|
|
3940
|
+
this.cleanupSessionBrowserApis(), this.sessionBrowserApisCleanup = Ci();
|
|
3926
3941
|
}
|
|
3927
3942
|
cleanupSessionBrowserApis() {
|
|
3928
|
-
this.sessionBrowserApisCleanup && (
|
|
3943
|
+
this.sessionBrowserApisCleanup && (xi(this.sessionBrowserApisCleanup), this.sessionBrowserApisCleanup = null);
|
|
3929
3944
|
}
|
|
3930
3945
|
async executeRuntimeHelper() {
|
|
3931
3946
|
if (!this.runtimeHelperJavascript?.trim())
|
|
@@ -3933,15 +3948,15 @@ class Ne {
|
|
|
3933
3948
|
const e = await Gt({
|
|
3934
3949
|
javascript: this.runtimeHelperJavascript
|
|
3935
3950
|
});
|
|
3936
|
-
return e.ok === !1 ?
|
|
3951
|
+
return e.ok === !1 ? rr(e) : null;
|
|
3937
3952
|
}
|
|
3938
3953
|
enableNetworkCapture() {
|
|
3939
|
-
this.networkCaptureCleanup || (this.networkCaptureCleanup =
|
|
3940
|
-
|
|
3954
|
+
this.networkCaptureCleanup || (this.networkCaptureCleanup = wi((e) => {
|
|
3955
|
+
uo(e.url, this.options.backendUrl) || this.enqueueNetworkEvent(e);
|
|
3941
3956
|
}));
|
|
3942
3957
|
}
|
|
3943
3958
|
enqueueNetworkEvent(e) {
|
|
3944
|
-
this.queuedNetworkEvents.length >=
|
|
3959
|
+
this.queuedNetworkEvents.length >= li || (this.queuedNetworkEvents.push(co(e)), this.networkBatchTimer === null && (this.networkBatchTimer = window.setTimeout(() => {
|
|
3945
3960
|
this.networkBatchTimer = null;
|
|
3946
3961
|
const t = this.queuedNetworkEvents.splice(0, this.queuedNetworkEvents.length);
|
|
3947
3962
|
t.length === 0 || this.socket?.readyState !== WebSocket.OPEN || this.sendNow({
|
|
@@ -3950,14 +3965,14 @@ class Ne {
|
|
|
3950
3965
|
page: _(),
|
|
3951
3966
|
events: t
|
|
3952
3967
|
});
|
|
3953
|
-
},
|
|
3968
|
+
}, ai)));
|
|
3954
3969
|
}
|
|
3955
3970
|
scheduleReconnect(e = 0) {
|
|
3956
3971
|
if (this.reconnectTimer !== null || this.state.status === "closed")
|
|
3957
3972
|
return;
|
|
3958
3973
|
const t = Math.min(
|
|
3959
3974
|
ot,
|
|
3960
|
-
Math.max(
|
|
3975
|
+
Math.max(yi(this.reconnectAttempts), e)
|
|
3961
3976
|
);
|
|
3962
3977
|
this.reconnectAttempts += 1, this.reconnectTimer = window.setTimeout(() => {
|
|
3963
3978
|
this.reconnectTimer = null, this.connect().catch((n) => {
|
|
@@ -3974,8 +3989,8 @@ class Ne {
|
|
|
3974
3989
|
const e = this.socket;
|
|
3975
3990
|
!e || !this.sendNow({ type: "runtime.ping" }) || (this.clearHeartbeatAckTimer(), this.heartbeatAckTimer = window.setTimeout(() => {
|
|
3976
3991
|
this.socket === e && (b("web-sdk.agent", "Pluno heartbeat acknowledgement timed out; reconnecting"), this.replaceTimedOutSocket(e));
|
|
3977
|
-
},
|
|
3978
|
-
},
|
|
3992
|
+
}, Kn));
|
|
3993
|
+
}, zn);
|
|
3979
3994
|
}
|
|
3980
3995
|
stopHeartbeat() {
|
|
3981
3996
|
this.heartbeatTimer !== null && (window.clearInterval(this.heartbeatTimer), this.heartbeatTimer = null), this.clearHeartbeatAckTimer();
|
|
@@ -4013,12 +4028,12 @@ class Ne {
|
|
|
4013
4028
|
...e.lastError === null && e.lastErrorCode === void 0 ? { lastErrorCode: null } : {},
|
|
4014
4029
|
...e.lastError !== void 0 && e.lastErrorSecuritySettingsUrl === void 0 ? { lastErrorSecuritySettingsUrl: null } : {}
|
|
4015
4030
|
}, a = this.state.sessionId, l = this.state.isThinking || this.state.pendingMessageStatus !== null, c = o.isThinking || o.pendingMessageStatus !== null, u = this.activeClientMessageId ?? this.pendingClientMessageId;
|
|
4016
|
-
u && u === this.lastProjectedTurnClientMessageId && c &&
|
|
4031
|
+
u && u === this.lastProjectedTurnClientMessageId && c && Ri(this.lastProjectedTurnPhase, o.turnPhase) && this.reportHealthSignal("invalid_state_transition", {
|
|
4017
4032
|
clientMessageId: u,
|
|
4018
4033
|
reason: "active_turn_phase_moved_backward",
|
|
4019
4034
|
previousPhase: this.lastProjectedTurnPhase,
|
|
4020
4035
|
nextPhase: o.turnPhase
|
|
4021
|
-
}), this.state = o, this.lastProjectedTurnClientMessageId = u, this.lastProjectedTurnPhase = o.turnPhase, o.sessionId && (o.sessionId === a && c !== l || o.sessionId !== a && c) && this.sessionHistoryManager.setActivity(o.sessionId, c), this.rebuildRuntimeInteractions(), e.messages !== void 0 && this.refreshRuntimeInteractions(), this.state.sessionId && this.rememberSessionTimeline(this.state.sessionId, this.state.messages),
|
|
4036
|
+
}), this.state = o, this.lastProjectedTurnClientMessageId = u, this.lastProjectedTurnPhase = o.turnPhase, o.sessionId && (o.sessionId === a && c !== l || o.sessionId !== a && c) && this.sessionHistoryManager.setActivity(o.sessionId, c), this.rebuildRuntimeInteractions(), e.messages !== void 0 && this.refreshRuntimeInteractions(), this.state.sessionId && this.rememberSessionTimeline(this.state.sessionId, this.state.messages), Kr(this.options.clientId, this.state), this.emit("state", this.getState()), Se("state", this.state.status, {
|
|
4022
4037
|
status: this.state.status,
|
|
4023
4038
|
sessionId: this.state.sessionId,
|
|
4024
4039
|
messageCount: this.state.messages.length,
|
|
@@ -4077,13 +4092,13 @@ class Ne {
|
|
|
4077
4092
|
}
|
|
4078
4093
|
}
|
|
4079
4094
|
const Ze = /* @__PURE__ */ new WeakMap();
|
|
4080
|
-
function
|
|
4081
|
-
const e = window.__plunoProductAgentNetworkCapture ??
|
|
4095
|
+
function wi(s) {
|
|
4096
|
+
const e = window.__plunoProductAgentNetworkCapture ?? Ai();
|
|
4082
4097
|
return e.subscribers.add(s), () => {
|
|
4083
4098
|
e.subscribers.delete(s), !(e.subscribers.size > 0) && (e.destroy(), window.__plunoProductAgentNetworkCapture === e && delete window.__plunoProductAgentNetworkCapture);
|
|
4084
4099
|
};
|
|
4085
4100
|
}
|
|
4086
|
-
function
|
|
4101
|
+
function Ai() {
|
|
4087
4102
|
const s = /* @__PURE__ */ new Set(), e = (g) => {
|
|
4088
4103
|
s.forEach((f) => {
|
|
4089
4104
|
try {
|
|
@@ -4100,7 +4115,7 @@ function Ti() {
|
|
|
4100
4115
|
throw m;
|
|
4101
4116
|
}
|
|
4102
4117
|
try {
|
|
4103
|
-
const m = f instanceof Request ? f : null, M =
|
|
4118
|
+
const m = f instanceof Request ? f : null, M = ro(f, m), w = Ls(h?.headers ?? m?.headers);
|
|
4104
4119
|
if (!te(M, w, h?.body)) {
|
|
4105
4120
|
const H = {
|
|
4106
4121
|
requestId: nt("fetch"),
|
|
@@ -4113,7 +4128,7 @@ function Ti() {
|
|
|
4113
4128
|
};
|
|
4114
4129
|
y.then(
|
|
4115
4130
|
(S) => {
|
|
4116
|
-
|
|
4131
|
+
oo(S, H, p, e).catch(() => {
|
|
4117
4132
|
e({
|
|
4118
4133
|
...H,
|
|
4119
4134
|
responseStatus: S.status,
|
|
@@ -4155,7 +4170,7 @@ function Ti() {
|
|
|
4155
4170
|
() => {
|
|
4156
4171
|
queueMicrotask(() => {
|
|
4157
4172
|
try {
|
|
4158
|
-
const p =
|
|
4173
|
+
const p = po(this.getAllResponseHeaders());
|
|
4159
4174
|
e({
|
|
4160
4175
|
requestId: h.requestId,
|
|
4161
4176
|
url: h.url,
|
|
@@ -4165,7 +4180,7 @@ function Ti() {
|
|
|
4165
4180
|
resourceType: "xhr",
|
|
4166
4181
|
responseStatus: this.status,
|
|
4167
4182
|
responseHeaders: p,
|
|
4168
|
-
responseBody:
|
|
4183
|
+
responseBody: lo(this, p),
|
|
4169
4184
|
errorText: this.status === 0 ? "XHR request failed or was aborted" : void 0,
|
|
4170
4185
|
startedAt: h.startedAt,
|
|
4171
4186
|
durationMs: Date.now() - h.startedAtMs
|
|
@@ -4261,10 +4276,10 @@ function Kt(s) {
|
|
|
4261
4276
|
const e = typeof s == "function" ? s() : s;
|
|
4262
4277
|
return e && Object.keys(e).length > 0 ? e : void 0;
|
|
4263
4278
|
}
|
|
4264
|
-
function
|
|
4279
|
+
function Mi(s) {
|
|
4265
4280
|
return s.type === "run.model_started" || s.type === "conversation.state" || s.type === "session.updated" || s.type === "session.item" || s.type === "chat.assistant_delta" || s.type === "chat.assistant_done" || s.type === "tool.call";
|
|
4266
4281
|
}
|
|
4267
|
-
function
|
|
4282
|
+
function bi(s) {
|
|
4268
4283
|
if (s.type === "chat.assistant_delta")
|
|
4269
4284
|
return typeof s.delta == "string" && s.delta.trim().length > 0;
|
|
4270
4285
|
if (s.type === "tool.call")
|
|
@@ -4274,7 +4289,7 @@ function Ai(s) {
|
|
|
4274
4289
|
const e = C(s.item);
|
|
4275
4290
|
return e ? e.type === "message" && e.role === "assistant" ? typeof e.content == "string" && e.content.trim().length > 0 : e.type === "tool_call" || e.type === "function_call" : !1;
|
|
4276
4291
|
}
|
|
4277
|
-
function
|
|
4292
|
+
function Ri(s, e) {
|
|
4278
4293
|
if (!s || !e)
|
|
4279
4294
|
return !1;
|
|
4280
4295
|
const t = {
|
|
@@ -4302,27 +4317,27 @@ function K(s) {
|
|
|
4302
4317
|
}
|
|
4303
4318
|
return null;
|
|
4304
4319
|
}
|
|
4305
|
-
const
|
|
4306
|
-
function
|
|
4320
|
+
const Ei = 5e3, ki = 12e4;
|
|
4321
|
+
function Ci() {
|
|
4307
4322
|
const s = [
|
|
4308
|
-
|
|
4309
|
-
|
|
4323
|
+
Pi(),
|
|
4324
|
+
_i()
|
|
4310
4325
|
].filter((e) => typeof e == "function");
|
|
4311
4326
|
return () => {
|
|
4312
4327
|
for (const e of s.reverse())
|
|
4313
4328
|
e();
|
|
4314
4329
|
};
|
|
4315
4330
|
}
|
|
4316
|
-
function
|
|
4331
|
+
function _i() {
|
|
4317
4332
|
return ps(globalThis, "getPageSnapshot", async () => At());
|
|
4318
4333
|
}
|
|
4319
|
-
function
|
|
4334
|
+
function Pi() {
|
|
4320
4335
|
return ps(globalThis, "pageImages", {
|
|
4321
|
-
inspectImage: async (e, t) => await
|
|
4336
|
+
inspectImage: async (e, t) => await vi(e, t)
|
|
4322
4337
|
});
|
|
4323
4338
|
}
|
|
4324
|
-
async function
|
|
4325
|
-
const t =
|
|
4339
|
+
async function vi(s, e = {}) {
|
|
4340
|
+
const t = Oi(e.name), n = await Ui(s);
|
|
4326
4341
|
return n.ok ? n.sizeBytes > 8 * 1024 * 1024 ? {
|
|
4327
4342
|
type: "pluno.pageImages.inspectImage",
|
|
4328
4343
|
imageAttached: !1,
|
|
@@ -4340,15 +4355,15 @@ async function _i(s, e = {}) {
|
|
|
4340
4355
|
imageAttachmentError: n.error
|
|
4341
4356
|
};
|
|
4342
4357
|
}
|
|
4343
|
-
async function
|
|
4358
|
+
async function Ui(s) {
|
|
4344
4359
|
return s instanceof Blob ? s.type.startsWith("image/") ? s.size === 0 ? { ok: !1, error: "Page image is empty." } : s.size > 8 * 1024 * 1024 ? { ok: !1, error: As } : {
|
|
4345
4360
|
ok: !0,
|
|
4346
4361
|
mimeType: s.type,
|
|
4347
4362
|
sizeBytes: s.size,
|
|
4348
|
-
dataUrl: await
|
|
4349
|
-
} : { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : typeof s != "string" ? { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } :
|
|
4363
|
+
dataUrl: await Li(s)
|
|
4364
|
+
} : { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : typeof s != "string" ? { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : Di(s);
|
|
4350
4365
|
}
|
|
4351
|
-
function
|
|
4366
|
+
function Di(s) {
|
|
4352
4367
|
if (!s.startsWith("data:") || !s.includes(","))
|
|
4353
4368
|
return { ok: !1, error: "Page image must be a complete data:image/* URL, not bare base64." };
|
|
4354
4369
|
const [e, t] = s.slice(5).split(",", 2), n = e.split(";").map((a) => a.trim()).filter(Boolean), i = n[0] ?? "";
|
|
@@ -4359,7 +4374,7 @@ function vi(s) {
|
|
|
4359
4374
|
const r = t.replace(/[ \t\r\n\f]+/g, "");
|
|
4360
4375
|
if (!/^[A-Za-z0-9+/]*={0,2}$/.test(r))
|
|
4361
4376
|
return { ok: !1, error: "Page image data URL has invalid base64." };
|
|
4362
|
-
const o =
|
|
4377
|
+
const o = qi(r);
|
|
4363
4378
|
return o === null ? { ok: !1, error: "Page image data URL has invalid base64." } : o === 0 ? { ok: !1, error: "Page image is empty." } : {
|
|
4364
4379
|
ok: !0,
|
|
4365
4380
|
mimeType: i,
|
|
@@ -4367,22 +4382,22 @@ function vi(s) {
|
|
|
4367
4382
|
dataUrl: `data:${i};base64,${r}`
|
|
4368
4383
|
};
|
|
4369
4384
|
}
|
|
4370
|
-
function
|
|
4385
|
+
function qi(s) {
|
|
4371
4386
|
if (s.length === 0 || s.length % 4 !== 0)
|
|
4372
4387
|
return null;
|
|
4373
4388
|
const e = s.length - s.replace(/=+$/, "").length;
|
|
4374
4389
|
return e > 2 ? null : s.length / 4 * 3 - e;
|
|
4375
4390
|
}
|
|
4376
|
-
function
|
|
4391
|
+
function Oi(s) {
|
|
4377
4392
|
return (typeof s == "string" ? s.trim() : "") || "Page image";
|
|
4378
4393
|
}
|
|
4379
|
-
function
|
|
4394
|
+
function xi(s) {
|
|
4380
4395
|
try {
|
|
4381
4396
|
s();
|
|
4382
4397
|
} catch {
|
|
4383
4398
|
}
|
|
4384
4399
|
}
|
|
4385
|
-
function
|
|
4400
|
+
function Li(s) {
|
|
4386
4401
|
return new Promise((e, t) => {
|
|
4387
4402
|
const n = new FileReader();
|
|
4388
4403
|
n.onload = () => {
|
|
@@ -4396,7 +4411,7 @@ function Oi(s) {
|
|
|
4396
4411
|
}
|
|
4397
4412
|
async function Gt(s, e) {
|
|
4398
4413
|
const t = Object.getPrototypeOf(async function() {
|
|
4399
|
-
}).constructor, n = s.timeoutMs ??
|
|
4414
|
+
}).constructor, n = s.timeoutMs ?? Ei, i = Date.now(), r = [];
|
|
4400
4415
|
let o;
|
|
4401
4416
|
const a = {
|
|
4402
4417
|
log: console.log,
|
|
@@ -4414,7 +4429,7 @@ async function Gt(s, e) {
|
|
|
4414
4429
|
o = window.setTimeout(() => d(c), n);
|
|
4415
4430
|
})
|
|
4416
4431
|
]);
|
|
4417
|
-
return u === c ?
|
|
4432
|
+
return u === c ? Hi(n) : {
|
|
4418
4433
|
ok: !0,
|
|
4419
4434
|
result: u,
|
|
4420
4435
|
console: r,
|
|
@@ -4443,7 +4458,7 @@ async function Gt(s, e) {
|
|
|
4443
4458
|
e?.deactivate(), o !== void 0 && window.clearTimeout(o), console.log = a.log, console.info = a.info, console.warn = a.warn, console.error = a.error;
|
|
4444
4459
|
}
|
|
4445
4460
|
}
|
|
4446
|
-
function
|
|
4461
|
+
function Ni(s, e) {
|
|
4447
4462
|
if (!s || typeof s != "object")
|
|
4448
4463
|
return;
|
|
4449
4464
|
const t = s.sandboxFilesToken;
|
|
@@ -4453,7 +4468,7 @@ function xi(s, e) {
|
|
|
4453
4468
|
const i = () => {
|
|
4454
4469
|
if (!n)
|
|
4455
4470
|
throw new Error("sandboxFiles is only available during browser-code execution");
|
|
4456
|
-
}, r = async (a, l) => await
|
|
4471
|
+
}, r = async (a, l) => await xn(`${e.replace(/\/$/, "")}${a}`, l);
|
|
4457
4472
|
return {
|
|
4458
4473
|
value: Object.freeze({
|
|
4459
4474
|
upload: async (a) => {
|
|
@@ -4487,7 +4502,7 @@ function xi(s, e) {
|
|
|
4487
4502
|
}
|
|
4488
4503
|
};
|
|
4489
4504
|
}
|
|
4490
|
-
function
|
|
4505
|
+
function Hi(s) {
|
|
4491
4506
|
return {
|
|
4492
4507
|
ok: !1,
|
|
4493
4508
|
exception: {
|
|
@@ -4501,10 +4516,10 @@ function Li(s) {
|
|
|
4501
4516
|
}
|
|
4502
4517
|
};
|
|
4503
4518
|
}
|
|
4504
|
-
function
|
|
4519
|
+
function Bi(s) {
|
|
4505
4520
|
return s.replace(/\/+$/, "");
|
|
4506
4521
|
}
|
|
4507
|
-
function
|
|
4522
|
+
function Fi(s) {
|
|
4508
4523
|
const e = {
|
|
4509
4524
|
sidepanel: "extension_sidepanel",
|
|
4510
4525
|
browser_extension_page_ui: "extension_widget",
|
|
@@ -4516,13 +4531,13 @@ function Hi(s) {
|
|
|
4516
4531
|
};
|
|
4517
4532
|
return s && s in e ? e[s] : s ?? "embedded_custom_ui";
|
|
4518
4533
|
}
|
|
4519
|
-
function
|
|
4534
|
+
function Wi(s) {
|
|
4520
4535
|
return s === "pluno" ? "scheduled_continuation" : s ?? "user";
|
|
4521
4536
|
}
|
|
4522
|
-
function
|
|
4537
|
+
function $i(s, e = location.origin) {
|
|
4523
4538
|
return /origin (?:is not allowed|does not match browser origin)/i.test(s) ? `Pluno widget blocked on ${e}: this domain is not allowed. Add ${e} in Pluno under Integration > Domains.` : null;
|
|
4524
4539
|
}
|
|
4525
|
-
function
|
|
4540
|
+
function ji(s) {
|
|
4526
4541
|
const e = new URL("/api/product-agent/embed/ws", s);
|
|
4527
4542
|
return e.protocol = e.protocol === "https:" ? "wss:" : "ws:", e.toString();
|
|
4528
4543
|
}
|
|
@@ -4535,19 +4550,19 @@ function _() {
|
|
|
4535
4550
|
...s ? { plunoProductAgentUi: s } : {}
|
|
4536
4551
|
};
|
|
4537
4552
|
}
|
|
4538
|
-
function
|
|
4553
|
+
function zi() {
|
|
4539
4554
|
return {
|
|
4540
4555
|
pageUrl: location.href,
|
|
4541
4556
|
pageTitle: document.title,
|
|
4542
4557
|
htmlContent: At()
|
|
4543
4558
|
};
|
|
4544
4559
|
}
|
|
4545
|
-
function
|
|
4546
|
-
return Ce.add(s), we || (we =
|
|
4560
|
+
function Ki(s) {
|
|
4561
|
+
return Ce.add(s), we || (we = Gi()), () => {
|
|
4547
4562
|
Ce.delete(s), Ce.size === 0 && (we?.(), we = null);
|
|
4548
4563
|
};
|
|
4549
4564
|
}
|
|
4550
|
-
function
|
|
4565
|
+
function Gi() {
|
|
4551
4566
|
const s = () => {
|
|
4552
4567
|
for (const r of Array.from(Ce))
|
|
4553
4568
|
r();
|
|
@@ -4578,12 +4593,12 @@ function At() {
|
|
|
4578
4593
|
);
|
|
4579
4594
|
for (const p of i.slice(0, 3))
|
|
4580
4595
|
t("Active overlay", tt(he(p), e));
|
|
4581
|
-
const r =
|
|
4596
|
+
const r = Qi(), o = r ? tt(he(r), e) : "";
|
|
4582
4597
|
t("Main page content", o), t("Additional visible page text", tt(he(document.body), e));
|
|
4583
4598
|
const a = s.map(([p, y]) => `${p}:
|
|
4584
4599
|
${y}`).join(`
|
|
4585
4600
|
|
|
4586
|
-
`).trim().slice(0, 12e3), l =
|
|
4601
|
+
`).trim().slice(0, 12e3), l = Vi(i, r).trim(), c = `Simplified DOM outline:
|
|
4587
4602
|
`, u = `
|
|
4588
4603
|
|
|
4589
4604
|
Visible page text:
|
|
@@ -4611,10 +4626,10 @@ function bs(s) {
|
|
|
4611
4626
|
const e = window.getComputedStyle(s);
|
|
4612
4627
|
return e.display !== "none" && e.visibility !== "hidden" && s.getClientRects().length > 0;
|
|
4613
4628
|
}
|
|
4614
|
-
function
|
|
4629
|
+
function Qi() {
|
|
4615
4630
|
return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(bs).sort((s, e) => he(e).length - he(s).length)[0] ?? null;
|
|
4616
4631
|
}
|
|
4617
|
-
function
|
|
4632
|
+
function Vi(s, e) {
|
|
4618
4633
|
const t = /* @__PURE__ */ new Set([
|
|
4619
4634
|
"main",
|
|
4620
4635
|
"nav",
|
|
@@ -4694,7 +4709,7 @@ function Gi(s, e) {
|
|
|
4694
4709
|
"data-test",
|
|
4695
4710
|
"data-qa",
|
|
4696
4711
|
"data-cy"
|
|
4697
|
-
], c = ["aria-label", "placeholder", "data-testid", "data-test", "data-qa", "data-cy"], { priorityElements: u, priorityTargets: d } =
|
|
4712
|
+
], c = ["aria-label", "placeholder", "data-testid", "data-test", "data-qa", "data-cy"], { priorityElements: u, priorityTargets: d } = Xi(), g = new Set(s);
|
|
4698
4713
|
e && g.add(e);
|
|
4699
4714
|
let f = 0;
|
|
4700
4715
|
const h = (w) => {
|
|
@@ -4764,7 +4779,7 @@ function Gi(s, e) {
|
|
|
4764
4779
|
`);
|
|
4765
4780
|
}, m = [], M = ne(window.getSelection()?.toString() ?? "");
|
|
4766
4781
|
M && m.push(`--- selected text ---
|
|
4767
|
-
${JSON.stringify(M)}`), d.length > 0 && m.push(
|
|
4782
|
+
${JSON.stringify(M)}`), d.length > 0 && m.push(Ji(d, t, l, o));
|
|
4768
4783
|
for (const w of s.slice(0, 3))
|
|
4769
4784
|
m.push(y(w, "active overlay DOM", /* @__PURE__ */ new Set()));
|
|
4770
4785
|
if (e && m.push(y(e, "main DOM", /* @__PURE__ */ new Set())), document.body) {
|
|
@@ -4779,7 +4794,7 @@ function Rs(s, e, t, n) {
|
|
|
4779
4794
|
const i = s.tagName.toLowerCase();
|
|
4780
4795
|
let r = i;
|
|
4781
4796
|
const o = s.getAttribute("id");
|
|
4782
|
-
o &&
|
|
4797
|
+
o && Yi(o) && (r += `#${o}`);
|
|
4783
4798
|
for (const a of e) {
|
|
4784
4799
|
const l = s.getAttribute(a);
|
|
4785
4800
|
l && l.length <= 160 && (a !== "role" || !t.has(l)) && (r += `[${a}=${JSON.stringify(l)}]`);
|
|
@@ -4792,7 +4807,7 @@ function Rs(s, e, t, n) {
|
|
|
4792
4807
|
s.hasAttribute(a) && (r += `[${a}]`);
|
|
4793
4808
|
return `${r}${n ? ` ${JSON.stringify(n)}` : ""}`;
|
|
4794
4809
|
}
|
|
4795
|
-
function
|
|
4810
|
+
function Xi() {
|
|
4796
4811
|
const s = /* @__PURE__ */ new Set(), e = /* @__PURE__ */ new Map(), t = (a, l) => {
|
|
4797
4812
|
if (!a)
|
|
4798
4813
|
return;
|
|
@@ -4835,7 +4850,7 @@ function Qi() {
|
|
|
4835
4850
|
priorityTargets: Array.from(e, ([a, l]) => ({ element: a, labels: Array.from(l) }))
|
|
4836
4851
|
};
|
|
4837
4852
|
}
|
|
4838
|
-
function
|
|
4853
|
+
function Ji(s, e, t, n) {
|
|
4839
4854
|
const i = ["--- active/current elements ---"];
|
|
4840
4855
|
for (const r of s) {
|
|
4841
4856
|
const o = [];
|
|
@@ -4871,12 +4886,12 @@ function Es(s) {
|
|
|
4871
4886
|
Array.from(s.childNodes).filter((e) => e.nodeType === Node.TEXT_NODE).map((e) => e.textContent ?? "").join(" ")
|
|
4872
4887
|
);
|
|
4873
4888
|
}
|
|
4874
|
-
function
|
|
4889
|
+
function Yi(s) {
|
|
4875
4890
|
return s.length <= 64 && /^[A-Za-z_][A-Za-z0-9_:.-]*$/.test(s) && !/[a-f0-9]{12,}/i.test(s) && !/:r[0-9a-z]+:/i.test(s);
|
|
4876
4891
|
}
|
|
4877
4892
|
function ks() {
|
|
4878
4893
|
const s = Array.from(document.querySelectorAll(Ht)), e = s.find(
|
|
4879
|
-
(r) => typeof r[
|
|
4894
|
+
(r) => typeof r[Bn] == "string"
|
|
4880
4895
|
);
|
|
4881
4896
|
if (!(e ?? s[0]))
|
|
4882
4897
|
return;
|
|
@@ -4892,23 +4907,23 @@ function ks() {
|
|
|
4892
4907
|
},
|
|
4893
4908
|
{
|
|
4894
4909
|
name: "widget_root",
|
|
4895
|
-
selector:
|
|
4910
|
+
selector: Ln,
|
|
4896
4911
|
description: "Finds Pluno's widget root inside the widget host shadow root."
|
|
4897
4912
|
},
|
|
4898
4913
|
{
|
|
4899
4914
|
name: "widget_panel",
|
|
4900
|
-
selector:
|
|
4915
|
+
selector: Nn,
|
|
4901
4916
|
description: "Finds Pluno's open chat panel inside the widget host shadow root."
|
|
4902
4917
|
},
|
|
4903
4918
|
{
|
|
4904
4919
|
name: "widget_timeline",
|
|
4905
|
-
selector:
|
|
4920
|
+
selector: Hn,
|
|
4906
4921
|
description: "Finds Pluno's chat timeline inside the widget host shadow root."
|
|
4907
4922
|
}
|
|
4908
4923
|
]
|
|
4909
4924
|
};
|
|
4910
4925
|
}
|
|
4911
|
-
function
|
|
4926
|
+
function Zi(s) {
|
|
4912
4927
|
try {
|
|
4913
4928
|
const e = JSON.parse(s);
|
|
4914
4929
|
return e && typeof e == "object" ? e : { type: "error", message: "Invalid server event" };
|
|
@@ -4916,7 +4931,7 @@ function Ji(s) {
|
|
|
4916
4931
|
return { type: "error", message: "Invalid server event" };
|
|
4917
4932
|
}
|
|
4918
4933
|
}
|
|
4919
|
-
function
|
|
4934
|
+
function er(s) {
|
|
4920
4935
|
if (typeof s != "string")
|
|
4921
4936
|
return null;
|
|
4922
4937
|
try {
|
|
@@ -4940,10 +4955,10 @@ function Xt(s) {
|
|
|
4940
4955
|
return typeof t.taskId != "string" || !t.taskId || typeof t.dueAt != "string" || Number.isNaN(Date.parse(t.dueAt)) ? [] : [{ taskId: t.taskId, dueAt: t.dueAt }];
|
|
4941
4956
|
}) : [];
|
|
4942
4957
|
}
|
|
4943
|
-
function
|
|
4958
|
+
function tr(s) {
|
|
4944
4959
|
return Array.isArray(s) ? s.filter((e) => typeof e == "string" && e.trim().length > 0) : [];
|
|
4945
4960
|
}
|
|
4946
|
-
function
|
|
4961
|
+
function sr(s) {
|
|
4947
4962
|
if (!s || typeof s != "object")
|
|
4948
4963
|
return null;
|
|
4949
4964
|
const e = s, t = e.appearance, n = t && typeof t == "object" ? t : e, i = typeof n.accentColor == "string" ? n.accentColor : null, r = n.colorScheme === "dark" ? "dark" : n.colorScheme === "light" ? "light" : null, o = typeof n.fontFamily == "string" && n.fontFamily.trim() ? n.fontFamily : null, a = typeof n.scribbleStyle == "boolean" ? n.scribbleStyle : null;
|
|
@@ -4954,13 +4969,13 @@ function er(s) {
|
|
|
4954
4969
|
...a !== null ? { scribbleStyle: a } : {}
|
|
4955
4970
|
};
|
|
4956
4971
|
}
|
|
4957
|
-
function
|
|
4972
|
+
function nr(s) {
|
|
4958
4973
|
if (!s || typeof s != "object")
|
|
4959
4974
|
return null;
|
|
4960
4975
|
const e = s.javascript;
|
|
4961
4976
|
return typeof e != "string" || !e.trim() ? null : { javascript: e };
|
|
4962
4977
|
}
|
|
4963
|
-
function
|
|
4978
|
+
function ir(s, e) {
|
|
4964
4979
|
return e ? s && typeof s == "object" ? {
|
|
4965
4980
|
...s,
|
|
4966
4981
|
helperError: e
|
|
@@ -4970,13 +4985,13 @@ function sr(s, e) {
|
|
|
4970
4985
|
helperError: e
|
|
4971
4986
|
} : s;
|
|
4972
4987
|
}
|
|
4973
|
-
function
|
|
4988
|
+
function rr(s) {
|
|
4974
4989
|
if (!s || typeof s != "object")
|
|
4975
4990
|
return s;
|
|
4976
4991
|
const e = s;
|
|
4977
4992
|
return typeof e.exception?.message == "string" ? e.exception.message : typeof e.error == "string" ? e.error : s;
|
|
4978
4993
|
}
|
|
4979
|
-
function
|
|
4994
|
+
function or() {
|
|
4980
4995
|
const s = "pluno.productAgent.clientId", e = window.localStorage.getItem(s);
|
|
4981
4996
|
if (e)
|
|
4982
4997
|
return e;
|
|
@@ -4986,7 +5001,7 @@ function ir() {
|
|
|
4986
5001
|
function x() {
|
|
4987
5002
|
return crypto.randomUUID();
|
|
4988
5003
|
}
|
|
4989
|
-
function
|
|
5004
|
+
function ar(s) {
|
|
4990
5005
|
if (!s || typeof s != "object")
|
|
4991
5006
|
return null;
|
|
4992
5007
|
const e = s, t = typeof e.id == "string" ? e.id : null;
|
|
@@ -5002,7 +5017,7 @@ function st(s, e) {
|
|
|
5002
5017
|
s.map((t) => Ue(t, e)).filter((t) => t !== null)
|
|
5003
5018
|
) : [];
|
|
5004
5019
|
}
|
|
5005
|
-
function
|
|
5020
|
+
function lr(s) {
|
|
5006
5021
|
return Array.isArray(s) ? s.flatMap((e) => {
|
|
5007
5022
|
if (!e || typeof e != "object")
|
|
5008
5023
|
return [];
|
|
@@ -5109,7 +5124,7 @@ function Ue(s, e) {
|
|
|
5109
5124
|
scheduledCheckInId: o.id ?? void 0,
|
|
5110
5125
|
scheduledCheckInAt: o.dueAt
|
|
5111
5126
|
};
|
|
5112
|
-
const a =
|
|
5127
|
+
const a = ur(i.output), l = dr(i.output);
|
|
5113
5128
|
return a ? {
|
|
5114
5129
|
id: String(t.id ?? crypto.randomUUID()),
|
|
5115
5130
|
role: "tool",
|
|
@@ -5141,7 +5156,7 @@ function Ue(s, e) {
|
|
|
5141
5156
|
return i.type === "function_call" || i.type === "tool_call" || i.type === "web_search_call" || i.type === "mcp_call" || i.type === "tab_lifecycle_decision" ? {
|
|
5142
5157
|
id: String(t.id ?? crypto.randomUUID()),
|
|
5143
5158
|
role: "tool",
|
|
5144
|
-
content: i.type === "mcp_call" ?
|
|
5159
|
+
content: i.type === "mcp_call" ? cr(i) : pr(i),
|
|
5145
5160
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5146
5161
|
...k(i) !== null ? { displaySequence: k(i) } : {},
|
|
5147
5162
|
...P(i) !== null ? { causalSequence: P(i) } : {},
|
|
@@ -5155,7 +5170,7 @@ function Ue(s, e) {
|
|
|
5155
5170
|
} : i.type === "run_status" || i.type === "run_error" ? i.type === "run_error" && i.stage === "tool_execution" ? null : {
|
|
5156
5171
|
id: String(t.id ?? crypto.randomUUID()),
|
|
5157
5172
|
role: "system",
|
|
5158
|
-
content:
|
|
5173
|
+
content: hr(i),
|
|
5159
5174
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5160
5175
|
...k(i) !== null ? { displaySequence: k(i) } : {},
|
|
5161
5176
|
...P(i) !== null ? { causalSequence: P(i) } : {},
|
|
@@ -5168,11 +5183,11 @@ function Ue(s, e) {
|
|
|
5168
5183
|
...typeof i.securitySettingsUrl == "string" ? { securitySettingsUrl: i.securitySettingsUrl } : {}
|
|
5169
5184
|
} : null;
|
|
5170
5185
|
}
|
|
5171
|
-
function
|
|
5186
|
+
function cr(s) {
|
|
5172
5187
|
const t = (typeof s.server_label == "string" ? s.server_label : "").replace(/^pipedream_/, "").split(/[_-]+/).filter(Boolean).map((n) => `${n.charAt(0).toUpperCase()}${n.slice(1)}`).join(" ");
|
|
5173
5188
|
return t ? `🔌 Using ${t}` : "🔌 Using connected integration";
|
|
5174
5189
|
}
|
|
5175
|
-
function
|
|
5190
|
+
function ur(s) {
|
|
5176
5191
|
if (typeof s != "string")
|
|
5177
5192
|
return null;
|
|
5178
5193
|
try {
|
|
@@ -5189,7 +5204,7 @@ function lr(s) {
|
|
|
5189
5204
|
return null;
|
|
5190
5205
|
}
|
|
5191
5206
|
}
|
|
5192
|
-
function
|
|
5207
|
+
function dr(s) {
|
|
5193
5208
|
if (typeof s != "string")
|
|
5194
5209
|
return null;
|
|
5195
5210
|
try {
|
|
@@ -5204,10 +5219,10 @@ function cr(s) {
|
|
|
5204
5219
|
return null;
|
|
5205
5220
|
}
|
|
5206
5221
|
}
|
|
5207
|
-
function
|
|
5222
|
+
function hr(s) {
|
|
5208
5223
|
return s.type === "run_status" && s.status === "steered" ? "Steered" : typeof s.message == "string" && s.message.trim().length > 0 ? s.message : "";
|
|
5209
5224
|
}
|
|
5210
|
-
function
|
|
5225
|
+
function pr(s) {
|
|
5211
5226
|
if (s.type === "web_search_call") {
|
|
5212
5227
|
const e = s.action;
|
|
5213
5228
|
if (e && typeof e == "object") {
|
|
@@ -5219,9 +5234,9 @@ function dr(s) {
|
|
|
5219
5234
|
}
|
|
5220
5235
|
return "🔎 Searching the web";
|
|
5221
5236
|
}
|
|
5222
|
-
return
|
|
5237
|
+
return gr(s);
|
|
5223
5238
|
}
|
|
5224
|
-
function
|
|
5239
|
+
function gr(s) {
|
|
5225
5240
|
if (typeof s.summary == "string" && s.summary.trim().length > 0)
|
|
5226
5241
|
return se(s.summary);
|
|
5227
5242
|
if (typeof s.arguments == "string")
|
|
@@ -5238,7 +5253,7 @@ function se(s) {
|
|
|
5238
5253
|
const e = s.trim() || "Run tool", t = e.codePointAt(0) ?? 0;
|
|
5239
5254
|
return t >= 126976 && t <= 129791 || t >= 9728 && t <= 10175 || t >= 127462 && t <= 127487 ? e : `🛠️ ${e}`;
|
|
5240
5255
|
}
|
|
5241
|
-
function
|
|
5256
|
+
function fr(s) {
|
|
5242
5257
|
if (s == null)
|
|
5243
5258
|
return s;
|
|
5244
5259
|
if (typeof s != "object")
|
|
@@ -5275,10 +5290,10 @@ function de(s, e) {
|
|
|
5275
5290
|
const t = Cs(
|
|
5276
5291
|
s,
|
|
5277
5292
|
Mt(s, e)
|
|
5278
|
-
), n =
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5293
|
+
), n = Ir(
|
|
5294
|
+
yr(
|
|
5295
|
+
Ar(
|
|
5296
|
+
mr(s, e),
|
|
5282
5297
|
e
|
|
5283
5298
|
),
|
|
5284
5299
|
t
|
|
@@ -5303,7 +5318,7 @@ function Mt(s, e, t = !0) {
|
|
|
5303
5318
|
const i = s.flatMap((r) => (e.respondsToUserMessageId !== void 0 ? r.respondsToUserMessageId === e.respondsToUserMessageId : e.runId !== void 0 && r.respondsToUserMessageId === void 0 && r.runId === e.runId) && r.displaySequence !== void 0 ? [r.displaySequence] : []);
|
|
5304
5319
|
return e.displaySequence = (i.length > 0 ? Math.max(...i) : 0) + 1, e;
|
|
5305
5320
|
}
|
|
5306
|
-
function
|
|
5321
|
+
function mr(s, e) {
|
|
5307
5322
|
const t = e.proactiveSuggestionClientMessageId;
|
|
5308
5323
|
if (!t)
|
|
5309
5324
|
return s;
|
|
@@ -5313,7 +5328,7 @@ function gr(s, e) {
|
|
|
5313
5328
|
const r = [...s];
|
|
5314
5329
|
return r[i] = e, r;
|
|
5315
5330
|
}
|
|
5316
|
-
function
|
|
5331
|
+
function yr(s, e) {
|
|
5317
5332
|
const t = e.assistantDraftItemId;
|
|
5318
5333
|
return t ? s.map(
|
|
5319
5334
|
(n) => n.dataType === "assistant_draft" && n.id === t ? e : n
|
|
@@ -5381,7 +5396,7 @@ function ts(s) {
|
|
|
5381
5396
|
loading: !0
|
|
5382
5397
|
};
|
|
5383
5398
|
}
|
|
5384
|
-
function
|
|
5399
|
+
function Ir(s, e) {
|
|
5385
5400
|
if (e.id.startsWith("transient-activity:"))
|
|
5386
5401
|
return s;
|
|
5387
5402
|
const t = e.toolName === "tab_lifecycle";
|
|
@@ -5407,7 +5422,7 @@ function lt(s, e) {
|
|
|
5407
5422
|
ct
|
|
5408
5423
|
);
|
|
5409
5424
|
}
|
|
5410
|
-
function
|
|
5425
|
+
function Sr(s, e) {
|
|
5411
5426
|
const t = new Map(s.map((r) => [r.id, r])), n = e.map(
|
|
5412
5427
|
(r) => Mt(s, r, !1)
|
|
5413
5428
|
);
|
|
@@ -5457,22 +5472,22 @@ function Cs(s, e) {
|
|
|
5457
5472
|
if (!t?.attachments?.length)
|
|
5458
5473
|
return e;
|
|
5459
5474
|
const n = e.attachments.map((o) => {
|
|
5460
|
-
const a =
|
|
5461
|
-
return a ?
|
|
5475
|
+
const a = Tr(t.attachments ?? [], o);
|
|
5476
|
+
return a ? wr(o, a) : o;
|
|
5462
5477
|
}), i = { ...e, attachments: n }, r = J(e);
|
|
5463
5478
|
return r && Object.defineProperty(i, "clientMessageId", {
|
|
5464
5479
|
value: r,
|
|
5465
5480
|
enumerable: !1
|
|
5466
5481
|
}), i;
|
|
5467
5482
|
}
|
|
5468
|
-
function
|
|
5483
|
+
function Tr(s, e) {
|
|
5469
5484
|
return e.id ? s.find((t) => t.id === e.id) ?? null : null;
|
|
5470
5485
|
}
|
|
5471
|
-
function
|
|
5486
|
+
function wr(s, e) {
|
|
5472
5487
|
const { previewUrl: t } = e;
|
|
5473
5488
|
return t ? { ...s, previewUrl: t } : s;
|
|
5474
5489
|
}
|
|
5475
|
-
function
|
|
5490
|
+
function Ar(s, e) {
|
|
5476
5491
|
if (e.role !== "user")
|
|
5477
5492
|
return s;
|
|
5478
5493
|
const t = s.findIndex(
|
|
@@ -5523,7 +5538,7 @@ function ss(s) {
|
|
|
5523
5538
|
}
|
|
5524
5539
|
return !1;
|
|
5525
5540
|
}
|
|
5526
|
-
function
|
|
5541
|
+
function Mr(s, e, t) {
|
|
5527
5542
|
const n = new Set(
|
|
5528
5543
|
s.filter(
|
|
5529
5544
|
(i) => i.role === "user" && e !== null && J(i) === e
|
|
@@ -5543,7 +5558,7 @@ function wr(s, e, t) {
|
|
|
5543
5558
|
return !1;
|
|
5544
5559
|
});
|
|
5545
5560
|
}
|
|
5546
|
-
function
|
|
5561
|
+
function br(s) {
|
|
5547
5562
|
const e = Ps(s);
|
|
5548
5563
|
if (e === null)
|
|
5549
5564
|
return s.some(W);
|
|
@@ -5575,7 +5590,7 @@ function ie(s) {
|
|
|
5575
5590
|
}
|
|
5576
5591
|
return null;
|
|
5577
5592
|
}
|
|
5578
|
-
function
|
|
5593
|
+
function Rr(s) {
|
|
5579
5594
|
const e = ie(s);
|
|
5580
5595
|
if (e === null)
|
|
5581
5596
|
return null;
|
|
@@ -5594,10 +5609,10 @@ function C(s) {
|
|
|
5594
5609
|
function pe(s) {
|
|
5595
5610
|
return s?.retryable !== !0 ? !1 : s.type === "run_error" ? !0 : s.type === "run_status" && s.status === "interrupted";
|
|
5596
5611
|
}
|
|
5597
|
-
function
|
|
5612
|
+
function Er(s) {
|
|
5598
5613
|
return s?.type === "run_status" && s.status === "interrupted" && s.reason === "backend_restart";
|
|
5599
5614
|
}
|
|
5600
|
-
function
|
|
5615
|
+
function kr(s, e) {
|
|
5601
5616
|
const t = ie(e);
|
|
5602
5617
|
if (t === null)
|
|
5603
5618
|
return !1;
|
|
@@ -5622,7 +5637,7 @@ function ut(s) {
|
|
|
5622
5637
|
const i = n.clientMessageId;
|
|
5623
5638
|
return typeof i == "string" ? i : null;
|
|
5624
5639
|
}
|
|
5625
|
-
function
|
|
5640
|
+
function Cr(s) {
|
|
5626
5641
|
const e = ie(s);
|
|
5627
5642
|
if (e === null)
|
|
5628
5643
|
return null;
|
|
@@ -5653,7 +5668,7 @@ function dt(s, e) {
|
|
|
5653
5668
|
return i?.type === "message" && i.role === "user" && typeof i.clientMessageId == "string" ? i.clientMessageId : null;
|
|
5654
5669
|
}
|
|
5655
5670
|
function ns(s, e, t, n, i, r) {
|
|
5656
|
-
if (!e || !
|
|
5671
|
+
if (!e || !Pr(s))
|
|
5657
5672
|
return !1;
|
|
5658
5673
|
const o = s;
|
|
5659
5674
|
if (pe(o) || t !== null && typeof o.id == "string" && o.id !== t)
|
|
@@ -5661,7 +5676,7 @@ function ns(s, e, t, n, i, r) {
|
|
|
5661
5676
|
const a = O(o);
|
|
5662
5677
|
return n !== null ? a !== null ? a === n : i !== null && E(o) === i && r === n : i === null || E(o) === i;
|
|
5663
5678
|
}
|
|
5664
|
-
function
|
|
5679
|
+
function _r(s, e) {
|
|
5665
5680
|
for (let t = e - 1; t >= 0; t -= 1) {
|
|
5666
5681
|
const n = C(s[t]);
|
|
5667
5682
|
if (n?.type === "message" && n.role === "user")
|
|
@@ -5675,7 +5690,7 @@ function vs(s, e) {
|
|
|
5675
5690
|
return s[t].id;
|
|
5676
5691
|
return null;
|
|
5677
5692
|
}
|
|
5678
|
-
function
|
|
5693
|
+
function Pr(s) {
|
|
5679
5694
|
if (!s || typeof s != "object")
|
|
5680
5695
|
return !1;
|
|
5681
5696
|
const e = s;
|
|
@@ -5684,16 +5699,16 @@ function Cr(s) {
|
|
|
5684
5699
|
function W(s) {
|
|
5685
5700
|
return s.role === "assistant" && s.phase !== "commentary";
|
|
5686
5701
|
}
|
|
5687
|
-
function
|
|
5702
|
+
function vr(s) {
|
|
5688
5703
|
if (!s || typeof s != "object")
|
|
5689
5704
|
return !1;
|
|
5690
5705
|
const e = s;
|
|
5691
5706
|
return e.type === "message" && e.role === "user" ? !1 : e.type === "message" || e.type === "function_call" || e.type === "function_call_output" || e.type === "run_error" || e.type === "run_status";
|
|
5692
5707
|
}
|
|
5693
5708
|
function ht(s) {
|
|
5694
|
-
return s.filter((e, t) => G(e) ? !
|
|
5709
|
+
return s.filter((e, t) => G(e) ? !jr(s, t) && !Us(s, t) && !Wr(s, t) && !$r(s, t) : Ur(e) ? e.retryable === !0 && Fr(s, t) ? !1 : !Br(s, t) : !0);
|
|
5695
5710
|
}
|
|
5696
|
-
function
|
|
5711
|
+
function Ur(s) {
|
|
5697
5712
|
return s.role === "system" && (s.dataType === "run_error" || s.dataType === "run_status" && s.steered !== !0);
|
|
5698
5713
|
}
|
|
5699
5714
|
function G(s) {
|
|
@@ -5702,17 +5717,17 @@ function G(s) {
|
|
|
5702
5717
|
function pt(s) {
|
|
5703
5718
|
return s.steered !== !0 && (s.dataType === "assistant_draft" || s.loading === !0);
|
|
5704
5719
|
}
|
|
5705
|
-
function
|
|
5720
|
+
function Dr(s) {
|
|
5706
5721
|
return s.some(pt);
|
|
5707
5722
|
}
|
|
5708
5723
|
function is(s, e) {
|
|
5709
5724
|
return (s.retryable === !0 || s.code === "transient_model_error") && s.code !== "run_recovery_exhausted" && e !== null && typeof s.clientMessageId == "string";
|
|
5710
5725
|
}
|
|
5711
|
-
function
|
|
5726
|
+
function qr(s, e) {
|
|
5712
5727
|
const t = [...s].reverse().find(pt), n = typeof e.respondsToUserMessageId == "string" ? e.respondsToUserMessageId : t?.respondsToUserMessageId ?? null, i = typeof e.runId == "string" ? e.runId : t?.runId ?? null;
|
|
5713
5728
|
return s.flatMap((r) => (n ? r.respondsToUserMessageId === n || !r.respondsToUserMessageId && i !== null && r.runId === i : i ? r.runId === i : pt(r)) ? r.dataType === "assistant_draft" || G(r) ? [] : r.loading === !0 ? [{ ...r, loading: !1 }] : [r] : [r]);
|
|
5714
5729
|
}
|
|
5715
|
-
function
|
|
5730
|
+
function Or(s, e, t, n) {
|
|
5716
5731
|
const i = s.findIndex(
|
|
5717
5732
|
(l, c) => G(l) && !Us(s, c)
|
|
5718
5733
|
), r = i === -1 ? null : s[i], o = e ?? r?.respondsToUserMessageId ?? null, a = o ? s.find(
|
|
@@ -5727,7 +5742,7 @@ function Dr(s, e, t, n) {
|
|
|
5727
5742
|
function _e(s) {
|
|
5728
5743
|
return s?.type === "run_status" && s.status === "stopped";
|
|
5729
5744
|
}
|
|
5730
|
-
function
|
|
5745
|
+
function xr(s, e) {
|
|
5731
5746
|
return W(e) ? "completed" : _e(s) ? "stopped" : !pe(s) && (s?.type === "run_error" || s?.type === "run_status" && (s.status === "failed" || s.status === "interrupted")) ? "failed" : null;
|
|
5732
5747
|
}
|
|
5733
5748
|
function rs(s, e, t) {
|
|
@@ -5742,14 +5757,14 @@ function rs(s, e, t) {
|
|
|
5742
5757
|
}
|
|
5743
5758
|
function Us(s, e) {
|
|
5744
5759
|
return s.some(
|
|
5745
|
-
(t, n) => n !== e && t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.loading !== !0 && t.steered !== !0) &&
|
|
5760
|
+
(t, n) => n !== e && t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.loading !== !0 && t.steered !== !0) && Lr(
|
|
5746
5761
|
s,
|
|
5747
5762
|
e,
|
|
5748
5763
|
n
|
|
5749
5764
|
)
|
|
5750
5765
|
);
|
|
5751
5766
|
}
|
|
5752
|
-
function
|
|
5767
|
+
function Lr(s, e, t) {
|
|
5753
5768
|
const n = s[e], i = s[t];
|
|
5754
5769
|
if (ge(n, i))
|
|
5755
5770
|
return !0;
|
|
@@ -5762,11 +5777,11 @@ function Or(s, e, t) {
|
|
|
5762
5777
|
}
|
|
5763
5778
|
function os(s, e, t, n) {
|
|
5764
5779
|
const i = (t && t !== e ? t : null) ?? [...s].reverse().find(
|
|
5765
|
-
(l) => l.respondsToUserMessageId !== void 0 && l.respondsToUserMessageId !== e && as(l) && !
|
|
5780
|
+
(l) => l.respondsToUserMessageId !== void 0 && l.respondsToUserMessageId !== e && as(l) && !Hr(
|
|
5766
5781
|
s,
|
|
5767
5782
|
l.respondsToUserMessageId
|
|
5768
5783
|
)
|
|
5769
|
-
)?.respondsToUserMessageId ??
|
|
5784
|
+
)?.respondsToUserMessageId ?? Nr(
|
|
5770
5785
|
s,
|
|
5771
5786
|
e
|
|
5772
5787
|
);
|
|
@@ -5795,7 +5810,7 @@ function os(s, e, t, n) {
|
|
|
5795
5810
|
}
|
|
5796
5811
|
];
|
|
5797
5812
|
}
|
|
5798
|
-
function
|
|
5813
|
+
function Nr(s, e) {
|
|
5799
5814
|
const t = s.findIndex(
|
|
5800
5815
|
(n) => n.role === "user" && n.id === e
|
|
5801
5816
|
);
|
|
@@ -5809,12 +5824,12 @@ function xr(s, e) {
|
|
|
5809
5824
|
function as(s) {
|
|
5810
5825
|
return s.role === "tool" || G(s) ? !0 : s.role === "assistant" && s.phase === "commentary";
|
|
5811
5826
|
}
|
|
5812
|
-
function
|
|
5827
|
+
function Hr(s, e) {
|
|
5813
5828
|
return s.some(
|
|
5814
5829
|
(t) => t.respondsToUserMessageId === e && (W(t) || t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.loading !== !0))
|
|
5815
5830
|
);
|
|
5816
5831
|
}
|
|
5817
|
-
function
|
|
5832
|
+
function Br(s, e) {
|
|
5818
5833
|
const t = s[e];
|
|
5819
5834
|
for (let n = e + 1; n < s.length; n += 1) {
|
|
5820
5835
|
const i = s[n];
|
|
@@ -5823,7 +5838,7 @@ function Nr(s, e) {
|
|
|
5823
5838
|
}
|
|
5824
5839
|
return !1;
|
|
5825
5840
|
}
|
|
5826
|
-
function
|
|
5841
|
+
function Fr(s, e) {
|
|
5827
5842
|
const t = s[e];
|
|
5828
5843
|
if (!t.respondsToUserMessageId)
|
|
5829
5844
|
return !1;
|
|
@@ -5836,19 +5851,19 @@ function Hr(s, e) {
|
|
|
5836
5851
|
}
|
|
5837
5852
|
return !1;
|
|
5838
5853
|
}
|
|
5839
|
-
function
|
|
5854
|
+
function Wr(s, e) {
|
|
5840
5855
|
const t = s[e];
|
|
5841
5856
|
return s.some(
|
|
5842
5857
|
(n, i) => i !== e && n.role === "assistant" && ge(t, n)
|
|
5843
5858
|
);
|
|
5844
5859
|
}
|
|
5845
|
-
function
|
|
5860
|
+
function $r(s, e) {
|
|
5846
5861
|
const t = s[e];
|
|
5847
5862
|
return s.some(
|
|
5848
5863
|
(n, i) => i !== e && n.role === "tool" && ge(t, n)
|
|
5849
5864
|
);
|
|
5850
5865
|
}
|
|
5851
|
-
function
|
|
5866
|
+
function jr(s, e) {
|
|
5852
5867
|
const t = s[e];
|
|
5853
5868
|
for (let n = e + 1; n < s.length; n += 1)
|
|
5854
5869
|
if (G(s[n]) && ge(t, s[n]))
|
|
@@ -5861,7 +5876,7 @@ function ge(s, e) {
|
|
|
5861
5876
|
function A(s, e) {
|
|
5862
5877
|
return s && typeof s == "object" && typeof s[e] == "string" ? s[e] : null;
|
|
5863
5878
|
}
|
|
5864
|
-
function
|
|
5879
|
+
function zr(s, e) {
|
|
5865
5880
|
try {
|
|
5866
5881
|
const t = window.localStorage.getItem(`${Ms}${s}`);
|
|
5867
5882
|
if (!t)
|
|
@@ -5869,7 +5884,7 @@ function $r(s, e) {
|
|
|
5869
5884
|
const n = JSON.parse(t), i = typeof n.sessionId == "string" ? n.sessionId : null;
|
|
5870
5885
|
if (e !== void 0 && i !== e)
|
|
5871
5886
|
return null;
|
|
5872
|
-
const r = Array.isArray(n.messages) ? n.messages.map(
|
|
5887
|
+
const r = Array.isArray(n.messages) ? n.messages.map(so).filter((o) => !!o) : [];
|
|
5873
5888
|
return {
|
|
5874
5889
|
sessionId: i,
|
|
5875
5890
|
messages: r
|
|
@@ -5883,20 +5898,20 @@ function gt(s) {
|
|
|
5883
5898
|
// running tool or commentary history from disappearing while authoritative hydration is still in flight.
|
|
5884
5899
|
s.role === "tool" || s.dataType === "run_status" || s.dataType === "run_error";
|
|
5885
5900
|
}
|
|
5886
|
-
function
|
|
5901
|
+
function Kr(s, e) {
|
|
5887
5902
|
try {
|
|
5888
5903
|
window.localStorage.setItem(
|
|
5889
5904
|
`${Ms}${s}`,
|
|
5890
5905
|
JSON.stringify({
|
|
5891
5906
|
sessionId: e.sessionId,
|
|
5892
|
-
messages: e.messages.filter(gt).slice(-
|
|
5907
|
+
messages: e.messages.filter(gt).slice(-pi).map(no)
|
|
5893
5908
|
})
|
|
5894
5909
|
);
|
|
5895
5910
|
} catch {
|
|
5896
5911
|
return;
|
|
5897
5912
|
}
|
|
5898
5913
|
}
|
|
5899
|
-
function
|
|
5914
|
+
function Gr(s) {
|
|
5900
5915
|
try {
|
|
5901
5916
|
const e = window.localStorage.getItem(`${at}${s}`);
|
|
5902
5917
|
if (!e)
|
|
@@ -5947,19 +5962,19 @@ function ls(s, e) {
|
|
|
5947
5962
|
}
|
|
5948
5963
|
Ds(s, e);
|
|
5949
5964
|
}
|
|
5950
|
-
function
|
|
5965
|
+
function Qr(s) {
|
|
5951
5966
|
try {
|
|
5952
5967
|
const e = `${Le}${s}`, t = window.sessionStorage.getItem(e);
|
|
5953
5968
|
if (window.sessionStorage.removeItem(e), !t)
|
|
5954
5969
|
return [];
|
|
5955
5970
|
const n = JSON.parse(t);
|
|
5956
|
-
return Array.isArray(n) ? n.flatMap((i) =>
|
|
5971
|
+
return Array.isArray(n) ? n.flatMap((i) => Xr(i) ? [{
|
|
5957
5972
|
...i.event,
|
|
5958
5973
|
page: _(),
|
|
5959
5974
|
rawOutput: {
|
|
5960
5975
|
pageContextRestarted: !0,
|
|
5961
5976
|
outcome: "unknown",
|
|
5962
|
-
message:
|
|
5977
|
+
message: Vr(location.href),
|
|
5963
5978
|
currentUrl: location.href,
|
|
5964
5979
|
console: [],
|
|
5965
5980
|
metadata: {
|
|
@@ -5976,17 +5991,17 @@ function Kr(s) {
|
|
|
5976
5991
|
return [];
|
|
5977
5992
|
}
|
|
5978
5993
|
}
|
|
5979
|
-
function
|
|
5994
|
+
function Vr(s) {
|
|
5980
5995
|
return `The page context restarted. This is expected when the action included page navigation. Otherwise, it's unknown whether the action completed.
|
|
5981
5996
|
Current URL: ${s}`;
|
|
5982
5997
|
}
|
|
5983
|
-
function
|
|
5998
|
+
function Xr(s) {
|
|
5984
5999
|
if (!s || typeof s != "object")
|
|
5985
6000
|
return !1;
|
|
5986
6001
|
const e = s, t = e.event;
|
|
5987
6002
|
return typeof e.startedAtMs == "number" && typeof e.startedAtUrl == "string" && e.startedAtOrigin === location.origin && e.unloadOrigin === location.origin && typeof e.unloadUrl == "string" && bt(t) && t.type === "tool.result";
|
|
5988
6003
|
}
|
|
5989
|
-
function
|
|
6004
|
+
function Jr(s, e) {
|
|
5990
6005
|
const t = new Set(
|
|
5991
6006
|
s.flatMap((n) => n.type === "tool.result" ? [n.callId] : [])
|
|
5992
6007
|
);
|
|
@@ -5995,7 +6010,7 @@ function Vr(s, e) {
|
|
|
5995
6010
|
...e.filter((n) => !t.has(n.callId))
|
|
5996
6011
|
];
|
|
5997
6012
|
}
|
|
5998
|
-
function
|
|
6013
|
+
function Yr(s) {
|
|
5999
6014
|
try {
|
|
6000
6015
|
window.sessionStorage.removeItem(`${Le}${s}`);
|
|
6001
6016
|
} catch {
|
|
@@ -6032,9 +6047,9 @@ function Os(s, e) {
|
|
|
6032
6047
|
} : s;
|
|
6033
6048
|
}
|
|
6034
6049
|
function ft(s) {
|
|
6035
|
-
return s.type ||
|
|
6050
|
+
return s.type || to(s.name) || "application/octet-stream";
|
|
6036
6051
|
}
|
|
6037
|
-
function
|
|
6052
|
+
function Zr(s) {
|
|
6038
6053
|
xs({
|
|
6039
6054
|
name: s.name,
|
|
6040
6055
|
mimeType: ft(s),
|
|
@@ -6042,21 +6057,21 @@ function Jr(s) {
|
|
|
6042
6057
|
});
|
|
6043
6058
|
}
|
|
6044
6059
|
function xs(s) {
|
|
6045
|
-
const e =
|
|
6046
|
-
if (!
|
|
6060
|
+
const e = eo(s.name), t = s.mimeType.trim().toLowerCase();
|
|
6061
|
+
if (!ui.has(`${e}:${t}`))
|
|
6047
6062
|
throw new Error("This attachment type is not supported by the embedded model provider");
|
|
6048
6063
|
if (s.sizeBytes <= 0 || s.sizeBytes >= ws)
|
|
6049
6064
|
throw new Error("Embedded attachments must be between 1 byte and less than 50 MB");
|
|
6050
6065
|
}
|
|
6051
|
-
function
|
|
6066
|
+
function eo(s) {
|
|
6052
6067
|
const e = s.trim().toLowerCase(), t = e.lastIndexOf(".");
|
|
6053
6068
|
return t >= 0 ? e.slice(t) : "";
|
|
6054
6069
|
}
|
|
6055
|
-
function
|
|
6070
|
+
function to(s) {
|
|
6056
6071
|
const e = s.toLowerCase();
|
|
6057
6072
|
return e.endsWith(".png") ? "image/png" : e.endsWith(".jpg") || e.endsWith(".jpeg") ? "image/jpeg" : e.endsWith(".webp") ? "image/webp" : e.endsWith(".gif") ? "image/gif" : e.endsWith(".pdf") ? "application/pdf" : null;
|
|
6058
6073
|
}
|
|
6059
|
-
function
|
|
6074
|
+
function so(s) {
|
|
6060
6075
|
if (!s || typeof s != "object")
|
|
6061
6076
|
return null;
|
|
6062
6077
|
const e = s;
|
|
@@ -6078,7 +6093,7 @@ function eo(s) {
|
|
|
6078
6093
|
loading: typeof e.loading == "boolean" ? e.loading : void 0
|
|
6079
6094
|
};
|
|
6080
6095
|
}
|
|
6081
|
-
function
|
|
6096
|
+
function no(s) {
|
|
6082
6097
|
return s.attachments?.length ? {
|
|
6083
6098
|
...s,
|
|
6084
6099
|
attachments: s.attachments.map(qe)
|
|
@@ -6102,9 +6117,9 @@ function E(s) {
|
|
|
6102
6117
|
const e = s.runId;
|
|
6103
6118
|
return typeof e == "string" && e ? e : null;
|
|
6104
6119
|
}
|
|
6105
|
-
function
|
|
6120
|
+
function io(s) {
|
|
6106
6121
|
const e = s?.timeoutMs;
|
|
6107
|
-
return !!s && typeof s == "object" && typeof s.summary == "string" && typeof s.javascript == "string" && (e === void 0 || typeof e == "number" && Number.isInteger(e) && e > 0 && e <=
|
|
6122
|
+
return !!s && typeof s == "object" && typeof s.summary == "string" && typeof s.javascript == "string" && (e === void 0 || typeof e == "number" && Number.isInteger(e) && e > 0 && e <= ki);
|
|
6108
6123
|
}
|
|
6109
6124
|
function Ls(s) {
|
|
6110
6125
|
const e = {};
|
|
@@ -6118,22 +6133,22 @@ function Ls(s) {
|
|
|
6118
6133
|
return e;
|
|
6119
6134
|
}
|
|
6120
6135
|
function Rt(s, e) {
|
|
6121
|
-
return $s(s) ? Be : F(xe(e),
|
|
6136
|
+
return $s(s) ? Be : F(xe(e), di);
|
|
6122
6137
|
}
|
|
6123
|
-
function
|
|
6138
|
+
function ro(s, e) {
|
|
6124
6139
|
return typeof s == "string" ? s : s instanceof URL ? s.toString() : e?.url ?? "";
|
|
6125
6140
|
}
|
|
6126
|
-
async function
|
|
6141
|
+
async function oo(s, e, t, n) {
|
|
6127
6142
|
const i = Ls(s.headers);
|
|
6128
6143
|
n({
|
|
6129
6144
|
...e,
|
|
6130
6145
|
responseStatus: s.status,
|
|
6131
6146
|
responseHeaders: i,
|
|
6132
|
-
responseBody: await
|
|
6147
|
+
responseBody: await ao(s),
|
|
6133
6148
|
durationMs: Date.now() - t
|
|
6134
6149
|
});
|
|
6135
6150
|
}
|
|
6136
|
-
async function
|
|
6151
|
+
async function ao(s) {
|
|
6137
6152
|
if (!Ns(s.headers))
|
|
6138
6153
|
return;
|
|
6139
6154
|
let e = null, t = null;
|
|
@@ -6143,7 +6158,7 @@ async function ro(s) {
|
|
|
6143
6158
|
const n = new Promise((a) => {
|
|
6144
6159
|
t = window.setTimeout(() => {
|
|
6145
6160
|
e?.cancel(), a("timeout");
|
|
6146
|
-
},
|
|
6161
|
+
}, hi);
|
|
6147
6162
|
}), i = new TextDecoder();
|
|
6148
6163
|
let r = "", o = 0;
|
|
6149
6164
|
for (; ; ) {
|
|
@@ -6165,7 +6180,7 @@ async function ro(s) {
|
|
|
6165
6180
|
t !== null && window.clearTimeout(t);
|
|
6166
6181
|
}
|
|
6167
6182
|
}
|
|
6168
|
-
function
|
|
6183
|
+
function lo(s, e) {
|
|
6169
6184
|
if (Ns(new Headers(e)))
|
|
6170
6185
|
try {
|
|
6171
6186
|
return s.responseType === "" || s.responseType === "text" ? F(s.responseText ?? "") : void 0;
|
|
@@ -6177,7 +6192,7 @@ function us(s) {
|
|
|
6177
6192
|
if (typeof s == "string")
|
|
6178
6193
|
return F(s);
|
|
6179
6194
|
}
|
|
6180
|
-
function
|
|
6195
|
+
function co(s) {
|
|
6181
6196
|
return L({
|
|
6182
6197
|
...s,
|
|
6183
6198
|
requestBody: ds(s.requestBody),
|
|
@@ -6203,7 +6218,7 @@ function Ns(s) {
|
|
|
6203
6218
|
return t !== null && Number.isInteger(n) && n >= 0 && n <= Tt && (e.startsWith("text/") || e.includes("json") || e.includes("javascript"));
|
|
6204
6219
|
}
|
|
6205
6220
|
function te(s, e = {}, t) {
|
|
6206
|
-
if (
|
|
6221
|
+
if (ho(t))
|
|
6207
6222
|
return !0;
|
|
6208
6223
|
const n = Object.entries(e).find(([i]) => i.toLowerCase() === "content-type")?.[1]?.toLowerCase();
|
|
6209
6224
|
if (n?.includes("multipart/form-data") || n?.includes("application/octet-stream"))
|
|
@@ -6218,7 +6233,7 @@ function te(s, e = {}, t) {
|
|
|
6218
6233
|
return !0;
|
|
6219
6234
|
}
|
|
6220
6235
|
}
|
|
6221
|
-
function
|
|
6236
|
+
function uo(s, e) {
|
|
6222
6237
|
if (te(s))
|
|
6223
6238
|
return !0;
|
|
6224
6239
|
try {
|
|
@@ -6228,10 +6243,10 @@ function lo(s, e) {
|
|
|
6228
6243
|
return !0;
|
|
6229
6244
|
}
|
|
6230
6245
|
}
|
|
6231
|
-
function
|
|
6246
|
+
function ho(s) {
|
|
6232
6247
|
return s instanceof FormData || s instanceof Blob || s instanceof ArrayBuffer || ArrayBuffer.isView(s) || typeof ReadableStream < "u" && s instanceof ReadableStream;
|
|
6233
6248
|
}
|
|
6234
|
-
function
|
|
6249
|
+
function po(s) {
|
|
6235
6250
|
const e = {};
|
|
6236
6251
|
for (const t of s.trim().split(/[\r\n]+/)) {
|
|
6237
6252
|
const n = t.indexOf(":");
|
|
@@ -6262,27 +6277,27 @@ async function be(s, e) {
|
|
|
6262
6277
|
try {
|
|
6263
6278
|
return await s();
|
|
6264
6279
|
} catch (i) {
|
|
6265
|
-
if (t = i, n >= zt - 1 || !
|
|
6280
|
+
if (t = i, n >= zt - 1 || !fo(i))
|
|
6266
6281
|
throw i;
|
|
6267
|
-
await
|
|
6282
|
+
await go(n);
|
|
6268
6283
|
}
|
|
6269
6284
|
throw t instanceof Error ? t : new Error(e);
|
|
6270
6285
|
}
|
|
6271
|
-
function
|
|
6286
|
+
function go(s) {
|
|
6272
6287
|
return new Promise((e) => {
|
|
6273
|
-
window.setTimeout(e,
|
|
6288
|
+
window.setTimeout(e, ci[s] ?? 0);
|
|
6274
6289
|
});
|
|
6275
6290
|
}
|
|
6276
|
-
function
|
|
6277
|
-
return s instanceof Pe ?
|
|
6291
|
+
function fo(s) {
|
|
6292
|
+
return s instanceof Pe ? mo(s.status) : s instanceof TypeError;
|
|
6278
6293
|
}
|
|
6279
|
-
function
|
|
6294
|
+
function mo(s) {
|
|
6280
6295
|
return s === 408 || s === 409 || s === 429 || s >= 500;
|
|
6281
6296
|
}
|
|
6282
|
-
function
|
|
6297
|
+
function yo(s) {
|
|
6283
6298
|
return s === 401 || s === 403;
|
|
6284
6299
|
}
|
|
6285
|
-
const Be = "[REDACTED_SECRET]", $ = "[REDACTED_TOKEN]",
|
|
6300
|
+
const Be = "[REDACTED_SECRET]", $ = "[REDACTED_TOKEN]", Io = "[REDACTED_SIGNED_URL]", So = 20, To = /^(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, Hs = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, Bs = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, Fs = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, Ws = /\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, wo = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, Ao = /\bhttps?:\/\/[^\s"'<>]+/gi, Mo = /[),.;\]]+$/;
|
|
6286
6301
|
function L(s) {
|
|
6287
6302
|
return Oe(s, 0, /* @__PURE__ */ new WeakSet());
|
|
6288
6303
|
}
|
|
@@ -6291,7 +6306,7 @@ function Oe(s, e, t) {
|
|
|
6291
6306
|
return s.startsWith("data:image/") || s.startsWith("data:application/pdf;") ? s : xe(s);
|
|
6292
6307
|
if (s === null || typeof s != "object")
|
|
6293
6308
|
return s;
|
|
6294
|
-
if (e >=
|
|
6309
|
+
if (e >= So)
|
|
6295
6310
|
return "[REDACTED_MAX_DEPTH]";
|
|
6296
6311
|
if (t.has(s))
|
|
6297
6312
|
return "[REDACTED_CIRCULAR]";
|
|
@@ -6299,71 +6314,71 @@ function Oe(s, e, t) {
|
|
|
6299
6314
|
return s.map((i) => Oe(i, e + 1, t));
|
|
6300
6315
|
const n = {};
|
|
6301
6316
|
for (const [i, r] of Object.entries(s))
|
|
6302
|
-
i === "pageContent" ? n[i] = r : $s(i) ? n[i] = Be : n[i] = i.toLowerCase() === "url" ?
|
|
6317
|
+
i === "pageContent" ? n[i] = r : $s(i) ? n[i] = Be : n[i] = i.toLowerCase() === "url" ? bo(r) : Oe(r, e + 1, t);
|
|
6303
6318
|
return n;
|
|
6304
6319
|
}
|
|
6305
6320
|
function $s(s) {
|
|
6306
6321
|
const e = s.replace(/[^a-z0-9]/gi, "").toLowerCase();
|
|
6307
6322
|
return e.includes("authorization") || e.includes("cookie") || e.includes("password") || e.includes("passwd") || e === "pwd" || e.includes("secret") || e === "token" || e.endsWith("token") || e.includes("apikey") || e.includes("csrf") || e.includes("xsrf") || e === "jwt" || e === "session" || e === "signature" || e.includes("privatekey");
|
|
6308
6323
|
}
|
|
6309
|
-
function
|
|
6324
|
+
function bo(s) {
|
|
6310
6325
|
return typeof s == "string" ? js(s) : Oe(s, 0, /* @__PURE__ */ new WeakSet());
|
|
6311
6326
|
}
|
|
6312
6327
|
function js(s) {
|
|
6313
6328
|
try {
|
|
6314
6329
|
const e = new URL(s, location.href);
|
|
6315
6330
|
for (const t of Array.from(e.searchParams.keys()))
|
|
6316
|
-
|
|
6331
|
+
To.test(t) && e.searchParams.set(t, $);
|
|
6317
6332
|
return e.username && (e.username = $), e.password && (e.password = $), e.toString();
|
|
6318
6333
|
} catch {
|
|
6319
|
-
return
|
|
6334
|
+
return Ro(s);
|
|
6320
6335
|
}
|
|
6321
6336
|
}
|
|
6322
6337
|
function xe(s) {
|
|
6323
|
-
return s.replace(
|
|
6338
|
+
return s.replace(wo, Io).replace(Ao, Eo).replace(Hs, `Bearer ${$}`).replace(Bs, `Basic ${$}`).replace(Fs, $).replace(Ws, (e, t) => `${t}: ${Be}`);
|
|
6324
6339
|
}
|
|
6325
|
-
function
|
|
6340
|
+
function Ro(s) {
|
|
6326
6341
|
return s.replace(Hs, `Bearer ${$}`).replace(Bs, `Basic ${$}`).replace(Fs, $).replace(Ws, (e, t) => `${t}: ${Be}`);
|
|
6327
6342
|
}
|
|
6328
|
-
function
|
|
6329
|
-
const e = s.match(
|
|
6343
|
+
function Eo(s) {
|
|
6344
|
+
const e = s.match(Mo)?.[0] ?? "", t = e ? s.slice(0, -e.length) : s;
|
|
6330
6345
|
return `${js(t)}${e}`;
|
|
6331
6346
|
}
|
|
6332
|
-
const
|
|
6347
|
+
const Oo = Object.freeze({
|
|
6333
6348
|
init: (s) => Ne.init(s)
|
|
6334
6349
|
});
|
|
6335
|
-
function
|
|
6350
|
+
function xo(s) {
|
|
6336
6351
|
return Ne.init(s);
|
|
6337
6352
|
}
|
|
6338
6353
|
export {
|
|
6339
6354
|
Ht as PLUNO_PRODUCT_AGENT_WIDGET_HOST_SELECTOR,
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6355
|
+
Nn as PLUNO_PRODUCT_AGENT_WIDGET_PANEL_SELECTOR,
|
|
6356
|
+
Ln as PLUNO_PRODUCT_AGENT_WIDGET_ROOT_SELECTOR,
|
|
6357
|
+
Hn as PLUNO_PRODUCT_AGENT_WIDGET_TIMELINE_SELECTOR,
|
|
6358
|
+
qo as PRODUCT_AGENT_PROVIDER_INPUT_ATTACHMENT_ACCEPT,
|
|
6359
|
+
Oo as PlunoProductAgent,
|
|
6345
6360
|
_n as ProductAgentInteractionManager,
|
|
6346
6361
|
xt as ProductAgentQueryController,
|
|
6347
|
-
|
|
6362
|
+
Do as ProductAgentRemoteRuntimeClient,
|
|
6348
6363
|
Ne as ProductAgentSessionEngine,
|
|
6349
6364
|
En as ProductAgentSessionHistoryManager,
|
|
6350
|
-
|
|
6365
|
+
Po as ProductAgentTaskPageTitleController,
|
|
6351
6366
|
X as ProductAgentTokenProviderError,
|
|
6352
|
-
|
|
6353
|
-
|
|
6367
|
+
yi as calculateReconnectDelay,
|
|
6368
|
+
_o as createLocalStorageInteractionDecisionStorage,
|
|
6354
6369
|
Ee as createProductAgentQueryState,
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6370
|
+
xo as createProductAgentRuntime,
|
|
6371
|
+
vo as createProductAgentTaskPageTitleDocument,
|
|
6372
|
+
Oo as default,
|
|
6358
6373
|
Dn as formatProductAgentTaskPageTitle,
|
|
6359
|
-
|
|
6360
|
-
|
|
6374
|
+
$i as getProductAgentOriginAccessErrorMessage,
|
|
6375
|
+
Uo as isProductAgentRuntimeCommand,
|
|
6361
6376
|
Mn as mergeProductAgentEntityPages,
|
|
6362
6377
|
ke as normalizeProductAgentEntityPage,
|
|
6363
6378
|
st as normalizeProductAgentSessionItems,
|
|
6364
6379
|
Pn as readLocalStorageInteractionDecisions,
|
|
6365
|
-
|
|
6366
|
-
|
|
6380
|
+
Co as resolveProductAgentComposerAction,
|
|
6381
|
+
ko as resolveProductAgentWidgetPresentation,
|
|
6367
6382
|
Ss as selectProductAgentQueryEntities,
|
|
6368
|
-
|
|
6383
|
+
Zr as validateProductAgentProviderInputFile
|
|
6369
6384
|
};
|