@pluno/product-agent-web 0.1.304 → 0.1.305
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.
|
@@ -4,12 +4,12 @@ const Oi = [
|
|
|
4
4
|
{ value: "deepseek/deepseek-v4-flash", label: "DeepSeek V4 Flash", price: "$" },
|
|
5
5
|
{ value: "anthropic/claude-opus-5.5", label: "Claude Opus 5.5", price: "$$$" }
|
|
6
6
|
];
|
|
7
|
-
function
|
|
7
|
+
function Gr(t) {
|
|
8
8
|
return t.length <= 4 ? { primary: t, more: [] } : { primary: t.slice(0, 3), more: t.slice(3) };
|
|
9
9
|
}
|
|
10
|
-
const xi =
|
|
10
|
+
const xi = Gr(Oi), ns = xi.primary;
|
|
11
11
|
xi.more;
|
|
12
|
-
const
|
|
12
|
+
const Jr = (t) => Oi.some((e) => e.value === t), xe = (t) => t === "gpt-5.6-sol" || t === "gpt-5.6-terra" || t === "anthropic/claude-sonnet-5" ? "gpt-6-sol" : t === "anthropic/claude-opus-5" ? "anthropic/claude-opus-5.5" : Jr(t) ? t : void 0;
|
|
13
13
|
function wt(t, e, s) {
|
|
14
14
|
t.throwIfAborted();
|
|
15
15
|
let n, i = () => {
|
|
@@ -28,7 +28,7 @@ function Ns(t) {
|
|
|
28
28
|
for (const i of Un) t.removeItem(i);
|
|
29
29
|
return t.setItem(Nn, JSON.stringify(s.filter((i) => !Ds.includes(i.promptKey)))), n;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Qr(t, e) {
|
|
32
32
|
if (!Ds.includes(e)) throw new Error("Unknown device hint.");
|
|
33
33
|
t.setItem(Us, JSON.stringify({ ...Ns(t), [e]: !0 }));
|
|
34
34
|
}
|
|
@@ -156,7 +156,7 @@ const Di = {
|
|
|
156
156
|
canReadHostedBrowserEligibility: !1,
|
|
157
157
|
canManageInteractions: !0,
|
|
158
158
|
canInvokeConversationActions: !0
|
|
159
|
-
},
|
|
159
|
+
}, Xr = {
|
|
160
160
|
...js,
|
|
161
161
|
canExecuteCurrentPageTools: !1,
|
|
162
162
|
canManageTabs: !1,
|
|
@@ -212,15 +212,15 @@ const Di = {
|
|
|
212
212
|
canReadHostedBrowserEligibility: !1,
|
|
213
213
|
canManageInteractions: !0,
|
|
214
214
|
canInvokeConversationActions: !0
|
|
215
|
-
},
|
|
215
|
+
}, Yr = {
|
|
216
216
|
extension_sidepanel: js,
|
|
217
217
|
extension_widget: js,
|
|
218
|
-
main_web_chat:
|
|
218
|
+
main_web_chat: Xr,
|
|
219
219
|
embedded_widget: jn,
|
|
220
220
|
embedded_custom_ui: jn
|
|
221
221
|
};
|
|
222
222
|
function X(t, e) {
|
|
223
|
-
return
|
|
223
|
+
return Yr[t][e] === !0;
|
|
224
224
|
}
|
|
225
225
|
function Ui(t, e, s = null, n = !0) {
|
|
226
226
|
const i = (a, o) => ({ operation: e, allowed: a === "allowed", reason: a, recovery: o }), r = t.authority;
|
|
@@ -321,8 +321,8 @@ function Bs(t) {
|
|
|
321
321
|
function ji(t) {
|
|
322
322
|
return ["history_load_failed", "request_timed_out", "connection_interrupted", "408", "425", "429"].includes(t) || /^5\d\d$/.test(t);
|
|
323
323
|
}
|
|
324
|
-
const
|
|
325
|
-
function
|
|
324
|
+
const Zr = "Message storage has not confirmed this submission. Reconnect to check its status.";
|
|
325
|
+
function eo(t, e) {
|
|
326
326
|
const s = t?.executionByUserMessage[e]?.responseMessageIds, n = s?.indexOf(e) ?? -1;
|
|
327
327
|
return s && n >= 0 ? s.slice(0, n + 1) : [e];
|
|
328
328
|
}
|
|
@@ -406,7 +406,7 @@ function Bi(t, e) {
|
|
|
406
406
|
const a = e ?? [...t.items].reverse().find((o) => o.type === "user_message")?.id ?? [...t.submissions].reverse().find((o) => !o.cancelled && o.delivery === "accepted")?.userMessageId;
|
|
407
407
|
return t.sessionId && a ? { type: "execution", userMessageId: a, sessionId: t.sessionId } : null;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function to(t, e) {
|
|
410
410
|
return G({ scopes: Object.fromEntries([...new Set(Object.values(e.clients))].map((s) => [s, ge(t, e, s)])) });
|
|
411
411
|
}
|
|
412
412
|
function Li(t, e) {
|
|
@@ -449,7 +449,7 @@ function $i(t, e, s) {
|
|
|
449
449
|
const n = Object.values(t.interactions.actions).filter((i) => i.interactionId === e && (!s.conversationScopeId || i.conversationScopeId === s.conversationScopeId) && (i.operation.kind !== "edit" || !s.clientScopeId || i.clientScopeId === s.clientScopeId));
|
|
450
450
|
return n.find((i) => i.status === "pending") ?? n[n.length - 1];
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function so(t, e, s) {
|
|
453
453
|
const n = t.account.authority;
|
|
454
454
|
if (!n) return [];
|
|
455
455
|
const i = X(n.profile, "canShowPersonalFeatures"), r = [], a = t.features.now, o = (c) => {
|
|
@@ -555,9 +555,9 @@ function zi(t, e, s, n) {
|
|
|
555
555
|
const i = s.clients[n], r = s.selections[i];
|
|
556
556
|
if (!r || s.authorityId !== t.account.authority?.authorityId || s.generation !== t.account.authority.generation) return [];
|
|
557
557
|
const a = Object.values(e.submissions).some((o) => o.conversationScopeId === i && !o.cancelled && o.delivery !== "failed");
|
|
558
|
-
return
|
|
558
|
+
return so(t, e, { sessionId: r.sessionId, newChat: r.sessionId === null && r.provisionalId !== null, submissionStarted: a, clientScopeId: n, conversationScopeId: i });
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function no(t, e, s, n) {
|
|
561
561
|
let i = t;
|
|
562
562
|
const r = [], a = i.account.authority, o = (u, l) => JSON.stringify(["stage7.platform", a.authorityId, a.generation, u, l]), c = (u, l) => {
|
|
563
563
|
i = { ...i, interactions: { ...i.interactions, actions: { ...i.interactions.actions, [u]: l } } };
|
|
@@ -693,7 +693,7 @@ const oe = (t) => t;
|
|
|
693
693
|
function Hi(t) {
|
|
694
694
|
return ["appearance", "sampleStyle", "saveStyle", "scribble", "deleteStyle"].includes(t.kind);
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function io(t, e, s, n) {
|
|
697
697
|
let i = t;
|
|
698
698
|
const r = [], a = (l) => {
|
|
699
699
|
i = { ...i, ...l };
|
|
@@ -778,7 +778,7 @@ function so(t, e, s, n) {
|
|
|
778
778
|
function Ls(t = null) {
|
|
779
779
|
return { authority: t, refusal: null, paidFallbackBySession: {}, query: ve("account"), preferences: null };
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function ro(t, e) {
|
|
782
782
|
return t.preferences && e.preferencesVersion <= t.preferences.preferencesVersion ? t : { ...t, preferences: e };
|
|
783
783
|
}
|
|
784
784
|
function Fs() {
|
|
@@ -827,7 +827,7 @@ function ie(t, e) {
|
|
|
827
827
|
function _t(t, e) {
|
|
828
828
|
return t.account.preferences?.[e === "notifications" ? "taskNotificationsEnabled" : "tabGroupingEnabled"] ?? null;
|
|
829
829
|
}
|
|
830
|
-
const
|
|
830
|
+
const oo = {
|
|
831
831
|
account: "read_account",
|
|
832
832
|
preferences: "manage_preferences",
|
|
833
833
|
preferencePrompts: "manage_preferences",
|
|
@@ -860,7 +860,7 @@ const io = {
|
|
|
860
860
|
blockedOrigins: "manage_origin_access"
|
|
861
861
|
};
|
|
862
862
|
function Ce(t, e) {
|
|
863
|
-
if (!X(t.profile, Di[
|
|
863
|
+
if (!X(t.profile, Di[oo[e.kind]])) throw new Error("Feature capability unavailable.");
|
|
864
864
|
if (["decisions", "decision", "preferencePrompts"].includes(e.kind) && !X(t.profile, "canShowPersonalFeatures")) throw new Error("Personal feature unavailable.");
|
|
865
865
|
if (t.profile.startsWith("embedded_") && e.kind === "targetFeedback") throw new Error("Embedded target feedback has no supported contract.");
|
|
866
866
|
if (e.kind === "proactiveFeedback" && !X(t.profile, "canManageProactiveSuggestions")) throw new Error("Proactive feedback unavailable.");
|
|
@@ -908,11 +908,11 @@ function zs(t, e, s) {
|
|
|
908
908
|
const d = e.type === "stage7.query" ? e.query : e.type === "stage7.mutate" ? e.mutation : e.type === "effect.completed" || e.type === "effect.failed" ? n.features.pending[e.effectId]?.operation : null;
|
|
909
909
|
if (d && Hi(d)) {
|
|
910
910
|
Ce(o, d);
|
|
911
|
-
const g =
|
|
911
|
+
const g = io(n.features, o, e, (v) => ie(o, v));
|
|
912
912
|
return { state: { ...n, features: g.state }, effects: g.effects };
|
|
913
913
|
}
|
|
914
914
|
if (e.type === "stage7.act" || e.type === "stage7.retry_action" || (e.type === "effect.completed" || e.type === "effect.failed") && e.effectKind === "stage7.platform") {
|
|
915
|
-
const g =
|
|
915
|
+
const g = no(n, e, s.conversation, s.directory);
|
|
916
916
|
if (!g.command) return { state: g.state, effects: g.effects };
|
|
917
917
|
const v = zs(g.state, g.command, s);
|
|
918
918
|
return { state: v.state, effects: [...g.effects, ...v.effects] };
|
|
@@ -945,7 +945,7 @@ function zs(t, e, s) {
|
|
|
945
945
|
const w = g.kind === "preferencePrompts" ? g.value[I] : g.feature === I ? g.value : null;
|
|
946
946
|
w && w.revision > n.interactions.preferencePrompts[I].revision && l(I, w.requestId);
|
|
947
947
|
}
|
|
948
|
-
g.kind === "preferences" && (n = { ...n, account:
|
|
948
|
+
g.kind === "preferences" && (n = { ...n, account: ro(n.account, g.value) }), g.kind === "preferencePrompts" && (n = { ...n, interactions: Bn(n.interactions, g.value) }), g.kind === "preferencePrompt" && (n = { ...n, interactions: Bn(n.interactions, { ...n.interactions.preferencePrompts, [g.feature]: g.value }) }), g.kind === "decisions" && (n = { ...n, interactions: os(n.interactions, g.decisions) }), g.kind === "decision" && (n = { ...n, interactions: os(n.interactions, [g.value]) });
|
|
949
949
|
}, p = (g, v) => {
|
|
950
950
|
const I = n.interactions.deviceFacts[g];
|
|
951
951
|
if (!(v.revision <= I.revision) && ((_t(n, g) === !0 || n.features.desiredPreferences[g] === !0) && (v.permission === "granted" && I.permission !== "granted" || v.snoozedUntil && v.snoozedUntil !== I.snoozedUntil) && l(g, null), a({ deviceFacts: { ...n.interactions.deviceFacts, [g]: v } }), n.features.desiredPreferences[g] === !0 && _t(n, g) !== !0)) {
|
|
@@ -1375,11 +1375,11 @@ function zs(t, e, s) {
|
|
|
1375
1375
|
function Ut(t, e) {
|
|
1376
1376
|
return t.account.authority ? t.features.queries[ie(t.account.authority, e)] ?? null : null;
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1378
|
+
function ao(t, e) {
|
|
1379
1379
|
const s = Ut(t, e);
|
|
1380
1380
|
return s?.status === "loading" || s?.status === "refreshing" || !!(t.account.authority && t.features.polls[ie(t.account.authority, e)]);
|
|
1381
1381
|
}
|
|
1382
|
-
const
|
|
1382
|
+
const co = {
|
|
1383
1383
|
taskNotificationsEnabled: null,
|
|
1384
1384
|
tabGroupingEnabled: null,
|
|
1385
1385
|
scribbleStyleEnabled: null,
|
|
@@ -1388,7 +1388,7 @@ const oo = {
|
|
|
1388
1388
|
preferencesVersion: 0,
|
|
1389
1389
|
securityPolicyVersion: 1
|
|
1390
1390
|
};
|
|
1391
|
-
function
|
|
1391
|
+
function lo(t, e, s, n) {
|
|
1392
1392
|
let i = Promise.resolve(), r = !1;
|
|
1393
1393
|
const a = (d) => {
|
|
1394
1394
|
if (JSON.stringify(s()) !== JSON.stringify(d)) throw new Error("Feature authority retired.");
|
|
@@ -1470,7 +1470,7 @@ function ao(t, e, s, n) {
|
|
|
1470
1470
|
if (u.kind !== "preference" && u.kind !== "scribblePreference") return t["stage7.mutate"](d);
|
|
1471
1471
|
const l = await o(async () => {
|
|
1472
1472
|
a(d.authority);
|
|
1473
|
-
const h = await e.load(d.authority.userId), p = h?.value ??
|
|
1473
|
+
const h = await e.load(d.authority.userId), p = h?.value ?? co, m = u.kind === "preference" ? { [u.feature === "notifications" ? "taskNotificationsEnabled" : "tabGroupingEnabled"]: u.enabled } : { scribbleStyleEnabled: u.enabled }, f = { ...p, ...m, preferencesVersion: p.preferencesVersion + 1 };
|
|
1474
1474
|
return await e.save(d.authority.userId, { value: f, pending: [...h?.pending ?? [], u] }), f;
|
|
1475
1475
|
});
|
|
1476
1476
|
return a(d.authority), c(d.authority), { data: { kind: "preferences", value: l }, completedAt: n() };
|
|
@@ -1482,7 +1482,7 @@ function rt(t) {
|
|
|
1482
1482
|
const e = t;
|
|
1483
1483
|
return Object.keys(t).every((s) => ["boundary", "category", "messageKind"].includes(s)) && ["runtime", "web_transport", "extension_ipc"].includes(e.boundary) && ["error", "object", "null", "array", "string", "undefined", "number", "boolean", "bigint", "symbol", "function"].includes(e.category) && ["object_coercion", "text", "blank", "non_text"].includes(e.messageKind);
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1485
|
+
function uo(t) {
|
|
1486
1486
|
if (t.details !== void 0 && !Be(t.details))
|
|
1487
1487
|
throw new TypeError("Product Agent transported error details must be JSON-safe.");
|
|
1488
1488
|
return {
|
|
@@ -1509,7 +1509,7 @@ function Y(t, e = "runtime_error", s = "runtime") {
|
|
|
1509
1509
|
...typeof o.durationMs == "number" && Number.isFinite(o.durationMs) && o.durationMs >= 0 ? { durationMs: o.durationMs } : {},
|
|
1510
1510
|
...typeof o.successfulRequests == "number" && Number.isSafeInteger(o.successfulRequests) && o.successfulRequests >= 0 ? { successfulRequests: o.successfulRequests } : {}
|
|
1511
1511
|
};
|
|
1512
|
-
return
|
|
1512
|
+
return uo({
|
|
1513
1513
|
code: r,
|
|
1514
1514
|
message: i.trim() && i.trim() !== "[object Object]" ? i : "The Product Agent operation failed. Try again.",
|
|
1515
1515
|
retryable: !!(n && "retryable" in n && n.retryable === !0),
|
|
@@ -1563,7 +1563,7 @@ function jt(t) {
|
|
|
1563
1563
|
const e = N(t);
|
|
1564
1564
|
return { eligibleSince: Nt(e.eligibleSince), revision: Oe(e.revision), requestId: de(e.requestId), snoozedUntil: Nt(e.snoozedUntil) };
|
|
1565
1565
|
}
|
|
1566
|
-
function
|
|
1566
|
+
function ho(t) {
|
|
1567
1567
|
const e = N(t);
|
|
1568
1568
|
return { notifications: jt(e.notifications), tab_grouping: jt(e.tabGrouping) };
|
|
1569
1569
|
}
|
|
@@ -1595,7 +1595,7 @@ function cs(t) {
|
|
|
1595
1595
|
...e.targetAncestorRegex == null ? {} : { targetAncestorRegex: P(e.targetAncestorRegex) }
|
|
1596
1596
|
};
|
|
1597
1597
|
}
|
|
1598
|
-
function
|
|
1598
|
+
function po(t) {
|
|
1599
1599
|
const e = N(t), s = N(e.condition), n = { id: P(e.id), suggestedQuery: P(e.suggestedQuery) };
|
|
1600
1600
|
if (s.template === "page_visit") return { ...n, condition: { template: s.template, urlRegex: P(s.urlRegex) } };
|
|
1601
1601
|
if (s.template === "semantic_interaction") return { ...n, condition: { template: s.template, event: cs(s.event) } };
|
|
@@ -1665,7 +1665,7 @@ function ds(t) {
|
|
|
1665
1665
|
sdk_preview_open: t.sdkPreviewOpen
|
|
1666
1666
|
};
|
|
1667
1667
|
}
|
|
1668
|
-
function
|
|
1668
|
+
function fo(t) {
|
|
1669
1669
|
const e = (n) => {
|
|
1670
1670
|
if (JSON.stringify(n) !== JSON.stringify(t.authority())) throw new Error("Feature authority retired.");
|
|
1671
1671
|
}, s = {
|
|
@@ -1681,7 +1681,7 @@ function ho(t) {
|
|
|
1681
1681
|
c = { kind: "preferences", value: Ve(await o("/preferences")) };
|
|
1682
1682
|
break;
|
|
1683
1683
|
case "preferencePrompts":
|
|
1684
|
-
c = { kind: "preferencePrompts", value:
|
|
1684
|
+
c = { kind: "preferencePrompts", value: ho(await o("/preference-prompts")) };
|
|
1685
1685
|
break;
|
|
1686
1686
|
case "decisions": {
|
|
1687
1687
|
const d = N(await o("/interaction-decisions"));
|
|
@@ -1702,7 +1702,7 @@ function ho(t) {
|
|
|
1702
1702
|
prompts: St(d.starterPrompts),
|
|
1703
1703
|
morningReportOpening: de(d.morningReportOpening),
|
|
1704
1704
|
signupAt: P(d.signupAt),
|
|
1705
|
-
proactiveSuggestions: d.proactiveSuggestions.map(
|
|
1705
|
+
proactiveSuggestions: d.proactiveSuggestions.map(po)
|
|
1706
1706
|
};
|
|
1707
1707
|
break;
|
|
1708
1708
|
}
|
|
@@ -1811,9 +1811,9 @@ function ho(t) {
|
|
|
1811
1811
|
return e(n), { data: c, completedAt: t.now() };
|
|
1812
1812
|
}
|
|
1813
1813
|
};
|
|
1814
|
-
return t.preferenceStorage ?
|
|
1814
|
+
return t.preferenceStorage ? lo(s, t.preferenceStorage, t.authority, t.now) : s;
|
|
1815
1815
|
}
|
|
1816
|
-
function
|
|
1816
|
+
function go(t) {
|
|
1817
1817
|
let e = null, s = null, n = !1;
|
|
1818
1818
|
const i = () => {
|
|
1819
1819
|
e !== null && clearTimeout(e), e = null, s?.({ now: t() }), s = null;
|
|
@@ -1831,7 +1831,7 @@ function po(t) {
|
|
|
1831
1831
|
}
|
|
1832
1832
|
};
|
|
1833
1833
|
}
|
|
1834
|
-
function
|
|
1834
|
+
function mo(t, e) {
|
|
1835
1835
|
let s = "";
|
|
1836
1836
|
const n = () => {
|
|
1837
1837
|
const r = t.engine.getState().slices, a = r.account.authority;
|
|
@@ -1846,13 +1846,13 @@ function fo(t, e) {
|
|
|
1846
1846
|
}, i = t.engine.subscribe(n);
|
|
1847
1847
|
return t.onDispose(i), n(), i;
|
|
1848
1848
|
}
|
|
1849
|
-
async function
|
|
1849
|
+
async function yo(t, e, s) {
|
|
1850
1850
|
await t.engine.dispatch({ type: "stage7.initialize", authority: e, now: s }), await t.engine.dispatch({ type: "stage7.reconcile", authority: e, now: s, requestId: crypto.randomUUID(), reason: "startup" });
|
|
1851
1851
|
}
|
|
1852
1852
|
function ls(t, e, s = {}) {
|
|
1853
1853
|
return Vi(t, { type: "stage7.query", query: e, force: s.force });
|
|
1854
1854
|
}
|
|
1855
|
-
function
|
|
1855
|
+
function vo(t, e, s) {
|
|
1856
1856
|
return Vi(t, { type: "stage7.mutate", mutation: e });
|
|
1857
1857
|
}
|
|
1858
1858
|
function Vi(t, e, s) {
|
|
@@ -1888,7 +1888,7 @@ function Vi(t, e, s) {
|
|
|
1888
1888
|
}, (m) => h(m));
|
|
1889
1889
|
});
|
|
1890
1890
|
}
|
|
1891
|
-
async function
|
|
1891
|
+
async function bo(t, e, s = crypto.randomUUID()) {
|
|
1892
1892
|
const n = t.engine.getState().slices.account.authority;
|
|
1893
1893
|
if (!n || t.isDisposed) throw new Error("Product Agent is not authenticated.");
|
|
1894
1894
|
const i = Object.entries(t.engine.getState().slices.interactions.actions).find(([, a]) => a.clientScopeId === e.clientScopeId && a.sourceVersion === (e.expectedSourceVersion ?? null) && a.interactionId === e.interactionId && a.action === e.action && a.expectedRevision === e.expectedRevision && a.status === "error" && a.step === "persist"), r = i?.[0] ?? s;
|
|
@@ -1923,7 +1923,7 @@ async function yo(t, e, s = crypto.randomUUID()) {
|
|
|
1923
1923
|
}, h);
|
|
1924
1924
|
});
|
|
1925
1925
|
}
|
|
1926
|
-
function
|
|
1926
|
+
function Io(t, e, s, n) {
|
|
1927
1927
|
return zi(t, e, s, n).map((i) => {
|
|
1928
1928
|
const r = i.sourceId ? Object.values(t.interactions.sources).find((p) => p.id === i.sourceId && p.conversation_id === i.conversationId) : null, a = r?.payload, o = i.payload.feature, c = i.category === "sharing" ? "social_share" : i.category === "integration_auth" ? "integration_connection" : i.category === "personal_channel" ? "personal_channel_connection" : o === "notifications" ? "task_notifications" : o === "tab_grouping" ? "tab_group_permission" : i.category, d = c === "integration_connection" && a?.kind === "integration_auth" ? `Connect ${a.app_name}` : c === "personal_channel_connection" ? "Connect WhatsApp" : null, u = o === "notifications" ? "Get notified when Pluno finishes a task?" : o === "tab_grouping" ? "Enable tab groups to keep Pluno’s tabs organized?" : i.category === "sharing" ? "Share what Pluno helped you accomplish." : String(i.payload.text ?? d ?? ""), l = Object.fromEntries(i.actions.map((p) => [p, i.actionLabels?.[p] ?? { enable: "Yes", not_now: "Not now", dont_enable: "Don't ask again", allow: "Allow", run: i.category === "proactive_suggestion" ? "Yes" : "Start", edit: "Edit", never: "Never", snooze: "Snooze morning report", pair: "Pair WhatsApp", dismiss: "Dismiss", copy: "Copy", share: "Share", feedback: "Send feedback" }[p] ?? p])), h = a?.kind === "integration_auth" ? { type: "pipedream_auth_required", authRequestId: a.request_id, appSlug: a.app_slug, appName: a.app_name, appLogo: a.app_logo, expiresAt: a.expires_at } : a?.kind === "personal_channel" ? { type: "personal_channel_connection_required", requestId: a.request_id, channel: a.channel, managementUrl: a.management_url } : null;
|
|
1929
1929
|
return {
|
|
@@ -1953,7 +1953,7 @@ function vo(t, e, s, n) {
|
|
|
1953
1953
|
};
|
|
1954
1954
|
});
|
|
1955
1955
|
}
|
|
1956
|
-
function
|
|
1956
|
+
function wo(t, e, s) {
|
|
1957
1957
|
return {
|
|
1958
1958
|
user: e,
|
|
1959
1959
|
communityId: s,
|
|
@@ -1966,7 +1966,7 @@ function bo(t, e, s) {
|
|
|
1966
1966
|
presentation: t
|
|
1967
1967
|
};
|
|
1968
1968
|
}
|
|
1969
|
-
function
|
|
1969
|
+
function _o(t, e = null) {
|
|
1970
1970
|
if (!t.authority) return null;
|
|
1971
1971
|
const s = t.query.data, n = s?.presentation ?? {
|
|
1972
1972
|
creditsUsed: null,
|
|
@@ -1987,9 +1987,9 @@ function Io(t, e = null) {
|
|
|
1987
1987
|
} : void 0);
|
|
1988
1988
|
return { ...n, ...o ? { auth: o } : {}, submissionGate: a, usingPaidCreditFallback: e ? t.paidFallbackBySession[e] ?? !1 : !1 };
|
|
1989
1989
|
}
|
|
1990
|
-
const
|
|
1991
|
-
version:
|
|
1992
|
-
}, Ki = (t) => t.selectedModel ?? t.historyModel ?? t.defaultModel,
|
|
1990
|
+
const So = "0.1.305", zt = {
|
|
1991
|
+
version: So
|
|
1992
|
+
}, Ki = (t) => t.selectedModel ?? t.historyModel ?? t.defaultModel, ko = (t, e) => t.scopes[e];
|
|
1993
1993
|
function Ht(t) {
|
|
1994
1994
|
if (!Number.isSafeInteger(t) || t < 0) throw new Error("Invalid conversation revision.");
|
|
1995
1995
|
}
|
|
@@ -2028,7 +2028,7 @@ function Vs(t, e) {
|
|
|
2028
2028
|
};
|
|
2029
2029
|
return { ...t, execution: e, executionByUserMessage: s };
|
|
2030
2030
|
}
|
|
2031
|
-
function
|
|
2031
|
+
function Ro(t) {
|
|
2032
2032
|
const e = /* @__PURE__ */ new Set();
|
|
2033
2033
|
for (const s of Object.values(t.items)) {
|
|
2034
2034
|
const n = Dt(s), i = t.streams[s.id];
|
|
@@ -2110,7 +2110,7 @@ function Gs(t, e, s = !1) {
|
|
|
2110
2110
|
function pt(t) {
|
|
2111
2111
|
return JSON.stringify(t, (e, s) => s && typeof s == "object" && !Array.isArray(s) ? Object.fromEntries(Object.entries(s).sort(([n], [i]) => n.localeCompare(i))) : s);
|
|
2112
2112
|
}
|
|
2113
|
-
function
|
|
2113
|
+
function Ao(t, e, s, n) {
|
|
2114
2114
|
let i = t;
|
|
2115
2115
|
const r = [];
|
|
2116
2116
|
let a = null;
|
|
@@ -2298,7 +2298,7 @@ function ko(t, e, s, n) {
|
|
|
2298
2298
|
requestId: e.requestId,
|
|
2299
2299
|
lane: e.lane,
|
|
2300
2300
|
before: e.lane === "history" ? c.cursor : null,
|
|
2301
|
-
refreshItemIds:
|
|
2301
|
+
refreshItemIds: Ro(o),
|
|
2302
2302
|
retryPreparation: c.error?.code === "history_preparation_failed"
|
|
2303
2303
|
}, u = Object.values(t.submissions).filter((p) => p.sessionId === e.sessionId && p.delivery === "accepted" && p.executionVersion === null).map((p) => p.userMessageId), l = t.requestSequence + 1, h = `conversation:${t.generation}:${l}`;
|
|
2304
2304
|
i = {
|
|
@@ -2388,7 +2388,7 @@ function Js(t, e, s, n = !1) {
|
|
|
2388
2388
|
function Qs(t, e = null) {
|
|
2389
2389
|
return { command: Z(t), conversationScopeId: e, phase: "waiting", effectId: null, result: null, error: null };
|
|
2390
2390
|
}
|
|
2391
|
-
function
|
|
2391
|
+
function Eo(t) {
|
|
2392
2392
|
const e = { ...t.context, ...t.contextPreparation };
|
|
2393
2393
|
return Object.fromEntries(["page", "pageContent", "agentMode", "metadata", "sessionTabs", "proactiveSuggestionQuestion"].filter((s) => s in e).map((s) => [s, e[s]]));
|
|
2394
2394
|
}
|
|
@@ -2443,7 +2443,7 @@ function Xs(t) {
|
|
|
2443
2443
|
request_id: c.requestId,
|
|
2444
2444
|
type: "chat.user_message",
|
|
2445
2445
|
payload: {
|
|
2446
|
-
...
|
|
2446
|
+
...Eo(c),
|
|
2447
2447
|
sessionId: c.sessionId,
|
|
2448
2448
|
clientMessageId: o,
|
|
2449
2449
|
content: c.content,
|
|
@@ -2504,7 +2504,7 @@ function Xs(t) {
|
|
|
2504
2504
|
}
|
|
2505
2505
|
return { state: G(e), effects: s };
|
|
2506
2506
|
}
|
|
2507
|
-
function
|
|
2507
|
+
function To(t, e, s, n) {
|
|
2508
2508
|
let i = t, r = e;
|
|
2509
2509
|
if (e.type === "effect.completed" || e.type === "effect.failed") {
|
|
2510
2510
|
e.effectKind === "conversation.checkpoint" && e.effectId === t.checkpointEffectId && (i = { ...i, checkpointEffectId: null, checkpointError: e.type === "effect.failed" ? e.error : null }), e.type === "effect.completed" && e.effectKind === "conversation.checkpoint" && e.output && e.output.authorityId === t.authorityId && e.output.generation === t.generation && (i = { ...i, durableSubmissionIds: [.../* @__PURE__ */ new Set([...t.durableSubmissionIds, ...e.output.submissionIds])].filter((p) => !!t.submissions[p]) });
|
|
@@ -2729,7 +2729,7 @@ function Ao(t, e, s, n) {
|
|
|
2729
2729
|
l?.phase === "uncertain" && (i = { ...t, operations: { ...t.operations, [e.requestId]: { ...l, phase: "waiting" } } });
|
|
2730
2730
|
}
|
|
2731
2731
|
}
|
|
2732
|
-
const a =
|
|
2732
|
+
const a = Ao(i, r, s, n);
|
|
2733
2733
|
let o = a.state;
|
|
2734
2734
|
if (e.type === "conversation.submission_stage" && o !== i && !o.deliveries[e.userMessageId]) {
|
|
2735
2735
|
o = {
|
|
@@ -2774,7 +2774,7 @@ function Ao(t, e, s, n) {
|
|
|
2774
2774
|
const d = Xs(o), u = Js(t, d.state, s, e.type === "conversation.recover" && t.checkpointError !== null);
|
|
2775
2775
|
return { state: u.state, effects: [...u.effects, ...a.effects, ...d.effects], interactionSources: a.interactionSources };
|
|
2776
2776
|
}
|
|
2777
|
-
const
|
|
2777
|
+
const qo = [
|
|
2778
2778
|
"submit",
|
|
2779
2779
|
"stop",
|
|
2780
2780
|
"staging_ipc",
|
|
@@ -2853,17 +2853,17 @@ const Eo = [
|
|
|
2853
2853
|
"backend_refusal",
|
|
2854
2854
|
"unknown"
|
|
2855
2855
|
];
|
|
2856
|
-
function
|
|
2856
|
+
function Co(t) {
|
|
2857
2857
|
const e = t, s = e?.code;
|
|
2858
2858
|
return e?.backendRefusal === !0 ? "backend_refusal" : typeof s == "string" && s !== "backend_refusal" && Ji.includes(s) ? s : e?.name === "AbortError" ? "aborted" : e?.name === "TypeError" ? "type_error" : "unknown";
|
|
2859
2859
|
}
|
|
2860
2860
|
const Qi = Math.random().toString(36).slice(2);
|
|
2861
|
-
let
|
|
2862
|
-
const Vn = () => `timing:${Qi}:${++
|
|
2861
|
+
let Mo = 0;
|
|
2862
|
+
const Vn = () => `timing:${Qi}:${++Mo}`, We = (t) => typeof t == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(t);
|
|
2863
2863
|
function ot(t) {
|
|
2864
2864
|
if (!t || typeof t != "object") return !1;
|
|
2865
2865
|
const e = t;
|
|
2866
|
-
return Object.keys(e).every((s) => ["entrySurface", "operation", "layer", "stage", "status", "spanId", "requestId", "clientMessageId", "sessionId", "occurredAt", "durationMs", "failureCategory", "tabId", "queueDepth", "workerId"].includes(s)) && (e.tabId === void 0 || Number.isSafeInteger(e.tabId) && e.tabId >= 0) && (e.queueDepth === void 0 || Number.isSafeInteger(e.queueDepth) && e.queueDepth >= 0) && (e.workerId === void 0 || We(e.workerId)) && (e.failureCategory === void 0 || e.status === "failed" && Ji.includes(e.failureCategory)) && (e.entrySurface === void 0 || ["extension_sidepanel", "extension_widget", "main_web_chat", "embedded_widget", "embedded_custom_ui", "automation", "mcp", "whatsapp", "email"].includes(e.entrySurface)) && ["send", "stop"].includes(e.operation) && ["renderer", "sdk", "extension", "http"].includes(e.layer) &&
|
|
2866
|
+
return Object.keys(e).every((s) => ["entrySurface", "operation", "layer", "stage", "status", "spanId", "requestId", "clientMessageId", "sessionId", "occurredAt", "durationMs", "failureCategory", "tabId", "queueDepth", "workerId"].includes(s)) && (e.tabId === void 0 || Number.isSafeInteger(e.tabId) && e.tabId >= 0) && (e.queueDepth === void 0 || Number.isSafeInteger(e.queueDepth) && e.queueDepth >= 0) && (e.workerId === void 0 || We(e.workerId)) && (e.failureCategory === void 0 || e.status === "failed" && Ji.includes(e.failureCategory)) && (e.entrySurface === void 0 || ["extension_sidepanel", "extension_widget", "main_web_chat", "embedded_widget", "embedded_custom_ui", "automation", "mcp", "whatsapp", "email"].includes(e.entrySurface)) && ["send", "stop"].includes(e.operation) && ["renderer", "sdk", "extension", "http"].includes(e.layer) && qo.includes(e.stage) && ["started", "completed", "failed", "observed"].includes(e.status) && We(e.spanId) && We(e.requestId) && (e.clientMessageId === null || We(e.clientMessageId)) && (e.sessionId === null || We(e.sessionId)) && typeof e.occurredAt == "string" && e.occurredAt.length <= 40 && Number.isFinite(Date.parse(e.occurredAt)) && Number.isSafeInteger(e.durationMs) && e.durationMs >= 0;
|
|
2867
2867
|
}
|
|
2868
2868
|
function Q(t, e) {
|
|
2869
2869
|
if (e = { workerId: Qi, ...e }, !t) return {
|
|
@@ -2880,7 +2880,7 @@ function Q(t, e) {
|
|
|
2880
2880
|
spanId: o,
|
|
2881
2881
|
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2882
2882
|
durationMs: Math.max(0, Math.round(performance.now() - a)),
|
|
2883
|
-
...r === "failed" ? { failureCategory:
|
|
2883
|
+
...r === "failed" ? { failureCategory: Co(c) } : {}
|
|
2884
2884
|
};
|
|
2885
2885
|
t && ot(d) && Promise.resolve().then(() => t(d)).catch(() => {
|
|
2886
2886
|
});
|
|
@@ -2899,7 +2899,7 @@ function Q(t, e) {
|
|
|
2899
2899
|
}
|
|
2900
2900
|
};
|
|
2901
2901
|
}
|
|
2902
|
-
function
|
|
2902
|
+
function Oo(t) {
|
|
2903
2903
|
let e = [], s;
|
|
2904
2904
|
const n = () => {
|
|
2905
2905
|
clearTimeout(s), s = void 0;
|
|
@@ -2911,7 +2911,7 @@ function Co(t) {
|
|
|
2911
2911
|
ot(i) && (JSON.stringify([...e, i]).length > 2800 && n(), e.push(i), e.length === 8 ? n() : s ??= setTimeout(n, 250));
|
|
2912
2912
|
};
|
|
2913
2913
|
}
|
|
2914
|
-
function
|
|
2914
|
+
function xo(t) {
|
|
2915
2915
|
let e = Promise.resolve(), s = null, n = null;
|
|
2916
2916
|
const i = () => n ??= t.read().catch((a) => {
|
|
2917
2917
|
throw n = null, a;
|
|
@@ -2976,7 +2976,7 @@ function Mo(t) {
|
|
|
2976
2976
|
}
|
|
2977
2977
|
};
|
|
2978
2978
|
}
|
|
2979
|
-
function
|
|
2979
|
+
function Po(t, e, s, n) {
|
|
2980
2980
|
if (t !== e)
|
|
2981
2981
|
for (const i of Object.values(e.submissions))
|
|
2982
2982
|
i.delivery !== "accepted" || t.submissions[i.userMessageId]?.delivery === "accepted" || Q(s, {
|
|
@@ -2989,12 +2989,12 @@ function Oo(t, e, s, n) {
|
|
|
2989
2989
|
}).mark("acceptance_applied");
|
|
2990
2990
|
}
|
|
2991
2991
|
const j = (t) => typeof t == "string" && /^[a-zA-Z0-9:_.-]{1,160}$/.test(t) ? t : null;
|
|
2992
|
-
function
|
|
2992
|
+
function Do(t) {
|
|
2993
2993
|
if (!t || typeof t != "object") return !1;
|
|
2994
2994
|
const e = t, s = (i) => Number.isSafeInteger(i) && i >= 0, n = (i) => i && typeof i == "object" && Object.keys(i).every((r) => ["sequence", "at", "type", "changed", "generation", "sessionId", "scopeId", "requestId", "effectId", "clientScopeId", "reason", "effectKind", "eventType", "itemCount", "removedCount", "projectionReady"].includes(r)) && s(i.sequence) && s(i.at) && j(i.type) !== null && typeof i.changed == "boolean" && [i.generation, i.itemCount, i.removedCount].every((r) => r === null || s(r)) && [i.sessionId, i.scopeId, i.requestId, i.effectId, i.clientScopeId, i.reason, i.effectKind, i.eventType].every((r) => r === null || j(r) !== null) && (i.projectionReady === null || typeof i.projectionReady == "boolean");
|
|
2995
2995
|
return Object.keys(e).every((i) => ["ownerId", "revision", "dropped", "lastIntent", "lastSelection", "transitions"].includes(i)) && j(e.ownerId) !== null && s(e.revision) && s(e.dropped) && (e.lastIntent == null || n(e.lastIntent)) && (e.lastSelection === null || n(e.lastSelection)) && Array.isArray(e.transitions) && e.transitions.length <= 16 && e.transitions.every(n);
|
|
2996
2996
|
}
|
|
2997
|
-
function
|
|
2997
|
+
function Uo(t, e, s) {
|
|
2998
2998
|
const n = t;
|
|
2999
2999
|
if (!/^(directory\.|conversation\.|session\.)/.test(n.type ?? "") && !/^(directory\.|conversation\.|session\.)/.test(n.effectKind ?? "") || n.type === "conversation.display_received" && !["conversation.execution.updated", "conversation.item.removed"].includes(n.event?.type ?? "")) return null;
|
|
3000
3000
|
const i = n.output?.snapshot;
|
|
@@ -3022,23 +3022,23 @@ function pn(t) {
|
|
|
3022
3022
|
const e = t;
|
|
3023
3023
|
return Object.keys(e).every((s) => ["sessionId", "episodeId", "consecutiveFailures", "transportCode", "requestId", "durationMs"].includes(s)) && typeof e.sessionId == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(e.sessionId) && typeof e.episodeId == "string" && /^[a-zA-Z0-9:_-]{1,500}$/.test(e.episodeId) && (e.transportCode === void 0 || typeof e.transportCode == "string" && /^[a-z0-9_]{1,80}$/.test(e.transportCode)) && (e.requestId === void 0 || typeof e.requestId == "string" && /^[a-zA-Z0-9_-]{1,160}$/.test(e.requestId)) && (e.durationMs === void 0 || typeof e.durationMs == "number" && Number.isFinite(e.durationMs) && e.durationMs >= 0) && Number.isSafeInteger(e.consecutiveFailures) && e.consecutiveFailures >= 1;
|
|
3024
3024
|
}
|
|
3025
|
-
const Kn = ["messageKeys", "canonicalItemKeys", "terminalResponseKeys", "toolCallKeys", "activeResponseKeys"], fn = (t) => typeof t == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(t), Ee = (t) => t === null || fn(t),
|
|
3025
|
+
const Kn = ["messageKeys", "canonicalItemKeys", "terminalResponseKeys", "toolCallKeys", "activeResponseKeys"], fn = (t) => typeof t == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(t), Ee = (t) => t === null || fn(t), No = (t) => typeof t == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?(?:Z|\+00:00)$/.test(t) && Number.isFinite(Date.parse(t));
|
|
3026
3026
|
function gn(t) {
|
|
3027
3027
|
if (!t || typeof t != "object") return !1;
|
|
3028
3028
|
const e = t;
|
|
3029
|
-
return Object.keys(t).every((s) => ["sessionId", "itemId", "userMessageId", "createdAt", "runId", "retryable"].includes(s)) && Ee(e.sessionId) && fn(e.itemId) && Ee(e.userMessageId) && (e.retryable === void 0 || typeof e.retryable == "boolean") && Ee(e.runId) && (e.createdAt === null ||
|
|
3029
|
+
return Object.keys(t).every((s) => ["sessionId", "itemId", "userMessageId", "createdAt", "runId", "retryable"].includes(s)) && Ee(e.sessionId) && fn(e.itemId) && Ee(e.userMessageId) && (e.retryable === void 0 || typeof e.retryable == "boolean") && Ee(e.runId) && (e.createdAt === null || No(e.createdAt));
|
|
3030
3030
|
}
|
|
3031
|
-
function
|
|
3031
|
+
function jo(t) {
|
|
3032
3032
|
if (!t || typeof t != "object") return !1;
|
|
3033
3033
|
const e = t, s = (n) => Number.isSafeInteger(n) && n >= 0;
|
|
3034
|
-
return Object.keys(e).every((n) => ["capturedAt", "selectionKey", "userId", "loading", "draft", "thinking", "connected", "hasError", "phase", "queryStatus", "queryRequestId", "queryUpdatedAt", "renderSource", "selectionFencePending", "guardCreatedAt", "owner", "sdkVersion", "presentationGate", "firstObservedAt", "confirmationMs"].includes(n)) && s(e.capturedAt) && [e.queryUpdatedAt, e.guardCreatedAt].every((n) => n === null || s(n)) && [e.selectionKey, e.userId, e.phase, e.queryStatus, e.queryRequestId].every((n) => n === null || j(n) !== null) && [e.loading, e.draft, e.thinking, e.connected, e.hasError, e.selectionFencePending].every((n) => typeof n == "boolean") && ["state", "account", "interactions", "local", "sidepanel_layout", "observer"].includes(e.renderSource) && (e.owner === void 0 ||
|
|
3034
|
+
return Object.keys(e).every((n) => ["capturedAt", "selectionKey", "userId", "loading", "draft", "thinking", "connected", "hasError", "phase", "queryStatus", "queryRequestId", "queryUpdatedAt", "renderSource", "selectionFencePending", "guardCreatedAt", "owner", "sdkVersion", "presentationGate", "firstObservedAt", "confirmationMs"].includes(n)) && s(e.capturedAt) && [e.queryUpdatedAt, e.guardCreatedAt].every((n) => n === null || s(n)) && [e.selectionKey, e.userId, e.phase, e.queryStatus, e.queryRequestId].every((n) => n === null || j(n) !== null) && [e.loading, e.draft, e.thinking, e.connected, e.hasError, e.selectionFencePending].every((n) => typeof n == "boolean") && ["state", "account", "interactions", "local", "sidepanel_layout", "observer"].includes(e.renderSource) && (e.owner === void 0 || Do(e.owner)) && (e.sdkVersion === void 0 || typeof e.sdkVersion == "string" && e.sdkVersion.length <= 32 && /^\d+\.\d+\.\d+(?:[-+][a-zA-Z0-9.-]+)?$/.test(e.sdkVersion)) && (e.presentationGate === void 0 || ["none", "authentication", "signup"].includes(e.presentationGate)) && [e.firstObservedAt, e.confirmationMs].every((n) => n === void 0 || s(n));
|
|
3035
3035
|
}
|
|
3036
3036
|
function mn(t) {
|
|
3037
3037
|
if (!t || typeof t != "object" || Object.keys(t).some((n) => n !== "before" && n !== "current")) return !1;
|
|
3038
3038
|
const e = (n) => {
|
|
3039
3039
|
if (!n || typeof n != "object") return !1;
|
|
3040
3040
|
const i = n;
|
|
3041
|
-
return Object.keys(n).every((r) => [...Kn, "sessionId", "runtimeItemCount", "welcome", "truncated", "thinkingSequence", "context", "duplicateToolCalls"].includes(r)) && (i.duplicateToolCalls === void 0 || Array.isArray(i.duplicateToolCalls) && i.duplicateToolCalls.length <= 5 && i.duplicateToolCalls.every((r) => r && Object.keys(r).every((a) => ["key", "count", "rows", "truncated"].includes(a)) && Ee(r.key) && Number.isSafeInteger(r.count) && r.count >= 2 && typeof r.truncated == "boolean" && Array.isArray(r.rows) && r.rows.length >= 1 && r.rows.length <= 5 && r.rows.length <= r.count && r.rows.every((a) => a && Object.keys(a).every((o) => ["itemId", "groupId"].includes(o)) && Ee(a.itemId) && Ee(a.groupId)))) && (i.context === void 0 ||
|
|
3041
|
+
return Object.keys(n).every((r) => [...Kn, "sessionId", "runtimeItemCount", "welcome", "truncated", "thinkingSequence", "context", "duplicateToolCalls"].includes(r)) && (i.duplicateToolCalls === void 0 || Array.isArray(i.duplicateToolCalls) && i.duplicateToolCalls.length <= 5 && i.duplicateToolCalls.every((r) => r && Object.keys(r).every((a) => ["key", "count", "rows", "truncated"].includes(a)) && Ee(r.key) && Number.isSafeInteger(r.count) && r.count >= 2 && typeof r.truncated == "boolean" && Array.isArray(r.rows) && r.rows.length >= 1 && r.rows.length <= 5 && r.rows.length <= r.count && r.rows.every((a) => a && Object.keys(a).every((o) => ["itemId", "groupId"].includes(o)) && Ee(a.itemId) && Ee(a.groupId)))) && (i.context === void 0 || jo(i.context)) && (i.thinkingSequence === void 0 || Array.isArray(i.thinkingSequence) && i.thinkingSequence.length <= 20 && i.thinkingSequence.every((r) => r === "user" || r === "thinking")) && Ee(i.sessionId) && Number.isSafeInteger(i.runtimeItemCount) && i.runtimeItemCount >= 0 && typeof i.welcome == "boolean" && typeof i.truncated == "boolean" && Kn.every((r) => Array.isArray(i[r]) && i[r].length <= 20 && i[r].every(fn));
|
|
3042
3042
|
}, s = t;
|
|
3043
3043
|
return (s.before === null || e(s.before)) && e(s.current);
|
|
3044
3044
|
}
|
|
@@ -3053,7 +3053,7 @@ function Xi(t) {
|
|
|
3053
3053
|
e ^= t.charCodeAt(s), e = Math.imul(e, 16777619);
|
|
3054
3054
|
return `fnv1a-${(e >>> 0).toString(16).padStart(8, "0")}`;
|
|
3055
3055
|
}
|
|
3056
|
-
function
|
|
3056
|
+
function Bo(t) {
|
|
3057
3057
|
if (!t || typeof t != "object") return !1;
|
|
3058
3058
|
const e = t;
|
|
3059
3059
|
return Object.keys(e).every((s) => ["sessionId", "requestId", "code", "normalization", "builds", "clientMessageId"].includes(s)) && (e.clientMessageId === void 0 || j(e.clientMessageId) !== null) && [e.sessionId, e.requestId, e.code].every((s) => s === null || j(s) !== null) && (e.normalization === void 0 || rt(e.normalization)) && !!e.builds && typeof e.builds == "object" && typeof e.builds.sdk == "string" && Object.entries(e.builds).every(([s, n]) => ["sdk", "rendererExtension", "contentExtension", "backgroundExtension"].includes(s) && typeof n == "string" && /^\d{1,5}\.\d{1,5}\.\d{1,5}$/.test(n));
|
|
@@ -3069,7 +3069,7 @@ function Yi(t, e, s, n, i = {}) {
|
|
|
3069
3069
|
builds: { sdk: zt.version, ...i }
|
|
3070
3070
|
};
|
|
3071
3071
|
}
|
|
3072
|
-
function
|
|
3072
|
+
function Lo(t, e = "runtime") {
|
|
3073
3073
|
const s = Y(t, "runtime_error", e), n = t !== null && typeof t == "object" && "stack" in t && typeof t.stack == "string" ? Me(t.stack.slice(0, 4e3).split(`
|
|
3074
3074
|
`).slice(0, 6).join(`
|
|
3075
3075
|
`).replace(/\n\s*at\s/g, `
|
|
@@ -3106,7 +3106,7 @@ function he(t) {
|
|
|
3106
3106
|
"upstreamTraceId"
|
|
3107
3107
|
].includes(n)) && j(e.requestId) !== null && ["GET", "POST", "PUT", "PATCH", "DELETE"].includes(e.method) && ["/api/product-agent/conversations/:sessionId/snapshot", "/api/product-agent/:namespace/commands", "/api/product-agent/:namespace/:operation"].includes(e.route) && (e.status === null || s(e.status) && e.status >= 100 && e.status <= 599) && (e.abortTrigger === null || ["deadline", "transport_disposed", "owner_disposed", "authority_retired", "observation_released", "request_replaced", "caller_cancelled", "unexpected_abort"].includes(e.abortTrigger)) && ["http_deadline", "http_transport", "conversation_query", "browser", "http_response"].includes(e.owner) && (e.category === void 0 || /^[a-z0-9_]{1,80}$/.test(e.category)) && [e.responseHeadersMs, e.responseBodyMs].every((n) => n == null || s(n)) && s(e.elapsedMs) && s(e.attempt) && e.attempt >= 1 && e.attempt <= 10 && [e.queryRequestId, e.ownerId, e.sessionId].every((n) => n === null || j(n) !== null) && (e.authorityGeneration === null || s(e.authorityGeneration)) && typeof e.release == "string" && /^[a-zA-Z0-9._-]{1,80}$/.test(e.release) && [e.upstreamRequestId, e.upstreamTraceId].every((n) => n === null || typeof n == "string" && /^[a-zA-Z0-9_:;=./-]{1,160}$/.test(n));
|
|
3108
3108
|
}
|
|
3109
|
-
function
|
|
3109
|
+
function Fo(t) {
|
|
3110
3110
|
const e = {}, s = (n, i) => {
|
|
3111
3111
|
if (!n || typeof n != "object") return;
|
|
3112
3112
|
const r = n;
|
|
@@ -3127,7 +3127,7 @@ function Bo(t) {
|
|
|
3127
3127
|
}
|
|
3128
3128
|
return e;
|
|
3129
3129
|
}
|
|
3130
|
-
function
|
|
3130
|
+
function $o(t, e = Math.random, s = Math.random) {
|
|
3131
3131
|
const n = () => Math.floor(s() * 21) - 10;
|
|
3132
3132
|
return {
|
|
3133
3133
|
"activeUsers.load": async () => ({ count: await t(), updatedAt: Date.now(), offset: n() }),
|
|
@@ -3135,14 +3135,14 @@ function Lo(t, e = Math.random, s = Math.random) {
|
|
|
3135
3135
|
"activeUsers.wait": ({ milliseconds: i }) => new Promise((r) => setTimeout(() => r(null), i + Math.round((e() - 0.5) * 1e3)))
|
|
3136
3136
|
};
|
|
3137
3137
|
}
|
|
3138
|
-
async function
|
|
3138
|
+
async function zo(t, e = fetch) {
|
|
3139
3139
|
const s = await e(new URL("/api/product-agent/embed/active-users", t), { cache: "no-store", credentials: "omit" });
|
|
3140
3140
|
if (!s.ok) throw new Error(`Active users request failed (${s.status})`);
|
|
3141
3141
|
const n = await s.json();
|
|
3142
3142
|
if (typeof n.count != "number" || !Number.isFinite(n.count) || n.count < 0) throw new Error("Invalid active users count");
|
|
3143
3143
|
return Math.round(n.count);
|
|
3144
3144
|
}
|
|
3145
|
-
function
|
|
3145
|
+
function Ho(t) {
|
|
3146
3146
|
const e = {
|
|
3147
3147
|
sidepanel: "extension_sidepanel",
|
|
3148
3148
|
browser_extension_page_ui: "extension_widget",
|
|
@@ -3154,7 +3154,7 @@ function $o(t) {
|
|
|
3154
3154
|
};
|
|
3155
3155
|
return t && t in e ? e[t] : t ?? "embedded_custom_ui";
|
|
3156
3156
|
}
|
|
3157
|
-
function
|
|
3157
|
+
function Vo(t, e) {
|
|
3158
3158
|
const s = {}, n = {};
|
|
3159
3159
|
for (const i of e) {
|
|
3160
3160
|
const r = i.command.payload, a = String(r.clientMessageId);
|
|
@@ -3191,7 +3191,7 @@ function hs(t) {
|
|
|
3191
3191
|
return null;
|
|
3192
3192
|
}
|
|
3193
3193
|
}
|
|
3194
|
-
function
|
|
3194
|
+
function Ko(t, e) {
|
|
3195
3195
|
try {
|
|
3196
3196
|
window.sessionStorage.setItem(`pa.authority:${t}`, e);
|
|
3197
3197
|
} catch (s) {
|
|
@@ -3281,7 +3281,7 @@ function Jn(t) {
|
|
|
3281
3281
|
return t instanceof Uint8Array ? t : t instanceof ArrayBuffer ? new Uint8Array(t) : new Uint8Array(t.buffer, t.byteOffset, t.byteLength);
|
|
3282
3282
|
}
|
|
3283
3283
|
let ps;
|
|
3284
|
-
function
|
|
3284
|
+
function Wo(t, e) {
|
|
3285
3285
|
if (Zi && t.data instanceof Blob)
|
|
3286
3286
|
return t.data.arrayBuffer().then(Jn).then(e);
|
|
3287
3287
|
if (er && (t.data instanceof ArrayBuffer || tr(t.data)))
|
|
@@ -3293,14 +3293,14 @@ function Vo(t, e) {
|
|
|
3293
3293
|
const Qn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", et = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
|
|
3294
3294
|
for (let t = 0; t < Qn.length; t++)
|
|
3295
3295
|
et[Qn.charCodeAt(t)] = t;
|
|
3296
|
-
const
|
|
3296
|
+
const Go = (t) => {
|
|
3297
3297
|
let e = t.length * 0.75, s = t.length, n, i = 0, r, a, o, c;
|
|
3298
3298
|
t[t.length - 1] === "=" && (e--, t[t.length - 2] === "=" && e--);
|
|
3299
3299
|
const d = new ArrayBuffer(e), u = new Uint8Array(d);
|
|
3300
3300
|
for (n = 0; n < s; n += 4)
|
|
3301
3301
|
r = et[t.charCodeAt(n)], a = et[t.charCodeAt(n + 1)], o = et[t.charCodeAt(n + 2)], c = et[t.charCodeAt(n + 3)], u[i++] = r << 2 | a >> 4, u[i++] = (a & 15) << 4 | o >> 2, u[i++] = (o & 3) << 6 | c & 63;
|
|
3302
3302
|
return d;
|
|
3303
|
-
},
|
|
3303
|
+
}, Jo = typeof ArrayBuffer == "function", vn = (t, e) => {
|
|
3304
3304
|
if (typeof t != "string")
|
|
3305
3305
|
return {
|
|
3306
3306
|
type: "message",
|
|
@@ -3309,20 +3309,20 @@ const Ko = (t) => {
|
|
|
3309
3309
|
const s = t.charAt(0);
|
|
3310
3310
|
return s === "b" ? {
|
|
3311
3311
|
type: "message",
|
|
3312
|
-
data:
|
|
3312
|
+
data: Qo(t.substring(1), e)
|
|
3313
3313
|
} : kt[s] ? t.length > 1 ? {
|
|
3314
3314
|
type: kt[s],
|
|
3315
3315
|
data: t.substring(1)
|
|
3316
3316
|
} : {
|
|
3317
3317
|
type: kt[s]
|
|
3318
3318
|
} : Ys;
|
|
3319
|
-
},
|
|
3320
|
-
if (
|
|
3321
|
-
const s =
|
|
3319
|
+
}, Qo = (t, e) => {
|
|
3320
|
+
if (Jo) {
|
|
3321
|
+
const s = Go(t);
|
|
3322
3322
|
return sr(s, e);
|
|
3323
3323
|
} else
|
|
3324
3324
|
return { base64: !0, data: t };
|
|
3325
|
-
}, sr = (t, e) => e === "blob" ? t instanceof Blob ? t : new Blob([t]) : t instanceof ArrayBuffer ? t : t.buffer, nr = "",
|
|
3325
|
+
}, sr = (t, e) => e === "blob" ? t instanceof Blob ? t : new Blob([t]) : t instanceof ArrayBuffer ? t : t.buffer, nr = "", Xo = (t, e) => {
|
|
3326
3326
|
const s = t.length, n = new Array(s);
|
|
3327
3327
|
let i = 0;
|
|
3328
3328
|
t.forEach((r, a) => {
|
|
@@ -3330,7 +3330,7 @@ const Ko = (t) => {
|
|
|
3330
3330
|
n[a] = o, ++i === s && e(n.join(nr));
|
|
3331
3331
|
});
|
|
3332
3332
|
});
|
|
3333
|
-
},
|
|
3333
|
+
}, Yo = (t, e) => {
|
|
3334
3334
|
const s = t.split(nr), n = [];
|
|
3335
3335
|
for (let i = 0; i < s.length; i++) {
|
|
3336
3336
|
const r = vn(s[i], e);
|
|
@@ -3339,10 +3339,10 @@ const Ko = (t) => {
|
|
|
3339
3339
|
}
|
|
3340
3340
|
return n;
|
|
3341
3341
|
};
|
|
3342
|
-
function
|
|
3342
|
+
function Zo() {
|
|
3343
3343
|
return new TransformStream({
|
|
3344
3344
|
transform(t, e) {
|
|
3345
|
-
|
|
3345
|
+
Wo(t, (s) => {
|
|
3346
3346
|
const n = s.length;
|
|
3347
3347
|
let i;
|
|
3348
3348
|
if (n < 126)
|
|
@@ -3374,7 +3374,7 @@ function gt(t, e) {
|
|
|
3374
3374
|
s[i] = t[0][n++], n === t[0].length && (t.shift(), n = 0);
|
|
3375
3375
|
return t.length && n < t[0].length && (t[0] = t[0].slice(n)), s;
|
|
3376
3376
|
}
|
|
3377
|
-
function
|
|
3377
|
+
function ea(t, e) {
|
|
3378
3378
|
fs || (fs = new TextDecoder());
|
|
3379
3379
|
const s = [];
|
|
3380
3380
|
let n = 0, i = -1, r = !1;
|
|
@@ -3416,9 +3416,9 @@ function Yo(t, e) {
|
|
|
3416
3416
|
}
|
|
3417
3417
|
const ir = 4;
|
|
3418
3418
|
function F(t) {
|
|
3419
|
-
if (t) return
|
|
3419
|
+
if (t) return ta(t);
|
|
3420
3420
|
}
|
|
3421
|
-
function
|
|
3421
|
+
function ta(t) {
|
|
3422
3422
|
for (var e in F.prototype)
|
|
3423
3423
|
t[e] = F.prototype[e];
|
|
3424
3424
|
return t;
|
|
@@ -3464,19 +3464,19 @@ F.prototype.listeners = function(t) {
|
|
|
3464
3464
|
F.prototype.hasListeners = function(t) {
|
|
3465
3465
|
return !!this.listeners(t).length;
|
|
3466
3466
|
};
|
|
3467
|
-
const Vt = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, s) => s(e, 0), re = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(),
|
|
3467
|
+
const Vt = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, s) => s(e, 0), re = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), sa = "arraybuffer";
|
|
3468
3468
|
function rr(t, ...e) {
|
|
3469
3469
|
return e.reduce((s, n) => (t.hasOwnProperty(n) && (s[n] = t[n]), s), {});
|
|
3470
3470
|
}
|
|
3471
|
-
const
|
|
3471
|
+
const na = re.setTimeout, ia = re.clearTimeout;
|
|
3472
3472
|
function Kt(t, e) {
|
|
3473
|
-
e.useNativeTimers ? (t.setTimeoutFn =
|
|
3473
|
+
e.useNativeTimers ? (t.setTimeoutFn = na.bind(re), t.clearTimeoutFn = ia.bind(re)) : (t.setTimeoutFn = re.setTimeout.bind(re), t.clearTimeoutFn = re.clearTimeout.bind(re));
|
|
3474
3474
|
}
|
|
3475
|
-
const
|
|
3476
|
-
function
|
|
3477
|
-
return typeof t == "string" ?
|
|
3475
|
+
const ra = 1.33;
|
|
3476
|
+
function oa(t) {
|
|
3477
|
+
return typeof t == "string" ? aa(t) : Math.ceil((t.byteLength || t.size) * ra);
|
|
3478
3478
|
}
|
|
3479
|
-
function
|
|
3479
|
+
function aa(t) {
|
|
3480
3480
|
let e = 0, s = 0;
|
|
3481
3481
|
for (let n = 0, i = t.length; n < i; n++)
|
|
3482
3482
|
e = t.charCodeAt(n), e < 128 ? s += 1 : e < 2048 ? s += 2 : e < 55296 || e >= 57344 ? s += 3 : (n++, s += 4);
|
|
@@ -3485,13 +3485,13 @@ function ra(t) {
|
|
|
3485
3485
|
function or() {
|
|
3486
3486
|
return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
|
|
3487
3487
|
}
|
|
3488
|
-
function
|
|
3488
|
+
function ca(t) {
|
|
3489
3489
|
let e = "";
|
|
3490
3490
|
for (let s in t)
|
|
3491
3491
|
t.hasOwnProperty(s) && (e.length && (e += "&"), e += encodeURIComponent(s) + "=" + encodeURIComponent(t[s]));
|
|
3492
3492
|
return e;
|
|
3493
3493
|
}
|
|
3494
|
-
function
|
|
3494
|
+
function da(t) {
|
|
3495
3495
|
let e = {}, s = t.split("&");
|
|
3496
3496
|
for (let n = 0, i = s.length; n < i; n++) {
|
|
3497
3497
|
let r = s[n].split("=");
|
|
@@ -3499,7 +3499,7 @@ function aa(t) {
|
|
|
3499
3499
|
}
|
|
3500
3500
|
return e;
|
|
3501
3501
|
}
|
|
3502
|
-
class
|
|
3502
|
+
class la extends Error {
|
|
3503
3503
|
constructor(e, s, n) {
|
|
3504
3504
|
super(e), this.description = s, this.context = n, this.type = "TransportError";
|
|
3505
3505
|
}
|
|
@@ -3524,7 +3524,7 @@ class bn extends F {
|
|
|
3524
3524
|
* @protected
|
|
3525
3525
|
*/
|
|
3526
3526
|
onError(e, s, n) {
|
|
3527
|
-
return super.emitReserved("error", new
|
|
3527
|
+
return super.emitReserved("error", new la(e, s, n)), this;
|
|
3528
3528
|
}
|
|
3529
3529
|
/**
|
|
3530
3530
|
* Opens the transport.
|
|
@@ -3598,11 +3598,11 @@ class bn extends F {
|
|
|
3598
3598
|
return this.opts.port && (this.opts.secure && Number(this.opts.port) !== 443 || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : "";
|
|
3599
3599
|
}
|
|
3600
3600
|
_query(e) {
|
|
3601
|
-
const s =
|
|
3601
|
+
const s = ca(e);
|
|
3602
3602
|
return s.length ? "?" + s : "";
|
|
3603
3603
|
}
|
|
3604
3604
|
}
|
|
3605
|
-
class
|
|
3605
|
+
class ua extends bn {
|
|
3606
3606
|
constructor() {
|
|
3607
3607
|
super(...arguments), this._polling = !1;
|
|
3608
3608
|
}
|
|
@@ -3658,7 +3658,7 @@ class da extends bn {
|
|
|
3658
3658
|
return this.onClose({ description: "transport closed by the server" }), !1;
|
|
3659
3659
|
this.onPacket(n);
|
|
3660
3660
|
};
|
|
3661
|
-
|
|
3661
|
+
Yo(e, this.socket.binaryType).forEach(s), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
|
|
3662
3662
|
}
|
|
3663
3663
|
/**
|
|
3664
3664
|
* For polling, send a close packet.
|
|
@@ -3678,7 +3678,7 @@ class da extends bn {
|
|
|
3678
3678
|
* @protected
|
|
3679
3679
|
*/
|
|
3680
3680
|
write(e) {
|
|
3681
|
-
this.writable = !1,
|
|
3681
|
+
this.writable = !1, Xo(e, (s) => {
|
|
3682
3682
|
this.doWrite(s, () => {
|
|
3683
3683
|
this.writable = !0, this.emitReserved("drain");
|
|
3684
3684
|
});
|
|
@@ -3699,10 +3699,10 @@ try {
|
|
|
3699
3699
|
ar = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
|
|
3700
3700
|
} catch {
|
|
3701
3701
|
}
|
|
3702
|
-
const
|
|
3703
|
-
function
|
|
3702
|
+
const ha = ar;
|
|
3703
|
+
function pa() {
|
|
3704
3704
|
}
|
|
3705
|
-
class
|
|
3705
|
+
class fa extends ua {
|
|
3706
3706
|
/**
|
|
3707
3707
|
* XHR Polling constructor.
|
|
3708
3708
|
*
|
|
@@ -3815,7 +3815,7 @@ let je = class Rt extends F {
|
|
|
3815
3815
|
*/
|
|
3816
3816
|
_cleanup(e) {
|
|
3817
3817
|
if (!(typeof this._xhr > "u" || this._xhr === null)) {
|
|
3818
|
-
if (this._xhr.onreadystatechange =
|
|
3818
|
+
if (this._xhr.onreadystatechange = pa, e)
|
|
3819
3819
|
try {
|
|
3820
3820
|
this._xhr.abort();
|
|
3821
3821
|
} catch {
|
|
@@ -3855,17 +3855,17 @@ function Xn() {
|
|
|
3855
3855
|
for (let t in je.requests)
|
|
3856
3856
|
je.requests.hasOwnProperty(t) && je.requests[t].abort();
|
|
3857
3857
|
}
|
|
3858
|
-
const
|
|
3858
|
+
const ga = (function() {
|
|
3859
3859
|
const t = cr({
|
|
3860
3860
|
xdomain: !1
|
|
3861
3861
|
});
|
|
3862
3862
|
return t && t.responseType !== null;
|
|
3863
3863
|
})();
|
|
3864
|
-
class
|
|
3864
|
+
class ma extends fa {
|
|
3865
3865
|
constructor(e) {
|
|
3866
3866
|
super(e);
|
|
3867
3867
|
const s = e && e.forceBase64;
|
|
3868
|
-
this.supportsBinary =
|
|
3868
|
+
this.supportsBinary = ga && !s;
|
|
3869
3869
|
}
|
|
3870
3870
|
request(e = {}) {
|
|
3871
3871
|
return Object.assign(e, { xd: this.xd }, this.opts), new je(cr, this.uri(), e);
|
|
@@ -3874,7 +3874,7 @@ class fa extends ha {
|
|
|
3874
3874
|
function cr(t) {
|
|
3875
3875
|
const e = t.xdomain;
|
|
3876
3876
|
try {
|
|
3877
|
-
if (typeof XMLHttpRequest < "u" && (!e ||
|
|
3877
|
+
if (typeof XMLHttpRequest < "u" && (!e || ha))
|
|
3878
3878
|
return new XMLHttpRequest();
|
|
3879
3879
|
} catch {
|
|
3880
3880
|
}
|
|
@@ -3885,7 +3885,7 @@ function cr(t) {
|
|
|
3885
3885
|
}
|
|
3886
3886
|
}
|
|
3887
3887
|
const dr = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative";
|
|
3888
|
-
class
|
|
3888
|
+
class ya extends bn {
|
|
3889
3889
|
get name() {
|
|
3890
3890
|
return "websocket";
|
|
3891
3891
|
}
|
|
@@ -3942,7 +3942,7 @@ class ga extends bn {
|
|
|
3942
3942
|
}
|
|
3943
3943
|
}
|
|
3944
3944
|
const gs = re.WebSocket || re.MozWebSocket;
|
|
3945
|
-
class
|
|
3945
|
+
class va extends ya {
|
|
3946
3946
|
createSocket(e, s, n) {
|
|
3947
3947
|
return dr ? new gs(e, s, n) : s ? new gs(e, s) : new gs(e);
|
|
3948
3948
|
}
|
|
@@ -3950,7 +3950,7 @@ class ma extends ga {
|
|
|
3950
3950
|
this.ws.send(s);
|
|
3951
3951
|
}
|
|
3952
3952
|
}
|
|
3953
|
-
class
|
|
3953
|
+
class ba extends bn {
|
|
3954
3954
|
get name() {
|
|
3955
3955
|
return "webtransport";
|
|
3956
3956
|
}
|
|
@@ -3966,7 +3966,7 @@ class ya extends bn {
|
|
|
3966
3966
|
this.onError("webtransport error", e);
|
|
3967
3967
|
}), this._transport.ready.then(() => {
|
|
3968
3968
|
this._transport.createBidirectionalStream().then((e) => {
|
|
3969
|
-
const s =
|
|
3969
|
+
const s = ea(Number.MAX_SAFE_INTEGER, this.socket.binaryType), n = e.readable.pipeThrough(s).getReader(), i = Zo();
|
|
3970
3970
|
i.readable.pipeTo(e.writable), this._writer = i.writable.getWriter();
|
|
3971
3971
|
const r = () => {
|
|
3972
3972
|
n.read().then(({ done: o, value: c }) => {
|
|
@@ -3996,11 +3996,11 @@ class ya extends bn {
|
|
|
3996
3996
|
(e = this._transport) === null || e === void 0 || e.close();
|
|
3997
3997
|
}
|
|
3998
3998
|
}
|
|
3999
|
-
const
|
|
4000
|
-
websocket:
|
|
4001
|
-
webtransport:
|
|
4002
|
-
polling:
|
|
4003
|
-
},
|
|
3999
|
+
const Ia = {
|
|
4000
|
+
websocket: va,
|
|
4001
|
+
webtransport: ba,
|
|
4002
|
+
polling: ma
|
|
4003
|
+
}, wa = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, _a = [
|
|
4004
4004
|
"source",
|
|
4005
4005
|
"protocol",
|
|
4006
4006
|
"authority",
|
|
@@ -4021,16 +4021,16 @@ function Zs(t) {
|
|
|
4021
4021
|
throw "URI too long";
|
|
4022
4022
|
const e = t, s = t.indexOf("["), n = t.indexOf("]");
|
|
4023
4023
|
s != -1 && n != -1 && (t = t.substring(0, s) + t.substring(s, n).replace(/:/g, ";") + t.substring(n, t.length));
|
|
4024
|
-
let i =
|
|
4024
|
+
let i = wa.exec(t || ""), r = {}, a = 14;
|
|
4025
4025
|
for (; a--; )
|
|
4026
|
-
r[
|
|
4027
|
-
return s != -1 && n != -1 && (r.source = e, r.host = r.host.substring(1, r.host.length - 1).replace(/;/g, ":"), r.authority = r.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), r.ipv6uri = !0), r.pathNames =
|
|
4026
|
+
r[_a[a]] = i[a] || "";
|
|
4027
|
+
return s != -1 && n != -1 && (r.source = e, r.host = r.host.substring(1, r.host.length - 1).replace(/;/g, ":"), r.authority = r.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), r.ipv6uri = !0), r.pathNames = Sa(r, r.path), r.queryKey = ka(r, r.query), r;
|
|
4028
4028
|
}
|
|
4029
|
-
function
|
|
4029
|
+
function Sa(t, e) {
|
|
4030
4030
|
const s = /\/{2,9}/g, n = e.replace(s, "/").split("/");
|
|
4031
4031
|
return (e.slice(0, 1) == "/" || e.length === 0) && n.splice(0, 1), e.slice(-1) == "/" && n.splice(n.length - 1, 1), n;
|
|
4032
4032
|
}
|
|
4033
|
-
function
|
|
4033
|
+
function ka(t, e) {
|
|
4034
4034
|
const s = {};
|
|
4035
4035
|
return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function(n, i, r) {
|
|
4036
4036
|
i && (s[i] = r);
|
|
@@ -4048,7 +4048,7 @@ class _e extends F {
|
|
|
4048
4048
|
* @param {Object} opts - options
|
|
4049
4049
|
*/
|
|
4050
4050
|
constructor(e, s) {
|
|
4051
|
-
if (super(), this.binaryType =
|
|
4051
|
+
if (super(), this.binaryType = sa, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = 1 / 0, e && typeof e == "object" && (s = e, e = null), e) {
|
|
4052
4052
|
const n = Zs(e);
|
|
4053
4053
|
s.hostname = n.host, s.secure = n.protocol === "https" || n.protocol === "wss", s.port = n.port, n.query && (s.query = n.query);
|
|
4054
4054
|
} else s.host && (s.hostname = Zs(s.host).host);
|
|
@@ -4069,7 +4069,7 @@ class _e extends F {
|
|
|
4069
4069
|
},
|
|
4070
4070
|
transportOptions: {},
|
|
4071
4071
|
closeOnBeforeunload: !1
|
|
4072
|
-
}, s), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query =
|
|
4072
|
+
}, s), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = da(this.opts.query)), en && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
|
|
4073
4073
|
this.transport && (this.transport.removeAllListeners(), this.transport.close());
|
|
4074
4074
|
}, addEventListener("beforeunload", this._beforeunloadEventListener, !1)), this.hostname !== "localhost" && (this._offlineEventListener = () => {
|
|
4075
4075
|
this._onClose("transport close", {
|
|
@@ -4204,7 +4204,7 @@ class _e extends F {
|
|
|
4204
4204
|
let s = 1;
|
|
4205
4205
|
for (let n = 0; n < this.writeBuffer.length; n++) {
|
|
4206
4206
|
const i = this.writeBuffer[n].data;
|
|
4207
|
-
if (i && (s +=
|
|
4207
|
+
if (i && (s += oa(i)), n > 0 && s > this._maxPayload)
|
|
4208
4208
|
return this.writeBuffer.slice(0, n);
|
|
4209
4209
|
s += 2;
|
|
4210
4210
|
}
|
|
@@ -4311,7 +4311,7 @@ class _e extends F {
|
|
|
4311
4311
|
}
|
|
4312
4312
|
}
|
|
4313
4313
|
_e.protocol = ir;
|
|
4314
|
-
class
|
|
4314
|
+
class Ra extends _e {
|
|
4315
4315
|
constructor() {
|
|
4316
4316
|
super(...arguments), this._upgrades = [];
|
|
4317
4317
|
}
|
|
@@ -4383,21 +4383,21 @@ class Sa extends _e {
|
|
|
4383
4383
|
return s;
|
|
4384
4384
|
}
|
|
4385
4385
|
}
|
|
4386
|
-
let
|
|
4386
|
+
let Aa = class extends Ra {
|
|
4387
4387
|
constructor(e, s = {}) {
|
|
4388
4388
|
const n = typeof e == "object", i = n ? { ...e } : { ...s };
|
|
4389
|
-
(!i.transports || i.transports && typeof i.transports[0] == "string") && (i.transports = (i.transports || ["polling", "websocket", "webtransport"]).map((r) =>
|
|
4389
|
+
(!i.transports || i.transports && typeof i.transports[0] == "string") && (i.transports = (i.transports || ["polling", "websocket", "webtransport"]).map((r) => Ia[r]).filter((r) => !!r)), super(n ? i : e, i);
|
|
4390
4390
|
}
|
|
4391
4391
|
};
|
|
4392
|
-
function
|
|
4392
|
+
function Ea(t, e = "", s) {
|
|
4393
4393
|
let n = t;
|
|
4394
4394
|
s = s || typeof location < "u" && location, t == null && (t = s.protocol + "//" + s.host), typeof t == "string" && (t.charAt(0) === "/" && (t.charAt(1) === "/" ? t = s.protocol + t : t = s.host + t), /^(https?|wss?):\/\//.test(t) || (typeof s < "u" ? t = s.protocol + "//" + t : t = "https://" + t), n = Zs(t)), n.port || (/^(http|ws)$/.test(n.protocol) ? n.port = "80" : /^(http|ws)s$/.test(n.protocol) && (n.port = "443")), n.path = n.path || "/";
|
|
4395
4395
|
const r = n.host.indexOf(":") !== -1 ? "[" + n.host + "]" : n.host;
|
|
4396
4396
|
return n.id = n.protocol + "://" + r + ":" + n.port + e, n.href = n.protocol + "://" + r + (s && s.port === n.port ? "" : ":" + n.port), n;
|
|
4397
4397
|
}
|
|
4398
|
-
const
|
|
4398
|
+
const Ta = typeof ArrayBuffer == "function", qa = (t) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(t) : t.buffer instanceof ArrayBuffer, lr = Object.prototype.toString, Ca = typeof Blob == "function" || typeof Blob < "u" && lr.call(Blob) === "[object BlobConstructor]", Ma = typeof File == "function" || typeof File < "u" && lr.call(File) === "[object FileConstructor]";
|
|
4399
4399
|
function In(t) {
|
|
4400
|
-
return
|
|
4400
|
+
return Ta && (t instanceof ArrayBuffer || qa(t)) || Ca && t instanceof Blob || Ma && t instanceof File;
|
|
4401
4401
|
}
|
|
4402
4402
|
function Et(t, e) {
|
|
4403
4403
|
if (!t || typeof t != "object")
|
|
@@ -4417,7 +4417,7 @@ function Et(t, e) {
|
|
|
4417
4417
|
return !0;
|
|
4418
4418
|
return !1;
|
|
4419
4419
|
}
|
|
4420
|
-
function
|
|
4420
|
+
function Oa(t) {
|
|
4421
4421
|
const e = [], s = t.data, n = t;
|
|
4422
4422
|
return n.data = Tt(s, e), n.attachments = e.length, { packet: n, buffers: e };
|
|
4423
4423
|
}
|
|
@@ -4442,7 +4442,7 @@ function Tt(t, e, s) {
|
|
|
4442
4442
|
}
|
|
4443
4443
|
return t;
|
|
4444
4444
|
}
|
|
4445
|
-
function
|
|
4445
|
+
function xa(t, e) {
|
|
4446
4446
|
return t.data = tn(t.data, e), delete t.attachments, t;
|
|
4447
4447
|
}
|
|
4448
4448
|
function tn(t, e) {
|
|
@@ -4460,7 +4460,7 @@ function tn(t, e) {
|
|
|
4460
4460
|
Object.prototype.hasOwnProperty.call(t, s) && (t[s] = tn(t[s], e));
|
|
4461
4461
|
return t;
|
|
4462
4462
|
}
|
|
4463
|
-
const
|
|
4463
|
+
const Pa = [
|
|
4464
4464
|
"connect",
|
|
4465
4465
|
// used on the client side
|
|
4466
4466
|
"connect_error",
|
|
@@ -4478,7 +4478,7 @@ var x;
|
|
|
4478
4478
|
(function(t) {
|
|
4479
4479
|
t[t.CONNECT = 0] = "CONNECT", t[t.DISCONNECT = 1] = "DISCONNECT", t[t.EVENT = 2] = "EVENT", t[t.ACK = 3] = "ACK", t[t.CONNECT_ERROR = 4] = "CONNECT_ERROR", t[t.BINARY_EVENT = 5] = "BINARY_EVENT", t[t.BINARY_ACK = 6] = "BINARY_ACK";
|
|
4480
4480
|
})(x || (x = {}));
|
|
4481
|
-
class
|
|
4481
|
+
class Da {
|
|
4482
4482
|
/**
|
|
4483
4483
|
* Encoder constructor
|
|
4484
4484
|
*
|
|
@@ -4514,7 +4514,7 @@ class xa {
|
|
|
4514
4514
|
* a list of buffers.
|
|
4515
4515
|
*/
|
|
4516
4516
|
encodeAsBinary(e) {
|
|
4517
|
-
const s =
|
|
4517
|
+
const s = Oa(e), n = this.encodeAsString(s.packet), i = s.buffers;
|
|
4518
4518
|
return i.unshift(n), i;
|
|
4519
4519
|
}
|
|
4520
4520
|
}
|
|
@@ -4540,7 +4540,7 @@ class wn extends F {
|
|
|
4540
4540
|
throw new Error("got plaintext data when reconstructing a packet");
|
|
4541
4541
|
s = this.decodeString(e);
|
|
4542
4542
|
const n = s.type === x.BINARY_EVENT;
|
|
4543
|
-
n || s.type === x.BINARY_ACK ? (s.type = n ? x.EVENT : x.ACK, this.reconstructor = new
|
|
4543
|
+
n || s.type === x.BINARY_ACK ? (s.type = n ? x.EVENT : x.ACK, this.reconstructor = new Ua(s)) : super.emitReserved("decoded", s);
|
|
4544
4544
|
} else if (In(e) || e.base64)
|
|
4545
4545
|
if (this.reconstructor)
|
|
4546
4546
|
s = this.reconstructor.takeBinaryData(e), s && (this.reconstructor = null, super.emitReserved("decoded", s));
|
|
@@ -4570,7 +4570,7 @@ class wn extends F {
|
|
|
4570
4570
|
if (a != Number(a) || e.charAt(s) !== "-")
|
|
4571
4571
|
throw new Error("Illegal attachments");
|
|
4572
4572
|
const o = Number(a);
|
|
4573
|
-
if (!
|
|
4573
|
+
if (!Na(o) || o < 1)
|
|
4574
4574
|
throw new Error("Illegal attachments");
|
|
4575
4575
|
if (o > this.opts.maxAttachments)
|
|
4576
4576
|
throw new Error("too many attachments");
|
|
@@ -4623,7 +4623,7 @@ class wn extends F {
|
|
|
4623
4623
|
return typeof s == "string" || Yn(s);
|
|
4624
4624
|
case x.EVENT:
|
|
4625
4625
|
case x.BINARY_EVENT:
|
|
4626
|
-
return Array.isArray(s) && (typeof s[0] == "number" || typeof s[0] == "string" &&
|
|
4626
|
+
return Array.isArray(s) && (typeof s[0] == "number" || typeof s[0] == "string" && Pa.indexOf(s[0]) === -1);
|
|
4627
4627
|
case x.ACK:
|
|
4628
4628
|
case x.BINARY_ACK:
|
|
4629
4629
|
return Array.isArray(s);
|
|
@@ -4636,7 +4636,7 @@ class wn extends F {
|
|
|
4636
4636
|
this.reconstructor && (this.reconstructor.finishedReconstruction(), this.reconstructor = null);
|
|
4637
4637
|
}
|
|
4638
4638
|
}
|
|
4639
|
-
class
|
|
4639
|
+
class Ua {
|
|
4640
4640
|
constructor(e) {
|
|
4641
4641
|
this.packet = e, this.buffers = [], this.reconPack = e;
|
|
4642
4642
|
}
|
|
@@ -4650,7 +4650,7 @@ class Pa {
|
|
|
4650
4650
|
*/
|
|
4651
4651
|
takeBinaryData(e) {
|
|
4652
4652
|
if (this.buffers.push(e), this.buffers.length === this.reconPack.attachments) {
|
|
4653
|
-
const s =
|
|
4653
|
+
const s = xa(this.reconPack, this.buffers);
|
|
4654
4654
|
return this.finishedReconstruction(), s;
|
|
4655
4655
|
}
|
|
4656
4656
|
return null;
|
|
@@ -4662,16 +4662,16 @@ class Pa {
|
|
|
4662
4662
|
this.reconPack = null, this.buffers = [];
|
|
4663
4663
|
}
|
|
4664
4664
|
}
|
|
4665
|
-
const
|
|
4665
|
+
const Na = Number.isInteger || function(t) {
|
|
4666
4666
|
return typeof t == "number" && isFinite(t) && Math.floor(t) === t;
|
|
4667
4667
|
};
|
|
4668
4668
|
function Yn(t) {
|
|
4669
4669
|
return Object.prototype.toString.call(t) === "[object Object]";
|
|
4670
4670
|
}
|
|
4671
|
-
const
|
|
4671
|
+
const ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4672
4672
|
__proto__: null,
|
|
4673
4673
|
Decoder: wn,
|
|
4674
|
-
Encoder:
|
|
4674
|
+
Encoder: Da,
|
|
4675
4675
|
get PacketType() {
|
|
4676
4676
|
return x;
|
|
4677
4677
|
}
|
|
@@ -4681,7 +4681,7 @@ function ce(t, e, s) {
|
|
|
4681
4681
|
t.off(e, s);
|
|
4682
4682
|
};
|
|
4683
4683
|
}
|
|
4684
|
-
const
|
|
4684
|
+
const Ba = Object.freeze({
|
|
4685
4685
|
connect: 1,
|
|
4686
4686
|
connect_error: 1,
|
|
4687
4687
|
disconnect: 1,
|
|
@@ -4806,7 +4806,7 @@ class ur extends F {
|
|
|
4806
4806
|
*/
|
|
4807
4807
|
emit(e, ...s) {
|
|
4808
4808
|
var n, i, r;
|
|
4809
|
-
if (
|
|
4809
|
+
if (Ba.hasOwnProperty(e))
|
|
4810
4810
|
throw new Error('"' + e.toString() + '" is a reserved event name');
|
|
4811
4811
|
if (s.unshift(e), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile)
|
|
4812
4812
|
return this._addToQueue(s), this;
|
|
@@ -5313,7 +5313,7 @@ class sn extends F {
|
|
|
5313
5313
|
max: this.reconnectionDelayMax(),
|
|
5314
5314
|
jitter: this.randomizationFactor()
|
|
5315
5315
|
}), this.timeout(s.timeout == null ? 2e4 : s.timeout), this._readyState = "closed", this.uri = e;
|
|
5316
|
-
const i = s.parser ||
|
|
5316
|
+
const i = s.parser || ja;
|
|
5317
5317
|
this.encoder = new i.Encoder(), this.decoder = new i.Decoder(), this._autoConnect = s.autoConnect !== !1, this._autoConnect && this.open();
|
|
5318
5318
|
}
|
|
5319
5319
|
reconnection(e) {
|
|
@@ -5356,7 +5356,7 @@ class sn extends F {
|
|
|
5356
5356
|
open(e) {
|
|
5357
5357
|
if (~this._readyState.indexOf("open"))
|
|
5358
5358
|
return this;
|
|
5359
|
-
this.engine = new
|
|
5359
|
+
this.engine = new Aa(this.uri, this.opts);
|
|
5360
5360
|
const s = this.engine, n = this;
|
|
5361
5361
|
this._readyState = "opening", this.skipReconnect = !1;
|
|
5362
5362
|
const i = ce(s, "open", function() {
|
|
@@ -5546,7 +5546,7 @@ class sn extends F {
|
|
|
5546
5546
|
const Ge = {};
|
|
5547
5547
|
function qt(t, e) {
|
|
5548
5548
|
typeof t == "object" && (e = t, t = void 0), e = e || {};
|
|
5549
|
-
const s =
|
|
5549
|
+
const s = Ea(t, e.path || "/socket.io"), n = s.source, i = s.id, r = s.path, a = Ge[i] && r in Ge[i].nsps, o = e.forceNew || e["force new connection"] || e.multiplex === !1 || a;
|
|
5550
5550
|
let c;
|
|
5551
5551
|
return o ? c = new sn(n, e) : (Ge[i] || (Ge[i] = new sn(n, e)), c = Ge[i]), s.query && !e.query && (e.query = s.queryKey), c.socket(s.path, e);
|
|
5552
5552
|
}
|
|
@@ -5556,7 +5556,7 @@ Object.assign(qt, {
|
|
|
5556
5556
|
io: qt,
|
|
5557
5557
|
connect: qt
|
|
5558
5558
|
});
|
|
5559
|
-
const
|
|
5559
|
+
const La = 9e4, Fa = /* @__PURE__ */ new Set([
|
|
5560
5560
|
"chat.user_message",
|
|
5561
5561
|
"chat.retry_last_user_message",
|
|
5562
5562
|
"run.stop",
|
|
@@ -5581,7 +5581,7 @@ function Zn(t, e) {
|
|
|
5581
5581
|
const s = t.result && typeof t.result == "object" ? t.result : void 0, n = typeof s?.message == "string" && s.message.trim() ? s.message : `${e} (${t.code ?? "request_rejected"})`;
|
|
5582
5582
|
return new T(n, t.code ?? "request_rejected", !1, t.result, !0);
|
|
5583
5583
|
}
|
|
5584
|
-
class
|
|
5584
|
+
class $a {
|
|
5585
5585
|
constructor(e) {
|
|
5586
5586
|
this.options = e, this.socket = qt(`${e.backendUrl.replace(/\/$/, "")}/product-agent`, {
|
|
5587
5587
|
path: "/api/product-agent/socket.io",
|
|
@@ -5749,7 +5749,7 @@ class La {
|
|
|
5749
5749
|
readinessPhase: this.ready ? "bootstrap" : this.admitted ? "activation" : "namespace_ready"
|
|
5750
5750
|
})), e === this.generation && this.recover(n));
|
|
5751
5751
|
};
|
|
5752
|
-
this.admissionTimer = setTimeout(() => s("connect_timeout"), 6e4), this.readinessTimer = setTimeout(() => s("auth_timeout"),
|
|
5752
|
+
this.admissionTimer = setTimeout(() => s("connect_timeout"), 6e4), this.readinessTimer = setTimeout(() => s("auth_timeout"), La);
|
|
5753
5753
|
}
|
|
5754
5754
|
clearReadinessTimers() {
|
|
5755
5755
|
this.admissionTimer !== null && clearTimeout(this.admissionTimer), this.readinessTimer !== null && clearTimeout(this.readinessTimer), this.admissionTimer = null, this.readinessTimer = null;
|
|
@@ -5770,7 +5770,7 @@ class La {
|
|
|
5770
5770
|
this.bindings.get(e)?.owners.delete(s), this.ready && await this.synchronize();
|
|
5771
5771
|
}
|
|
5772
5772
|
async rpc(e, s) {
|
|
5773
|
-
if (!
|
|
5773
|
+
if (!Fa.has(e)) throw new T("Operation requires its HTTP adapter", "unsupported_rpc");
|
|
5774
5774
|
const n = this.generation, i = JSON.stringify(s);
|
|
5775
5775
|
return e === "run.stop" && this.uploadingResult ? (this.assertReady(n), this.request("runtime.rpc", { type: e, payload: JSON.parse(i) }, n)) : this.enqueue(async () => {
|
|
5776
5776
|
if (this.assertReady(n), e === "tool.result") {
|
|
@@ -5945,7 +5945,7 @@ function ke(t, e) {
|
|
|
5945
5945
|
retryable: t !== null && typeof t == "object" && "retryable" in t && typeof t.retryable == "boolean" ? t.retryable : ["authority_retired", "executor_not_ready", "connection_interrupted", "request_timed_out", "408", "425", "429"].includes(n) || /^5\d\d$/.test(n)
|
|
5946
5946
|
});
|
|
5947
5947
|
}
|
|
5948
|
-
function
|
|
5948
|
+
function za(t) {
|
|
5949
5949
|
let e = Promise.resolve();
|
|
5950
5950
|
const s = (o = hn(t.runtime().engine.getState().slices.conversation, t.runtime().engine.getState().slices.directory), c = Promise.resolve()) => {
|
|
5951
5951
|
const d = c.then(() => ({ ok: !0 }), (m) => ({ ok: !1, error: m })), u = o ? Object.values(o.submissions).filter((m) => m.delivery !== "accepted").slice(-8).map((m) => ({ submission: m, timer: Q(t.onTiming, {
|
|
@@ -6216,7 +6216,7 @@ function Fa(t) {
|
|
|
6216
6216
|
})
|
|
6217
6217
|
};
|
|
6218
6218
|
}
|
|
6219
|
-
class
|
|
6219
|
+
class Ha {
|
|
6220
6220
|
constructor(e) {
|
|
6221
6221
|
this.options = e, this.owner = `conversation:${e.authority.authorityId}:${e.authority.generation}`, this.deliveryRecovery = new Ze({
|
|
6222
6222
|
activeIntervalMs: 3e3,
|
|
@@ -6357,10 +6357,10 @@ class $a {
|
|
|
6357
6357
|
}
|
|
6358
6358
|
}
|
|
6359
6359
|
}
|
|
6360
|
-
const
|
|
6360
|
+
const Va = /(\]\()(\/api\/product-agent\/attachments\/download\?[^)\s]+)(\))/g;
|
|
6361
6361
|
function Ue(t, e) {
|
|
6362
6362
|
return e ? t.replace(
|
|
6363
|
-
|
|
6363
|
+
Va,
|
|
6364
6364
|
(s, n, i, r) => `${n}${new URL(i, e).toString()}${r}`
|
|
6365
6365
|
) : t;
|
|
6366
6366
|
}
|
|
@@ -6401,7 +6401,7 @@ function ei(t, e) {
|
|
|
6401
6401
|
...t.file_url === null ? {} : { fileUrl: new URL(t.file_url, e).toString() }
|
|
6402
6402
|
};
|
|
6403
6403
|
}
|
|
6404
|
-
function
|
|
6404
|
+
function Ka(t, e, s, n) {
|
|
6405
6405
|
const i = s === "open" || s === "awaiting_content", r = {
|
|
6406
6406
|
id: t.id,
|
|
6407
6407
|
createdAt: t.created_at,
|
|
@@ -6442,7 +6442,7 @@ function ms(t, e, s, n) {
|
|
|
6442
6442
|
const i = /* @__PURE__ */ new Map();
|
|
6443
6443
|
for (const _ of t.segments)
|
|
6444
6444
|
for (const q of [..._.activityIds, ..._.outcomeIds]) i.set(q, _.userMessageId);
|
|
6445
|
-
const r = t.items.map((_) =>
|
|
6445
|
+
const r = t.items.map((_) => Ka(
|
|
6446
6446
|
_,
|
|
6447
6447
|
i.get(_.id) ?? null,
|
|
6448
6448
|
t.streamStates[_.id],
|
|
@@ -6490,7 +6490,7 @@ function ms(t, e, s, n) {
|
|
|
6490
6490
|
}] : [_];
|
|
6491
6491
|
}), y = e?.error != null && t.historyRefreshFailure != null && t.historyRefreshFailure.consecutiveFailures < 4, b = y ? null : e?.error ?? null, k = [...t.submissions].reverse().find((_) => t.pendingDurabilityIds?.includes(_.userMessageId)), R = k ? {
|
|
6492
6492
|
code: "submission_checkpoint_pending",
|
|
6493
|
-
message:
|
|
6493
|
+
message: Zr,
|
|
6494
6494
|
details: { requestId: k.requestId }
|
|
6495
6495
|
} : null, g = u?.delivery === "failed" && !u.cancelled && !p ? u.error : b ?? R;
|
|
6496
6496
|
let I = {
|
|
@@ -6574,7 +6574,7 @@ function ti(t) {
|
|
|
6574
6574
|
return "This request was interrupted before acceptance could be confirmed.";
|
|
6575
6575
|
}
|
|
6576
6576
|
}
|
|
6577
|
-
function
|
|
6577
|
+
function Wa(t) {
|
|
6578
6578
|
return {
|
|
6579
6579
|
content: t.content,
|
|
6580
6580
|
...typeof t.context.proactiveSuggestionQuestion == "string" ? { proactiveSuggestionQuestion: t.context.proactiveSuggestionQuestion } : {},
|
|
@@ -6686,20 +6686,20 @@ function Mt(t) {
|
|
|
6686
6686
|
nextCursor: t.nextCursor
|
|
6687
6687
|
};
|
|
6688
6688
|
}
|
|
6689
|
-
function
|
|
6689
|
+
function Ga(t, e, s) {
|
|
6690
6690
|
if (s === "replace" || t === null) return e;
|
|
6691
6691
|
const n = { ...t.entitiesById, ...e.entitiesById }, i = [...t.ids];
|
|
6692
6692
|
for (const r of e.ids)
|
|
6693
6693
|
t.entitiesById[r] || i.push(r);
|
|
6694
6694
|
return { entitiesById: n, ids: i, nextCursor: e.nextCursor };
|
|
6695
6695
|
}
|
|
6696
|
-
function
|
|
6696
|
+
function Ja(t) {
|
|
6697
6697
|
return t ? t.ids.map((e) => t.entitiesById[e]).filter((e) => !!e) : [];
|
|
6698
6698
|
}
|
|
6699
6699
|
function ru(t) {
|
|
6700
6700
|
return t.visible ? t.minimized ? { state: "minimized" } : { state: t.open ? "visible_open" : "visible_closed" } : { state: "hidden" };
|
|
6701
6701
|
}
|
|
6702
|
-
function
|
|
6702
|
+
function Qa(t) {
|
|
6703
6703
|
if (!t || typeof t != "object") return !1;
|
|
6704
6704
|
const e = t.paidCreditFallbackModel;
|
|
6705
6705
|
return typeof e == "string" && e.length > 0;
|
|
@@ -6717,11 +6717,11 @@ function au(t) {
|
|
|
6717
6717
|
disabled: !e || !t.canSubmitMessage
|
|
6718
6718
|
};
|
|
6719
6719
|
}
|
|
6720
|
-
const
|
|
6720
|
+
const Xa = "Pluno is reconnecting. Try again in a moment.";
|
|
6721
6721
|
function ni(t) {
|
|
6722
|
-
return (t instanceof Error ? t.message : t) ===
|
|
6722
|
+
return (t instanceof Error ? t.message : t) === Xa;
|
|
6723
6723
|
}
|
|
6724
|
-
function
|
|
6724
|
+
function Ya() {
|
|
6725
6725
|
const t = crypto.getRandomValues(new Uint8Array(16));
|
|
6726
6726
|
t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128;
|
|
6727
6727
|
const e = Array.from(t, (s) => s.toString(16).padStart(2, "0")).join("");
|
|
@@ -6785,7 +6785,7 @@ class hr {
|
|
|
6785
6785
|
h.signal.aborted || (p.trigger = E, h.abort());
|
|
6786
6786
|
}, f = () => m("transport_disposed"), y = () => m(["owner_disposed", "authority_retired", "observation_released", "request_replaced"].includes(a?.reason) ? a.reason : "caller_cancelled");
|
|
6787
6787
|
this.requests.signal.addEventListener("abort", f, { once: !0 }), a?.addEventListener("abort", y, { once: !0 });
|
|
6788
|
-
const b = r === "conversations" && /^\/[^/]+\/snapshot$/.test(e) && i === "POST", k = /^\/conversations(?:\/[^/]+)?$/.test(e) && (i ?? (n === void 0 ? "GET" : "POST")) === "GET", R = setTimeout(() => m("deadline"), k ? 6e4 : b ? 3e4 : 15e3), g =
|
|
6788
|
+
const b = r === "conversations" && /^\/[^/]+\/snapshot$/.test(e) && i === "POST", k = /^\/conversations(?:\/[^/]+)?$/.test(e) && (i ?? (n === void 0 ? "GET" : "POST")) === "GET", R = setTimeout(() => m("deadline"), k ? 6e4 : b ? 3e4 : 15e3), g = Ya(), v = Date.now();
|
|
6789
6789
|
let I = null, w = !1, A = null, _ = null, q = null;
|
|
6790
6790
|
try {
|
|
6791
6791
|
const E = await Promise.resolve(fetch(u, {
|
|
@@ -6892,11 +6892,11 @@ function pr() {
|
|
|
6892
6892
|
function B(t) {
|
|
6893
6893
|
return JSON.stringify([t.kind, t.origin, t.limit]);
|
|
6894
6894
|
}
|
|
6895
|
-
function
|
|
6895
|
+
function Za(t) {
|
|
6896
6896
|
const e = t.map((s) => tt(s) || s.requestId !== null && s.status !== "error" ? { ...s, status: s.status === "error" ? s.data?.length ? "refreshing" : "loading" : s.status, error: null } : s);
|
|
6897
6897
|
return e.find((s) => s.status === "loading_more" || s.status === "loading" || s.status === "refreshing") ?? e.find((s) => s.status === "error") ?? e.find((s) => s.query.kind === "recent") ?? e[0];
|
|
6898
6898
|
}
|
|
6899
|
-
function
|
|
6899
|
+
function ec(t) {
|
|
6900
6900
|
return [...new Set(t.flatMap((e) => e.data ?? []))];
|
|
6901
6901
|
}
|
|
6902
6902
|
function tt(t) {
|
|
@@ -6938,7 +6938,7 @@ function ri(t) {
|
|
|
6938
6938
|
c() || (n = t.runtime.engine.subscribe(c), i = t.runtime.onDispose(o));
|
|
6939
6939
|
});
|
|
6940
6940
|
}
|
|
6941
|
-
function
|
|
6941
|
+
function tc(t) {
|
|
6942
6942
|
const e = t.http.auth.client_kind === "extension" ? "extension" : void 0, s = /* @__PURE__ */ new Map();
|
|
6943
6943
|
return {
|
|
6944
6944
|
"directory.query": async (n) => {
|
|
@@ -6978,7 +6978,7 @@ function Za(t) {
|
|
|
6978
6978
|
}
|
|
6979
6979
|
};
|
|
6980
6980
|
}
|
|
6981
|
-
class
|
|
6981
|
+
class sc {
|
|
6982
6982
|
constructor(e) {
|
|
6983
6983
|
this.options = e, this.owner = `directory:${e.authority.authorityId}:${e.authority.generation}`, this.boundary = { authority: e.authority, currentAuthority: () => e.runtime.engine.getState().slices.directory }, this.unsubscribe = e.runtime.engine.subscribe(() => this.reconcile());
|
|
6984
6984
|
}
|
|
@@ -7151,7 +7151,7 @@ class ec {
|
|
|
7151
7151
|
this.unsubscribe(), this.reconcile();
|
|
7152
7152
|
}
|
|
7153
7153
|
}
|
|
7154
|
-
function
|
|
7154
|
+
function nc(t) {
|
|
7155
7155
|
if (!t || typeof t != "object") return !1;
|
|
7156
7156
|
const e = t;
|
|
7157
7157
|
if (e.version !== 1 || typeof e.authorityId != "string" || typeof e.browserSessionId != "string" || !Array.isArray(e.bindings) || !e.mains || typeof e.mains != "object" || Array.isArray(e.mains)) return !1;
|
|
@@ -7168,7 +7168,7 @@ function tc(t) {
|
|
|
7168
7168
|
return !0;
|
|
7169
7169
|
}
|
|
7170
7170
|
const oi = /* @__PURE__ */ new WeakMap();
|
|
7171
|
-
class
|
|
7171
|
+
class ic {
|
|
7172
7172
|
constructor(e) {
|
|
7173
7173
|
this.options = e;
|
|
7174
7174
|
}
|
|
@@ -7238,7 +7238,7 @@ class sc {
|
|
|
7238
7238
|
const s = this.state();
|
|
7239
7239
|
if (!this.current()) return !1;
|
|
7240
7240
|
const n = await this.options.persistence.read();
|
|
7241
|
-
if (!
|
|
7241
|
+
if (!nc(n) || n.authorityId !== this.options.authority.authorityId || n.browserSessionId !== this.options.persistence.sessionId()) return !1;
|
|
7242
7242
|
const i = new Set(await this.options.persistence.liveClients());
|
|
7243
7243
|
if (!this.current() || this.state().clients !== s.clients) return !1;
|
|
7244
7244
|
const r = n.bindings.filter((c) => {
|
|
@@ -7264,7 +7264,7 @@ class sc {
|
|
|
7264
7264
|
return await Promise.all(a.map((c) => this.options.runtime.engine.dispatch(c))), !0;
|
|
7265
7265
|
}
|
|
7266
7266
|
}
|
|
7267
|
-
function
|
|
7267
|
+
function rc(t, e, s, n = () => crypto.randomUUID()) {
|
|
7268
7268
|
const i = `pluno.productAgent.directory:${encodeURIComponent(s)}:${encodeURIComponent(e)}`, r = `${i}:tabSession`, a = t.getItem(r) ?? n();
|
|
7269
7269
|
return t.setItem(r, a), {
|
|
7270
7270
|
sessionId: () => a,
|
|
@@ -7276,9 +7276,9 @@ function nc(t, e, s, n = () => crypto.randomUUID()) {
|
|
|
7276
7276
|
};
|
|
7277
7277
|
}
|
|
7278
7278
|
const ai = /* @__PURE__ */ new Map(), ci = /* @__PURE__ */ new Map();
|
|
7279
|
-
function
|
|
7279
|
+
function oc(t, e, s = () => crypto.randomUUID()) {
|
|
7280
7280
|
try {
|
|
7281
|
-
return
|
|
7281
|
+
return rc(window.sessionStorage, t, e, s);
|
|
7282
7282
|
} catch (n) {
|
|
7283
7283
|
if (!(n instanceof DOMException) || n.name !== "SecurityError" && n.name !== "QuotaExceededError") throw n;
|
|
7284
7284
|
const i = `${e}:${t}`, r = ci.get(i) ?? s();
|
|
@@ -7298,7 +7298,7 @@ class L extends EventTarget {
|
|
|
7298
7298
|
...e,
|
|
7299
7299
|
executorConnection: () => this.connectionId,
|
|
7300
7300
|
restoreExecutor: (s) => this.restoreExecutor(s)
|
|
7301
|
-
}), this.transport = new
|
|
7301
|
+
}), this.transport = new $a({
|
|
7302
7302
|
backendUrl: e.backendUrl,
|
|
7303
7303
|
auth: e.auth,
|
|
7304
7304
|
displaySchema: e.displaySchema,
|
|
@@ -7669,7 +7669,7 @@ function gr(t) {
|
|
|
7669
7669
|
const e = t;
|
|
7670
7670
|
return typeof e.observedAt == "string" && e.observedAt.length <= 40 && Number.isFinite(Date.parse(e.observedAt)) && Te(e.sessionId) && Te(e.responseItemId) && Te(e.respondsToUserMessageId) && typeof e.panelVisible == "boolean" && typeof e.documentVisible == "boolean" && typeof e.loading == "boolean";
|
|
7671
7671
|
}
|
|
7672
|
-
function
|
|
7672
|
+
function ac(t, e, s) {
|
|
7673
7673
|
if (!gr(s)) return;
|
|
7674
7674
|
const n = rn.get(t) ?? /* @__PURE__ */ new Map();
|
|
7675
7675
|
n.set(e, {
|
|
@@ -7682,11 +7682,11 @@ function rc(t, e, s) {
|
|
|
7682
7682
|
loading: s.loading
|
|
7683
7683
|
}), n.size > 2 && n.delete(n.keys().next().value), rn.set(t, n);
|
|
7684
7684
|
}
|
|
7685
|
-
function
|
|
7685
|
+
function cc(t, e, s) {
|
|
7686
7686
|
const n = rn.get(t)?.get(e);
|
|
7687
7687
|
return n?.sessionId === s ? n : null;
|
|
7688
7688
|
}
|
|
7689
|
-
function
|
|
7689
|
+
function dc(t, e, s, n, i, r, a, o, c = null, d = !1) {
|
|
7690
7690
|
const u = n ? o.find((h) => h.role === "user" && (h.id === n || h.clientMessageId === n)) : void 0, l = u ? [...o].reverse().find((h) => (h.role === "assistant" || h.dataType === "commentary_history" || h.dataType === "tool_summary") && h.respondsToUserMessageId === u.id) : void 0;
|
|
7691
7691
|
return {
|
|
7692
7692
|
capturedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -7696,14 +7696,14 @@ function ac(t, e, s, n, i, r, a, o, c = null, d = !1) {
|
|
|
7696
7696
|
clientUserMessageItemId: u && Te(u.id) ? u.id : null,
|
|
7697
7697
|
clientResponseItemId: l && Te(l.id) ? l.id : null,
|
|
7698
7698
|
clientDraftObserved: !!(u && d && c === u.id),
|
|
7699
|
-
renderer:
|
|
7699
|
+
renderer: cc(t, e, s)
|
|
7700
7700
|
};
|
|
7701
7701
|
}
|
|
7702
|
-
const
|
|
7702
|
+
const lc = 1e4, uc = 3e3;
|
|
7703
7703
|
function mr() {
|
|
7704
7704
|
return { authenticated: !1, generation: 0, sequence: 0, displaySequence: 0, backendCount: null, query: ve("activeUsers") };
|
|
7705
7705
|
}
|
|
7706
|
-
function
|
|
7706
|
+
function hc(t, e) {
|
|
7707
7707
|
if (e.type === "activeUsers.authenticate") {
|
|
7708
7708
|
if (t.authenticated === e.authenticated) return { state: t, effects: [] };
|
|
7709
7709
|
const n = { ...mr(), authenticated: e.authenticated, generation: t.generation + 1 };
|
|
@@ -7725,7 +7725,7 @@ function lc(t, e) {
|
|
|
7725
7725
|
return t.backendCount === null ? li(s) : { state: s, effects: [] };
|
|
7726
7726
|
}
|
|
7727
7727
|
function di(t) {
|
|
7728
|
-
const e = t.sequence + 1, s = `activeUsers:${t.generation}:${e}`, n = [{ id: `${s}:wait`, kind: "activeUsers.wait", input: { milliseconds:
|
|
7728
|
+
const e = t.sequence + 1, s = `activeUsers:${t.generation}:${e}`, n = [{ id: `${s}:wait`, kind: "activeUsers.wait", input: { milliseconds: lc } }];
|
|
7729
7729
|
return t.query.status === "loading" || t.query.status === "refreshing" ? { state: { ...t, sequence: e }, effects: n } : (n.push({ id: `${s}:load`, kind: "activeUsers.load", input: { generation: t.generation } }), { state: { ...t, sequence: e, query: { ...t.query, requestId: `${s}:load`, status: t.query.data === null ? "loading" : "refreshing", error: null } }, effects: n });
|
|
7730
7730
|
}
|
|
7731
7731
|
function li(t) {
|
|
@@ -7733,11 +7733,11 @@ function li(t) {
|
|
|
7733
7733
|
return { state: { ...t, displaySequence: e }, effects: [{
|
|
7734
7734
|
id: `activeUsers:${t.generation}:display:${e}`,
|
|
7735
7735
|
kind: "activeUsers.displayWait",
|
|
7736
|
-
input: { milliseconds:
|
|
7736
|
+
input: { milliseconds: uc }
|
|
7737
7737
|
}] };
|
|
7738
7738
|
}
|
|
7739
|
-
const
|
|
7740
|
-
function
|
|
7739
|
+
const pc = () => Object.freeze({ scopes: Object.freeze({}) });
|
|
7740
|
+
function fc(t, e) {
|
|
7741
7741
|
const s = t.scopes[e.clientScopeId];
|
|
7742
7742
|
let n;
|
|
7743
7743
|
if (e.type === "model.scope_close") {
|
|
@@ -7853,7 +7853,7 @@ function hi(t, e, s, n) {
|
|
|
7853
7853
|
membershipRevision: t.membershipRevision + 1
|
|
7854
7854
|
};
|
|
7855
7855
|
}
|
|
7856
|
-
function
|
|
7856
|
+
function gc(t, e, s) {
|
|
7857
7857
|
switch (e.type) {
|
|
7858
7858
|
case "directory.bind":
|
|
7859
7859
|
case "directory.provisional": {
|
|
@@ -7865,7 +7865,7 @@ function pc(t, e, s) {
|
|
|
7865
7865
|
const r = t.clients[e.clientScopeId];
|
|
7866
7866
|
if (r === e.conversationScopeId) return t;
|
|
7867
7867
|
const a = t.selections[r];
|
|
7868
|
-
if (e.type === "directory.bind" && e.reason === "tool" && !
|
|
7868
|
+
if (e.type === "directory.bind" && e.reason === "tool" && !mc(t, e.clientScopeId, e.sessionId, s))
|
|
7869
7869
|
throw new Error("Tool target is already bound to another conversation.");
|
|
7870
7870
|
return a && a.sessionId !== null && a.sessionId === n.sessionId ? {
|
|
7871
7871
|
...t,
|
|
@@ -7900,7 +7900,7 @@ function pc(t, e, s) {
|
|
|
7900
7900
|
return t;
|
|
7901
7901
|
}
|
|
7902
7902
|
}
|
|
7903
|
-
function
|
|
7903
|
+
function mc(t, e, s, n) {
|
|
7904
7904
|
const i = t.clients[e];
|
|
7905
7905
|
return i === void 0 || t.selections[i].sessionId === s ? !0 : !n || Object.values(n.pendingRestoration).includes(i) || Object.values(n.submissions).some((r) => r.conversationScopeId === i && !r.cancelled) ? !1 : t.selections[i].sessionId === null || ge(n, t, i).isDraftSession;
|
|
7906
7906
|
}
|
|
@@ -8056,11 +8056,11 @@ function qe(t, e, s) {
|
|
|
8056
8056
|
}
|
|
8057
8057
|
n = { ...n, requestSequence: t.requestSequence + 1, requests: { ...n.requests, [r]: o } }, i.push({ id: r, ...o });
|
|
8058
8058
|
} else
|
|
8059
|
-
n =
|
|
8059
|
+
n = gc(t, e, s);
|
|
8060
8060
|
}
|
|
8061
8061
|
return { state: it(n), effects: i };
|
|
8062
8062
|
}
|
|
8063
|
-
function
|
|
8063
|
+
function yc(t) {
|
|
8064
8064
|
const e = { ...t.entities };
|
|
8065
8065
|
for (const [a, o] of Object.entries(t.mutations)) {
|
|
8066
8066
|
if (!e[a]) continue;
|
|
@@ -8089,7 +8089,7 @@ function gc(t) {
|
|
|
8089
8089
|
]))
|
|
8090
8090
|
});
|
|
8091
8091
|
}
|
|
8092
|
-
class
|
|
8092
|
+
class vc {
|
|
8093
8093
|
constructor(e, s, n) {
|
|
8094
8094
|
this.handlers = e, this.accept = s, this.errorAdapter = n;
|
|
8095
8095
|
}
|
|
@@ -8128,7 +8128,7 @@ class mc {
|
|
|
8128
8128
|
);
|
|
8129
8129
|
}
|
|
8130
8130
|
}
|
|
8131
|
-
class
|
|
8131
|
+
class bc {
|
|
8132
8132
|
state;
|
|
8133
8133
|
reducer;
|
|
8134
8134
|
selector;
|
|
@@ -8142,7 +8142,7 @@ class yc {
|
|
|
8142
8142
|
scopedDiagnostics = /* @__PURE__ */ new Map();
|
|
8143
8143
|
diagnostics = { ownerId: `owner-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, revision: 0, dropped: 0, lastSelection: null, transitions: [] };
|
|
8144
8144
|
constructor(e) {
|
|
8145
|
-
this.state = e.initialState, this.reducer = e.reducer, this.selector = e.selector, this.effectRunner = new
|
|
8145
|
+
this.state = e.initialState, this.reducer = e.reducer, this.selector = e.selector, this.effectRunner = new vc(
|
|
8146
8146
|
e.effectHandlers,
|
|
8147
8147
|
(s) => this.acceptEffectResult(s),
|
|
8148
8148
|
e.errorAdapter
|
|
@@ -8160,7 +8160,7 @@ class yc {
|
|
|
8160
8160
|
return this.state;
|
|
8161
8161
|
}
|
|
8162
8162
|
recordDiagnosticTransition(e, s = !1) {
|
|
8163
|
-
let n =
|
|
8163
|
+
let n = Uo(e, this.diagnostics.revision + 1, s);
|
|
8164
8164
|
if (n?.effectId) {
|
|
8165
8165
|
if (n.type === "effect.started")
|
|
8166
8166
|
this.diagnosticEffects.set(n.effectId, n), this.diagnosticEffects.size > 128 && this.diagnosticEffects.delete(this.diagnosticEffects.keys().next().value);
|
|
@@ -8276,7 +8276,7 @@ class yc {
|
|
|
8276
8276
|
for (const s of this.listeners) s(e);
|
|
8277
8277
|
}
|
|
8278
8278
|
}
|
|
8279
|
-
const
|
|
8279
|
+
const Ic = Object.freeze({
|
|
8280
8280
|
modelSelection: "core",
|
|
8281
8281
|
directory: "core",
|
|
8282
8282
|
activeUsers: "core",
|
|
@@ -8286,24 +8286,24 @@ const vc = Object.freeze({
|
|
|
8286
8286
|
browserExecution: "legacy"
|
|
8287
8287
|
});
|
|
8288
8288
|
function pi(t, e) {
|
|
8289
|
-
const s =
|
|
8289
|
+
const s = Ic[t], n = e[s];
|
|
8290
8290
|
if (!n) throw new Error(`No ${s} implementation for ${t}.`);
|
|
8291
8291
|
return n();
|
|
8292
8292
|
}
|
|
8293
|
-
function
|
|
8293
|
+
function wc(t) {
|
|
8294
8294
|
return t.type === "effect.completed" || t.type === "effect.failed" ? t.effectKind === "directory.query" || t.effectKind === "directory.mutate" : t.type.startsWith("directory.");
|
|
8295
8295
|
}
|
|
8296
|
-
function
|
|
8296
|
+
function _c(t) {
|
|
8297
8297
|
return t.type === "effect.completed" || t.type === "effect.failed" ? t.effectKind.startsWith("conversation.") : t.type.startsWith("conversation.");
|
|
8298
8298
|
}
|
|
8299
|
-
const
|
|
8299
|
+
const Sc = {
|
|
8300
8300
|
"directory.query": async () => {
|
|
8301
8301
|
throw new Error("Directory ports are not installed before S5-C.");
|
|
8302
8302
|
},
|
|
8303
8303
|
"directory.mutate": async () => {
|
|
8304
8304
|
throw new Error("Directory ports are not installed before S5-C.");
|
|
8305
8305
|
}
|
|
8306
|
-
},
|
|
8306
|
+
}, kc = {
|
|
8307
8307
|
"conversation.prepare": async () => {
|
|
8308
8308
|
throw new Error("Conversation preparation adapter is not installed.");
|
|
8309
8309
|
},
|
|
@@ -8357,18 +8357,18 @@ function fi(t, e, s) {
|
|
|
8357
8357
|
}
|
|
8358
8358
|
return n;
|
|
8359
8359
|
}
|
|
8360
|
-
class
|
|
8360
|
+
class Rc {
|
|
8361
8361
|
engine;
|
|
8362
8362
|
disposeListeners = /* @__PURE__ */ new Set();
|
|
8363
8363
|
conversationPorts;
|
|
8364
8364
|
featurePorts;
|
|
8365
|
-
constructor(e =
|
|
8366
|
-
this.conversationPorts = { ...
|
|
8365
|
+
constructor(e = Sc, s = {}, n, i) {
|
|
8366
|
+
this.conversationPorts = { ...kc, ...s }, this.featurePorts = i ?? {}, this.engine = new bc({
|
|
8367
8367
|
initialState: Object.freeze({ revision: 0, slices: Object.freeze({
|
|
8368
8368
|
account: G(Ls()),
|
|
8369
8369
|
features: G($s()),
|
|
8370
8370
|
interactions: G(Fs()),
|
|
8371
|
-
modelSelection:
|
|
8371
|
+
modelSelection: pc(),
|
|
8372
8372
|
directory: pr(),
|
|
8373
8373
|
conversation: Ni(),
|
|
8374
8374
|
activeUsers: mr()
|
|
@@ -8382,18 +8382,18 @@ class Sc {
|
|
|
8382
8382
|
return { state: Object.freeze({ revision: r.revision + 1, slices: Object.freeze({ ...r.slices, ...u }) }), effects: d.effects };
|
|
8383
8383
|
}
|
|
8384
8384
|
if (o.type.startsWith("activeUsers.") || (o.type === "effect.completed" || o.type === "effect.failed") && o.effectKind.startsWith("activeUsers.")) {
|
|
8385
|
-
const d =
|
|
8385
|
+
const d = hc(r.slices.activeUsers, o);
|
|
8386
8386
|
return { state: d.state === r.slices.activeUsers ? r : Object.freeze({ revision: r.revision + 1, slices: Object.freeze({ ...r.slices, activeUsers: d.state }) }), effects: d.effects };
|
|
8387
8387
|
}
|
|
8388
|
-
if (
|
|
8388
|
+
if (wc(o)) {
|
|
8389
8389
|
const d = qe(r.slices.directory, o, r.slices.conversation), u = Xs(Gs(r.slices.conversation, d.state, o.type === "directory.authority_replace" && o.adoptLocalSubmissions === !0)), l = Js(r.slices.conversation, u.state, d.state, d.state.clients !== r.slices.directory.clients), h = l.state, p = fi(r.slices.conversation, h, d.state);
|
|
8390
8390
|
return { state: p === r.slices.directory && h === r.slices.conversation ? r : Object.freeze({
|
|
8391
8391
|
revision: r.revision + 1,
|
|
8392
8392
|
slices: Object.freeze({ ...r.slices, directory: p, conversation: h })
|
|
8393
8393
|
}), effects: [...l.effects, ...d.effects, ...u.effects] };
|
|
8394
8394
|
}
|
|
8395
|
-
if (
|
|
8396
|
-
const d =
|
|
8395
|
+
if (_c(o)) {
|
|
8396
|
+
const d = To(r.slices.conversation, o, r.slices.directory, r.slices.modelSelection);
|
|
8397
8397
|
let u = r.slices.directory;
|
|
8398
8398
|
for (const [k, R] of Object.entries(d.state.operations)) {
|
|
8399
8399
|
if (!["runtime.warmup", "attachment.prepare"].includes(R.command.type) || !R.conversationScopeId || R.phase !== "done" || r.slices.conversation.operations[k]?.phase === "done") continue;
|
|
@@ -8432,13 +8432,13 @@ class Sc {
|
|
|
8432
8432
|
slices: Object.freeze({ ...r.slices, account: m.account, features: m.features, interactions: m.interactions, directory: u, conversation: p.state })
|
|
8433
8433
|
}), effects: [...d.effects, ...f, ...p.effects, ...h.effects] };
|
|
8434
8434
|
}
|
|
8435
|
-
const c =
|
|
8435
|
+
const c = fc(r.slices.modelSelection, o);
|
|
8436
8436
|
return { state: c === r.slices.modelSelection ? r : Object.freeze({
|
|
8437
8437
|
revision: r.revision + 1,
|
|
8438
8438
|
slices: Object.freeze({ ...r.slices, modelSelection: c })
|
|
8439
8439
|
}), effects: [] };
|
|
8440
8440
|
},
|
|
8441
|
-
selector: (r) => Object.freeze({ ...r.slices, directory:
|
|
8441
|
+
selector: (r) => Object.freeze({ ...r.slices, directory: yc(r.slices.directory), conversation: to(r.slices.conversation, r.slices.directory) }),
|
|
8442
8442
|
effectHandlers: {
|
|
8443
8443
|
...e,
|
|
8444
8444
|
"stage7.platform": (r) => {
|
|
@@ -8520,8 +8520,8 @@ class Sc {
|
|
|
8520
8520
|
}
|
|
8521
8521
|
}
|
|
8522
8522
|
}
|
|
8523
|
-
const
|
|
8524
|
-
async function
|
|
8523
|
+
const Ac = "pluno-product-agent-attachments", Ec = 1, an = "files", Tc = 1440 * 60 * 1e3;
|
|
8524
|
+
async function qc(t) {
|
|
8525
8525
|
const e = await Wt();
|
|
8526
8526
|
await vr(e, "readwrite", (s) => s.put(t));
|
|
8527
8527
|
}
|
|
@@ -8548,7 +8548,7 @@ async function yr(t, e) {
|
|
|
8548
8548
|
});
|
|
8549
8549
|
});
|
|
8550
8550
|
}
|
|
8551
|
-
async function
|
|
8551
|
+
async function Cc(t = Tc) {
|
|
8552
8552
|
const e = await Wt(), s = Date.now() - t;
|
|
8553
8553
|
await _n(e, "readwrite", async (n) => {
|
|
8554
8554
|
const i = n.index("lastUsedAt");
|
|
@@ -8557,7 +8557,7 @@ async function Tc(t = Ac) {
|
|
|
8557
8557
|
}
|
|
8558
8558
|
function Wt() {
|
|
8559
8559
|
return typeof indexedDB > "u" ? Promise.reject(new Error("Product Agent attachment storage is unavailable")) : new Promise((t, e) => {
|
|
8560
|
-
const s = indexedDB.open(
|
|
8560
|
+
const s = indexedDB.open(Ac, Ec);
|
|
8561
8561
|
s.onupgradeneeded = () => {
|
|
8562
8562
|
const i = s.result.createObjectStore(an, { keyPath: "attachmentId" });
|
|
8563
8563
|
i.createIndex("lastUsedAt", "lastUsedAt", { unique: !1 }), i.createIndex("sessionId", "sessionId", { unique: !1 }), i.createIndex("origin", "origin", { unique: !1 });
|
|
@@ -8594,11 +8594,11 @@ function Sn(t) {
|
|
|
8594
8594
|
t.onsuccess = () => e(t.result), t.onerror = () => s(t.error ?? new Error("Product Agent attachment storage request failed"));
|
|
8595
8595
|
});
|
|
8596
8596
|
}
|
|
8597
|
-
function
|
|
8597
|
+
function Mc(t) {
|
|
8598
8598
|
return t !== null && (typeof t == "object" || typeof t == "function");
|
|
8599
8599
|
}
|
|
8600
8600
|
function br(t, e, s) {
|
|
8601
|
-
const n = Reflect.get(t, "pluno"), i =
|
|
8601
|
+
const n = Reflect.get(t, "pluno"), i = Mc(n) ? n : {};
|
|
8602
8602
|
if (i !== n && !Reflect.set(t, "pluno", i))
|
|
8603
8603
|
return null;
|
|
8604
8604
|
const r = Object.getOwnPropertyDescriptor(i, e);
|
|
@@ -8613,7 +8613,7 @@ function br(t, e, s) {
|
|
|
8613
8613
|
};
|
|
8614
8614
|
}
|
|
8615
8615
|
const Ir = "suggest_share_on_socials";
|
|
8616
|
-
function
|
|
8616
|
+
function Oc(t) {
|
|
8617
8617
|
let e = t;
|
|
8618
8618
|
if (typeof t == "string")
|
|
8619
8619
|
try {
|
|
@@ -8621,20 +8621,20 @@ function Cc(t) {
|
|
|
8621
8621
|
} catch {
|
|
8622
8622
|
return null;
|
|
8623
8623
|
}
|
|
8624
|
-
const s =
|
|
8624
|
+
const s = xc(e);
|
|
8625
8625
|
return s ? typeof s.showSharePrompt == "boolean" ? s.showSharePrompt : s.ok === !0 && typeof s.message == "string" && s.message.includes("social-sharing prompt") ? !0 : null : null;
|
|
8626
8626
|
}
|
|
8627
|
-
function
|
|
8627
|
+
function xc(t) {
|
|
8628
8628
|
return t && typeof t == "object" && !Array.isArray(t) ? t : null;
|
|
8629
8629
|
}
|
|
8630
|
-
const
|
|
8631
|
-
function
|
|
8632
|
-
return (t.type === "function_call" || t.type === "tool_call") && t.name ===
|
|
8630
|
+
const Pc = "save_runtime_captured_skill";
|
|
8631
|
+
function Dc(t) {
|
|
8632
|
+
return (t.type === "function_call" || t.type === "tool_call") && t.name === Pc;
|
|
8633
8633
|
}
|
|
8634
|
-
const bs = "pluno.productAgent.transportId",
|
|
8634
|
+
const bs = "pluno.productAgent.transportId", Uc = "pluno.productAgent.transportIdentity", Is = "pluno.productAgent.transportIdentity.event", Nc = 50, jc = globalThis.setTimeout.bind(globalThis);
|
|
8635
8635
|
let Qe = null;
|
|
8636
8636
|
const Ot = /* @__PURE__ */ new Set(), ws = /* @__PURE__ */ new Map();
|
|
8637
|
-
async function
|
|
8637
|
+
async function Bc(t = wr()) {
|
|
8638
8638
|
const e = t.randomUUID(), s = t.storage.getItem(bs);
|
|
8639
8639
|
let n = s ?? t.randomUUID(), i = !1, r = !1;
|
|
8640
8640
|
const a = t.channel.subscribe((c) => {
|
|
@@ -8672,8 +8672,8 @@ async function Nc(t = wr()) {
|
|
|
8672
8672
|
}
|
|
8673
8673
|
};
|
|
8674
8674
|
}
|
|
8675
|
-
async function
|
|
8676
|
-
Qe || (Qe =
|
|
8675
|
+
async function Lc(t = !1) {
|
|
8676
|
+
Qe || (Qe = Bc({
|
|
8677
8677
|
...wr(),
|
|
8678
8678
|
skipStoredIdentityCollisionCheck: t
|
|
8679
8679
|
}), Qe.then((i) => {
|
|
@@ -8682,7 +8682,7 @@ async function jc(t = !1) {
|
|
|
8682
8682
|
};
|
|
8683
8683
|
window.addEventListener("pagehide", r);
|
|
8684
8684
|
}));
|
|
8685
|
-
const e = await Qe, s =
|
|
8685
|
+
const e = await Qe, s = Fc();
|
|
8686
8686
|
Ot.add(s);
|
|
8687
8687
|
let n = !1;
|
|
8688
8688
|
return {
|
|
@@ -8693,7 +8693,7 @@ async function jc(t = !1) {
|
|
|
8693
8693
|
}
|
|
8694
8694
|
};
|
|
8695
8695
|
}
|
|
8696
|
-
function
|
|
8696
|
+
function Fc() {
|
|
8697
8697
|
let t = 0;
|
|
8698
8698
|
for (; Ot.has(t); )
|
|
8699
8699
|
t += 1;
|
|
@@ -8701,13 +8701,13 @@ function Bc() {
|
|
|
8701
8701
|
}
|
|
8702
8702
|
function wr() {
|
|
8703
8703
|
return {
|
|
8704
|
-
storage:
|
|
8705
|
-
channel:
|
|
8704
|
+
storage: $c(),
|
|
8705
|
+
channel: zc(),
|
|
8706
8706
|
randomUUID: () => crypto.randomUUID(),
|
|
8707
|
-
settle: () => new Promise((t) =>
|
|
8707
|
+
settle: () => new Promise((t) => jc(t, Nc))
|
|
8708
8708
|
};
|
|
8709
8709
|
}
|
|
8710
|
-
function
|
|
8710
|
+
function $c() {
|
|
8711
8711
|
return {
|
|
8712
8712
|
getItem: (t) => {
|
|
8713
8713
|
try {
|
|
@@ -8725,9 +8725,9 @@ function Lc() {
|
|
|
8725
8725
|
}
|
|
8726
8726
|
};
|
|
8727
8727
|
}
|
|
8728
|
-
function
|
|
8728
|
+
function zc() {
|
|
8729
8729
|
if (typeof BroadcastChannel < "u") {
|
|
8730
|
-
const t = new BroadcastChannel(
|
|
8730
|
+
const t = new BroadcastChannel(Uc);
|
|
8731
8731
|
return {
|
|
8732
8732
|
postMessage: (e) => t.postMessage(e),
|
|
8733
8733
|
subscribe: (e) => {
|
|
@@ -8737,9 +8737,9 @@ function Fc() {
|
|
|
8737
8737
|
close: () => t.close()
|
|
8738
8738
|
};
|
|
8739
8739
|
}
|
|
8740
|
-
return
|
|
8740
|
+
return Hc();
|
|
8741
8741
|
}
|
|
8742
|
-
function
|
|
8742
|
+
function Hc() {
|
|
8743
8743
|
const t = /* @__PURE__ */ new Set(), e = (s) => {
|
|
8744
8744
|
if (s.key !== Is || !s.newValue)
|
|
8745
8745
|
return;
|
|
@@ -8761,7 +8761,7 @@ function $c() {
|
|
|
8761
8761
|
};
|
|
8762
8762
|
}
|
|
8763
8763
|
const _r = "schedule_follow_up";
|
|
8764
|
-
function
|
|
8764
|
+
function Vc(t) {
|
|
8765
8765
|
let e = t;
|
|
8766
8766
|
if (typeof e == "string")
|
|
8767
8767
|
try {
|
|
@@ -8777,7 +8777,7 @@ function zc(t) {
|
|
|
8777
8777
|
dueAt: s.dueAt
|
|
8778
8778
|
};
|
|
8779
8779
|
}
|
|
8780
|
-
const
|
|
8780
|
+
const Kc = [
|
|
8781
8781
|
"anthropic/claude-opus-5",
|
|
8782
8782
|
"anthropic/claude-opus-5.5",
|
|
8783
8783
|
"anthropic/claude-sonnet-5",
|
|
@@ -8791,16 +8791,16 @@ const Hc = [
|
|
|
8791
8791
|
"gpt-5.6-sol",
|
|
8792
8792
|
"gpt-6-sol",
|
|
8793
8793
|
"gpt-6-luna"
|
|
8794
|
-
], Bt = (t) => typeof t == "string" &&
|
|
8795
|
-
function
|
|
8794
|
+
], Bt = (t) => typeof t == "string" && Kc.includes(t), _s = /* @__PURE__ */ new Map();
|
|
8795
|
+
function Wc(t, e, s) {
|
|
8796
8796
|
const n = `pluno.productAgent.modelClientScope:${e}`, i = t.getItem(n);
|
|
8797
8797
|
if (i) return i;
|
|
8798
8798
|
const r = s();
|
|
8799
8799
|
return t.setItem(n, r), r;
|
|
8800
8800
|
}
|
|
8801
|
-
function
|
|
8801
|
+
function Gc(t, e) {
|
|
8802
8802
|
try {
|
|
8803
|
-
const s =
|
|
8803
|
+
const s = Wc(window.sessionStorage, t, e);
|
|
8804
8804
|
return _s.set(t, s), s;
|
|
8805
8805
|
} catch (s) {
|
|
8806
8806
|
if (!(s instanceof DOMException) || s.name !== "SecurityError" && s.name !== "QuotaExceededError") throw s;
|
|
@@ -8808,13 +8808,13 @@ function Kc(t, e) {
|
|
|
8808
8808
|
return _s.set(t, n), n;
|
|
8809
8809
|
}
|
|
8810
8810
|
}
|
|
8811
|
-
function
|
|
8811
|
+
function Jc(t) {
|
|
8812
8812
|
if (!t || typeof t != "object") return;
|
|
8813
8813
|
const e = t, s = e.requestedModel ?? e.requested_model, n = e.effectiveModel ?? e.effective_model, i = e.provider;
|
|
8814
8814
|
if (!(!Bt(s) || !Bt(n) || i !== "openrouter" && i !== "azure" && i !== "openai"))
|
|
8815
8815
|
return Object.freeze({ requestedModel: s, effectiveModel: n, provider: i });
|
|
8816
8816
|
}
|
|
8817
|
-
const Sr = (t, e) =>
|
|
8817
|
+
const Sr = (t, e) => ko(
|
|
8818
8818
|
t.engine.getState().slices.modelSelection,
|
|
8819
8819
|
e
|
|
8820
8820
|
);
|
|
@@ -8826,8 +8826,8 @@ function Ss(t, e, s, n) {
|
|
|
8826
8826
|
requestedModel: n
|
|
8827
8827
|
}), Sr(t, e).submissions[s].requestedModel;
|
|
8828
8828
|
}
|
|
8829
|
-
function
|
|
8830
|
-
const a =
|
|
8829
|
+
function Qc(t, e, s, n, i, r) {
|
|
8830
|
+
const a = Jc(i);
|
|
8831
8831
|
a && t.engine.accept({
|
|
8832
8832
|
type: "model.routing_accepted",
|
|
8833
8833
|
clientScopeId: e,
|
|
@@ -8842,7 +8842,7 @@ function ks(t, e, s, n) {
|
|
|
8842
8842
|
for (const i of n) {
|
|
8843
8843
|
if (!i || typeof i != "object") continue;
|
|
8844
8844
|
const r = i, a = r.clientMessageId ?? r.client_message_id, o = r.updatedAt ?? r.updated_at;
|
|
8845
|
-
typeof a == "string" &&
|
|
8845
|
+
typeof a == "string" && Qc(
|
|
8846
8846
|
t,
|
|
8847
8847
|
e,
|
|
8848
8848
|
s,
|
|
@@ -8862,7 +8862,7 @@ class cu {
|
|
|
8862
8862
|
nextCursor: r.nextCursor
|
|
8863
8863
|
}))
|
|
8864
8864
|
),
|
|
8865
|
-
|
|
8865
|
+
Ga
|
|
8866
8866
|
), this.pinnedQuery = new si(
|
|
8867
8867
|
`${e}:pinned`,
|
|
8868
8868
|
async () => Mt({
|
|
@@ -8895,7 +8895,7 @@ class cu {
|
|
|
8895
8895
|
}) : null;
|
|
8896
8896
|
return {
|
|
8897
8897
|
key: e.key.slice(0, -7),
|
|
8898
|
-
status:
|
|
8898
|
+
status: Xc(e, s),
|
|
8899
8899
|
data: o,
|
|
8900
8900
|
error: e.error ?? s.error,
|
|
8901
8901
|
requestId: Math.max(e.requestId, s.requestId),
|
|
@@ -9004,7 +9004,7 @@ class cu {
|
|
|
9004
9004
|
function mt(t) {
|
|
9005
9005
|
return t ? t.ids.map((e) => t.entitiesById[e]).filter((e) => !!e) : [];
|
|
9006
9006
|
}
|
|
9007
|
-
function
|
|
9007
|
+
function Xc(t, e) {
|
|
9008
9008
|
return t.status === "error" || e.status === "error" ? "error" : t.status === "loading" || e.status === "loading" ? "loading" : t.status === "refreshing" || e.status === "refreshing" ? "refreshing" : t.status === "loading_more" ? "loading_more" : t.status === "ready" || e.status === "ready" ? "ready" : "not_requested";
|
|
9009
9009
|
}
|
|
9010
9010
|
class du {
|
|
@@ -9162,11 +9162,11 @@ class du {
|
|
|
9162
9162
|
}
|
|
9163
9163
|
function lu(t, e) {
|
|
9164
9164
|
return {
|
|
9165
|
-
load: async () =>
|
|
9165
|
+
load: async () => Yc(t, e),
|
|
9166
9166
|
save: async (s) => t.setItem(e, JSON.stringify(s))
|
|
9167
9167
|
};
|
|
9168
9168
|
}
|
|
9169
|
-
function
|
|
9169
|
+
function Yc(t, e) {
|
|
9170
9170
|
const s = t.getItem(e);
|
|
9171
9171
|
if (!s) return [];
|
|
9172
9172
|
const n = JSON.parse(s);
|
|
@@ -9183,15 +9183,15 @@ function cn(t) {
|
|
|
9183
9183
|
const e = t;
|
|
9184
9184
|
return typeof e.promptKey == "string" && typeof e.category == "string" && typeof e.decidedAt == "string" && (e.nextEligibleAt === null || typeof e.nextEligibleAt == "string") && kr(e.action) && !!(e.scope && typeof e.scope == "object" && typeof e.scope.level == "string" && typeof e.scope.key == "string");
|
|
9185
9185
|
}
|
|
9186
|
-
const
|
|
9186
|
+
const Zc = {
|
|
9187
9187
|
working: "⏳",
|
|
9188
9188
|
completed: "✅",
|
|
9189
9189
|
failed: "❗",
|
|
9190
9190
|
stopped: "⏹️"
|
|
9191
|
-
},
|
|
9192
|
-
function
|
|
9191
|
+
}, ed = /^(?:⌛|⏳|✅|❗|⏹️) Pluno(?:: )?/;
|
|
9192
|
+
function td(t, e) {
|
|
9193
9193
|
if (!e) return Lt(t);
|
|
9194
|
-
const s = Lt(t), n = `${
|
|
9194
|
+
const s = Lt(t), n = `${Zc[e]} Pluno`;
|
|
9195
9195
|
return s ? `${n}: ${s}` : n;
|
|
9196
9196
|
}
|
|
9197
9197
|
class uu {
|
|
@@ -9228,7 +9228,7 @@ class uu {
|
|
|
9228
9228
|
applyTitle() {
|
|
9229
9229
|
if (!this.status)
|
|
9230
9230
|
return;
|
|
9231
|
-
const e =
|
|
9231
|
+
const e = td(this.baseTitle, this.status);
|
|
9232
9232
|
this.lastAppliedTitle = e, this.titleDocument.getTitle() !== e && this.titleDocument.setTitle(e);
|
|
9233
9233
|
}
|
|
9234
9234
|
}
|
|
@@ -9249,9 +9249,9 @@ function hu(t) {
|
|
|
9249
9249
|
};
|
|
9250
9250
|
}
|
|
9251
9251
|
function Lt(t) {
|
|
9252
|
-
return t.replace(
|
|
9252
|
+
return t.replace(ed, "");
|
|
9253
9253
|
}
|
|
9254
|
-
const
|
|
9254
|
+
const sd = {
|
|
9255
9255
|
"stop-without-rendered-message": "Stop is enabled while no message is rendered or the welcome screen is still visible.",
|
|
9256
9256
|
"in-progress-stop-unavailable": "An in-progress response has no visible enabled interrupt control.",
|
|
9257
9257
|
"stop-did-not-interrupt": "The stopped response remained in progress after an interrupt click.",
|
|
@@ -9267,8 +9267,8 @@ const ed = {
|
|
|
9267
9267
|
"thinking-groups-without-user-message": "Multiple thinking groups appeared without a user message between them.",
|
|
9268
9268
|
"thinking-without-progress": "Thinking remained visible without progress for five minutes."
|
|
9269
9269
|
};
|
|
9270
|
-
function
|
|
9271
|
-
return typeof t == "string" && t.startsWith("ui_invariant:") && Object.prototype.hasOwnProperty.call(
|
|
9270
|
+
function nd(t) {
|
|
9271
|
+
return typeof t == "string" && t.startsWith("ui_invariant:") && Object.prototype.hasOwnProperty.call(sd, t.slice(13));
|
|
9272
9272
|
}
|
|
9273
9273
|
function mi(t) {
|
|
9274
9274
|
return {
|
|
@@ -9299,9 +9299,9 @@ function pu(t) {
|
|
|
9299
9299
|
case "runtime.report_operation_timing":
|
|
9300
9300
|
return ot(e.timing);
|
|
9301
9301
|
case "runtime.report_displayed_error":
|
|
9302
|
-
return (e.errorDiagnostic === void 0 ||
|
|
9302
|
+
return (e.errorDiagnostic === void 0 || Bo(e.errorDiagnostic)) && (e.httpRequest === void 0 || he(e.httpRequest)) && (e.historyRefreshFailure === void 0 || pn(e.historyRefreshFailure)) && (e.renderedError === void 0 || gn(e.renderedError)) && (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);
|
|
9303
9303
|
case "runtime.report_invalid_state_transition":
|
|
9304
|
-
return (e.uiInvariant === void 0 || mn(e.uiInvariant)) && (e.reason === "submitted_turn_returned_to_welcome_without_new_chat" || e.reason === "new_messages_button_without_user_scroll" ||
|
|
9304
|
+
return (e.uiInvariant === void 0 || mn(e.uiInvariant)) && (e.reason === "submitted_turn_returned_to_welcome_without_new_chat" || e.reason === "new_messages_button_without_user_scroll" || nd(e.reason)) && (e.clientMessageId === void 0 || typeof e.clientMessageId == "string");
|
|
9305
9305
|
case "runtime.prompt_presented":
|
|
9306
9306
|
return (e.feature === "notifications" || e.feature === "tab_grouping") && typeof e.openingGeneration == "number" && Number.isSafeInteger(e.openingGeneration) && e.openingGeneration > 0;
|
|
9307
9307
|
case "runtime.widget_lifecycle":
|
|
@@ -9403,7 +9403,7 @@ class fu {
|
|
|
9403
9403
|
for (const l of this.state.messages) {
|
|
9404
9404
|
if (l.role !== "user" || !l.attachments?.length) continue;
|
|
9405
9405
|
const h = a.messages.find((p) => p.role === "user" && p.id === l.id);
|
|
9406
|
-
a.sessionId !== e.sessionId && !(a.sessionId === null && h) || (l.attachments =
|
|
9406
|
+
a.sessionId !== e.sessionId && !(a.sessionId === null && h) || (l.attachments = id(h?.attachments, l.attachments));
|
|
9407
9407
|
}
|
|
9408
9408
|
if (n && JSON.stringify(n) !== JSON.stringify(this.sessionHistoryState)) {
|
|
9409
9409
|
this.sessionHistoryState = yi(n);
|
|
@@ -9825,7 +9825,7 @@ class fu {
|
|
|
9825
9825
|
for (const i of n ?? []) i(s);
|
|
9826
9826
|
}
|
|
9827
9827
|
}
|
|
9828
|
-
function
|
|
9828
|
+
function id(t, e) {
|
|
9829
9829
|
if (!e || !t) return e;
|
|
9830
9830
|
const s = /* @__PURE__ */ new Map();
|
|
9831
9831
|
for (const n of t) {
|
|
@@ -9865,12 +9865,12 @@ function yi(t) {
|
|
|
9865
9865
|
return {
|
|
9866
9866
|
...t,
|
|
9867
9867
|
data: t.data ? Mt({
|
|
9868
|
-
entities:
|
|
9868
|
+
entities: Ja(t.data).map((e) => ({ ...e })),
|
|
9869
9869
|
nextCursor: t.data.nextCursor
|
|
9870
9870
|
}) : null
|
|
9871
9871
|
};
|
|
9872
9872
|
}
|
|
9873
|
-
const
|
|
9873
|
+
const rd = globalThis.fetch.bind(globalThis), vi = '.pluno-pa-widget-host[data-pluno-product-agent-ui="widget"]', od = '.pluno-pa-widget[data-pluno-product-agent-ui-root="widget"]', ad = ".pluno-pa-widget__panel", cd = ".pluno-pa-widget__timeline", dd = "__plunoExtensionWidgetOwner";
|
|
9874
9874
|
class ue extends Error {
|
|
9875
9875
|
constructor(e, s, n, i) {
|
|
9876
9876
|
super(e), this.retryable = s, this.status = n, this.retryAfterMs = i, this.name = "ProductAgentTokenProviderError";
|
|
@@ -9879,7 +9879,7 @@ class ue extends Error {
|
|
|
9879
9879
|
status;
|
|
9880
9880
|
retryAfterMs;
|
|
9881
9881
|
}
|
|
9882
|
-
let
|
|
9882
|
+
let ld = 0;
|
|
9883
9883
|
function As(t) {
|
|
9884
9884
|
const e = {};
|
|
9885
9885
|
for (const c of [
|
|
@@ -9911,7 +9911,7 @@ function As(t) {
|
|
|
9911
9911
|
const r = (c) => {
|
|
9912
9912
|
if (!c || typeof c != "object")
|
|
9913
9913
|
return null;
|
|
9914
|
-
const d = c, u = d.data, l = u && typeof u == "object" ? u : {}, h =
|
|
9914
|
+
const d = c, u = d.data, l = u && typeof u == "object" ? u : {}, h = Or(c);
|
|
9915
9915
|
return {
|
|
9916
9916
|
id: typeof d.id == "string" ? d.id : null,
|
|
9917
9917
|
streamId: l.type === "message" && l.role === "assistant" && typeof l.id == "string" ? l.id : null,
|
|
@@ -9945,7 +9945,7 @@ function As(t) {
|
|
|
9945
9945
|
}
|
|
9946
9946
|
}
|
|
9947
9947
|
}
|
|
9948
|
-
return { ...e, ...
|
|
9948
|
+
return { ...e, ...Fo(t) };
|
|
9949
9949
|
}
|
|
9950
9950
|
function Pe(t, e, s) {
|
|
9951
9951
|
if (typeof window > "u")
|
|
@@ -9959,26 +9959,26 @@ function Pe(t, e, s) {
|
|
|
9959
9959
|
source: "web_sdk",
|
|
9960
9960
|
category: t,
|
|
9961
9961
|
name: e,
|
|
9962
|
-
sequence: ++
|
|
9962
|
+
sequence: ++ld,
|
|
9963
9963
|
wallTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
9964
9964
|
monotonicMs: performance.now(),
|
|
9965
9965
|
data: s
|
|
9966
9966
|
};
|
|
9967
9967
|
window.dispatchEvent(new CustomEvent("product-agent:trace", { detail: i }));
|
|
9968
9968
|
}
|
|
9969
|
-
const
|
|
9969
|
+
const ud = "https://app.pluno.ai", hd = 2e4, pd = 1e4, fd = 6e4, gd = 6e4, md = 1e4, yd = 1e4, vd = 1e3, dn = 3e4, bi = 0.2, Es = 6e4, Ts = 3, Ii = "Still connecting to Pluno. Retrying automatically.", bd = 1e3, Id = 100, wi = 3, wd = [300, 1e3], Rr = 50 * 1024 * 1024, _d = /* @__PURE__ */ new Set([
|
|
9970
9970
|
".jpeg:image/jpeg",
|
|
9971
9971
|
".jpg:image/jpeg",
|
|
9972
9972
|
".pdf:application/pdf",
|
|
9973
9973
|
".png:image/png",
|
|
9974
9974
|
".webp:image/webp"
|
|
9975
|
-
]), gu = ".pdf,.png,.jpg,.jpeg,.webp", kn = 64e3, qs = 4e3, Rn = 30,
|
|
9975
|
+
]), gu = ".pdf,.png,.jpg,.jpeg,.webp", kn = 64e3, qs = 4e3, Rn = 30, Sd = 2e3, kd = 1e3, Ar = "Image is too large for model vision input.", Rd = "pluno.productAgent.state.", ln = "pluno.productAgent.pendingEvents.", Gt = "pluno.productAgent.activeToolCalls.", Ad = 100, xt = /* @__PURE__ */ new Set();
|
|
9976
9976
|
let vt = null;
|
|
9977
|
-
function
|
|
9978
|
-
const s = Math.min(dn,
|
|
9977
|
+
function Ed(t, e = Math.random) {
|
|
9978
|
+
const s = Math.min(dn, vd * 2 ** t), n = 1 - bi + e() * bi * 2;
|
|
9979
9979
|
return Math.min(dn, Math.round(s * n));
|
|
9980
9980
|
}
|
|
9981
|
-
function
|
|
9981
|
+
function Td(t) {
|
|
9982
9982
|
const e = t.split(".")[1];
|
|
9983
9983
|
if (!e)
|
|
9984
9984
|
return null;
|
|
@@ -10039,7 +10039,7 @@ class Jt {
|
|
|
10039
10039
|
}
|
|
10040
10040
|
});
|
|
10041
10041
|
const n = this;
|
|
10042
|
-
this.clientRuntime = new
|
|
10042
|
+
this.clientRuntime = new Rc(tc({
|
|
10043
10043
|
http: this.directoryHttp,
|
|
10044
10044
|
get authority() {
|
|
10045
10045
|
return n.directoryAuthority;
|
|
@@ -10052,10 +10052,10 @@ class Jt {
|
|
|
10052
10052
|
const r = xe(i);
|
|
10053
10053
|
this.options.productVariant !== "personal" || !r || (this.lastPersonalModel = r, this.state.sessionId === null && !this.draftModelExplicit && this.draftModel !== r && (this.draftModel = r, this.emit("state", this.getState())));
|
|
10054
10054
|
}
|
|
10055
|
-
}), void 0,
|
|
10055
|
+
}), void 0, $o(async () => {
|
|
10056
10056
|
if (!this.token || !this.state.user || this.state.status === "closed") throw new Error("Product Agent is not authenticated");
|
|
10057
|
-
return this.options.activeUsersLoader ? (await this.options.activeUsersLoader()).count :
|
|
10058
|
-
})), this.draftModel = (e.productVariant === "personal" ? xe(e.model) : e.model) ?? (e.productVariant === "personal" ? ns[0].value : "gpt-5.6-terra"), this.modelClientScopeId =
|
|
10057
|
+
return this.options.activeUsersLoader ? (await this.options.activeUsersLoader()).count : zo(this.options.backendUrl);
|
|
10058
|
+
})), this.draftModel = (e.productVariant === "personal" ? xe(e.model) : e.model) ?? (e.productVariant === "personal" ? ns[0].value : "gpt-5.6-terra"), this.modelClientScopeId = Gc(e.clientId, () => crypto.randomUUID()), this.directoryConversationScopeId = `conversation:${this.modelClientScopeId}`, this.createDirectoryAdapters(), this.clientRuntime.engine.dispatch({
|
|
10059
10059
|
type: "model.scope_open",
|
|
10060
10060
|
clientScopeId: this.modelClientScopeId,
|
|
10061
10061
|
sessionId: null,
|
|
@@ -10180,17 +10180,17 @@ class Jt {
|
|
|
10180
10180
|
s in e && Object.assign(this.platformState, { [s]: e[s] });
|
|
10181
10181
|
}
|
|
10182
10182
|
static async init(e) {
|
|
10183
|
-
const s = e, n = await
|
|
10183
|
+
const s = e, n = await Lc(
|
|
10184
10184
|
s.skipStoredTransportIdentityCollisionCheck === !0
|
|
10185
10185
|
), i = new Jt({
|
|
10186
10186
|
...e,
|
|
10187
|
-
backendUrl: zd(e.backendUrl ??
|
|
10187
|
+
backendUrl: zd(e.backendUrl ?? ud),
|
|
10188
10188
|
clientId: e.clientId ?? al(),
|
|
10189
10189
|
productVariant: e.productVariant ?? "customer_embedded",
|
|
10190
|
-
entrySurface:
|
|
10190
|
+
entrySurface: Ho(e.entrySurface)
|
|
10191
10191
|
}, n);
|
|
10192
10192
|
try {
|
|
10193
|
-
await i.initializeDirectory(), await i.initializeConversation(),
|
|
10193
|
+
await i.initializeDirectory(), await i.initializeConversation(), Cc().catch((r) => {
|
|
10194
10194
|
V("web-sdk.attachments", "Failed to delete stale Product Agent attachments", {
|
|
10195
10195
|
message: r instanceof Error ? r.message : String(r)
|
|
10196
10196
|
});
|
|
@@ -10201,15 +10201,15 @@ class Jt {
|
|
|
10201
10201
|
return i;
|
|
10202
10202
|
}
|
|
10203
10203
|
createDirectoryAdapters() {
|
|
10204
|
-
this.directoryScope = new
|
|
10204
|
+
this.directoryScope = new ic({
|
|
10205
10205
|
runtime: this.clientRuntime,
|
|
10206
10206
|
authority: this.directoryAuthority,
|
|
10207
10207
|
random: Math.random,
|
|
10208
|
-
persistence:
|
|
10208
|
+
persistence: oc(
|
|
10209
10209
|
this.modelClientScopeId,
|
|
10210
10210
|
this.directoryAuthority.authorityId
|
|
10211
10211
|
)
|
|
10212
|
-
}), this.directoryObservation = new
|
|
10212
|
+
}), this.directoryObservation = new sc({
|
|
10213
10213
|
runtime: this.clientRuntime,
|
|
10214
10214
|
authority: this.directoryAuthority,
|
|
10215
10215
|
http: this.directoryHttp,
|
|
@@ -10238,12 +10238,12 @@ class Jt {
|
|
|
10238
10238
|
const e = ++this.conversationAdapterGeneration;
|
|
10239
10239
|
this.conversationObservation?.dispose(), this.conversationUnsubscribe?.();
|
|
10240
10240
|
const s = this.directoryAuthority, n = () => e === this.conversationAdapterGeneration;
|
|
10241
|
-
this.operationTimingReporter =
|
|
10241
|
+
this.operationTimingReporter = Oo((f) => {
|
|
10242
10242
|
n() && !this.clientRuntime.isDisposed && this.reportHealthSignal("operation_timing", { timings: f.map((y) => ({ ...y, entrySurface: this.options.entrySurface })) });
|
|
10243
10243
|
});
|
|
10244
10244
|
const i = `pa.conversation.delivery:${this.modelClientScopeId}:${s.authorityId}`, r = `${i}:cancellations`;
|
|
10245
10245
|
this.authenticatedUserId && this.options.restorePersistedState === !1 && sessionStorage.removeItem(r);
|
|
10246
|
-
const a = this.authenticatedUserId ? hs(r) : null, o =
|
|
10246
|
+
const a = this.authenticatedUserId ? hs(r) : null, o = xo({
|
|
10247
10247
|
authorityId: s.authorityId,
|
|
10248
10248
|
isCurrent: n,
|
|
10249
10249
|
read: async () => a ? JSON.parse(a) : null,
|
|
@@ -10253,7 +10253,7 @@ class Jt {
|
|
|
10253
10253
|
onTiming: (f) => this.reportOperationTiming(f)
|
|
10254
10254
|
});
|
|
10255
10255
|
this.clientRuntime.installConversationPorts({
|
|
10256
|
-
...
|
|
10256
|
+
...za({
|
|
10257
10257
|
authority: s,
|
|
10258
10258
|
runtime: () => this.clientRuntime,
|
|
10259
10259
|
isCurrent: n,
|
|
@@ -10327,13 +10327,13 @@ class Jt {
|
|
|
10327
10327
|
y.sessionId === this.getState().sessionId && this.startNewSession({ notifyTransport: !1 });
|
|
10328
10328
|
return;
|
|
10329
10329
|
}
|
|
10330
|
-
V("web-sdk.conversation", "Conversation operation failed", { ...y, ...
|
|
10330
|
+
V("web-sdk.conversation", "Conversation operation failed", { ...y, ...Lo(f) }), f instanceof T && f.backendRefusal && y.operation.startsWith("chat.") ? this.applyAccountSubmissionError(f.code) : this.handleDirectoryTransportError(f);
|
|
10331
10331
|
}
|
|
10332
10332
|
})
|
|
10333
10333
|
});
|
|
10334
10334
|
const c = this.clientRuntime.engine.getState().slices.conversation, d = this.options.restorePersistedState === !1 || !this.authenticatedUserId ? null : hs(i);
|
|
10335
10335
|
if (this.authenticatedUserId && !c.submissionOrder.length && !Object.keys(c.operations).length) {
|
|
10336
|
-
const f = this.queuedClientEvents.filter((k) => k.type === "chat.user_message"), y = d ? JSON.parse(d) : f.length ?
|
|
10336
|
+
const f = this.queuedClientEvents.filter((k) => k.type === "chat.user_message"), y = d ? JSON.parse(d) : f.length ? Vo(c, f.map((k) => {
|
|
10337
10337
|
const { type: R, ...g } = k, v = this.clientRuntime.engine.getState().slices.directory, I = v.clients[this.modelClientScopeId];
|
|
10338
10338
|
return {
|
|
10339
10339
|
command: { type: R, request_id: k.clientMessageId, payload: JSON.parse(JSON.stringify(g)) },
|
|
@@ -10352,7 +10352,7 @@ class Jt {
|
|
|
10352
10352
|
b && (y || Object.keys(b.operations).length || Object.keys(b.stops).length) && await this.clientRuntime.engine.dispatch({ ...s, type: "conversation.restore_delivery", checkpoint: b });
|
|
10353
10353
|
}
|
|
10354
10354
|
if (this.authenticatedUserId && (this.queuedClientEvents = this.queuedClientEvents.filter((f) => !["chat.user_message", "chat.retry_last_user_message", "run.stop", "runtime.warmup", "session.reset", "attachment.upload_completed"].includes(f.type))), Re(this.options.clientId, this.queuedClientEvents), !n()) return;
|
|
10355
|
-
this.conversationObservation = new
|
|
10355
|
+
this.conversationObservation = new Ha({
|
|
10356
10356
|
authority: s,
|
|
10357
10357
|
now: () => Date.now(),
|
|
10358
10358
|
runtime: () => this.clientRuntime,
|
|
@@ -10386,7 +10386,7 @@ class Jt {
|
|
|
10386
10386
|
for (const b of f)
|
|
10387
10387
|
if (b.content.trim() && (b.role === "assistant" || b.dataType === "commentary_history" || b.dataType === "tool_summary")) {
|
|
10388
10388
|
const k = y ? this.clientRuntime.engine.getState().slices.conversation.sessions[y] : void 0;
|
|
10389
|
-
for (const R of b.respondsToUserMessageId ?
|
|
10389
|
+
for (const R of b.respondsToUserMessageId ? eo(k, b.respondsToUserMessageId) : [])
|
|
10390
10390
|
this.clearFirstResponseTimer(R, !0, y);
|
|
10391
10391
|
}
|
|
10392
10392
|
}
|
|
@@ -10394,7 +10394,7 @@ class Jt {
|
|
|
10394
10394
|
let l = new Map(this.getState().messages.map((f) => [f.id, f])), h = this.clientRuntime.engine.getState().slices.conversation, p = this.clientRuntime.engine.getState().slices.directory.selections, m = this.clientRuntime.engine.getState().slices.directory.clients[this.modelClientScopeId];
|
|
10395
10395
|
this.conversationUnsubscribe = this.clientRuntime.engine.subscribe(() => {
|
|
10396
10396
|
const f = this.clientRuntime.engine.getState().slices, y = h;
|
|
10397
|
-
h = f.conversation,
|
|
10397
|
+
h = f.conversation, Po(y, f.conversation, this.operationTimingReporter, "sdk");
|
|
10398
10398
|
const b = m !== f.directory.clients[this.modelClientScopeId];
|
|
10399
10399
|
m = f.directory.clients[this.modelClientScopeId], p !== f.directory.selections && (p = f.directory.selections, this.directoryScope.persist());
|
|
10400
10400
|
for (const R of Object.values(f.conversation.submissions)) {
|
|
@@ -10497,7 +10497,7 @@ class Jt {
|
|
|
10497
10497
|
lastErrorCode: i.lastErrorCode ?? this.platformState.lastErrorCode,
|
|
10498
10498
|
lastErrorSecuritySettingsUrl: !i.lastErrorCode || i.lastErrorCode === this.platformState.lastErrorCode ? this.platformState.lastErrorSecuritySettingsUrl : null,
|
|
10499
10499
|
starterPrompts: o?.data && (o.data.kind === "starterPrompts" || o.data.kind === "userSuggestedTasks") ? [...o.data.prompts] : sl(this.options.initialStarterPrompts),
|
|
10500
|
-
starterPromptsLoading:
|
|
10500
|
+
starterPromptsLoading: ao(e, a),
|
|
10501
10501
|
appearance: d ? { accentColor: d.accent, colorScheme: d.colorScheme, fontFamily: d.fontFamily, scribbleStyle: d.scribbleStyle } : null
|
|
10502
10502
|
};
|
|
10503
10503
|
}
|
|
@@ -10520,7 +10520,7 @@ class Jt {
|
|
|
10520
10520
|
if (!this.options.tokenProvider)
|
|
10521
10521
|
return this.token;
|
|
10522
10522
|
if (this.tokenRequest) return await this.tokenRequest;
|
|
10523
|
-
const n = Date.now(), i = this.token !== null && this.tokenExpiresAtMs !== null && this.tokenExpiresAtMs -
|
|
10523
|
+
const n = Date.now(), i = this.token !== null && this.tokenExpiresAtMs !== null && this.tokenExpiresAtMs - gd > n;
|
|
10524
10524
|
if (!s.forceRefresh && (i || s.preferCached && this.token !== null))
|
|
10525
10525
|
return this.token;
|
|
10526
10526
|
s.forceRefresh && this.invalidateProviderToken();
|
|
@@ -10531,7 +10531,7 @@ class Jt {
|
|
|
10531
10531
|
const c = new Promise((d, u) => {
|
|
10532
10532
|
o = window.setTimeout(() => {
|
|
10533
10533
|
r.abort(), u(new ue("Pluno token provider timed out", !0));
|
|
10534
|
-
},
|
|
10534
|
+
}, fd);
|
|
10535
10535
|
});
|
|
10536
10536
|
try {
|
|
10537
10537
|
const d = await Promise.race([
|
|
@@ -10542,7 +10542,7 @@ class Jt {
|
|
|
10542
10542
|
throw new ue("Pluno token request was cancelled", !0);
|
|
10543
10543
|
if (typeof d != "string" || !d.trim())
|
|
10544
10544
|
throw new ue("Chat setup did not return a session. Contact your app administrator, then try again.", !1);
|
|
10545
|
-
return this.token = d, this.tokenExpiresAtMs =
|
|
10545
|
+
return this.token = d, this.tokenExpiresAtMs = Td(d), d;
|
|
10546
10546
|
} finally {
|
|
10547
10547
|
o !== null && window.clearTimeout(o);
|
|
10548
10548
|
}
|
|
@@ -10617,7 +10617,7 @@ class Jt {
|
|
|
10617
10617
|
});
|
|
10618
10618
|
this.socket = a, this.options.webSocketFactory && (this.socketConnectTimer = window.setTimeout(() => {
|
|
10619
10619
|
this.socket === a && a.readyState === WebSocket.CONNECTING && (V("web-sdk.agent", "Pluno socket opening timed out; reconnecting"), this.reportTransportDiagnostic("connect_timeout"), this.replaceTimedOutSocket(a));
|
|
10620
|
-
},
|
|
10620
|
+
}, md)), a.addEventListener("reconnecting", (o) => {
|
|
10621
10621
|
this.socket === a && this.state.status !== "closed" && (this.refreshingDefaultCredentials || this.reportTransportDiagnostic("socket_closed", { disconnectReason: o.detail.reason }), this.setReconnectingState());
|
|
10622
10622
|
}), a.addEventListener("open", () => {
|
|
10623
10623
|
this.socket !== a || (this.clearSocketConnectTimer(), this.directoryObservation.reconnect().catch(() => {
|
|
@@ -10632,7 +10632,7 @@ class Jt {
|
|
|
10632
10632
|
pageUrl: location.href
|
|
10633
10633
|
}) : !0)) || this.options.webSocketFactory && (this.socketAuthTimer = window.setTimeout(() => {
|
|
10634
10634
|
this.socket === a && (V("web-sdk.agent", "Pluno socket authentication timed out; reconnecting"), this.reportTransportDiagnostic("auth_timeout"), this.replaceTimedOutSocket(a));
|
|
10635
|
-
},
|
|
10635
|
+
}, yd));
|
|
10636
10636
|
}), a.addEventListener("message", (o) => {
|
|
10637
10637
|
if (this.socket !== a)
|
|
10638
10638
|
return;
|
|
@@ -10784,7 +10784,7 @@ class Jt {
|
|
|
10784
10784
|
if (this.clientRuntime.isDisposed) return null;
|
|
10785
10785
|
const n = e.trim(), i = s.attachments ?? [];
|
|
10786
10786
|
if (!n && !i.length) return null;
|
|
10787
|
-
if (this.options.productVariant === "customer_embedded" && (i.forEach(
|
|
10787
|
+
if (this.options.productVariant === "customer_embedded" && (i.forEach(Nr), i.reduce((y, b) => y + b.sizeBytes, 0) > Rr))
|
|
10788
10788
|
throw new Error("Embedded attachments must total at most 50 MB per message");
|
|
10789
10789
|
const r = s.clientMessageId ?? z(), a = Q(this.operationTimingReporter, {
|
|
10790
10790
|
operation: "send",
|
|
@@ -10859,7 +10859,7 @@ class Jt {
|
|
|
10859
10859
|
});
|
|
10860
10860
|
}
|
|
10861
10861
|
reportResponseVisibility(e) {
|
|
10862
|
-
|
|
10862
|
+
ac(this, this.options.entrySurface, e);
|
|
10863
10863
|
}
|
|
10864
10864
|
reportInvalidStateTransition(e, s, n) {
|
|
10865
10865
|
n !== void 0 && !mn(n) || this.reportHealthSignal("invalid_state_transition", {
|
|
@@ -10894,7 +10894,7 @@ class Jt {
|
|
|
10894
10894
|
const s = this.clientRuntime.engine.getState().slices, n = s.directory.clients[this.modelClientScopeId], i = ge(s.conversation, s.directory, n), r = Bi(i, e);
|
|
10895
10895
|
if (!r) return !1;
|
|
10896
10896
|
if (r.type === "preparation") {
|
|
10897
|
-
const a = z(), o =
|
|
10897
|
+
const a = z(), o = Wa(r.submission);
|
|
10898
10898
|
return Ss(this.clientRuntime, this.modelClientScopeId, a, r.submission.requestedModel), this.sendMessage(o.content, { clientMessageId: a, attachments: o.attachments, proactiveSuggestionQuestion: o.proactiveSuggestionQuestion }).catch((c) => this.emit("error", Xe(c))), !0;
|
|
10899
10899
|
}
|
|
10900
10900
|
return r.type === "delivery" ? (this.clientRuntime.engine.dispatch({ ...this.directoryAuthority, type: "conversation.submit", userMessageId: r.userMessageId, now: Date.now(), manualRetry: !0 }), !0) : (this.clientRuntime.engine.dispatch({ ...this.directoryAuthority, type: "conversation.operation", command: {
|
|
@@ -10912,9 +10912,9 @@ class Jt {
|
|
|
10912
10912
|
const s = z(), n = {
|
|
10913
10913
|
id: s,
|
|
10914
10914
|
name: e.name || "attachment",
|
|
10915
|
-
mimeType:
|
|
10915
|
+
mimeType: Ur(e),
|
|
10916
10916
|
sizeBytes: e.size
|
|
10917
|
-
}, i = Date.now(), r =
|
|
10917
|
+
}, i = Date.now(), r = qc({
|
|
10918
10918
|
attachmentId: s,
|
|
10919
10919
|
name: n.name,
|
|
10920
10920
|
mimeType: n.mimeType,
|
|
@@ -10958,7 +10958,7 @@ class Jt {
|
|
|
10958
10958
|
return;
|
|
10959
10959
|
}
|
|
10960
10960
|
const k = f.result.attachment;
|
|
10961
|
-
d(
|
|
10961
|
+
d(Dr({
|
|
10962
10962
|
id: k.id,
|
|
10963
10963
|
name: k.name,
|
|
10964
10964
|
mimeType: k.mime_type,
|
|
@@ -10990,7 +10990,7 @@ class Jt {
|
|
|
10990
10990
|
let a = !1;
|
|
10991
10991
|
return Hl(async () => {
|
|
10992
10992
|
let o = await r(!1);
|
|
10993
|
-
if (i(), !o.ok && Gl(o.status) && this.options.tokenProvider && !a && (a = !0, o = await r(!0), i()), !o.ok) throw new
|
|
10993
|
+
if (i(), !o.ok && Gl(o.status) && this.options.tokenProvider && !a && (a = !0, o = await r(!0), i()), !o.ok) throw new Lr("Failed to prepare attachment upload", o.status);
|
|
10994
10994
|
return await o.json();
|
|
10995
10995
|
}, "Failed to prepare attachment upload");
|
|
10996
10996
|
}
|
|
@@ -11051,7 +11051,7 @@ class Jt {
|
|
|
11051
11051
|
}
|
|
11052
11052
|
getSessionHistoryState() {
|
|
11053
11053
|
return this.clientRuntime.project("directory", { core: () => {
|
|
11054
|
-
const e = this.clientRuntime.engine.getProjection().directory, s = e.queries[B(this.getDirectoryQuery())], n = Ms(this.options.entrySurface).map((u) => this.getDirectoryQuery(u)).map((u) => e.queries[B(u)]).filter((u) => u !== void 0), i = Object.values(e.optimisticEntries).reverse(), r =
|
|
11054
|
+
const e = this.clientRuntime.engine.getProjection().directory, s = e.queries[B(this.getDirectoryQuery())], n = Ms(this.options.entrySurface).map((u) => this.getDirectoryQuery(u)).map((u) => e.queries[B(u)]).filter((u) => u !== void 0), i = Object.values(e.optimisticEntries).reverse(), r = ec(n), a = new Set(i.flatMap((u) => u.sessionId ? [u.sessionId] : [])), o = [...i.map((u) => u.id), ...r.filter((u) => !a.has(u))], c = Object.fromEntries([
|
|
11055
11055
|
...i.map((u) => [u.id, {
|
|
11056
11056
|
id: u.id,
|
|
11057
11057
|
title: null,
|
|
@@ -11065,7 +11065,7 @@ class Jt {
|
|
|
11065
11065
|
isPinned: !1
|
|
11066
11066
|
}]),
|
|
11067
11067
|
...r.filter((u) => !a.has(u)).map((u) => [u, this.toSessionHistoryEntry(e.entities[u])])
|
|
11068
|
-
]), d =
|
|
11068
|
+
]), d = Za(n);
|
|
11069
11069
|
return {
|
|
11070
11070
|
key: `${this.options.clientId}:recent`,
|
|
11071
11071
|
status: d?.status ?? "not_requested",
|
|
@@ -11156,7 +11156,7 @@ class Jt {
|
|
|
11156
11156
|
}
|
|
11157
11157
|
getInteractions() {
|
|
11158
11158
|
const e = this.clientRuntime.engine.getState().slices;
|
|
11159
|
-
return
|
|
11159
|
+
return Io(e, e.conversation, e.directory, this.modelClientScopeId);
|
|
11160
11160
|
}
|
|
11161
11161
|
subscribeInteractions(e) {
|
|
11162
11162
|
return this.interactionListeners.add(e), e(this.getInteractions()), () => this.interactionListeners.delete(e);
|
|
@@ -11165,7 +11165,7 @@ class Jt {
|
|
|
11165
11165
|
const r = this.clientRuntime.engine.getState().slices.account.authority;
|
|
11166
11166
|
if (!r) throw new Error("Product Agent is not authenticated.");
|
|
11167
11167
|
const a = this.getInteractions().find((d) => d.id === e), o = i.expectedSourceVersion === void 0 ? a?.sourceVersion ?? null : i.expectedSourceVersion, c = crypto.randomUUID();
|
|
11168
|
-
await
|
|
11168
|
+
await bo(this.clientRuntime, {
|
|
11169
11169
|
clientScopeId: this.modelClientScopeId,
|
|
11170
11170
|
interactionId: e,
|
|
11171
11171
|
action: s,
|
|
@@ -11192,7 +11192,7 @@ class Jt {
|
|
|
11192
11192
|
for (const e of this.accountListeners) e(this.getAccount());
|
|
11193
11193
|
}
|
|
11194
11194
|
getAccount() {
|
|
11195
|
-
return
|
|
11195
|
+
return _o(this.clientRuntime.engine.getState().slices.account, this.state.sessionId);
|
|
11196
11196
|
}
|
|
11197
11197
|
subscribeAccount(e) {
|
|
11198
11198
|
return this.accountListeners.add(e), e(this.getAccount()), () => this.accountListeners.delete(e);
|
|
@@ -11222,7 +11222,7 @@ class Jt {
|
|
|
11222
11222
|
}
|
|
11223
11223
|
}
|
|
11224
11224
|
installFeaturePorts() {
|
|
11225
|
-
const e =
|
|
11225
|
+
const e = go(() => Date.now());
|
|
11226
11226
|
let s = !1, n = !1;
|
|
11227
11227
|
const i = () => {
|
|
11228
11228
|
const u = this.options.runtimeAdapters?.featurePermissions, l = this.clientRuntime.engine.getState().slices.account.authority;
|
|
@@ -11260,7 +11260,7 @@ class Jt {
|
|
|
11260
11260
|
}).finally(() => {
|
|
11261
11261
|
s = !1, n && (n = !1, i());
|
|
11262
11262
|
});
|
|
11263
|
-
}, r =
|
|
11263
|
+
}, r = fo({
|
|
11264
11264
|
http: this.directoryHttp,
|
|
11265
11265
|
now: () => Date.now(),
|
|
11266
11266
|
preferenceStorage: {
|
|
@@ -11275,7 +11275,7 @@ class Jt {
|
|
|
11275
11275
|
readAccount: async (u) => {
|
|
11276
11276
|
const l = this.clientRuntime.engine.getState().slices.account, h = this.options.accountLoader ? await this.options.accountLoader() : l.refusal ? null : this.options.initialAccount;
|
|
11277
11277
|
if (!h) throw new Error("Account information is unavailable.");
|
|
11278
|
-
return i(),
|
|
11278
|
+
return i(), wo(h, {
|
|
11279
11279
|
id: u.userId,
|
|
11280
11280
|
email: this.state.user?.email ?? null,
|
|
11281
11281
|
name: this.state.user?.name ?? null,
|
|
@@ -11310,7 +11310,7 @@ class Jt {
|
|
|
11310
11310
|
"stage7.platform": async (u) => {
|
|
11311
11311
|
const l = u.operation, h = l.kind === "connect" ? l.source : null;
|
|
11312
11312
|
if (l.kind === "saveHint")
|
|
11313
|
-
|
|
11313
|
+
Qr(localStorage, l.interactionId);
|
|
11314
11314
|
else if (l.kind === "connect" && h?.payload.kind === "integration_auth") {
|
|
11315
11315
|
const p = h.payload;
|
|
11316
11316
|
if (!this.options.runtimeAdapters?.integrationAuthHandler) throw new Error("Connection handler unavailable.");
|
|
@@ -11341,7 +11341,7 @@ class Jt {
|
|
|
11341
11341
|
const u = this.clientRuntime.engine.getState().slices, h = u.directory.selections[u.directory.clients[this.modelClientScopeId]]?.sessionId, p = JSON.stringify([h, h ? u.conversation.sessions[h]?.execution : null]);
|
|
11342
11342
|
p !== a && (a = p, i());
|
|
11343
11343
|
}), c = this.options.runtimeAdapters?.featurePermissions?.subscribe?.(i);
|
|
11344
|
-
this.clientRuntime.onDispose(() => c?.()),
|
|
11344
|
+
this.clientRuntime.onDispose(() => c?.()), mo(this.clientRuntime, () => Date.now());
|
|
11345
11345
|
const d = () => {
|
|
11346
11346
|
const u = this.clientRuntime.engine.getState().slices.account.authority;
|
|
11347
11347
|
u?.profile === "main_web_chat" && this.options.entrySurface === "main_web_chat" && this.clientRuntime.engine.dispatch({ type: "stage7.device_hints", authority: u, now: Date.now(), hints: Ns(localStorage) });
|
|
@@ -11412,7 +11412,7 @@ class Jt {
|
|
|
11412
11412
|
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11413
11413
|
source: "web_sdk",
|
|
11414
11414
|
entrySurface: this.options.entrySurface,
|
|
11415
|
-
...e === "first_response_slow" ? { responseDiagnostics:
|
|
11415
|
+
...e === "first_response_slow" ? { responseDiagnostics: dc(
|
|
11416
11416
|
this,
|
|
11417
11417
|
this.options.entrySurface,
|
|
11418
11418
|
n.sessionId,
|
|
@@ -11605,7 +11605,7 @@ class Jt {
|
|
|
11605
11605
|
}
|
|
11606
11606
|
requestTransientStarterPrompts() {
|
|
11607
11607
|
const e = ne(Kd());
|
|
11608
|
-
return
|
|
11608
|
+
return vo(this.clientRuntime, {
|
|
11609
11609
|
kind: "generatePrompts",
|
|
11610
11610
|
page: { clientScopeId: this.modelClientScopeId, origin: location.origin, pageUrl: e.pageUrl },
|
|
11611
11611
|
htmlContent: e.htmlContent,
|
|
@@ -11621,7 +11621,7 @@ class Jt {
|
|
|
11621
11621
|
e !== this.lastStarterPromptPageUrl && (this.lastStarterPromptPageUrl = e, this.clearStarterPromptUrlRefreshTimer(), this.starterPromptUrlRefreshTimer = window.setTimeout(() => {
|
|
11622
11622
|
this.starterPromptUrlRefreshTimer = null, this.refreshStarterPromptsForCurrentUrl().catch(() => {
|
|
11623
11623
|
});
|
|
11624
|
-
},
|
|
11624
|
+
}, Ad));
|
|
11625
11625
|
}
|
|
11626
11626
|
refreshStarterPromptsForCurrentUrl() {
|
|
11627
11627
|
if (!this.clientRuntime.engine.getState().slices.account.authority || this.state.status === "closed") return Promise.resolve();
|
|
@@ -11654,7 +11654,7 @@ class Jt {
|
|
|
11654
11654
|
const s = Ai(e);
|
|
11655
11655
|
if (!s) return !1;
|
|
11656
11656
|
const n = It(e, "runtimeCommunityId") ?? this.directoryHttp.auth.community_id, i = `${this.options.clientId}:${s.id}:${n ?? this.options.productVariant}`, r = this.directoryAuthority.authorityId !== i, a = this.authenticatedUserId === null, o = a ? Object.values(this.clientRuntime.engine.getState().slices.conversation.operations).filter((u) => ["waiting", "running", "uncertain"].includes(u.phase) && (u.command.type === "run.stop" || u.command.type === "session.reset")).map((u) => u.command) : [], c = a && this.directoryAuthority.authorityId === `${this.options.clientId}:${this.options.runtimeCommunityId ?? this.options.productVariant}` ? this.state.sessionId : null;
|
|
11657
|
-
if (this.authenticatedUserId = s.id, this.directoryHttp.auth.community_id = n,
|
|
11657
|
+
if (this.authenticatedUserId = s.id, this.directoryHttp.auth.community_id = n, Ko(this.options.clientId, i), r) {
|
|
11658
11658
|
const u = this.directoryAuthority;
|
|
11659
11659
|
this.directoryObservation.dispose(), this.conversationAdapterGeneration++, this.conversationObservation?.dispose(), this.directoryAuthority = { authorityId: i, generation: u.generation + 1 }, this.clientRuntime.engine.dispatch({ ...this.directoryAuthority, type: "directory.authority_replace", expectedGeneration: u.generation }), this.createDirectoryAdapters();
|
|
11660
11660
|
const l = a ? this.draftModel : void 0, h = this.draftModelExplicit;
|
|
@@ -11671,7 +11671,7 @@ class Jt {
|
|
|
11671
11671
|
personalChannel: !!this.options.runtimeAdapters?.personalChannelConnectionHandler
|
|
11672
11672
|
}
|
|
11673
11673
|
};
|
|
11674
|
-
if (
|
|
11674
|
+
if (yo(this.clientRuntime, d, Date.now()).then(async () => {
|
|
11675
11675
|
this.options.entrySurface === "main_web_chat" && d.profile === "main_web_chat" && await this.clientRuntime.engine.dispatch({ type: "stage7.device_hints", authority: d, now: Date.now(), hints: Ns(localStorage) }), await this.refreshStarterPromptsForCurrentUrl();
|
|
11676
11676
|
}).catch(() => {
|
|
11677
11677
|
}), r || a) {
|
|
@@ -11849,7 +11849,7 @@ class Jt {
|
|
|
11849
11849
|
authority: n,
|
|
11850
11850
|
now: Date.now(),
|
|
11851
11851
|
sessionId: s,
|
|
11852
|
-
enabled:
|
|
11852
|
+
enabled: Qa(e.metadata)
|
|
11853
11853
|
});
|
|
11854
11854
|
}
|
|
11855
11855
|
async executeToolCall(e) {
|
|
@@ -11912,10 +11912,7 @@ class Jt {
|
|
|
11912
11912
|
startedAtOrigin: location.origin
|
|
11913
11913
|
}), this.installSessionBrowserApis();
|
|
11914
11914
|
let u = null, l;
|
|
11915
|
-
u = await this.executeRuntimeHelper(), l = await Si(
|
|
11916
|
-
a,
|
|
11917
|
-
Fd(e.runtimeContext, this.options.backendUrl)
|
|
11918
|
-
).catch((h) => ({
|
|
11915
|
+
u = await this.executeRuntimeHelper({ callId: n, sessionId: s }), l = await (this.options.runtimeAdapters?.executeBrowserCode ? this.options.runtimeAdapters.executeBrowserCode({ ...a, callId: n, sessionId: s }) : Si(a, Fd(e.runtimeContext, this.options.backendUrl))).catch((h) => ({
|
|
11919
11916
|
ok: !1,
|
|
11920
11917
|
exception: {
|
|
11921
11918
|
message: h instanceof Error ? h.message : String(h)
|
|
@@ -11934,33 +11931,31 @@ class Jt {
|
|
|
11934
11931
|
if (this.pageLifecycleCleanup)
|
|
11935
11932
|
return;
|
|
11936
11933
|
const e = () => {
|
|
11937
|
-
|
|
11934
|
+
xr(this.options.clientId, this.activeBrowserToolCalls.values());
|
|
11938
11935
|
};
|
|
11939
11936
|
window.addEventListener("pagehide", e), window.addEventListener("beforeunload", e), this.pageLifecycleCleanup = () => {
|
|
11940
11937
|
window.removeEventListener("pagehide", e), window.removeEventListener("beforeunload", e);
|
|
11941
11938
|
};
|
|
11942
11939
|
}
|
|
11943
11940
|
installSessionBrowserApis() {
|
|
11944
|
-
this.cleanupSessionBrowserApis(), this.sessionBrowserApisCleanup =
|
|
11941
|
+
this.cleanupSessionBrowserApis(), this.sessionBrowserApisCleanup = Tr();
|
|
11945
11942
|
}
|
|
11946
11943
|
cleanupSessionBrowserApis() {
|
|
11947
11944
|
this.sessionBrowserApisCleanup && (Bd(this.sessionBrowserApisCleanup), this.sessionBrowserApisCleanup = null);
|
|
11948
11945
|
}
|
|
11949
|
-
async executeRuntimeHelper() {
|
|
11946
|
+
async executeRuntimeHelper(e) {
|
|
11950
11947
|
if (!this.runtimeHelperJavascript?.trim())
|
|
11951
11948
|
return null;
|
|
11952
|
-
const
|
|
11953
|
-
|
|
11954
|
-
});
|
|
11955
|
-
return e.ok === !1 ? ol(e) : null;
|
|
11949
|
+
const s = { javascript: this.runtimeHelperJavascript }, n = await (this.options.runtimeAdapters?.executeBrowserCode ? this.options.runtimeAdapters.executeBrowserCode({ ...s, sessionId: e.sessionId, callId: `${e.callId}:helper` }) : Si(s)).catch((i) => ({ ok: !1, exception: { message: i instanceof Error ? i.message : String(i) } }));
|
|
11950
|
+
return n.ok === !1 ? ol(n) : null;
|
|
11956
11951
|
}
|
|
11957
11952
|
enableNetworkCapture() {
|
|
11958
|
-
this.networkCaptureCleanup || (this.networkCaptureCleanup =
|
|
11953
|
+
this.networkCaptureCleanup || (this.networkCaptureCleanup = (this.options.runtimeAdapters?.subscribeNetworkCapture ?? Er)((e) => {
|
|
11959
11954
|
Fl(e.url, this.options.backendUrl) || this.enqueueNetworkEvent(e);
|
|
11960
11955
|
}));
|
|
11961
11956
|
}
|
|
11962
11957
|
enqueueNetworkEvent(e) {
|
|
11963
|
-
this.queuedNetworkEvents.length >=
|
|
11958
|
+
this.queuedNetworkEvents.length >= Id || (this.queuedNetworkEvents.push(Ll(e)), this.networkBatchTimer === null && (this.networkBatchTimer = window.setTimeout(() => {
|
|
11964
11959
|
this.networkBatchTimer = null;
|
|
11965
11960
|
const s = this.queuedNetworkEvents.splice(0, this.queuedNetworkEvents.length);
|
|
11966
11961
|
s.length === 0 || this.socket?.readyState !== WebSocket.OPEN || this.sendNow({
|
|
@@ -11969,7 +11964,7 @@ class Jt {
|
|
|
11969
11964
|
page: ae(),
|
|
11970
11965
|
events: s
|
|
11971
11966
|
});
|
|
11972
|
-
},
|
|
11967
|
+
}, bd)));
|
|
11973
11968
|
}
|
|
11974
11969
|
startEmbeddedRecoveryBudget() {
|
|
11975
11970
|
if (this.options.productVariant !== "customer_embedded" || this.embeddedRecoveryTimer !== null || this.authenticationFailure) return;
|
|
@@ -12004,7 +11999,7 @@ class Jt {
|
|
|
12004
11999
|
return;
|
|
12005
12000
|
const s = Math.min(
|
|
12006
12001
|
dn,
|
|
12007
|
-
Math.max(
|
|
12002
|
+
Math.max(Ed(this.reconnectAttempts), e)
|
|
12008
12003
|
);
|
|
12009
12004
|
this.reconnectAttempts += 1, this.reconnectTimer = window.setTimeout(() => {
|
|
12010
12005
|
this.reconnectTimer = null, (this.refreshingDefaultCredentials && this.socket instanceof L ? this.refreshDefaultTransportCredentials(this.socket) : this.connect()).catch((i) => {
|
|
@@ -12126,8 +12121,8 @@ class Jt {
|
|
|
12126
12121
|
const e = this.socket;
|
|
12127
12122
|
!e || !this.sendNow({ type: "runtime.ping" }) || (this.clearHeartbeatAckTimer(), this.heartbeatAckTimer = window.setTimeout(() => {
|
|
12128
12123
|
this.socket === e && (V("web-sdk.agent", "Pluno heartbeat acknowledgement timed out; reconnecting"), this.replaceTimedOutSocket(e));
|
|
12129
|
-
},
|
|
12130
|
-
},
|
|
12124
|
+
}, pd));
|
|
12125
|
+
}, hd));
|
|
12131
12126
|
}
|
|
12132
12127
|
stopHeartbeat() {
|
|
12133
12128
|
this.heartbeatTimer !== null && (window.clearInterval(this.heartbeatTimer), this.heartbeatTimer = null), this.clearHeartbeatAckTimer();
|
|
@@ -12163,13 +12158,13 @@ class Jt {
|
|
|
12163
12158
|
}
|
|
12164
12159
|
}
|
|
12165
12160
|
const Os = /* @__PURE__ */ new WeakMap();
|
|
12166
|
-
function
|
|
12167
|
-
const e = window.__plunoProductAgentNetworkCapture ??
|
|
12161
|
+
function Er(t) {
|
|
12162
|
+
const e = window.__plunoProductAgentNetworkCapture ?? qd();
|
|
12168
12163
|
return e.subscribers.add(t), () => {
|
|
12169
12164
|
e.subscribers.delete(t), !(e.subscribers.size > 0) && (e.destroy(), window.__plunoProductAgentNetworkCapture === e && delete window.__plunoProductAgentNetworkCapture);
|
|
12170
12165
|
};
|
|
12171
12166
|
}
|
|
12172
|
-
function
|
|
12167
|
+
function qd() {
|
|
12173
12168
|
const t = /* @__PURE__ */ new Set(), e = (h) => {
|
|
12174
12169
|
t.forEach((p) => {
|
|
12175
12170
|
try {
|
|
@@ -12186,7 +12181,7 @@ function Td() {
|
|
|
12186
12181
|
throw b;
|
|
12187
12182
|
}
|
|
12188
12183
|
try {
|
|
12189
|
-
const b = p instanceof Request ? p : null, k = Ul(p, b), R =
|
|
12184
|
+
const b = p instanceof Request ? p : null, k = Ul(p, b), R = jr(m?.headers ?? b?.headers);
|
|
12190
12185
|
if (!De(k, R, m?.body)) {
|
|
12191
12186
|
const v = {
|
|
12192
12187
|
requestId: Ps("fetch"),
|
|
@@ -12347,8 +12342,8 @@ function _i(t) {
|
|
|
12347
12342
|
const e = typeof t == "function" ? t() : t;
|
|
12348
12343
|
return e && Object.keys(e).length > 0 ? e : void 0;
|
|
12349
12344
|
}
|
|
12350
|
-
const
|
|
12351
|
-
function
|
|
12345
|
+
const Cd = 5e3, Md = 12e4;
|
|
12346
|
+
function Tr() {
|
|
12352
12347
|
const t = [
|
|
12353
12348
|
xd(),
|
|
12354
12349
|
Od()
|
|
@@ -12358,6 +12353,12 @@ function Md() {
|
|
|
12358
12353
|
e();
|
|
12359
12354
|
};
|
|
12360
12355
|
}
|
|
12356
|
+
function mu(t) {
|
|
12357
|
+
const e = Tr(), s = Er(t);
|
|
12358
|
+
return () => {
|
|
12359
|
+
s(), e();
|
|
12360
|
+
};
|
|
12361
|
+
}
|
|
12361
12362
|
function Od() {
|
|
12362
12363
|
return br(globalThis, "getPageSnapshot", async () => An());
|
|
12363
12364
|
}
|
|
@@ -12441,7 +12442,7 @@ function Ld(t) {
|
|
|
12441
12442
|
}
|
|
12442
12443
|
async function Si(t, e) {
|
|
12443
12444
|
const s = Object.getPrototypeOf(async function() {
|
|
12444
|
-
}).constructor, n = t.timeoutMs ??
|
|
12445
|
+
}).constructor, n = t.timeoutMs ?? Cd, i = Date.now(), r = [];
|
|
12445
12446
|
let a;
|
|
12446
12447
|
const o = {
|
|
12447
12448
|
log: console.log,
|
|
@@ -12498,7 +12499,7 @@ function Fd(t, e) {
|
|
|
12498
12499
|
const i = () => {
|
|
12499
12500
|
if (!n)
|
|
12500
12501
|
throw new Error("sandboxFiles is only available during browser-code execution");
|
|
12501
|
-
}, r = async (o, c) => await
|
|
12502
|
+
}, r = async (o, c) => await rd(`${e.replace(/\/$/, "")}${o}`, c);
|
|
12502
12503
|
return {
|
|
12503
12504
|
value: Object.freeze({
|
|
12504
12505
|
upload: async (o) => {
|
|
@@ -12552,7 +12553,7 @@ function zd(t) {
|
|
|
12552
12553
|
function Hd(t) {
|
|
12553
12554
|
return t === "pluno" ? "scheduled_continuation" : t ?? "user";
|
|
12554
12555
|
}
|
|
12555
|
-
function
|
|
12556
|
+
function yu(t, e = location.origin) {
|
|
12556
12557
|
return /origin (?:is not allowed|does not match browser origin)/i.test(t) ? `Pluno widget blocked on ${e}: this domain is not allowed. Add ${e} in Pluno under Integration > Domains.` : null;
|
|
12557
12558
|
}
|
|
12558
12559
|
function Vd(t) {
|
|
@@ -12604,7 +12605,7 @@ function An() {
|
|
|
12604
12605
|
};
|
|
12605
12606
|
s("Selected text", window.getSelection()?.toString() ?? "");
|
|
12606
12607
|
const n = "[role='dialog'], [role='alertdialog'], dialog[open], [aria-modal='true']", i = Array.from(document.querySelectorAll(n)).filter(
|
|
12607
|
-
(f) =>
|
|
12608
|
+
(f) => qr(f) && !f.parentElement?.closest(n)
|
|
12608
12609
|
);
|
|
12609
12610
|
for (const f of i.slice(0, 3))
|
|
12610
12611
|
s("Active overlay", xs(nt(f), e));
|
|
@@ -12637,12 +12638,12 @@ function xs(t, e) {
|
|
|
12637
12638
|
s = s.replace(n, "");
|
|
12638
12639
|
return Fe(s);
|
|
12639
12640
|
}
|
|
12640
|
-
function
|
|
12641
|
+
function qr(t) {
|
|
12641
12642
|
const e = window.getComputedStyle(t);
|
|
12642
12643
|
return e.display !== "none" && e.visibility !== "hidden" && t.getClientRects().length > 0;
|
|
12643
12644
|
}
|
|
12644
12645
|
function Jd() {
|
|
12645
|
-
return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(
|
|
12646
|
+
return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(qr).sort((t, e) => nt(e).length - nt(t).length)[0] ?? null;
|
|
12646
12647
|
}
|
|
12647
12648
|
function Qd(t, e) {
|
|
12648
12649
|
const s = /* @__PURE__ */ new Set([
|
|
@@ -12739,7 +12740,7 @@ function Qd(t, e) {
|
|
|
12739
12740
|
if (p >= 1e3 && !E || v.has(w) || r.has(_) || w.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") || q.display === "none" || q.visibility === "hidden")
|
|
12740
12741
|
return { lines: [], hasUsefulContent: !1, textPreview: "", containsTextElement: !1 };
|
|
12741
12742
|
p += 1;
|
|
12742
|
-
const C = m(w), M =
|
|
12743
|
+
const C = m(w), M = Mr(w), S = o.has(C) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(_) || _ === "a" && w.hasAttribute("href"), O = Array.from(w.children).filter((D) => D instanceof HTMLElement), U = /* @__PURE__ */ new Map();
|
|
12743
12744
|
for (const D of O) {
|
|
12744
12745
|
const $ = f(D);
|
|
12745
12746
|
U.set($, (U.get($) ?? 0) + 1);
|
|
@@ -12765,10 +12766,10 @@ function Qd(t, e) {
|
|
|
12765
12766
|
D instanceof HTMLElement && Yt.push(I(D, A + 1));
|
|
12766
12767
|
const dt = [...Mn, ...Yt], Zt = M.length > 0 || S || dt.some((D) => D.hasUsefulContent), On = Fe(
|
|
12767
12768
|
[M, ...dt.map((D) => D.textPreview)].filter(Boolean).join(" ")
|
|
12768
|
-
).slice(0, 180),
|
|
12769
|
+
).slice(0, 180), Wr = w.hasAttribute("contenteditable") && (M.length > 0 || !w.querySelector("[contenteditable]")), xn = d.some((D) => w.hasAttribute(D)) || !!C || Wr, es = (w.getClientRects().length > 0 || q.display === "contents") && (s.has(_) || xn || E) && (Zt || E) && (!i.has(_) || Zt || xn || E), ts = es ? 1 : 0, He = [];
|
|
12769
12770
|
if (es) {
|
|
12770
12771
|
const D = dt.some((be) => be.containsTextElement), $ = n.has(_) && !D ? On : M;
|
|
12771
|
-
He.push(
|
|
12772
|
+
He.push(Cr(w, c, a, $.slice(0, 180)));
|
|
12772
12773
|
}
|
|
12773
12774
|
for (const D of Xt)
|
|
12774
12775
|
He.push(...bt(D, ts));
|
|
@@ -12805,7 +12806,7 @@ ${JSON.stringify(k)}`), l.length > 0 && b.push(Yd(l, s, c, a));
|
|
|
12805
12806
|
|
|
12806
12807
|
`);
|
|
12807
12808
|
}
|
|
12808
|
-
function
|
|
12809
|
+
function Cr(t, e, s, n) {
|
|
12809
12810
|
const i = t.tagName.toLowerCase();
|
|
12810
12811
|
let r = i;
|
|
12811
12812
|
const a = t.getAttribute("id");
|
|
@@ -12876,11 +12877,11 @@ function Yd(t, e, s, n) {
|
|
|
12876
12877
|
const l = o.getRootNode();
|
|
12877
12878
|
o = o.parentElement ?? (l instanceof ShadowRoot && l.host instanceof HTMLElement ? l.host : null);
|
|
12878
12879
|
}
|
|
12879
|
-
const c = a.length > 6 ? [a[0], ...a.slice(-5)] : a, d = c.map((u, l) =>
|
|
12880
|
+
const c = a.length > 6 ? [a[0], ...a.slice(-5)] : a, d = c.map((u, l) => Cr(
|
|
12880
12881
|
u,
|
|
12881
12882
|
s,
|
|
12882
12883
|
n,
|
|
12883
|
-
l === c.length - 1 ?
|
|
12884
|
+
l === c.length - 1 ? Mr(u).slice(0, 180) : ""
|
|
12884
12885
|
));
|
|
12885
12886
|
a.length > c.length && d.splice(1, 0, "…"), i.push(`${r.labels.join(", ")}: ${d.join(" > ")}`);
|
|
12886
12887
|
}
|
|
@@ -12896,7 +12897,7 @@ function bt(t, e) {
|
|
|
12896
12897
|
const s = " ".repeat(e);
|
|
12897
12898
|
return t.map((n) => `${s}${n}`);
|
|
12898
12899
|
}
|
|
12899
|
-
function
|
|
12900
|
+
function Mr(t) {
|
|
12900
12901
|
return Fe(
|
|
12901
12902
|
Array.from(t.childNodes).filter((e) => e.nodeType === Node.TEXT_NODE).map((e) => e.textContent ?? "").join(" ")
|
|
12902
12903
|
);
|
|
@@ -12906,7 +12907,7 @@ function Zd(t) {
|
|
|
12906
12907
|
}
|
|
12907
12908
|
function el() {
|
|
12908
12909
|
const t = Array.from(document.querySelectorAll(vi)), e = t.find(
|
|
12909
|
-
(r) => typeof r[
|
|
12910
|
+
(r) => typeof r[dd] == "string"
|
|
12910
12911
|
);
|
|
12911
12912
|
if (!(e ?? t[0]))
|
|
12912
12913
|
return;
|
|
@@ -12922,17 +12923,17 @@ function el() {
|
|
|
12922
12923
|
},
|
|
12923
12924
|
{
|
|
12924
12925
|
name: "widget_root",
|
|
12925
|
-
selector:
|
|
12926
|
+
selector: od,
|
|
12926
12927
|
description: "Finds Pluno's widget root inside the widget host shadow root."
|
|
12927
12928
|
},
|
|
12928
12929
|
{
|
|
12929
12930
|
name: "widget_panel",
|
|
12930
|
-
selector:
|
|
12931
|
+
selector: ad,
|
|
12931
12932
|
description: "Finds Pluno's open chat panel inside the widget host shadow root."
|
|
12932
12933
|
},
|
|
12933
12934
|
{
|
|
12934
12935
|
name: "widget_timeline",
|
|
12935
|
-
selector:
|
|
12936
|
+
selector: cd,
|
|
12936
12937
|
description: "Finds Pluno's chat timeline inside the widget host shadow root."
|
|
12937
12938
|
}
|
|
12938
12939
|
]
|
|
@@ -13017,19 +13018,19 @@ function Ai(t) {
|
|
|
13017
13018
|
avatarUrl: typeof e.avatarUrl == "string" ? e.avatarUrl : null
|
|
13018
13019
|
} : null;
|
|
13019
13020
|
}
|
|
13020
|
-
function
|
|
13021
|
+
function vu(t, e) {
|
|
13021
13022
|
return Array.isArray(t) ? fl(
|
|
13022
|
-
t.map((s) =>
|
|
13023
|
+
t.map((s) => Or(s, e)).filter((s) => s !== null)
|
|
13023
13024
|
) : [];
|
|
13024
13025
|
}
|
|
13025
|
-
function
|
|
13026
|
+
function Or(t, e) {
|
|
13026
13027
|
if (!t || typeof t != "object")
|
|
13027
13028
|
return null;
|
|
13028
13029
|
const s = t, n = s.data;
|
|
13029
13030
|
if (!n || typeof n != "object")
|
|
13030
13031
|
return null;
|
|
13031
13032
|
const i = n;
|
|
13032
|
-
if (i.hiddenFromTranscript === !0 ||
|
|
13033
|
+
if (i.hiddenFromTranscript === !0 || Dc(i) || i.type === "tab_lifecycle_decision" && i.decision === "keep")
|
|
13033
13034
|
return null;
|
|
13034
13035
|
if (i.type === "assistant_draft")
|
|
13035
13036
|
return {
|
|
@@ -13062,7 +13063,7 @@ function Cr(t, e) {
|
|
|
13062
13063
|
...se(i) !== null ? { causalSequence: se(i) } : {},
|
|
13063
13064
|
respondsToUserMessageId: Ie(i) ?? void 0,
|
|
13064
13065
|
...W(i) ? { runId: W(i) } : {},
|
|
13065
|
-
attachments:
|
|
13066
|
+
attachments: Pr(i.attachments, e),
|
|
13066
13067
|
...i.steered === !0 ? { steered: !0 } : {}
|
|
13067
13068
|
};
|
|
13068
13069
|
return r === "assistant" && typeof i.id == "string" && Object.defineProperty(a, "assistantDraftItemId", {
|
|
@@ -13077,7 +13078,7 @@ function Cr(t, e) {
|
|
|
13077
13078
|
}), a;
|
|
13078
13079
|
}
|
|
13079
13080
|
if (i.type === "function_call_output") {
|
|
13080
|
-
const r =
|
|
13081
|
+
const r = Oc(i.output);
|
|
13081
13082
|
if (r !== null)
|
|
13082
13083
|
return {
|
|
13083
13084
|
id: String(s.id ?? crypto.randomUUID()),
|
|
@@ -13092,7 +13093,7 @@ function Cr(t, e) {
|
|
|
13092
13093
|
callId: Ye(i) ?? void 0,
|
|
13093
13094
|
sharePromptAllowed: r
|
|
13094
13095
|
};
|
|
13095
|
-
const a =
|
|
13096
|
+
const a = Vc(i.output);
|
|
13096
13097
|
if (a)
|
|
13097
13098
|
return {
|
|
13098
13099
|
id: String(s.id ?? crypto.randomUUID()),
|
|
@@ -13333,7 +13334,7 @@ function It(t, e) {
|
|
|
13333
13334
|
}
|
|
13334
13335
|
function Sl(t, e) {
|
|
13335
13336
|
try {
|
|
13336
|
-
const s = window.localStorage.getItem(`${
|
|
13337
|
+
const s = window.localStorage.getItem(`${Rd}${t}`);
|
|
13337
13338
|
if (!s)
|
|
13338
13339
|
return null;
|
|
13339
13340
|
const n = JSON.parse(s), i = typeof n.sessionId == "string" ? n.sessionId : null;
|
|
@@ -13374,7 +13375,7 @@ function Re(t, e) {
|
|
|
13374
13375
|
return;
|
|
13375
13376
|
}
|
|
13376
13377
|
}
|
|
13377
|
-
function
|
|
13378
|
+
function xr(t, e) {
|
|
13378
13379
|
try {
|
|
13379
13380
|
const s = `${Gt}${t}`, n = location.href, i = location.origin, r = Array.from(e, (a) => ({
|
|
13380
13381
|
...a,
|
|
@@ -13397,7 +13398,7 @@ function Ti(t, e) {
|
|
|
13397
13398
|
} catch {
|
|
13398
13399
|
return;
|
|
13399
13400
|
}
|
|
13400
|
-
|
|
13401
|
+
xr(t, e);
|
|
13401
13402
|
}
|
|
13402
13403
|
function Rl(t) {
|
|
13403
13404
|
try {
|
|
@@ -13466,7 +13467,7 @@ function qi(t) {
|
|
|
13466
13467
|
const e = t;
|
|
13467
13468
|
return typeof e.url == "string" && typeof e.title == "string" && typeof e.origin == "string";
|
|
13468
13469
|
}
|
|
13469
|
-
function
|
|
13470
|
+
function Pr(t, e) {
|
|
13470
13471
|
if (!Array.isArray(t))
|
|
13471
13472
|
return;
|
|
13472
13473
|
const s = t.filter((i) => {
|
|
@@ -13474,28 +13475,28 @@ function Or(t, e) {
|
|
|
13474
13475
|
return !1;
|
|
13475
13476
|
const r = i;
|
|
13476
13477
|
return typeof r.name == "string" && typeof r.mimeType == "string" && typeof r.sizeBytes == "number";
|
|
13477
|
-
}), n = e ? s.map((i) =>
|
|
13478
|
+
}), n = e ? s.map((i) => Dr(i, e)) : s;
|
|
13478
13479
|
return n.length > 0 ? n : void 0;
|
|
13479
13480
|
}
|
|
13480
|
-
function
|
|
13481
|
+
function Dr(t, e) {
|
|
13481
13482
|
return t.fileUrl?.startsWith("/") ? {
|
|
13482
13483
|
...t,
|
|
13483
13484
|
fileUrl: new URL(t.fileUrl, e).toString()
|
|
13484
13485
|
} : t;
|
|
13485
13486
|
}
|
|
13486
|
-
function
|
|
13487
|
+
function Ur(t) {
|
|
13487
13488
|
return t.type || Ol(t.name) || "application/octet-stream";
|
|
13488
13489
|
}
|
|
13489
13490
|
function Cl(t) {
|
|
13490
|
-
|
|
13491
|
+
Nr({
|
|
13491
13492
|
name: t.name,
|
|
13492
|
-
mimeType:
|
|
13493
|
+
mimeType: Ur(t),
|
|
13493
13494
|
sizeBytes: t.size
|
|
13494
13495
|
});
|
|
13495
13496
|
}
|
|
13496
|
-
function
|
|
13497
|
+
function Nr(t) {
|
|
13497
13498
|
const e = Ml(t.name), s = t.mimeType.trim().toLowerCase();
|
|
13498
|
-
if (!
|
|
13499
|
+
if (!_d.has(`${e}:${s}`))
|
|
13499
13500
|
throw new Error("This attachment type is not supported by the embedded model provider");
|
|
13500
13501
|
if (t.sizeBytes <= 0 || t.sizeBytes >= Rr)
|
|
13501
13502
|
throw new Error("Embedded attachments must be between 1 byte and less than 50 MB");
|
|
@@ -13526,7 +13527,7 @@ function xl(t) {
|
|
|
13526
13527
|
scheduledCheckInId: typeof e.scheduledCheckInId == "string" ? e.scheduledCheckInId : void 0,
|
|
13527
13528
|
scheduledCheckInAt: typeof e.scheduledCheckInAt == "string" ? e.scheduledCheckInAt : void 0,
|
|
13528
13529
|
securitySettingsUrl: typeof e.securitySettingsUrl == "string" ? e.securitySettingsUrl : void 0,
|
|
13529
|
-
attachments:
|
|
13530
|
+
attachments: Pr(e.attachments)?.map(Pl),
|
|
13530
13531
|
loading: typeof e.loading == "boolean" ? e.loading : void 0
|
|
13531
13532
|
};
|
|
13532
13533
|
}
|
|
@@ -13550,9 +13551,9 @@ function W(t) {
|
|
|
13550
13551
|
}
|
|
13551
13552
|
function Dl(t) {
|
|
13552
13553
|
const e = t?.timeoutMs;
|
|
13553
|
-
return !!t && typeof t == "object" && typeof t.summary == "string" && typeof t.javascript == "string" && (e === void 0 || typeof e == "number" && Number.isInteger(e) && e > 0 && e <=
|
|
13554
|
+
return !!t && typeof t == "object" && typeof t.summary == "string" && typeof t.javascript == "string" && (e === void 0 || typeof e == "number" && Number.isInteger(e) && e > 0 && e <= Md);
|
|
13554
13555
|
}
|
|
13555
|
-
function
|
|
13556
|
+
function jr(t) {
|
|
13556
13557
|
const e = {};
|
|
13557
13558
|
try {
|
|
13558
13559
|
new Headers(t).forEach((s, n) => {
|
|
@@ -13564,13 +13565,13 @@ function Ur(t) {
|
|
|
13564
13565
|
return e;
|
|
13565
13566
|
}
|
|
13566
13567
|
function qn(t, e) {
|
|
13567
|
-
return
|
|
13568
|
+
return Vr(t) ? Qt : me($t(e), Sd);
|
|
13568
13569
|
}
|
|
13569
13570
|
function Ul(t, e) {
|
|
13570
13571
|
return typeof t == "string" ? t : t instanceof URL ? t.toString() : e?.url ?? "";
|
|
13571
13572
|
}
|
|
13572
13573
|
async function Nl(t, e, s, n) {
|
|
13573
|
-
const i =
|
|
13574
|
+
const i = jr(t.headers);
|
|
13574
13575
|
n({
|
|
13575
13576
|
...e,
|
|
13576
13577
|
responseStatus: t.status,
|
|
@@ -13580,7 +13581,7 @@ async function Nl(t, e, s, n) {
|
|
|
13580
13581
|
});
|
|
13581
13582
|
}
|
|
13582
13583
|
async function jl(t) {
|
|
13583
|
-
if (!
|
|
13584
|
+
if (!Br(t.headers))
|
|
13584
13585
|
return;
|
|
13585
13586
|
let e = null, s = null;
|
|
13586
13587
|
try {
|
|
@@ -13589,7 +13590,7 @@ async function jl(t) {
|
|
|
13589
13590
|
const n = new Promise((o) => {
|
|
13590
13591
|
s = window.setTimeout(() => {
|
|
13591
13592
|
e?.cancel(), o("timeout");
|
|
13592
|
-
},
|
|
13593
|
+
}, kd);
|
|
13593
13594
|
}), i = new TextDecoder();
|
|
13594
13595
|
let r = "", a = 0;
|
|
13595
13596
|
for (; ; ) {
|
|
@@ -13612,7 +13613,7 @@ async function jl(t) {
|
|
|
13612
13613
|
}
|
|
13613
13614
|
}
|
|
13614
13615
|
function Bl(t, e) {
|
|
13615
|
-
if (
|
|
13616
|
+
if (Br(new Headers(e)))
|
|
13616
13617
|
try {
|
|
13617
13618
|
return t.responseType === "" || t.responseType === "text" ? me(t.responseText ?? "") : void 0;
|
|
13618
13619
|
} catch {
|
|
@@ -13642,7 +13643,7 @@ function Mi(t) {
|
|
|
13642
13643
|
return $t(t);
|
|
13643
13644
|
}
|
|
13644
13645
|
}
|
|
13645
|
-
function
|
|
13646
|
+
function Br(t) {
|
|
13646
13647
|
if (!t)
|
|
13647
13648
|
return !1;
|
|
13648
13649
|
const e = t.get("content-type")?.toLowerCase() ?? "", s = t.get("content-length"), n = Number(s);
|
|
@@ -13696,7 +13697,7 @@ function me(t, e = kn) {
|
|
|
13696
13697
|
function Ps(t) {
|
|
13697
13698
|
return `${t}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
13698
13699
|
}
|
|
13699
|
-
class
|
|
13700
|
+
class Lr extends Error {
|
|
13700
13701
|
constructor(e, s) {
|
|
13701
13702
|
super(`${e} (${s})`), this.status = s, this.name = "AttachmentUploadHttpError", this.code = String(s);
|
|
13702
13703
|
}
|
|
@@ -13717,11 +13718,11 @@ async function Hl(t, e) {
|
|
|
13717
13718
|
}
|
|
13718
13719
|
function Vl(t) {
|
|
13719
13720
|
return new Promise((e) => {
|
|
13720
|
-
window.setTimeout(e,
|
|
13721
|
+
window.setTimeout(e, wd[t] ?? 0);
|
|
13721
13722
|
});
|
|
13722
13723
|
}
|
|
13723
13724
|
function Kl(t) {
|
|
13724
|
-
return t instanceof
|
|
13725
|
+
return t instanceof Lr ? Wl(t.status) : t instanceof TypeError;
|
|
13725
13726
|
}
|
|
13726
13727
|
function Wl(t) {
|
|
13727
13728
|
return t === 408 || t === 409 || t === 429 || t >= 500;
|
|
@@ -13729,7 +13730,7 @@ function Wl(t) {
|
|
|
13729
13730
|
function Gl(t) {
|
|
13730
13731
|
return t === 401 || t === 403;
|
|
13731
13732
|
}
|
|
13732
|
-
const Qt = "[REDACTED_SECRET]", ye = "[REDACTED_TOKEN]", Jl = "[REDACTED_SIGNED_URL]", Ql = 20, Xl = /^(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,
|
|
13733
|
+
const Qt = "[REDACTED_SECRET]", ye = "[REDACTED_TOKEN]", Jl = "[REDACTED_SIGNED_URL]", Ql = 20, Xl = /^(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, Fr = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, $r = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, zr = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, Hr = /\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, Yl = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, Zl = /\bhttps?:\/\/[^\s"'<>]+/gi, eu = /[),.;\]]+$/;
|
|
13733
13734
|
function ne(t) {
|
|
13734
13735
|
return Ft(t, 0, /* @__PURE__ */ new WeakSet());
|
|
13735
13736
|
}
|
|
@@ -13746,17 +13747,17 @@ function Ft(t, e, s) {
|
|
|
13746
13747
|
return t.map((i) => Ft(i, e + 1, s));
|
|
13747
13748
|
const n = {};
|
|
13748
13749
|
for (const [i, r] of Object.entries(t))
|
|
13749
|
-
i === "pageContent" ? n[i] = r :
|
|
13750
|
+
i === "pageContent" ? n[i] = r : Vr(i) ? n[i] = Qt : n[i] = i.toLowerCase() === "url" ? tu(r) : Ft(r, e + 1, s);
|
|
13750
13751
|
return n;
|
|
13751
13752
|
}
|
|
13752
|
-
function
|
|
13753
|
+
function Vr(t) {
|
|
13753
13754
|
const e = t.replace(/[^a-z0-9]/gi, "").toLowerCase();
|
|
13754
13755
|
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");
|
|
13755
13756
|
}
|
|
13756
13757
|
function tu(t) {
|
|
13757
|
-
return typeof t == "string" ?
|
|
13758
|
+
return typeof t == "string" ? Kr(t) : Ft(t, 0, /* @__PURE__ */ new WeakSet());
|
|
13758
13759
|
}
|
|
13759
|
-
function
|
|
13760
|
+
function Kr(t) {
|
|
13760
13761
|
try {
|
|
13761
13762
|
const e = new URL(t, location.href);
|
|
13762
13763
|
for (const s of Array.from(e.searchParams.keys()))
|
|
@@ -13767,29 +13768,29 @@ function Hr(t) {
|
|
|
13767
13768
|
}
|
|
13768
13769
|
}
|
|
13769
13770
|
function $t(t) {
|
|
13770
|
-
return t.replace(Yl, Jl).replace(Zl, nu).replace(
|
|
13771
|
+
return t.replace(Yl, Jl).replace(Zl, nu).replace(Fr, `Bearer ${ye}`).replace($r, `Basic ${ye}`).replace(zr, ye).replace(Hr, (e, s) => `${s}: ${Qt}`);
|
|
13771
13772
|
}
|
|
13772
13773
|
function su(t) {
|
|
13773
|
-
return t.replace(
|
|
13774
|
+
return t.replace(Fr, `Bearer ${ye}`).replace($r, `Basic ${ye}`).replace(zr, ye).replace(Hr, (e, s) => `${s}: ${Qt}`);
|
|
13774
13775
|
}
|
|
13775
13776
|
function nu(t) {
|
|
13776
13777
|
const e = t.match(eu)?.[0] ?? "", s = e ? t.slice(0, -e.length) : t;
|
|
13777
|
-
return `${
|
|
13778
|
+
return `${Kr(s)}${e}`;
|
|
13778
13779
|
}
|
|
13779
|
-
const
|
|
13780
|
+
const bu = Object.freeze({
|
|
13780
13781
|
init: (t) => Jt.init(t)
|
|
13781
13782
|
});
|
|
13782
|
-
function
|
|
13783
|
+
function Iu(t) {
|
|
13783
13784
|
return Jt.init(t);
|
|
13784
13785
|
}
|
|
13785
13786
|
export {
|
|
13786
13787
|
vi as PLUNO_PRODUCT_AGENT_WIDGET_HOST_SELECTOR,
|
|
13787
|
-
|
|
13788
|
-
|
|
13789
|
-
|
|
13790
|
-
|
|
13788
|
+
ad as PLUNO_PRODUCT_AGENT_WIDGET_PANEL_SELECTOR,
|
|
13789
|
+
od as PLUNO_PRODUCT_AGENT_WIDGET_ROOT_SELECTOR,
|
|
13790
|
+
cd as PLUNO_PRODUCT_AGENT_WIDGET_TIMELINE_SELECTOR,
|
|
13791
|
+
Xa as PRODUCT_AGENT_AUTH_RECONNECTING_ERROR_MESSAGE,
|
|
13791
13792
|
gu as PRODUCT_AGENT_PROVIDER_INPUT_ATTACHMENT_ACCEPT,
|
|
13792
|
-
|
|
13793
|
+
bu as PlunoProductAgent,
|
|
13793
13794
|
du as ProductAgentInteractionManager,
|
|
13794
13795
|
si as ProductAgentQueryController,
|
|
13795
13796
|
fu as ProductAgentRemoteRuntimeClient,
|
|
@@ -13797,23 +13798,24 @@ export {
|
|
|
13797
13798
|
cu as ProductAgentSessionHistoryManager,
|
|
13798
13799
|
uu as ProductAgentTaskPageTitleController,
|
|
13799
13800
|
ue as ProductAgentTokenProviderError,
|
|
13800
|
-
|
|
13801
|
+
Ed as calculateReconnectDelay,
|
|
13801
13802
|
ou as canSubmitPersonalProductAgentMessage,
|
|
13802
13803
|
lu as createLocalStorageInteractionDecisionStorage,
|
|
13803
13804
|
Ct as createProductAgentQueryState,
|
|
13804
|
-
|
|
13805
|
+
Iu as createProductAgentRuntime,
|
|
13805
13806
|
hu as createProductAgentTaskPageTitleDocument,
|
|
13806
|
-
|
|
13807
|
-
|
|
13808
|
-
|
|
13807
|
+
bu as default,
|
|
13808
|
+
td as formatProductAgentTaskPageTitle,
|
|
13809
|
+
yu as getProductAgentOriginAccessErrorMessage,
|
|
13810
|
+
mu as installProductAgentPageEnvironment,
|
|
13809
13811
|
ni as isProductAgentAuthReconnectError,
|
|
13810
13812
|
pu as isProductAgentRuntimeCommand,
|
|
13811
|
-
|
|
13813
|
+
Ga as mergeProductAgentEntityPages,
|
|
13812
13814
|
Mt as normalizeProductAgentEntityPage,
|
|
13813
|
-
|
|
13814
|
-
|
|
13815
|
+
vu as normalizeProductAgentSessionItems,
|
|
13816
|
+
Yc as readLocalStorageInteractionDecisions,
|
|
13815
13817
|
au as resolveProductAgentComposerAction,
|
|
13816
13818
|
ru as resolveProductAgentWidgetPresentation,
|
|
13817
|
-
|
|
13819
|
+
Ja as selectProductAgentQueryEntities,
|
|
13818
13820
|
Cl as validateProductAgentProviderInputFile
|
|
13819
13821
|
};
|