@pluno/product-agent-web 0.1.281 → 0.1.283
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/interactions/contracts.d.ts +1 -0
- package/dist/featureActionFeedback.d.ts +19 -0
- package/dist/index.d.ts +1 -0
- package/dist/product-agent-runtime.cjs +1 -1
- package/dist/product-agent-runtime.js +1 -1
- package/dist/product-agent-sdk.js +153 -142
- package/dist/product-agent-widget.js +3912 -3857
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function vt(t, e, s) {
|
|
2
2
|
t.throwIfAborted();
|
|
3
3
|
let n, i = () => {
|
|
4
4
|
};
|
|
@@ -272,7 +272,7 @@ function ts(t, e) {
|
|
|
272
272
|
updatedAt: e.updatedAt
|
|
273
273
|
};
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function ct(t, e) {
|
|
276
276
|
return t.key !== e.key || t.requestId !== e.requestId ? t : { ...t, status: "error", error: e.error };
|
|
277
277
|
}
|
|
278
278
|
function je(t) {
|
|
@@ -336,7 +336,7 @@ function Ie(t, e, s) {
|
|
|
336
336
|
}
|
|
337
337
|
for (const S of c) {
|
|
338
338
|
const x = l.findIndex((U) => {
|
|
339
|
-
const H = a.find((
|
|
339
|
+
const H = a.find((ot) => ot.userMessageId === U.userMessageId), $e = r?.items[U.userMessageId ?? U.activityIds[0] ?? U.outcomeIds[0]];
|
|
340
340
|
return (H?.submittedAt ?? ($e ? Date.parse($e.created_at) : 1 / 0)) > S.submittedAt;
|
|
341
341
|
});
|
|
342
342
|
l.splice(x < 0 ? l.length : x, 0, {
|
|
@@ -468,23 +468,23 @@ function Gr(t, e, s) {
|
|
|
468
468
|
if (!X(n.profile, d)) continue;
|
|
469
469
|
const l = s.conversationScopeId ? t.interactions.openings[s.conversationScopeId] : void 0;
|
|
470
470
|
if (!s.sessionId || !l || l.sessionId !== s.sessionId || !xi(t, s.conversationScopeId, c) || t.features.refreshRequired && !l.shown[c] || n.profile === "main_web_chat" && !t.interactions.bridgeReady && !l.shown[c]) continue;
|
|
471
|
-
const u =
|
|
472
|
-
if (u === !1 || t.features.desiredPreferences[c] === !1 ||
|
|
473
|
-
const
|
|
471
|
+
const u = bt(t, c), h = t.interactions.preferencePrompts[c], p = t.interactions.deviceFacts[c], m = `preference:${c}`;
|
|
472
|
+
if (u === !1 || t.features.desiredPreferences[c] === !1 || u === !0 && ["granted", "unknown"].includes(p.permission) || p.permission === "unsupported" || h.snoozedUntil && Date.parse(h.snoozedUntil) > a || p.snoozedUntil && Date.parse(p.snoozedUntil) > a) continue;
|
|
473
|
+
const f = p.pending || Object.values(t.interactions.devicePending).some((k) => k.feature === c), y = o([m, `preferenceSnooze:${c}`, `preferenceAcknowledge:${c}`]), b = y.error ?? t.interactions.deviceErrors[c] ?? (l.shown[c] && t.interactions.bridgeError ? { code: "connection_interrupted", message: t.interactions.bridgeError, retryable: !0 } : null);
|
|
474
474
|
r.push({
|
|
475
475
|
id: m,
|
|
476
|
-
category:
|
|
476
|
+
category: "preference",
|
|
477
477
|
placement: "bottom_overlay",
|
|
478
478
|
sourceId: null,
|
|
479
479
|
conversationId: null,
|
|
480
480
|
userMessageId: null,
|
|
481
481
|
sourceVersion: l.generation,
|
|
482
482
|
decisionRevision: h.revision,
|
|
483
|
-
actions:
|
|
484
|
-
status:
|
|
485
|
-
error:
|
|
483
|
+
actions: ["enable", "not_now", "dont_enable"],
|
|
484
|
+
status: f ? "pending" : b ? "error" : y.status,
|
|
485
|
+
error: b,
|
|
486
486
|
payload: { feature: c, openingGeneration: l.generation },
|
|
487
|
-
nextEligibleAt:
|
|
487
|
+
nextEligibleAt: h.snoozedUntil ?? p.snoozedUntil
|
|
488
488
|
});
|
|
489
489
|
}
|
|
490
490
|
for (const c of Object.values(t.interactions.sources)) {
|
|
@@ -580,8 +580,8 @@ function Jr(t, e, s, n) {
|
|
|
580
580
|
if (u.category === "preference" || u.category === "permission") {
|
|
581
581
|
const f = u.payload.feature;
|
|
582
582
|
if (f !== "notifications" && f !== "tab_grouping") throw new Error("Missing preference feature.");
|
|
583
|
-
if (i = { ...i, interactions: { ...i.interactions, promptActions: { ...i.interactions.promptActions, [e.requestId]: { scope: n.clients[e.clientScopeId], openingGeneration: u.sourceVersion, expectedRevision: e.expectedRevision, feature: f, action: e.action } } } }, u.category === "permission") return { state: i, effects: r, command: { type: "stage7.permission", authority: a, now: e.now, requestId: e.requestId, feature: f, action: e.action, settings: !1 } };
|
|
584
|
-
const y = e.action === "not_now" ? { kind: "preferenceSnooze", feature: f, expectedRevision: e.expectedRevision } : { kind: "preference", feature: f, enabled:
|
|
583
|
+
if (i = { ...i, interactions: { ...i.interactions, promptActions: { ...i.interactions.promptActions, [e.requestId]: { scope: n.clients[e.clientScopeId], openingGeneration: u.sourceVersion, expectedRevision: e.expectedRevision, feature: f, action: e.action } } } }, e.action === "enable" || u.category === "permission") return { state: i, effects: r, command: { type: "stage7.permission", authority: a, now: e.now, requestId: e.requestId, feature: f, action: e.action === "enable" ? "allow" : e.action, settings: !1 } };
|
|
584
|
+
const y = e.action === "not_now" ? { kind: "preferenceSnooze", feature: f, expectedRevision: e.expectedRevision } : { kind: "preference", feature: f, enabled: !1 };
|
|
585
585
|
return { state: i, effects: r, command: { type: "stage7.mutate", authority: a, now: e.now, requestId: e.requestId, mutation: y } };
|
|
586
586
|
}
|
|
587
587
|
if (["not_now", "never", "snooze"].includes(e.action)) {
|
|
@@ -810,7 +810,7 @@ function ie(t, e) {
|
|
|
810
810
|
"runId" in e ? e.runId : null
|
|
811
811
|
]);
|
|
812
812
|
}
|
|
813
|
-
function
|
|
813
|
+
function bt(t, e) {
|
|
814
814
|
return t.account.preferences?.[e === "notifications" ? "taskNotificationsEnabled" : "tabGroupingEnabled"] ?? null;
|
|
815
815
|
}
|
|
816
816
|
const Yr = {
|
|
@@ -905,7 +905,7 @@ function Ls(t, e, s) {
|
|
|
905
905
|
}
|
|
906
906
|
const l = (g, v, I) => {
|
|
907
907
|
const w = g === "notifications" ? "canRequestNotificationPermission" : "canGroupSessionTabs";
|
|
908
|
-
if (!X(o.profile, w) ||
|
|
908
|
+
if (!X(o.profile, w) || n.features.desiredPreferences[g] === !1 || v === "check" && bt(n, g) !== !0 || Object.values(n.interactions.devicePending).some((T) => T.feature === g && (v === "check" || T.action !== "check"))) return;
|
|
909
909
|
const A = Se(o, "device", I), _ = { ...n.interactions.deviceErrors };
|
|
910
910
|
delete _[g], a({ deviceErrors: _, devicePending: { ...n.interactions.devicePending, [A]: { feature: g, requestId: I, generation: o.generation, desired: !0, action: v } } }), i.push({ kind: "stage7.device", id: A, input: { authority: o, requestId: I, feature: g, action: v, now: n.features.now } });
|
|
911
911
|
}, u = (g, v) => {
|
|
@@ -934,7 +934,15 @@ function Ls(t, e, s) {
|
|
|
934
934
|
g.kind === "preferences" && (n = { ...n, account: Xr(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: ss(n.interactions, g.decisions) }), g.kind === "decision" && (n = { ...n, interactions: ss(n.interactions, [g.value]) });
|
|
935
935
|
}, p = (g, v) => {
|
|
936
936
|
const I = n.interactions.deviceFacts[g];
|
|
937
|
-
v.revision <= I.revision
|
|
937
|
+
if (!(v.revision <= I.revision) && ((bt(n, g) === !0 || n.features.desiredPreferences[g] === !0) && (v.permission === "granted" && I.permission !== "granted" || v.snoozedUntil && v.snoozedUntil !== I.snoozedUntil) && u(g, null), a({ deviceFacts: { ...n.interactions.deviceFacts, [g]: v } }), n.features.desiredPreferences[g] === !0 && bt(n, g) !== !0)) {
|
|
938
|
+
const w = Object.values(n.features.pending).filter((A) => A.mode === "mutation" && A.key === `preference:${g}`);
|
|
939
|
+
if (v.permission === "granted" && !w.some((A) => A.status === "pending" || A.status === "error"))
|
|
940
|
+
f({ kind: "preference", feature: g, enabled: !0 }, `permission:${g}:${v.revision}`);
|
|
941
|
+
else if (!v.pending && v.permission === "missing" && v.snoozedUntil) {
|
|
942
|
+
const A = { ...n.features.desiredPreferences };
|
|
943
|
+
delete A[g], r({ desiredPreferences: A });
|
|
944
|
+
}
|
|
945
|
+
}
|
|
938
946
|
}, m = (g, v, I = !1) => {
|
|
939
947
|
Ce(o, g);
|
|
940
948
|
const w = ie(o, g), A = Se(o, "query", v);
|
|
@@ -1023,7 +1031,7 @@ function Ls(t, e, s) {
|
|
|
1023
1031
|
const T = { code: e.code, message: "The backend refused account access. Refresh account status before retrying.", retryable: !0 };
|
|
1024
1032
|
I[A] = { ..._, status: "error", error: T }, w.push(A);
|
|
1025
1033
|
const E = v[_.key];
|
|
1026
|
-
E && (v[_.key] =
|
|
1034
|
+
E && (v[_.key] = ct(E, { key: _.key, requestId: oe(_.requestId), error: T }));
|
|
1027
1035
|
}
|
|
1028
1036
|
n = { ...n, features: { ...n.features, pending: I, queries: v }, account: {
|
|
1029
1037
|
...n.account,
|
|
@@ -1103,7 +1111,10 @@ function Ls(t, e, s) {
|
|
|
1103
1111
|
break;
|
|
1104
1112
|
}
|
|
1105
1113
|
case "stage7.permission": {
|
|
1106
|
-
if (
|
|
1114
|
+
if (e.action === "allow") {
|
|
1115
|
+
const v = Object.fromEntries(Object.entries(n.features.pending).filter(([, I]) => !(I.key === `preference:${e.feature}` && I.status === "error")));
|
|
1116
|
+
r({ pending: v, desiredPreferences: { ...n.features.desiredPreferences, [e.feature]: !0 } });
|
|
1117
|
+
}
|
|
1107
1118
|
const g = n.interactions.deviceFacts[e.feature].snoozedUntil;
|
|
1108
1119
|
if (!e.settings && g && Date.parse(g) > e.now) break;
|
|
1109
1120
|
l(e.feature, e.action, e.requestId);
|
|
@@ -1203,7 +1214,7 @@ function Ls(t, e, s) {
|
|
|
1203
1214
|
}, `${I.requestId}:ack`);
|
|
1204
1215
|
}
|
|
1205
1216
|
p(I.feature, e.output.fact);
|
|
1206
|
-
} else
|
|
1217
|
+
} else n.features.desiredPreferences[I.feature] !== !1 && a({ deviceErrors: { ...n.interactions.deviceErrors, [I.feature]: e.error } });
|
|
1207
1218
|
break;
|
|
1208
1219
|
}
|
|
1209
1220
|
const g = n.features.pending[e.effectId];
|
|
@@ -1222,7 +1233,7 @@ function Ls(t, e, s) {
|
|
|
1222
1233
|
} } });
|
|
1223
1234
|
}
|
|
1224
1235
|
if (v)
|
|
1225
|
-
r({ queries: { ...n.features.queries, [g.key]:
|
|
1236
|
+
r({ queries: { ...n.features.queries, [g.key]: ct(w, { key: g.key, requestId: oe(g.requestId), error: e.error }) } }), g.operation.kind === "account" && (n = { ...n, account: { ...n.account, query: ct(n.account.query, { key: g.key, requestId: oe(g.requestId), error: e.error }) } });
|
|
1226
1237
|
else {
|
|
1227
1238
|
if (e.output.data.kind !== g.operation.kind) throw new Error("Feature response kind does not match the query.");
|
|
1228
1239
|
r({ now: e.output.completedAt, queries: { ...n.features.queries, [g.key]: ts(w, { key: g.key, requestId: oe(g.requestId), data: e.output.data, cursor: null, updatedAt: e.output.completedAt }) } }), h(e.output.data, g.requestId), e.output.data.kind === "account" && (n = { ...n, account: { ...n.account, refusal: null, query: ts(n.account.query, { key: g.key, requestId: oe(g.requestId), data: e.output.data.value, cursor: null, updatedAt: e.output.completedAt }) } });
|
|
@@ -1250,7 +1261,7 @@ function Ls(t, e, s) {
|
|
|
1250
1261
|
}
|
|
1251
1262
|
if (b(e.effectId, v), g.operation.kind === "generatePrompts") {
|
|
1252
1263
|
const I = { kind: "starterPrompts", ...g.operation.page, includeUserSuggestions: g.operation.includeUserSuggestions ?? !1 }, w = ie(o, I), A = n.features.queries[w];
|
|
1253
|
-
A?.requestId === g.requestId && r({ queries: { ...n.features.queries, [w]: v ?
|
|
1264
|
+
A?.requestId === g.requestId && r({ queries: { ...n.features.queries, [w]: v ? ct(A, { key: w, requestId: oe(g.requestId), error: e.error }) : ts(A, { key: w, requestId: oe(g.requestId), data: e.output.data, cursor: null, updatedAt: e.output.completedAt }) } });
|
|
1254
1265
|
}
|
|
1255
1266
|
if (!v && e.output.data.kind === "originContext") {
|
|
1256
1267
|
const I = e.output.data, w = g.operation.kind === "originContext" || g.operation.kind === "refreshContext" ? g.operation.origin : null;
|
|
@@ -1452,7 +1463,7 @@ function to(t, e, s, n) {
|
|
|
1452
1463
|
}
|
|
1453
1464
|
};
|
|
1454
1465
|
}
|
|
1455
|
-
function
|
|
1466
|
+
function nt(t) {
|
|
1456
1467
|
if (!t || typeof t != "object") return !1;
|
|
1457
1468
|
const e = t;
|
|
1458
1469
|
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);
|
|
@@ -1471,7 +1482,7 @@ function Y(t, e = "runtime_error", s = "runtime") {
|
|
|
1471
1482
|
const n = t !== null && typeof t == "object" ? t : null, i = typeof t == "string" ? t : n && "message" in n && typeof n.message == "string" ? n.message : "", r = n && "code" in n && typeof n.code == "string" && n.code.trim() ? n.code : e, a = n && "details" in n ? n.details : null, o = a && typeof a == "object" ? a : {}, c = {
|
|
1472
1483
|
...typeof o.httpStatus == "number" && Number.isInteger(o.httpStatus) && o.httpStatus >= 100 && o.httpStatus <= 599 ? { httpStatus: o.httpStatus } : {},
|
|
1473
1484
|
// Preserve the first boundary's shape after normalization replaces the original message/prototype.
|
|
1474
|
-
errorNormalization:
|
|
1485
|
+
errorNormalization: nt(o.errorNormalization) ? o.errorNormalization : {
|
|
1475
1486
|
boundary: s,
|
|
1476
1487
|
category: t instanceof Error ? "error" : t === null ? "null" : Array.isArray(t) ? "array" : typeof t,
|
|
1477
1488
|
messageKind: i.trim() === "[object Object]" ? "object_coercion" : i.trim() ? "text" : typeof t == "string" || n && "message" in n && typeof n.message == "string" ? "blank" : "non_text"
|
|
@@ -1602,7 +1613,7 @@ function Ve(t, e) {
|
|
|
1602
1613
|
hasContext: Be(s.hasContext)
|
|
1603
1614
|
} };
|
|
1604
1615
|
}
|
|
1605
|
-
function
|
|
1616
|
+
function dt(t, e) {
|
|
1606
1617
|
const s = N(t), n = s.style === null ? null : N(s.style), i = n && N(n.style ?? n);
|
|
1607
1618
|
if (!i) return { kind: "appearance", origin: e, value: null };
|
|
1608
1619
|
const r = P(i.colorScheme);
|
|
@@ -1611,7 +1622,7 @@ function lt(t, e) {
|
|
|
1611
1622
|
if (!je(a)) throw new Error("Invalid appearance metadata.");
|
|
1612
1623
|
return { kind: "appearance", origin: e, ...n?.createdAt === void 0 ? {} : { stored: { createdAt: P(n.createdAt), updatedAt: P(n.updatedAt), metadata: a } }, value: { accent: P(i.accent), colorScheme: r, fontFamily: P(i.fontFamily), scribbleStyle: Be(i.scribbleStyle) } };
|
|
1613
1624
|
}
|
|
1614
|
-
function
|
|
1625
|
+
function lt(t) {
|
|
1615
1626
|
const e = N(t);
|
|
1616
1627
|
if (!Be(e.success)) throw new Error(de(e.message) ?? "Failed to submit feedback");
|
|
1617
1628
|
return { kind: "ack", success: !0 };
|
|
@@ -1696,7 +1707,7 @@ function ro(t) {
|
|
|
1696
1707
|
c = Ve("contextRun", await o(`/context-refresh-runs/${encodeURIComponent(i.runId)}`));
|
|
1697
1708
|
break;
|
|
1698
1709
|
case "appearance":
|
|
1699
|
-
c = a ? await t.embedded.appearance(i) :
|
|
1710
|
+
c = a ? await t.embedded.appearance(i) : dt(await o("/style", { origin: i.origin }), i.origin);
|
|
1700
1711
|
break;
|
|
1701
1712
|
case "hostedEligibility":
|
|
1702
1713
|
c = { kind: "hostedEligibility", eligible: Be(N(await o("/remote-browser/eligibility", { community_id: n.communityId })).usableBrowserStorage) };
|
|
@@ -1731,10 +1742,10 @@ function ro(t) {
|
|
|
1731
1742
|
c = { kind: "decision", value: $n(await o("/interaction-decisions", { category: i.category, prompt_key: i.promptKey, action: i.action, request_id: r, expected_revision: i.expectedRevision })) };
|
|
1732
1743
|
break;
|
|
1733
1744
|
case "feedback":
|
|
1734
|
-
c =
|
|
1745
|
+
c = lt(a ? { success: await t.embedded.feedback(i.message) } : await o("/feedback", { ...rs(i.context), feedback_type: "general", message: i.message }));
|
|
1735
1746
|
break;
|
|
1736
1747
|
case "proactiveFeedback":
|
|
1737
|
-
c =
|
|
1748
|
+
c = lt(await o("/feedback", {
|
|
1738
1749
|
...rs(i.context),
|
|
1739
1750
|
feedback_type: "proactive_suggestion",
|
|
1740
1751
|
proactive_suggestion_action: "feedback",
|
|
@@ -1745,10 +1756,10 @@ function ro(t) {
|
|
|
1745
1756
|
break;
|
|
1746
1757
|
case "targetFeedback":
|
|
1747
1758
|
if (a) throw new Error("Embedded target feedback has no HTTP contract.");
|
|
1748
|
-
c =
|
|
1759
|
+
c = lt(await o("/feedback/target", { feedback_type: "target_rating", target_id: i.targetId, rating: i.rating, ...i.comment === void 0 ? {} : { comment: i.comment } }));
|
|
1749
1760
|
break;
|
|
1750
1761
|
case "report":
|
|
1751
|
-
c =
|
|
1762
|
+
c = lt(await o("/feedback", { ...rs(i.context), feedback_type: "chat_report", session_id: i.sessionId, message: i.message, ui_evidence: i.uiEvidence, widget_evidence_available: i.widgetEvidenceAvailable }));
|
|
1752
1763
|
break;
|
|
1753
1764
|
case "generatePrompts": {
|
|
1754
1765
|
const d = N(await o("/starter-prompts", { page_url: i.page.pageUrl, html_content: i.htmlContent, page_title: i.pageTitle }, "POST", a ? {} : { origin: i.page.origin, include_user_suggestions: i.includeUserSuggestions ?? !1 }));
|
|
@@ -1770,17 +1781,17 @@ function ro(t) {
|
|
|
1770
1781
|
case "sampleStyle": {
|
|
1771
1782
|
if (!t.sampleStyle) throw new Error("Style sampling unavailable.");
|
|
1772
1783
|
const d = await t.sampleStyle(i.page);
|
|
1773
|
-
e(n), c =
|
|
1784
|
+
e(n), c = dt(await o("/style/refresh", { origin: i.origin, style: { accent: d.accent, color_scheme: d.colorScheme, font_family: d.fontFamily, scribble_style: d.scribbleStyle } }), i.origin);
|
|
1774
1785
|
break;
|
|
1775
1786
|
}
|
|
1776
1787
|
case "saveStyle":
|
|
1777
|
-
c =
|
|
1788
|
+
c = dt(await o("/style/refresh", { origin: i.origin, style: { accent: i.value.accent, color_scheme: i.value.colorScheme, font_family: i.value.fontFamily, scribble_style: i.value.scribbleStyle } }), i.origin);
|
|
1778
1789
|
break;
|
|
1779
1790
|
case "deleteStyle":
|
|
1780
1791
|
await o("/style", {}, "DELETE", { origin: i.origin }), c = { kind: "appearance", origin: i.origin, value: null };
|
|
1781
1792
|
break;
|
|
1782
1793
|
case "scribble":
|
|
1783
|
-
c =
|
|
1794
|
+
c = dt(await o("/style/scribble", { origin: i.origin, enabled: i.enabled }), i.origin);
|
|
1784
1795
|
break;
|
|
1785
1796
|
}
|
|
1786
1797
|
return e(n), { data: c, completedAt: t.now() };
|
|
@@ -1900,16 +1911,16 @@ async function uo(t, e, s = crypto.randomUUID()) {
|
|
|
1900
1911
|
}
|
|
1901
1912
|
function ho(t, e, s, n) {
|
|
1902
1913
|
return Fi(t, e, s, n).map((i) => {
|
|
1903
|
-
const r = i.sourceId ? Object.values(t.interactions.sources).find((
|
|
1914
|
+
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, l = o === "notifications" ? "Get notified when Pluno finishes a task?" : o === "tab_grouping" ? "Group tabs used by Pluno?" : i.category === "sharing" ? "Share what Pluno helped you accomplish." : String(i.payload.text ?? d ?? ""), u = 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;
|
|
1904
1915
|
return {
|
|
1905
1916
|
id: i.id,
|
|
1906
|
-
kind:
|
|
1917
|
+
kind: c,
|
|
1907
1918
|
category: i.category,
|
|
1908
1919
|
scope: { level: i.conversationId ? "session" : "user", key: i.conversationId ?? t.account.authority.userId },
|
|
1909
1920
|
payload: {
|
|
1910
1921
|
...i.payload,
|
|
1911
1922
|
error: i.error?.message ?? null,
|
|
1912
|
-
...
|
|
1923
|
+
...h ? { request: h, status: i.payload.lifecycle ?? r?.lifecycle, error: i.error?.message ?? null } : {},
|
|
1913
1924
|
...i.category === "sharing" ? { candidate: { id: i.id, variant: a?.kind === "sharing" ? a.variant : "social" } } : {},
|
|
1914
1925
|
...i.category === "proactive_suggestion" ? { suggestion: { id: String(i.payload.sourceSuggestionId ?? i.id), interactionId: i.id, genericQuestion: String(i.payload.text ?? ""), question: String(i.payload.text ?? "") } } : {},
|
|
1915
1926
|
...i.category === "morning_report" ? { opening: i.payload.text, prompts: i.payload.tasks } : {}
|
|
@@ -1917,7 +1928,7 @@ function ho(t, e, s, n) {
|
|
|
1917
1928
|
placement: i.placement,
|
|
1918
1929
|
userMessageId: i.userMessageId,
|
|
1919
1930
|
sourceVersion: i.sourceVersion,
|
|
1920
|
-
presentation: { title:
|
|
1931
|
+
presentation: { title: d, body: l, actionLabels: u },
|
|
1921
1932
|
eligible: !0,
|
|
1922
1933
|
status: i.status,
|
|
1923
1934
|
allowedActions: i.actions,
|
|
@@ -1962,7 +1973,7 @@ function fo(t, e = null) {
|
|
|
1962
1973
|
} : void 0);
|
|
1963
1974
|
return { ...n, ...o ? { auth: o } : {}, submissionGate: a, usingPaidCreditFallback: e ? t.paidFallbackBySession[e] ?? !1 : !1 };
|
|
1964
1975
|
}
|
|
1965
|
-
const go = "0.1.
|
|
1976
|
+
const go = "0.1.283", Lt = {
|
|
1966
1977
|
version: go
|
|
1967
1978
|
}, ln = (t) => t.selectedModel ?? t.historyModel ?? t.defaultModel, mo = (t, e) => t.scopes[e];
|
|
1968
1979
|
function Ft(t) {
|
|
@@ -2082,7 +2093,7 @@ function Vs(t, e, s = !1) {
|
|
|
2082
2093
|
}
|
|
2083
2094
|
return G(i);
|
|
2084
2095
|
}
|
|
2085
|
-
function
|
|
2096
|
+
function ut(t) {
|
|
2086
2097
|
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);
|
|
2087
2098
|
}
|
|
2088
2099
|
function vo(t, e, s, n) {
|
|
@@ -2181,7 +2192,7 @@ function vo(t, e, s, n) {
|
|
|
2181
2192
|
if (!o || o.cancelled || o.delivery === "failed") return { state: t, effects: r };
|
|
2182
2193
|
const c = Z({ pageContent: e.pageContent, sessionTabs: e.sessionTabs });
|
|
2183
2194
|
if (o.contextPreparation !== null) {
|
|
2184
|
-
if (
|
|
2195
|
+
if (ut(o.contextPreparation) !== ut(c)) throw new Error("Prepared submission context cannot change.");
|
|
2185
2196
|
return { state: t, effects: r };
|
|
2186
2197
|
}
|
|
2187
2198
|
i = { ...t, submissions: { ...t.submissions, [e.userMessageId]: { ...o, contextPreparation: c } } };
|
|
@@ -2192,7 +2203,7 @@ function vo(t, e, s, n) {
|
|
|
2192
2203
|
const { type: o, authorityId: c, generation: d, prepareContext: l, reconcileAcceptance: u, waitForAuthentication: h, ...p } = e, m = t.submissions[e.userMessageId];
|
|
2193
2204
|
if (m) {
|
|
2194
2205
|
const { contextPreparation: g, requestedModel: v, sessionId: I, delivery: w, cancelled: A, cancellationReason: _, error: T, executionVersion: E, ...C } = m;
|
|
2195
|
-
if (
|
|
2206
|
+
if (ut(C) !== ut(p)) throw new Error("User-message identity cannot be reused with different input.");
|
|
2196
2207
|
return { state: t, effects: r };
|
|
2197
2208
|
}
|
|
2198
2209
|
const f = s.selections[e.conversationScopeId], y = Object.values(t.submissions).find((g) => g.conversationScopeId === e.conversationScopeId && !g.cancelled && g.sessionId !== null), b = n.scopes[e.clientScopeId], k = {
|
|
@@ -2705,16 +2716,23 @@ function Io(t, e, s, n) {
|
|
|
2705
2716
|
}
|
|
2706
2717
|
const a = vo(i, r, s, n);
|
|
2707
2718
|
let o = a.state;
|
|
2708
|
-
e.type === "conversation.submission_stage" && o !== i && !o.deliveries[e.userMessageId]
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
...
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2719
|
+
if (e.type === "conversation.submission_stage" && o !== i && !o.deliveries[e.userMessageId]) {
|
|
2720
|
+
o = {
|
|
2721
|
+
...o,
|
|
2722
|
+
effectsEnabled: !0,
|
|
2723
|
+
requestSequence: o.requestSequence + 1,
|
|
2724
|
+
deliveries: { ...o.deliveries, [e.userMessageId]: {
|
|
2725
|
+
...zn(o.submissions[e.userMessageId], o.requestSequence + 1),
|
|
2726
|
+
...e.reconcileAcceptance !== void 0 ? { handoffRecovery: !0, recoveryDeadline: e.reconcileAcceptance + 18e4, acceptance: "uncertain", step: "receipt" } : {},
|
|
2727
|
+
...e.waitForAuthentication ? { phase: "failed" } : {}
|
|
2728
|
+
} }
|
|
2729
|
+
};
|
|
2730
|
+
const u = o.submissions[e.userMessageId], h = o.deliveries[e.userMessageId];
|
|
2731
|
+
h.phase === "waiting" && (o = { ...o, deliveries: Object.fromEntries(Object.entries(o.deliveries).map(([p, m]) => {
|
|
2732
|
+
const f = o.submissions[p];
|
|
2733
|
+
return m.queuePosition < h.queuePosition && (f.conversationScopeId === u.conversationScopeId || u.sessionId !== null && f.sessionId === u.sessionId) && m.acceptance === "uncertain" && ["uncertain", "paused"].includes(m.phase) && f.error?.code !== "message_acceptance_unconfirmed" ? [p, { ...m, phase: "waiting", effectId: null, prepared: !0, step: "receipt" }] : [p, m];
|
|
2734
|
+
})) });
|
|
2735
|
+
}
|
|
2718
2736
|
for (const [u, h] of Object.entries(o.submissions)) {
|
|
2719
2737
|
const p = o.deliveries[u];
|
|
2720
2738
|
p && (h.delivery === "accepted" && p.acceptance !== "accepted" ? o = {
|
|
@@ -2827,7 +2845,7 @@ function _o(t) {
|
|
|
2827
2845
|
const Wi = Math.random().toString(36).slice(2);
|
|
2828
2846
|
let So = 0;
|
|
2829
2847
|
const Vn = () => `timing:${Wi}:${++So}`, Ke = (t) => typeof t == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(t);
|
|
2830
|
-
function
|
|
2848
|
+
function it(t) {
|
|
2831
2849
|
if (!t || typeof t != "object") return !1;
|
|
2832
2850
|
const e = t;
|
|
2833
2851
|
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 || Ke(e.workerId)) && (e.failureCategory === void 0 || e.status === "failed" && Ki.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) && wo.includes(e.stage) && ["started", "completed", "failed", "observed"].includes(e.status) && Ke(e.spanId) && Ke(e.requestId) && (e.clientMessageId === null || Ke(e.clientMessageId)) && (e.sessionId === null || Ke(e.sessionId)) && typeof e.occurredAt == "string" && e.occurredAt.length <= 40 && Number.isFinite(Date.parse(e.occurredAt)) && Number.isSafeInteger(e.durationMs) && e.durationMs >= 0;
|
|
@@ -2849,7 +2867,7 @@ function Q(t, e) {
|
|
|
2849
2867
|
durationMs: Math.max(0, Math.round(performance.now() - a)),
|
|
2850
2868
|
...r === "failed" ? { failureCategory: _o(c) } : {}
|
|
2851
2869
|
};
|
|
2852
|
-
t &&
|
|
2870
|
+
t && it(d) && Promise.resolve().then(() => t(d)).catch(() => {
|
|
2853
2871
|
});
|
|
2854
2872
|
};
|
|
2855
2873
|
return {
|
|
@@ -2875,7 +2893,7 @@ function ko(t) {
|
|
|
2875
2893
|
});
|
|
2876
2894
|
};
|
|
2877
2895
|
return (i) => {
|
|
2878
|
-
|
|
2896
|
+
it(i) && (JSON.stringify([...e, i]).length > 2800 && n(), e.push(i), e.length === 8 ? n() : s ??= setTimeout(n, 250));
|
|
2879
2897
|
};
|
|
2880
2898
|
}
|
|
2881
2899
|
function Ro(t) {
|
|
@@ -3023,7 +3041,7 @@ function Gi(t) {
|
|
|
3023
3041
|
function Oo(t) {
|
|
3024
3042
|
if (!t || typeof t != "object") return !1;
|
|
3025
3043
|
const e = t;
|
|
3026
|
-
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 ||
|
|
3044
|
+
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 || nt(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));
|
|
3027
3045
|
}
|
|
3028
3046
|
function Ji(t, e, s, n, i = {}) {
|
|
3029
3047
|
const r = !n && e === "conversation_error" && s !== void 0 && t.conversationDiagnostics?.errorMessageFingerprint === Gi(Oe(s)) ? t.conversationDiagnostics : void 0;
|
|
@@ -3032,7 +3050,7 @@ function Ji(t, e, s, n, i = {}) {
|
|
|
3032
3050
|
requestId: j(r?.httpRequest?.requestId ?? r?.errorRequestId ?? r?.queryRequestId),
|
|
3033
3051
|
...j(r?.failedClientMessageId) ? { clientMessageId: r.failedClientMessageId } : {},
|
|
3034
3052
|
code: r ? j(t.lastErrorCode) : null,
|
|
3035
|
-
...
|
|
3053
|
+
...nt(r?.errorNormalization) ? { normalization: r.errorNormalization } : {},
|
|
3036
3054
|
builds: { sdk: Lt.version, ...i }
|
|
3037
3055
|
};
|
|
3038
3056
|
}
|
|
@@ -3042,7 +3060,7 @@ function xo(t, e = "runtime") {
|
|
|
3042
3060
|
`).replace(/\n\s*at\s/g, `
|
|
3043
3061
|
frame `)) : void 0;
|
|
3044
3062
|
return {
|
|
3045
|
-
...
|
|
3063
|
+
...nt(s.details?.errorNormalization) ? { normalization: s.details.errorNormalization } : {},
|
|
3046
3064
|
category: t instanceof Error ? "error" : t === null ? "null" : Array.isArray(t) ? "array" : typeof t,
|
|
3047
3065
|
code: Oe(s.code),
|
|
3048
3066
|
message: Oe(s.message),
|
|
@@ -3328,7 +3346,7 @@ function Bo(t) {
|
|
|
3328
3346
|
const y = h.engine.getState().slices, b = y.conversation.submissions[o.submission.userMessageId];
|
|
3329
3347
|
(!J(t) || !b || b.cancelled || b.requestId !== o.submission.requestId || y.directory.clients[b.clientScopeId] !== b.conversationScopeId) && l(Object.assign(new Error("Submission preparation was retired."), { code: "aborted", retryable: !1 }));
|
|
3330
3348
|
}, m = h.engine.subscribe(p), f = h.onDispose(() => l(Object.assign(new Error("Submission runtime was disposed."), { code: "aborted" })));
|
|
3331
|
-
return p(),
|
|
3349
|
+
return p(), vt(c.signal, () => t.prepareSubmission(o, c.signal).then((y) => (c.signal.aborted && d.mark("context_discarded"), y), (y) => {
|
|
3332
3350
|
throw c.signal.aborted && d.mark("context_discarded"), y;
|
|
3333
3351
|
})).then((y) => (p(), c.signal.throwIfAborted(), a(o), y)).catch((y) => (l(y), n(y, { operation: "conversation.prepare", requestId: o.submission.userMessageId }))).finally(() => {
|
|
3334
3352
|
clearTimeout(u), m(), f();
|
|
@@ -3782,7 +3800,7 @@ function ds(t, e, s, n) {
|
|
|
3782
3800
|
...g ? { errorMessageFingerprint: Gi(Oe(g.message)) } : {},
|
|
3783
3801
|
...l && g && g === l.error && !p ? { failedClientMessageId: l.userMessageId } : {},
|
|
3784
3802
|
...typeof g?.details?.requestId == "string" ? { errorRequestId: g.details.requestId } : {},
|
|
3785
|
-
...
|
|
3803
|
+
...nt(g?.details?.errorNormalization) ? { errorNormalization: g.details.errorNormalization } : {},
|
|
3786
3804
|
...n ? { owner: n } : {},
|
|
3787
3805
|
...he(g?.details?.httpRequest) ? { httpRequest: g.details.httpRequest } : {},
|
|
3788
3806
|
queryStatus: e?.status ?? null,
|
|
@@ -4034,15 +4052,15 @@ function Go(t, e) {
|
|
|
4034
4052
|
ls || (ls = new TextEncoder()), e(ls.encode(s));
|
|
4035
4053
|
});
|
|
4036
4054
|
}
|
|
4037
|
-
const ei = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
|
|
4055
|
+
const ei = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ye = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
|
|
4038
4056
|
for (let t = 0; t < ei.length; t++)
|
|
4039
|
-
|
|
4057
|
+
Ye[ei.charCodeAt(t)] = t;
|
|
4040
4058
|
const Jo = (t) => {
|
|
4041
4059
|
let e = t.length * 0.75, s = t.length, n, i = 0, r, a, o, c;
|
|
4042
4060
|
t[t.length - 1] === "=" && (e--, t[t.length - 2] === "=" && e--);
|
|
4043
4061
|
const d = new ArrayBuffer(e), l = new Uint8Array(d);
|
|
4044
4062
|
for (n = 0; n < s; n += 4)
|
|
4045
|
-
r =
|
|
4063
|
+
r = Ye[t.charCodeAt(n)], a = Ye[t.charCodeAt(n + 1)], o = Ye[t.charCodeAt(n + 2)], c = Ye[t.charCodeAt(n + 3)], l[i++] = r << 2 | a >> 4, l[i++] = (a & 15) << 4 | o >> 2, l[i++] = (o & 3) << 6 | c & 63;
|
|
4046
4064
|
return d;
|
|
4047
4065
|
}, Qo = typeof ArrayBuffer == "function", yn = (t, e) => {
|
|
4048
4066
|
if (typeof t != "string")
|
|
@@ -4106,10 +4124,10 @@ function ea() {
|
|
|
4106
4124
|
});
|
|
4107
4125
|
}
|
|
4108
4126
|
let us;
|
|
4109
|
-
function
|
|
4127
|
+
function ht(t) {
|
|
4110
4128
|
return t.reduce((e, s) => e + s.length, 0);
|
|
4111
4129
|
}
|
|
4112
|
-
function
|
|
4130
|
+
function pt(t, e) {
|
|
4113
4131
|
if (t[0].length === e)
|
|
4114
4132
|
return t.shift();
|
|
4115
4133
|
const s = new Uint8Array(e);
|
|
@@ -4126,28 +4144,28 @@ function ta(t, e) {
|
|
|
4126
4144
|
transform(a, o) {
|
|
4127
4145
|
for (s.push(a); ; ) {
|
|
4128
4146
|
if (n === 0) {
|
|
4129
|
-
if (
|
|
4147
|
+
if (ht(s) < 1)
|
|
4130
4148
|
break;
|
|
4131
|
-
const c =
|
|
4149
|
+
const c = pt(s, 1);
|
|
4132
4150
|
r = (c[0] & 128) === 128, i = c[0] & 127, i < 126 ? n = 3 : i === 126 ? n = 1 : n = 2;
|
|
4133
4151
|
} else if (n === 1) {
|
|
4134
|
-
if (
|
|
4152
|
+
if (ht(s) < 2)
|
|
4135
4153
|
break;
|
|
4136
|
-
const c =
|
|
4154
|
+
const c = pt(s, 2);
|
|
4137
4155
|
i = new DataView(c.buffer, c.byteOffset, c.length).getUint16(0), n = 3;
|
|
4138
4156
|
} else if (n === 2) {
|
|
4139
|
-
if (
|
|
4157
|
+
if (ht(s) < 8)
|
|
4140
4158
|
break;
|
|
4141
|
-
const c =
|
|
4159
|
+
const c = pt(s, 8), d = new DataView(c.buffer, c.byteOffset, c.length), l = d.getUint32(0);
|
|
4142
4160
|
if (l > Math.pow(2, 21) - 1) {
|
|
4143
4161
|
o.enqueue(Qs);
|
|
4144
4162
|
break;
|
|
4145
4163
|
}
|
|
4146
4164
|
i = l * Math.pow(2, 32) + d.getUint32(4), n = 3;
|
|
4147
4165
|
} else {
|
|
4148
|
-
if (
|
|
4166
|
+
if (ht(s) < i)
|
|
4149
4167
|
break;
|
|
4150
|
-
const c =
|
|
4168
|
+
const c = pt(s, i);
|
|
4151
4169
|
o.enqueue(yn(r ? c : us.decode(c), e)), n = 0;
|
|
4152
4170
|
}
|
|
4153
4171
|
if (i === 0 || i > t) {
|
|
@@ -6802,15 +6820,15 @@ class dr {
|
|
|
6802
6820
|
}
|
|
6803
6821
|
}
|
|
6804
6822
|
}
|
|
6805
|
-
function
|
|
6823
|
+
function st(t) {
|
|
6806
6824
|
if (t !== null && typeof t == "object" && !Object.isFrozen(t)) {
|
|
6807
|
-
for (const e of Object.values(t))
|
|
6825
|
+
for (const e of Object.values(t)) st(e);
|
|
6808
6826
|
Object.freeze(t);
|
|
6809
6827
|
}
|
|
6810
6828
|
return t;
|
|
6811
6829
|
}
|
|
6812
6830
|
function lr() {
|
|
6813
|
-
return
|
|
6831
|
+
return st({
|
|
6814
6832
|
authorityId: null,
|
|
6815
6833
|
generation: 0,
|
|
6816
6834
|
entities: {},
|
|
@@ -6835,13 +6853,13 @@ function B(t) {
|
|
|
6835
6853
|
return JSON.stringify([t.kind, t.origin, t.limit]);
|
|
6836
6854
|
}
|
|
6837
6855
|
function Va(t) {
|
|
6838
|
-
const e = t.map((s) =>
|
|
6856
|
+
const e = t.map((s) => Ze(s) || s.requestId !== null && s.status !== "error" ? { ...s, status: s.status === "error" ? s.data?.length ? "refreshing" : "loading" : s.status, error: null } : s);
|
|
6839
6857
|
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];
|
|
6840
6858
|
}
|
|
6841
6859
|
function Ka(t) {
|
|
6842
6860
|
return [...new Set(t.flatMap((e) => e.data ?? []))];
|
|
6843
6861
|
}
|
|
6844
|
-
function
|
|
6862
|
+
function Ze(t) {
|
|
6845
6863
|
const e = t.error;
|
|
6846
6864
|
return t.status === "error" && t.consecutiveFailures < 10 && e !== null && !["unauthorized", "401", "403", "authority_retired"].includes(e.code) && (e.retryable || /^5\d\d$/.test(e.code) || ["runtime_error", "connection_interrupted", "request_timed_out", "408", "429"].includes(e.code));
|
|
6847
6865
|
}
|
|
@@ -6969,7 +6987,7 @@ class Ga {
|
|
|
6969
6987
|
if (s) for (const i of Object.values(n)) {
|
|
6970
6988
|
const r = B(i.query);
|
|
6971
6989
|
if (i.status !== "error" || i.requestId !== null || this.queryRequests.has(r) || !this.isObserved(i.query)) continue;
|
|
6972
|
-
if (!
|
|
6990
|
+
if (!Ze(i)) {
|
|
6973
6991
|
const c = this.queryRetries.get(r);
|
|
6974
6992
|
c?.timer !== null && c?.timer !== void 0 && clearTimeout(c.timer), this.queryRetries.delete(r);
|
|
6975
6993
|
continue;
|
|
@@ -7033,16 +7051,16 @@ class Ga {
|
|
|
7033
7051
|
}
|
|
7034
7052
|
refreshObservedQuery(e) {
|
|
7035
7053
|
const s = this.options.runtime.engine.getState().slices.directory.queries[B(Ae(e))];
|
|
7036
|
-
return s?.status === "error" && !
|
|
7054
|
+
return s?.status === "error" && !Ze(s) ? Promise.resolve() : e.kind !== "pinned" && s?.status === "error" && s.mode === "append" ? this.enqueueQuery(e, async () => {
|
|
7037
7055
|
const n = this.options.runtime.engine.getState().slices.directory.queries[B(Ae(e))];
|
|
7038
|
-
!this.isObserved(e) || n?.status !== "error" || n.mode !== "append" || !
|
|
7056
|
+
!this.isObserved(e) || n?.status !== "error" || n.mode !== "append" || !Ze(n) || await this.readPage(e, "append", n.cursor);
|
|
7039
7057
|
}) : this.refreshPages(e, e.kind === "pinned", () => this.isObserved(e));
|
|
7040
7058
|
}
|
|
7041
7059
|
refreshPages(e, s, n, i = !1) {
|
|
7042
7060
|
return e = Ae(e), this.enqueueQuery(e, async () => {
|
|
7043
7061
|
if (!n()) return;
|
|
7044
7062
|
const r = this.options.runtime.engine.getState().slices.directory.queries[B(e)];
|
|
7045
|
-
if (!i && r?.status === "error" && !
|
|
7063
|
+
if (!i && r?.status === "error" && !Ze(r) || (await this.readPage(e, "replace", void 0, i), !s)) return;
|
|
7046
7064
|
let a = this.options.runtime.engine.getState().slices.directory.queries[B(e)]?.cursor ?? null;
|
|
7047
7065
|
for (; a !== null && n(); ) {
|
|
7048
7066
|
const o = a;
|
|
@@ -7877,7 +7895,7 @@ function Te(t, e, s) {
|
|
|
7877
7895
|
const a = { ...t.requests };
|
|
7878
7896
|
if (delete a[e.effectId], n = { ...t, requests: a }, r.kind === "directory.query") {
|
|
7879
7897
|
const o = B(r.input.query), c = t.queries[o];
|
|
7880
|
-
if (c.requestId !== r.input.requestId) return { state:
|
|
7898
|
+
if (c.requestId !== r.input.requestId) return { state: st(n), effects: i };
|
|
7881
7899
|
if (e.type === "effect.failed")
|
|
7882
7900
|
n = { ...n, queries: { ...n.queries, [o]: { ...c, status: "error", error: { ...e.error }, requestId: null, consecutiveFailures: c.consecutiveFailures + 1 } } };
|
|
7883
7901
|
else if (e.effectKind === "directory.query") {
|
|
@@ -7997,7 +8015,7 @@ function Te(t, e, s) {
|
|
|
7997
8015
|
} else
|
|
7998
8016
|
n = ac(t, e, s);
|
|
7999
8017
|
}
|
|
8000
|
-
return { state:
|
|
8018
|
+
return { state: st(n), effects: i };
|
|
8001
8019
|
}
|
|
8002
8020
|
function dc(t) {
|
|
8003
8021
|
const e = { ...t.entities };
|
|
@@ -8012,7 +8030,7 @@ function dc(t) {
|
|
|
8012
8030
|
activityRevision: i,
|
|
8013
8031
|
...r
|
|
8014
8032
|
} = t;
|
|
8015
|
-
return
|
|
8033
|
+
return st({
|
|
8016
8034
|
...r,
|
|
8017
8035
|
entities: e,
|
|
8018
8036
|
activityBySessionId: { ...s, ...t.activityBySessionId },
|
|
@@ -8821,8 +8839,8 @@ class nu {
|
|
|
8821
8839
|
activityReconciliationScheduled = !1;
|
|
8822
8840
|
getState() {
|
|
8823
8841
|
const e = this.recentQuery.getState(), s = this.pinnedQuery.getState(), n = [
|
|
8824
|
-
...
|
|
8825
|
-
...
|
|
8842
|
+
...ft(s.data),
|
|
8843
|
+
...ft(e.data)
|
|
8826
8844
|
], i = new Map(n.map((c) => [c.id, c])), r = Array.from(i.values()).map(
|
|
8827
8845
|
(c) => this.applyOverrides(c, this.completedRefreshSequence)
|
|
8828
8846
|
), a = Array.from(this.optimisticEntities.values()).filter((c) => !i.has(c.id)).reverse(), o = e.data || s.data || a.length > 0 ? St({
|
|
@@ -8897,8 +8915,8 @@ class nu {
|
|
|
8897
8915
|
}
|
|
8898
8916
|
reconcileDurableEntities() {
|
|
8899
8917
|
const e = [
|
|
8900
|
-
...
|
|
8901
|
-
...
|
|
8918
|
+
...ft(this.pinnedQuery.getState().data),
|
|
8919
|
+
...ft(this.recentQuery.getState().data)
|
|
8902
8920
|
], s = new Set(e.map((n) => n.id));
|
|
8903
8921
|
for (const n of this.optimisticEntities.keys())
|
|
8904
8922
|
s.has(n) && this.optimisticEntities.delete(n);
|
|
@@ -8937,7 +8955,7 @@ class nu {
|
|
|
8937
8955
|
for (const e of this.listeners) e(this.getState());
|
|
8938
8956
|
}
|
|
8939
8957
|
}
|
|
8940
|
-
function
|
|
8958
|
+
function ft(t) {
|
|
8941
8959
|
return t ? t.ids.map((e) => t.entitiesById[e]).filter((e) => !!e) : [];
|
|
8942
8960
|
}
|
|
8943
8961
|
function Hc(t, e) {
|
|
@@ -9233,7 +9251,7 @@ function cu(t) {
|
|
|
9233
9251
|
case "runtime.warmup":
|
|
9234
9252
|
return e.reason === "panel_open" || e.reason === "extension_install" || e.reason === "composer_input";
|
|
9235
9253
|
case "runtime.report_operation_timing":
|
|
9236
|
-
return
|
|
9254
|
+
return it(e.timing);
|
|
9237
9255
|
case "runtime.report_displayed_error":
|
|
9238
9256
|
return (e.errorDiagnostic === void 0 || Oo(e.errorDiagnostic)) && (e.httpRequest === void 0 || he(e.httpRequest)) && (e.historyRefreshFailure === void 0 || hn(e.historyRefreshFailure)) && (e.renderedError === void 0 || fn(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);
|
|
9239
9257
|
case "runtime.report_invalid_state_transition":
|
|
@@ -9364,7 +9382,7 @@ class du {
|
|
|
9364
9382
|
this.dispatch({ type: "runtime.widget_lifecycle", action: e, trigger: s });
|
|
9365
9383
|
}
|
|
9366
9384
|
reportOperationTiming(e) {
|
|
9367
|
-
!this.destroyed &&
|
|
9385
|
+
!this.destroyed && it(e) && this.adapter.dispatch({ type: "runtime.report_operation_timing", timing: e }).catch(() => {
|
|
9368
9386
|
});
|
|
9369
9387
|
}
|
|
9370
9388
|
reportResponseVisibility(e) {
|
|
@@ -9862,7 +9880,7 @@ const id = "https://app.pluno.ai", rd = 2e4, od = 1e4, ad = 6e4, cd = 6e4, dd =
|
|
|
9862
9880
|
".png:image/png",
|
|
9863
9881
|
".webp:image/webp"
|
|
9864
9882
|
]), lu = ".pdf,.png,.jpg,.jpeg,.webp", kn = 64e3, As = 4e3, Rn = 30, md = 2e3, yd = 1e3, _r = "Image is too large for model vision input.", vd = "pluno.productAgent.state.", cn = "pluno.productAgent.pendingEvents.", Vt = "pluno.productAgent.activeToolCalls.", bd = 100, Ot = /* @__PURE__ */ new Set();
|
|
9865
|
-
let
|
|
9883
|
+
let gt = null;
|
|
9866
9884
|
function Id(t, e = Math.random) {
|
|
9867
9885
|
const s = Math.min(an, ud * 2 ** t), n = 1 - bi + e() * bi * 2;
|
|
9868
9886
|
return Math.min(an, Math.round(s * n));
|
|
@@ -10116,7 +10134,7 @@ class Kt {
|
|
|
10116
10134
|
operationTimingReporter = () => {
|
|
10117
10135
|
};
|
|
10118
10136
|
reportOperationTiming(e) {
|
|
10119
|
-
|
|
10137
|
+
it(e) && this.operationTimingReporter(e);
|
|
10120
10138
|
}
|
|
10121
10139
|
async initializeConversation() {
|
|
10122
10140
|
const e = ++this.conversationAdapterGeneration;
|
|
@@ -10150,7 +10168,7 @@ class Kt {
|
|
|
10150
10168
|
requestId: f.requestId,
|
|
10151
10169
|
clientMessageId: f.userMessageId,
|
|
10152
10170
|
sessionId: f.sessionId
|
|
10153
|
-
}), R = (v, I) => k.measure(v, () =>
|
|
10171
|
+
}), R = (v, I) => k.measure(v, () => vt(b, I));
|
|
10154
10172
|
let g = f.contextPreparation ?? { pageContent: "", sessionTabs: [] };
|
|
10155
10173
|
if (f.contextPreparation === null) {
|
|
10156
10174
|
await R("first_frame", () => new Promise((I) => {
|
|
@@ -10171,9 +10189,9 @@ class Kt {
|
|
|
10171
10189
|
}
|
|
10172
10190
|
if (await R("authentication", () => this.waitForAuthentication()), !n() || s !== this.directoryAuthority || this.clientRuntime.isDisposed) throw new Error("Submission authority was retired.");
|
|
10173
10191
|
for (const v of y)
|
|
10174
|
-
if (!v.uploaded && (await
|
|
10192
|
+
if (!v.uploaded && (await vt(b, () => (this.attachmentPersistence.get(v.sourceId) ?? Promise.resolve()).catch(() => {
|
|
10175
10193
|
throw Object.assign(new Error("Attachment files could not be stored. Attach the files again and send a new message."), { code: "attachment_source_unavailable", retryable: !1 });
|
|
10176
|
-
})), !await
|
|
10194
|
+
})), !await vt(b, () => gi(v.sourceId))))
|
|
10177
10195
|
throw Object.assign(new Error("Attachment files are unavailable. Attach the files again and send a new message."), { code: "attachment_source_unavailable", retryable: !1 });
|
|
10178
10196
|
return b.throwIfAborted(), k.mark("context_ready"), { ...g, now: Date.now() };
|
|
10179
10197
|
},
|
|
@@ -11065,15 +11083,7 @@ class Kt {
|
|
|
11065
11083
|
bridgeStatus: null,
|
|
11066
11084
|
sdkPreviewOpen: null
|
|
11067
11085
|
} } } : {}
|
|
11068
|
-
}, c)
|
|
11069
|
-
type: "stage7.permission",
|
|
11070
|
-
authority: r,
|
|
11071
|
-
feature: a.kind === "task_notifications" ? "notifications" : "tab_grouping",
|
|
11072
|
-
action: "allow",
|
|
11073
|
-
settings: !0,
|
|
11074
|
-
requestId: c,
|
|
11075
|
-
now: Date.now()
|
|
11076
|
-
});
|
|
11086
|
+
}, c);
|
|
11077
11087
|
}
|
|
11078
11088
|
rebuildRuntimeInteractions() {
|
|
11079
11089
|
for (const e of this.interactionListeners) e(this.getInteractions());
|
|
@@ -11130,7 +11140,7 @@ class Kt {
|
|
|
11130
11140
|
authority: u,
|
|
11131
11141
|
now: Date.now(),
|
|
11132
11142
|
feature: m,
|
|
11133
|
-
fact: { permission: f.permissionGranted ? "granted" : f.permissionNeeded ? "missing" : "unknown", revision: Math.max(Date.now(), this.clientRuntime.engine.getState().slices.interactions.deviceFacts[m].revision + 1), snoozedUntil: f.snoozedUntil ?? null }
|
|
11143
|
+
fact: { permission: f.permissionGranted ? "granted" : f.permissionNeeded ? "missing" : "unknown", revision: Math.max(Date.now(), this.clientRuntime.engine.getState().slices.interactions.deviceFacts[m].revision + 1), snoozedUntil: f.snoozedUntil ?? null, pending: f.permissionPending === !0 }
|
|
11134
11144
|
}), m === "tab_grouping" && f.sessionId === h && h) for (const y of f.crossTabUserMessageIds ?? [])
|
|
11135
11145
|
await this.clientRuntime.engine.dispatch({ type: "stage7.cross_tab", authority: u, now: Date.now(), sessionId: h, userMessageId: y });
|
|
11136
11146
|
return f;
|
|
@@ -11191,7 +11201,8 @@ class Kt {
|
|
|
11191
11201
|
return { fact: {
|
|
11192
11202
|
permission: b.permissionGranted === !0 ? "granted" : b.permissionNeeded ? "missing" : "unknown",
|
|
11193
11203
|
revision: Math.max(Date.now(), this.clientRuntime.engine.getState().slices.interactions.deviceFacts[l].revision + 1),
|
|
11194
|
-
snoozedUntil: b.snoozedUntil ?? null
|
|
11204
|
+
snoozedUntil: b.snoozedUntil ?? null,
|
|
11205
|
+
pending: b.permissionPending === !0
|
|
11195
11206
|
}, completedAt: Date.now() };
|
|
11196
11207
|
},
|
|
11197
11208
|
"stage7.platform": async (l) => {
|
|
@@ -11540,7 +11551,7 @@ class Kt {
|
|
|
11540
11551
|
applyAuthenticatedDirectoryIdentity(e) {
|
|
11541
11552
|
const s = Ai(e);
|
|
11542
11553
|
if (!s) return !1;
|
|
11543
|
-
const n =
|
|
11554
|
+
const n = yt(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((l) => ["waiting", "running", "uncertain"].includes(l.phase) && (l.command.type === "run.stop" || l.command.type === "session.reset")).map((l) => l.command) : [], c = a && this.directoryAuthority.authorityId === `${this.options.clientId}:${this.options.runtimeCommunityId ?? this.options.productVariant}` ? this.state.sessionId : null;
|
|
11544
11555
|
if (this.authenticatedUserId = s.id, this.directoryHttp.auth.community_id = n, jo(this.options.clientId, i), r) {
|
|
11545
11556
|
const l = this.directoryAuthority;
|
|
11546
11557
|
this.directoryObservation.dispose(), this.conversationAdapterGeneration++, this.conversationObservation?.dispose(), this.directoryAuthority = { authorityId: i, generation: l.generation + 1 }, this.clientRuntime.engine.dispatch({ ...this.directoryAuthority, type: "directory.authority_replace", expectedGeneration: l.generation }), this.createDirectoryAdapters();
|
|
@@ -11651,7 +11662,7 @@ class Kt {
|
|
|
11651
11662
|
return;
|
|
11652
11663
|
}
|
|
11653
11664
|
if (e.type === "session.updated" || e.type === "conversation.state") {
|
|
11654
|
-
|
|
11665
|
+
yt(e.session, "id") === this.state.sessionId && (this.updatePersonalModelFromSession(e.session), this.updateAccountFallbackFromSession(e.session), Is(this.clientRuntime, this.modelClientScopeId, this.state.sessionId, e.turns));
|
|
11655
11666
|
return;
|
|
11656
11667
|
}
|
|
11657
11668
|
if (e.type === "tool.call")
|
|
@@ -11718,7 +11729,7 @@ class Kt {
|
|
|
11718
11729
|
}
|
|
11719
11730
|
updatePersonalModelFromSession(e) {
|
|
11720
11731
|
if (!e || typeof e != "object") return;
|
|
11721
|
-
const s =
|
|
11732
|
+
const s = yt(e, "id");
|
|
11722
11733
|
if (!s) return;
|
|
11723
11734
|
const n = e.metadata, i = n && typeof n == "object" ? n.model : void 0;
|
|
11724
11735
|
this.clientRuntime.engine.accept({
|
|
@@ -11730,7 +11741,7 @@ class Kt {
|
|
|
11730
11741
|
}
|
|
11731
11742
|
updateAccountFallbackFromSession(e) {
|
|
11732
11743
|
if (!e || typeof e != "object") return;
|
|
11733
|
-
const s =
|
|
11744
|
+
const s = yt(e, "id"), n = this.clientRuntime.engine.getState().slices.account.authority;
|
|
11734
11745
|
s && n && this.clientRuntime.engine.dispatch({
|
|
11735
11746
|
type: "stage7.account_fallback",
|
|
11736
11747
|
authority: n,
|
|
@@ -11740,7 +11751,7 @@ class Kt {
|
|
|
11740
11751
|
});
|
|
11741
11752
|
}
|
|
11742
11753
|
async executeToolCall(e) {
|
|
11743
|
-
const s = typeof e.sessionId == "string" ? e.sessionId : null, n = typeof e.callId == "string" ? e.callId : null, i = typeof e.toolName == "string" ? e.toolName : null, r =
|
|
11754
|
+
const s = typeof e.sessionId == "string" ? e.sessionId : null, n = typeof e.callId == "string" ? e.callId : null, i = typeof e.toolName == "string" ? e.toolName : null, r = et(
|
|
11744
11755
|
typeof e.summary == "string" ? e.summary : "Running browser tool"
|
|
11745
11756
|
), a = e.rawInput;
|
|
11746
11757
|
if (!s || !n || !i)
|
|
@@ -12463,8 +12474,8 @@ function Fd() {
|
|
|
12463
12474
|
};
|
|
12464
12475
|
}
|
|
12465
12476
|
function $d(t) {
|
|
12466
|
-
return Ot.add(t),
|
|
12467
|
-
Ot.delete(t), Ot.size === 0 && (
|
|
12477
|
+
return Ot.add(t), gt || (gt = zd()), () => {
|
|
12478
|
+
Ot.delete(t), Ot.size === 0 && (gt?.(), gt = null);
|
|
12468
12479
|
};
|
|
12469
12480
|
}
|
|
12470
12481
|
function zd() {
|
|
@@ -12494,9 +12505,9 @@ function An() {
|
|
|
12494
12505
|
(f) => Sr(f) && !f.parentElement?.closest(n)
|
|
12495
12506
|
);
|
|
12496
12507
|
for (const f of i.slice(0, 3))
|
|
12497
|
-
s("Active overlay", Cs(
|
|
12498
|
-
const r = Hd(), a = r ? Cs(
|
|
12499
|
-
s("Main page content", a), s("Additional visible page text", Cs(
|
|
12508
|
+
s("Active overlay", Cs(tt(f), e));
|
|
12509
|
+
const r = Hd(), a = r ? Cs(tt(r), e) : "";
|
|
12510
|
+
s("Main page content", a), s("Additional visible page text", Cs(tt(document.body), e));
|
|
12500
12511
|
const o = t.map(([f, y]) => `${f}:
|
|
12501
12512
|
${y}`).join(`
|
|
12502
12513
|
|
|
@@ -12507,7 +12518,7 @@ Visible page text:
|
|
|
12507
12518
|
`, u = 12e3 - d.length - l.length, h = Math.min(o.length, 7900), p = c.slice(0, u - h), m = o.slice(0, u - p.length);
|
|
12508
12519
|
return `${d}${p}${l}${m}`;
|
|
12509
12520
|
}
|
|
12510
|
-
function
|
|
12521
|
+
function tt(t) {
|
|
12511
12522
|
return t.innerText ?? t.textContent ?? "";
|
|
12512
12523
|
}
|
|
12513
12524
|
function Le(t) {
|
|
@@ -12529,7 +12540,7 @@ function Sr(t) {
|
|
|
12529
12540
|
return e.display !== "none" && e.visibility !== "hidden" && t.getClientRects().length > 0;
|
|
12530
12541
|
}
|
|
12531
12542
|
function Hd() {
|
|
12532
|
-
return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(Sr).sort((t, e) =>
|
|
12543
|
+
return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(Sr).sort((t, e) => tt(e).length - tt(t).length)[0] ?? null;
|
|
12533
12544
|
}
|
|
12534
12545
|
function Vd(t, e) {
|
|
12535
12546
|
const s = /* @__PURE__ */ new Set([
|
|
@@ -12636,10 +12647,10 @@ function Vd(t, e) {
|
|
|
12636
12647
|
const $ = f(D), ve = $e.get($) ?? 0;
|
|
12637
12648
|
$e.set($, ve + 1), (U.get($) ?? 0) > 8 && ve >= 6 && !l.has(D) && H.set($, (H.get($) ?? 0) + 1);
|
|
12638
12649
|
}
|
|
12639
|
-
const
|
|
12650
|
+
const ot = /* @__PURE__ */ new Map(), Cn = /* @__PURE__ */ new Set(), Gt = [], On = [];
|
|
12640
12651
|
for (const D of x) {
|
|
12641
|
-
const $ = f(D), ve = U.get($) ?? 0, Pn =
|
|
12642
|
-
if (
|
|
12652
|
+
const $ = f(D), ve = U.get($) ?? 0, Pn = ot.get($) ?? 0;
|
|
12653
|
+
if (ot.set($, Pn + 1), ve > 8 && Pn >= 6 && !l.has(D)) {
|
|
12643
12654
|
Cn.has($) || (Gt.push([`… ${H.get($) ?? 0} similar siblings omitted`]), Cn.add($));
|
|
12644
12655
|
continue;
|
|
12645
12656
|
}
|
|
@@ -12650,15 +12661,15 @@ function Vd(t, e) {
|
|
|
12650
12661
|
if (w.shadowRoot)
|
|
12651
12662
|
for (const D of Array.from(w.shadowRoot.children))
|
|
12652
12663
|
D instanceof HTMLElement && Jt.push(I(D, A + 1));
|
|
12653
|
-
const
|
|
12654
|
-
[O, ...
|
|
12664
|
+
const at = [...On, ...Jt], Qt = O.length > 0 || S || at.some((D) => D.hasUsefulContent), xn = Le(
|
|
12665
|
+
[O, ...at.map((D) => D.textPreview)].filter(Boolean).join(" ")
|
|
12655
12666
|
).slice(0, 180), Fr = w.hasAttribute("contenteditable") && (O.length > 0 || !w.querySelector("[contenteditable]")), Mn = d.some((D) => w.hasAttribute(D)) || !!C || Fr, Xt = (w.getClientRects().length > 0 || T.display === "contents") && (s.has(_) || Mn || E) && (Qt || E) && (!i.has(_) || Qt || Mn || E), Yt = Xt ? 1 : 0, ze = [];
|
|
12656
12667
|
if (Xt) {
|
|
12657
|
-
const D =
|
|
12668
|
+
const D = at.some((ve) => ve.containsTextElement), $ = n.has(_) && !D ? xn : O;
|
|
12658
12669
|
ze.push(kr(w, c, a, $.slice(0, 180)));
|
|
12659
12670
|
}
|
|
12660
12671
|
for (const D of Gt)
|
|
12661
|
-
ze.push(...
|
|
12672
|
+
ze.push(...mt(D, Yt));
|
|
12662
12673
|
const Zt = Jt.flatMap((D) => D.lines);
|
|
12663
12674
|
if (Zt.length > 0) {
|
|
12664
12675
|
const D = Zt.slice(0, 20);
|
|
@@ -12666,15 +12677,15 @@ function Vd(t, e) {
|
|
|
12666
12677
|
const $ = _.includes("tooltip") || _.includes("popper") || _.includes("loader");
|
|
12667
12678
|
if (A < 2 && !$) {
|
|
12668
12679
|
const ve = Xt ? "#shadow-root" : `${_} #shadow-root`;
|
|
12669
|
-
ze.push(...
|
|
12680
|
+
ze.push(...mt([ve, ...mt(D, 1)], Yt));
|
|
12670
12681
|
} else
|
|
12671
|
-
ze.push(...
|
|
12682
|
+
ze.push(...mt(D, Yt));
|
|
12672
12683
|
}
|
|
12673
12684
|
return {
|
|
12674
12685
|
lines: ze,
|
|
12675
12686
|
hasUsefulContent: Qt,
|
|
12676
12687
|
textPreview: xn,
|
|
12677
|
-
containsTextElement: n.has(_) ||
|
|
12688
|
+
containsTextElement: n.has(_) || at.some((D) => D.containsTextElement)
|
|
12678
12689
|
};
|
|
12679
12690
|
};
|
|
12680
12691
|
return [`--- ${g} ---`, ...I(R, 0).lines].join(`
|
|
@@ -12777,7 +12788,7 @@ function Wd(t, e, s, n) {
|
|
|
12777
12788
|
function ki(t) {
|
|
12778
12789
|
return t instanceof HTMLElement ? t : t?.parentElement instanceof HTMLElement ? t.parentElement : null;
|
|
12779
12790
|
}
|
|
12780
|
-
function
|
|
12791
|
+
function mt(t, e) {
|
|
12781
12792
|
if (e === 0)
|
|
12782
12793
|
return t;
|
|
12783
12794
|
const s = " ".repeat(e);
|
|
@@ -13109,18 +13120,18 @@ function al(t) {
|
|
|
13109
13120
|
}
|
|
13110
13121
|
function cl(t) {
|
|
13111
13122
|
if (typeof t.summary == "string" && t.summary.trim().length > 0)
|
|
13112
|
-
return
|
|
13123
|
+
return et(t.summary);
|
|
13113
13124
|
if (typeof t.arguments == "string")
|
|
13114
13125
|
try {
|
|
13115
13126
|
const e = JSON.parse(t.arguments);
|
|
13116
13127
|
if (typeof e.summary == "string" && e.summary.trim().length > 0)
|
|
13117
|
-
return
|
|
13128
|
+
return et(e.summary);
|
|
13118
13129
|
} catch {
|
|
13119
|
-
return typeof t.name == "string" && t.name.trim().length > 0 ?
|
|
13130
|
+
return typeof t.name == "string" && t.name.trim().length > 0 ? et(t.name) : "🛠️ Run tool";
|
|
13120
13131
|
}
|
|
13121
|
-
return typeof t.name == "string" && t.name.trim().length > 0 ?
|
|
13132
|
+
return typeof t.name == "string" && t.name.trim().length > 0 ? et(t.name) : "🛠️ Run tool";
|
|
13122
13133
|
}
|
|
13123
|
-
function
|
|
13134
|
+
function et(t) {
|
|
13124
13135
|
const e = t.trim() || "Run tool", s = e.codePointAt(0) ?? 0;
|
|
13125
13136
|
return s >= 126976 && s <= 129791 || s >= 9728 && s <= 10175 || s >= 127462 && s <= 127487 ? e : `🛠️ ${e}`;
|
|
13126
13137
|
}
|
|
@@ -13162,7 +13173,7 @@ function ul(t, e) {
|
|
|
13162
13173
|
}
|
|
13163
13174
|
function hl(t, e, s) {
|
|
13164
13175
|
const n = t[e], i = t[s];
|
|
13165
|
-
if (
|
|
13176
|
+
if (rt(n, i))
|
|
13166
13177
|
return !0;
|
|
13167
13178
|
if (!n.respondsToUserMessageId || i.respondsToUserMessageId || !n.runId || n.runId !== i.runId)
|
|
13168
13179
|
return !1;
|
|
@@ -13175,7 +13186,7 @@ function pl(t, e) {
|
|
|
13175
13186
|
const s = t[e];
|
|
13176
13187
|
for (let n = e + 1; n < t.length; n += 1) {
|
|
13177
13188
|
const i = t[n];
|
|
13178
|
-
if (i.role === "assistant" &&
|
|
13189
|
+
if (i.role === "assistant" && rt(s, i))
|
|
13179
13190
|
return !0;
|
|
13180
13191
|
}
|
|
13181
13192
|
return !1;
|
|
@@ -13196,26 +13207,26 @@ function fl(t, e) {
|
|
|
13196
13207
|
function gl(t, e) {
|
|
13197
13208
|
const s = t[e];
|
|
13198
13209
|
return t.some(
|
|
13199
|
-
(n, i) => i !== e && n.role === "assistant" &&
|
|
13210
|
+
(n, i) => i !== e && n.role === "assistant" && rt(s, n)
|
|
13200
13211
|
);
|
|
13201
13212
|
}
|
|
13202
13213
|
function ml(t, e) {
|
|
13203
13214
|
const s = t[e];
|
|
13204
13215
|
return t.some(
|
|
13205
|
-
(n, i) => i !== e && n.role === "tool" &&
|
|
13216
|
+
(n, i) => i !== e && n.role === "tool" && rt(s, n)
|
|
13206
13217
|
);
|
|
13207
13218
|
}
|
|
13208
13219
|
function yl(t, e) {
|
|
13209
13220
|
const s = t[e];
|
|
13210
13221
|
for (let n = e + 1; n < t.length; n += 1)
|
|
13211
|
-
if (En(t[n]) &&
|
|
13222
|
+
if (En(t[n]) && rt(s, t[n]))
|
|
13212
13223
|
return !0;
|
|
13213
13224
|
return !1;
|
|
13214
13225
|
}
|
|
13215
|
-
function
|
|
13226
|
+
function rt(t, e) {
|
|
13216
13227
|
return !!(t.respondsToUserMessageId && t.respondsToUserMessageId === e.respondsToUserMessageId);
|
|
13217
13228
|
}
|
|
13218
|
-
function
|
|
13229
|
+
function yt(t, e) {
|
|
13219
13230
|
return t && typeof t == "object" && typeof t[e] == "string" ? t[e] : null;
|
|
13220
13231
|
}
|
|
13221
13232
|
function vl(t, e) {
|