@pluno/product-agent-web 0.1.211 → 0.1.213
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/product-agent-runtime.cjs +1 -1
- package/dist/product-agent-runtime.js +192 -175
- package/dist/product-agent-sdk.js +85 -68
- package/dist/product-agent-widget.js +1963 -1909
- package/dist/runtimeClient.d.ts +1 -0
- package/dist/uiInvariants.d.ts +4 -0
- package/package.json +1 -1
|
@@ -491,7 +491,7 @@ function Rn() {
|
|
|
491
491
|
};
|
|
492
492
|
}
|
|
493
493
|
const Is = "schedule_follow_up";
|
|
494
|
-
function
|
|
494
|
+
function kn(s) {
|
|
495
495
|
let e = s;
|
|
496
496
|
if (typeof e == "string")
|
|
497
497
|
try {
|
|
@@ -507,7 +507,7 @@ function En(s) {
|
|
|
507
507
|
dueAt: t.dueAt
|
|
508
508
|
};
|
|
509
509
|
}
|
|
510
|
-
const
|
|
510
|
+
const En = [
|
|
511
511
|
{ value: "gpt-5.6-sol", label: "gpt-5.6-sol", price: "$$" },
|
|
512
512
|
{ value: "anthropic/claude-sonnet-5", label: "Claude Sonnet 5", price: "$$" },
|
|
513
513
|
{ value: "deepseek/deepseek-v4-flash", label: "DeepSeek V4 Flash", price: "$" }
|
|
@@ -515,7 +515,7 @@ const kn = [
|
|
|
515
515
|
{ value: "anthropic/claude-opus-5", label: "Claude Opus 5", price: "$$$" },
|
|
516
516
|
{ value: "gpt-5.6-terra", label: "gpt-5.6-terra", price: "$$" }
|
|
517
517
|
], _n = [
|
|
518
|
-
...
|
|
518
|
+
...En,
|
|
519
519
|
...Cn
|
|
520
520
|
], Qe = (s) => _n.some((e) => e.value === s);
|
|
521
521
|
function Lt(s, e) {
|
|
@@ -543,7 +543,7 @@ function Ts(s, e) {
|
|
|
543
543
|
function ws(s, e) {
|
|
544
544
|
return typeof s.respondsToUserMessageId == "string" && typeof e.respondsToUserMessageId == "string" ? s.respondsToUserMessageId === e.respondsToUserMessageId : typeof s.clientMessageId == "string" && typeof e.clientMessageId == "string" ? s.clientMessageId === e.clientMessageId : typeof s.runId == "string" && typeof e.runId == "string" && s.runId === e.runId;
|
|
545
545
|
}
|
|
546
|
-
function
|
|
546
|
+
function ke(s) {
|
|
547
547
|
return {
|
|
548
548
|
key: s,
|
|
549
549
|
status: "not_requested",
|
|
@@ -555,7 +555,7 @@ function Ee(s) {
|
|
|
555
555
|
}
|
|
556
556
|
class Ht {
|
|
557
557
|
constructor(e, t, n = (i, r) => r) {
|
|
558
|
-
this.loader = t, this.merge = n, this.state =
|
|
558
|
+
this.loader = t, this.merge = n, this.state = ke(e);
|
|
559
559
|
}
|
|
560
560
|
loader;
|
|
561
561
|
merge;
|
|
@@ -570,10 +570,10 @@ class Ht {
|
|
|
570
570
|
return this.listeners.add(e), e(this.state), () => this.listeners.delete(e);
|
|
571
571
|
}
|
|
572
572
|
setKey(e) {
|
|
573
|
-
e !== this.state.key && (this.state =
|
|
573
|
+
e !== this.state.key && (this.state = ke(e), this.trailingLoad = null, this.publish());
|
|
574
574
|
}
|
|
575
575
|
reset() {
|
|
576
|
-
this.state =
|
|
576
|
+
this.state = ke(this.state.key), this.trailingLoad = null, this.publish();
|
|
577
577
|
}
|
|
578
578
|
invalidate() {
|
|
579
579
|
this.state = {
|
|
@@ -628,7 +628,7 @@ class Ht {
|
|
|
628
628
|
for (const e of this.listeners) e(this.state);
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function Ee(s) {
|
|
632
632
|
const e = {}, t = [];
|
|
633
633
|
for (const n of s.entities)
|
|
634
634
|
e[n.id] || t.push(n.id), e[n.id] = n;
|
|
@@ -673,7 +673,7 @@ class qn {
|
|
|
673
673
|
constructor(e, t, n = 20) {
|
|
674
674
|
this.loadPage = t, this.limit = n, this.recentQuery = new Ht(
|
|
675
675
|
`${e}:recent`,
|
|
676
|
-
async ({ cursor: i }) =>
|
|
676
|
+
async ({ cursor: i }) => Ee(
|
|
677
677
|
await this.loadPage({ cursor: i, limit: this.limit, pinned: !1 }).then((r) => ({
|
|
678
678
|
entities: r.sessions,
|
|
679
679
|
nextCursor: r.nextCursor
|
|
@@ -682,7 +682,7 @@ class qn {
|
|
|
682
682
|
vn
|
|
683
683
|
), this.pinnedQuery = new Ht(
|
|
684
684
|
`${e}:pinned`,
|
|
685
|
-
async () =>
|
|
685
|
+
async () => Ee({
|
|
686
686
|
entities: await this.loadAllPinned(),
|
|
687
687
|
nextCursor: null
|
|
688
688
|
})
|
|
@@ -706,7 +706,7 @@ class qn {
|
|
|
706
706
|
...Ie(e.data)
|
|
707
707
|
], i = new Map(n.map((l) => [l.id, l])), r = Array.from(i.values()).map(
|
|
708
708
|
(l) => this.applyOverrides(l, this.completedRefreshSequence)
|
|
709
|
-
), o = Array.from(this.optimisticEntities.values()).filter((l) => !i.has(l.id)).reverse(), a = e.data || t.data || o.length > 0 ?
|
|
709
|
+
), o = Array.from(this.optimisticEntities.values()).filter((l) => !i.has(l.id)).reverse(), a = e.data || t.data || o.length > 0 ? Ee({
|
|
710
710
|
entities: [...o, ...r],
|
|
711
711
|
nextCursor: e.data?.nextCursor ?? null
|
|
712
712
|
}) : null;
|
|
@@ -1109,7 +1109,9 @@ const Wn = {
|
|
|
1109
1109
|
"foreign-session-item-visible": "The visible transcript contains state owned by another session.",
|
|
1110
1110
|
"terminal-response-reactivated": "A terminal response became active again.",
|
|
1111
1111
|
"terminal-history-not-append-only": "An established terminal outcome disappeared or changed order.",
|
|
1112
|
-
"runtime-transcript-not-rendered": "A nonempty runtime transcript is displaying starter prompts."
|
|
1112
|
+
"runtime-transcript-not-rendered": "A nonempty runtime transcript is displaying starter prompts.",
|
|
1113
|
+
"thinking-groups-without-user-message": "Multiple thinking groups appeared without a user message between them.",
|
|
1114
|
+
"thinking-without-progress": "Thinking remained visible without progress for five minutes."
|
|
1113
1115
|
};
|
|
1114
1116
|
function $n(s) {
|
|
1115
1117
|
return typeof s == "string" && s.startsWith("ui_invariant:") && Object.prototype.hasOwnProperty.call(Wn, s.slice(13));
|
|
@@ -1166,11 +1168,12 @@ class Fo {
|
|
|
1166
1168
|
interactionListeners = /* @__PURE__ */ new Set();
|
|
1167
1169
|
accountListeners = /* @__PURE__ */ new Set();
|
|
1168
1170
|
state;
|
|
1169
|
-
sessionHistoryState =
|
|
1171
|
+
sessionHistoryState = ke("unavailable");
|
|
1170
1172
|
model;
|
|
1171
1173
|
interactions = [];
|
|
1172
1174
|
account = null;
|
|
1173
1175
|
stagedProactiveSuggestionClientMessageId = null;
|
|
1176
|
+
unacknowledgedSubmissions = /* @__PURE__ */ new Map();
|
|
1174
1177
|
operationQueue = Promise.resolve();
|
|
1175
1178
|
destroyed = !1;
|
|
1176
1179
|
on(e, t) {
|
|
@@ -1182,7 +1185,17 @@ class Fo {
|
|
|
1182
1185
|
}
|
|
1183
1186
|
updateProjection(e, t, n, i, r) {
|
|
1184
1187
|
if (!this.destroyed) {
|
|
1185
|
-
|
|
1188
|
+
this.state = Xe(e);
|
|
1189
|
+
for (const [o, a] of this.unacknowledgedSubmissions) {
|
|
1190
|
+
if (e.user?.id !== a.userId || a.sessionId !== null && e.sessionId !== a.sessionId || e.messages.some(
|
|
1191
|
+
(l) => l.clientMessageId === o
|
|
1192
|
+
)) {
|
|
1193
|
+
this.unacknowledgedSubmissions.delete(o);
|
|
1194
|
+
continue;
|
|
1195
|
+
}
|
|
1196
|
+
a.sessionId ??= e.sessionId, this.state.messages.push(a.message), this.state.pendingMessageStatus = "sending", this.state.turnPhase ??= "sending", this.state.taskStatus ??= "working";
|
|
1197
|
+
}
|
|
1198
|
+
if (t !== void 0 && (this.model = t), n) {
|
|
1186
1199
|
this.sessionHistoryState = Ft(n);
|
|
1187
1200
|
for (const o of this.sessionHistoryListeners)
|
|
1188
1201
|
o(this.getSessionHistoryState());
|
|
@@ -1203,7 +1216,7 @@ class Fo {
|
|
|
1203
1216
|
}
|
|
1204
1217
|
destroy() {
|
|
1205
1218
|
if (!this.destroyed) {
|
|
1206
|
-
this.destroyed = !0, this.attachmentFiles.clear(), this.sessionHistoryListeners.clear(), this.interactionListeners.clear(), this.accountListeners.clear();
|
|
1219
|
+
this.destroyed = !0, this.unacknowledgedSubmissions.clear(), this.attachmentFiles.clear(), this.sessionHistoryListeners.clear(), this.interactionListeners.clear(), this.accountListeners.clear();
|
|
1207
1220
|
for (const e of Object.values(this.listeners)) e?.clear();
|
|
1208
1221
|
this.adapter.onDisconnect?.();
|
|
1209
1222
|
}
|
|
@@ -1243,7 +1256,11 @@ class Fo {
|
|
|
1243
1256
|
...i.length > 0 ? { attachments: i } : {},
|
|
1244
1257
|
clientMessageId: r
|
|
1245
1258
|
};
|
|
1246
|
-
return this.
|
|
1259
|
+
return this.unacknowledgedSubmissions.set(r, {
|
|
1260
|
+
message: { ...l, attachments: l.attachments?.map((c) => ({ ...c })) },
|
|
1261
|
+
sessionId: a.sessionId,
|
|
1262
|
+
userId: a.user?.id
|
|
1263
|
+
}), this.state = {
|
|
1247
1264
|
...this.state,
|
|
1248
1265
|
messages: [...this.state.messages, l],
|
|
1249
1266
|
pendingMessageStatus: "sending",
|
|
@@ -1296,7 +1313,7 @@ class Fo {
|
|
|
1296
1313
|
c.id && this.attachmentFiles.delete(c.id);
|
|
1297
1314
|
return r === this.stagedProactiveSuggestionClientMessageId && (this.stagedProactiveSuggestionClientMessageId = null), l?.clientMessageId ?? r;
|
|
1298
1315
|
} catch (l) {
|
|
1299
|
-
throw this.state = {
|
|
1316
|
+
throw this.unacknowledgedSubmissions.delete(r), this.state = {
|
|
1300
1317
|
...this.state,
|
|
1301
1318
|
messages: this.state.messages.filter(
|
|
1302
1319
|
(c) => c.id !== `local-${r}` && c.id !== `optimistic-user-message:${r}`
|
|
@@ -1332,11 +1349,11 @@ class Fo {
|
|
|
1332
1349
|
};
|
|
1333
1350
|
}
|
|
1334
1351
|
stop() {
|
|
1335
|
-
return this.dispatch({ type: "run.stop" }).then(() => {
|
|
1352
|
+
return this.unacknowledgedSubmissions.clear(), this.dispatch({ type: "run.stop" }).then(() => {
|
|
1336
1353
|
});
|
|
1337
1354
|
}
|
|
1338
1355
|
startNewSession(e = {}) {
|
|
1339
|
-
return e.notifyTransport === !1 ? Promise.resolve() : this.dispatch({ type: "session.new" }).then(() => {
|
|
1356
|
+
return this.unacknowledgedSubmissions.clear(), e.notifyTransport === !1 ? Promise.resolve() : this.dispatch({ type: "session.new" }).then(() => {
|
|
1340
1357
|
});
|
|
1341
1358
|
}
|
|
1342
1359
|
async listSessions(e = {}) {
|
|
@@ -1396,7 +1413,7 @@ class Fo {
|
|
|
1396
1413
|
return Promise.resolve();
|
|
1397
1414
|
}
|
|
1398
1415
|
loadSession(e) {
|
|
1399
|
-
return this.dispatch({ type: "session.load", sessionId: e }).then(() => {
|
|
1416
|
+
return this.unacknowledgedSubmissions.clear(), this.dispatch({ type: "session.load", sessionId: e }).then(() => {
|
|
1400
1417
|
});
|
|
1401
1418
|
}
|
|
1402
1419
|
stageProactiveSuggestionQuestion(e) {
|
|
@@ -1454,7 +1471,7 @@ function Xe(s) {
|
|
|
1454
1471
|
function Ft(s) {
|
|
1455
1472
|
return {
|
|
1456
1473
|
...s,
|
|
1457
|
-
data: s.data ?
|
|
1474
|
+
data: s.data ? Ee({
|
|
1458
1475
|
entities: As(s.data).map((e) => ({ ...e })),
|
|
1459
1476
|
nextCursor: s.data.nextCursor
|
|
1460
1477
|
}) : null
|
|
@@ -1569,7 +1586,7 @@ const Yn = "https://app.pluno.ai", Zn = 2e4, ei = 1e4, ti = 6e4, si = 6e4, ni =
|
|
|
1569
1586
|
".pdf:application/pdf",
|
|
1570
1587
|
".png:image/png",
|
|
1571
1588
|
".webp:image/webp"
|
|
1572
|
-
]), Wo = ".pdf,.png,.jpg,.jpeg,.webp", wt = 64e3, Ye = 4e3, At = 30, Si = 2e3, Ti = 1e3, Rs = "Image is too large for model vision input.", wi = 100, Ai = 20,
|
|
1589
|
+
]), Wo = ".pdf,.png,.jpg,.jpeg,.webp", wt = 64e3, Ye = 4e3, At = 30, Si = 2e3, Ti = 1e3, Rs = "Image is too large for model vision input.", wi = 100, Ai = 20, ks = "pluno.productAgent.state.", lt = "pluno.productAgent.pendingEvents.", Le = "pluno.productAgent.activeToolCalls.", Mi = 100;
|
|
1573
1590
|
function bi(s, e = 0) {
|
|
1574
1591
|
const t = s === 0 ? 0 : Math.min(3e4, 1e3 * 2 ** (s - 1));
|
|
1575
1592
|
return Math.max(e, t);
|
|
@@ -1580,7 +1597,7 @@ function Ri(s, e = Math.random) {
|
|
|
1580
1597
|
const t = Math.min(at, ai * 2 ** s), n = 1 - jt + e() * jt * 2;
|
|
1581
1598
|
return Math.min(at, Math.round(t * n));
|
|
1582
1599
|
}
|
|
1583
|
-
function
|
|
1600
|
+
function ki(s) {
|
|
1584
1601
|
const e = s.split(".")[1];
|
|
1585
1602
|
if (!e)
|
|
1586
1603
|
return null;
|
|
@@ -1591,7 +1608,7 @@ function Ei(s) {
|
|
|
1591
1608
|
return null;
|
|
1592
1609
|
}
|
|
1593
1610
|
}
|
|
1594
|
-
function
|
|
1611
|
+
function Ei(s) {
|
|
1595
1612
|
if (s instanceof J)
|
|
1596
1613
|
return s.retryable;
|
|
1597
1614
|
if (s && typeof s == "object") {
|
|
@@ -1912,7 +1929,7 @@ class Ne {
|
|
|
1912
1929
|
throw new J("Pluno token request was cancelled", !0);
|
|
1913
1930
|
if (!c)
|
|
1914
1931
|
throw new J("Pluno token provider did not return a token", !1);
|
|
1915
|
-
return this.token = c, this.tokenExpiresAtMs =
|
|
1932
|
+
return this.token = c, this.tokenExpiresAtMs = ki(c), c;
|
|
1916
1933
|
} finally {
|
|
1917
1934
|
a !== null && window.clearTimeout(a);
|
|
1918
1935
|
}
|
|
@@ -1984,7 +2001,7 @@ class Ne {
|
|
|
1984
2001
|
if (e !== this.connectionAttemptId || this.state.status === "closed")
|
|
1985
2002
|
return;
|
|
1986
2003
|
const n = Ci(t);
|
|
1987
|
-
if (
|
|
2004
|
+
if (Ei(t)) {
|
|
1988
2005
|
b("web-sdk.agent", "Pluno connection attempt failed; retrying", {
|
|
1989
2006
|
message: n.message,
|
|
1990
2007
|
reconnectAttempt: this.reconnectAttempts
|
|
@@ -3115,7 +3132,7 @@ class Ne {
|
|
|
3115
3132
|
const n = C(t);
|
|
3116
3133
|
if (!e || !n || !_e(n) || this.findStoppedTurn(e, n))
|
|
3117
3134
|
return;
|
|
3118
|
-
const i = O(n), r =
|
|
3135
|
+
const i = O(n), r = k(n), o = typeof n.clientMessageId == "string" ? n.clientMessageId : i ? this.clientMessageIdsByUserMessageItemId.get(i) ?? null : null;
|
|
3119
3136
|
this.stoppedTurns.push({
|
|
3120
3137
|
sessionId: e,
|
|
3121
3138
|
clientMessageId: o,
|
|
@@ -3390,7 +3407,7 @@ class Ne {
|
|
|
3390
3407
|
this.options.backendUrl
|
|
3391
3408
|
);
|
|
3392
3409
|
t === this.sessionActivityRequestId && (this.sessionActivityRequestId = null), this.setState({
|
|
3393
|
-
messages:
|
|
3410
|
+
messages: Er(this.state.messages, i)
|
|
3394
3411
|
});
|
|
3395
3412
|
return;
|
|
3396
3413
|
}
|
|
@@ -4365,7 +4382,7 @@ function Pi() {
|
|
|
4365
4382
|
}), M;
|
|
4366
4383
|
}, l = function(f, h) {
|
|
4367
4384
|
const p = i.call(this, f, h), y = Ze.get(this);
|
|
4368
|
-
return y && Object.keys(y.requestHeaders).length < At && (y.requestHeaders[f] =
|
|
4385
|
+
return y && Object.keys(y.requestHeaders).length < At && (y.requestHeaders[f] = kt(f, h), y.excluded = y.excluded || te(y.url, y.requestHeaders)), p;
|
|
4369
4386
|
}, c = function(f) {
|
|
4370
4387
|
try {
|
|
4371
4388
|
const h = Ze.get(this);
|
|
@@ -4793,7 +4810,7 @@ function Mt() {
|
|
|
4793
4810
|
};
|
|
4794
4811
|
t("Selected text", window.getSelection()?.toString() ?? "");
|
|
4795
4812
|
const n = "[role='dialog'], [role='alertdialog'], dialog[open], [aria-modal='true']", i = Array.from(document.querySelectorAll(n)).filter(
|
|
4796
|
-
(p) =>
|
|
4813
|
+
(p) => Es(p) && !p.parentElement?.closest(n)
|
|
4797
4814
|
);
|
|
4798
4815
|
for (const p of i.slice(0, 3))
|
|
4799
4816
|
t("Active overlay", tt(he(p), e));
|
|
@@ -4826,12 +4843,12 @@ function tt(s, e) {
|
|
|
4826
4843
|
t = t.replace(n, "");
|
|
4827
4844
|
return ne(t);
|
|
4828
4845
|
}
|
|
4829
|
-
function
|
|
4846
|
+
function Es(s) {
|
|
4830
4847
|
const e = window.getComputedStyle(s);
|
|
4831
4848
|
return e.display !== "none" && e.visibility !== "hidden" && s.getClientRects().length > 0;
|
|
4832
4849
|
}
|
|
4833
4850
|
function sr() {
|
|
4834
|
-
return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(
|
|
4851
|
+
return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(Es).sort((s, e) => he(e).length - he(s).length)[0] ?? null;
|
|
4835
4852
|
}
|
|
4836
4853
|
function nr(s, e) {
|
|
4837
4854
|
const t = /* @__PURE__ */ new Set([
|
|
@@ -4938,7 +4955,7 @@ function nr(s, e) {
|
|
|
4938
4955
|
const R = p(I), z = oe.get(R) ?? 0;
|
|
4939
4956
|
oe.set(R, z + 1), (V.get(R) ?? 0) > 8 && z >= 6 && !u.has(I) && me.set(R, (me.get(R) ?? 0) + 1);
|
|
4940
4957
|
}
|
|
4941
|
-
const j = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Set(), q = [],
|
|
4958
|
+
const j = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Set(), q = [], Et = [];
|
|
4942
4959
|
for (const I of B) {
|
|
4943
4960
|
const R = p(I), z = V.get(R) ?? 0, Pt = j.get(R) ?? 0;
|
|
4944
4961
|
if (j.set(R, Pt + 1), z > 8 && Pt >= 6 && !u.has(I)) {
|
|
@@ -4946,13 +4963,13 @@ function nr(s, e) {
|
|
|
4946
4963
|
continue;
|
|
4947
4964
|
}
|
|
4948
4965
|
const vt = S(I, N);
|
|
4949
|
-
|
|
4966
|
+
Et.push(vt), q.push(vt.lines);
|
|
4950
4967
|
}
|
|
4951
4968
|
const Fe = [];
|
|
4952
4969
|
if (T.shadowRoot)
|
|
4953
4970
|
for (const I of Array.from(T.shadowRoot.children))
|
|
4954
4971
|
I instanceof HTMLElement && Fe.push(S(I, N + 1));
|
|
4955
|
-
const ye = [...
|
|
4972
|
+
const ye = [...Et, ...Fe], We = ee.length > 0 || fe || ye.some((I) => I.hasUsefulContent), Ct = ne(
|
|
4956
4973
|
[ee, ...ye.map((I) => I.textPreview)].filter(Boolean).join(" ")
|
|
4957
4974
|
).slice(0, 180), Vs = T.hasAttribute("contenteditable") && (ee.length > 0 || !T.querySelector("[contenteditable]")), _t = c.some((I) => T.hasAttribute(I)) || !!Z || Vs, $e = (T.getClientRects().length > 0 || re.display === "contents") && (t.has(v) || _t || Y) && (We || Y) && (!i.has(v) || We || _t || Y), je = $e ? 1 : 0, ae = [];
|
|
4958
4975
|
if ($e) {
|
|
@@ -5261,10 +5278,10 @@ function Ue(s, e) {
|
|
|
5261
5278
|
e
|
|
5262
5279
|
),
|
|
5263
5280
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5264
|
-
...
|
|
5281
|
+
...E(i) !== null ? { displaySequence: E(i) } : {},
|
|
5265
5282
|
...P(i) !== null ? { causalSequence: P(i) } : {},
|
|
5266
5283
|
respondsToUserMessageId: O(i) ?? void 0,
|
|
5267
|
-
...
|
|
5284
|
+
...k(i) ? { runId: k(i) } : {},
|
|
5268
5285
|
dataType: "assistant_draft",
|
|
5269
5286
|
...i.steered === !0 ? { steered: !0 } : {}
|
|
5270
5287
|
};
|
|
@@ -5278,10 +5295,10 @@ function Ue(s, e) {
|
|
|
5278
5295
|
e
|
|
5279
5296
|
),
|
|
5280
5297
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5281
|
-
...
|
|
5298
|
+
...E(i) !== null ? { displaySequence: E(i) } : {},
|
|
5282
5299
|
...P(i) !== null ? { causalSequence: P(i) } : {},
|
|
5283
5300
|
respondsToUserMessageId: O(i) ?? void 0,
|
|
5284
|
-
...
|
|
5301
|
+
...k(i) ? { runId: k(i) } : {},
|
|
5285
5302
|
attachments: Ls(i.attachments, e),
|
|
5286
5303
|
...i.steered === !0 ? { steered: !0 } : {}
|
|
5287
5304
|
};
|
|
@@ -5304,24 +5321,24 @@ function Ue(s, e) {
|
|
|
5304
5321
|
role: "tool",
|
|
5305
5322
|
content: "",
|
|
5306
5323
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5307
|
-
...
|
|
5324
|
+
...E(i) !== null ? { displaySequence: E(i) } : {},
|
|
5308
5325
|
respondsToUserMessageId: O(i) ?? void 0,
|
|
5309
|
-
...
|
|
5326
|
+
...k(i) ? { runId: k(i) } : {},
|
|
5310
5327
|
dataType: "function_call_output",
|
|
5311
5328
|
toolName: Tt,
|
|
5312
5329
|
callId: ue(i) ?? void 0,
|
|
5313
5330
|
sharePromptAllowed: r
|
|
5314
5331
|
};
|
|
5315
|
-
const o =
|
|
5332
|
+
const o = kn(i.output);
|
|
5316
5333
|
if (o)
|
|
5317
5334
|
return {
|
|
5318
5335
|
id: String(t.id ?? crypto.randomUUID()),
|
|
5319
5336
|
role: "tool",
|
|
5320
5337
|
content: "",
|
|
5321
5338
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5322
|
-
...
|
|
5339
|
+
...E(i) !== null ? { displaySequence: E(i) } : {},
|
|
5323
5340
|
respondsToUserMessageId: O(i) ?? void 0,
|
|
5324
|
-
...
|
|
5341
|
+
...k(i) ? { runId: k(i) } : {},
|
|
5325
5342
|
dataType: "scheduled_check_in",
|
|
5326
5343
|
toolName: Is,
|
|
5327
5344
|
callId: ue(i) ?? void 0,
|
|
@@ -5334,10 +5351,10 @@ function Ue(s, e) {
|
|
|
5334
5351
|
role: "tool",
|
|
5335
5352
|
content: `Connect ${a.appName} to continue`,
|
|
5336
5353
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5337
|
-
...
|
|
5354
|
+
...E(i) !== null ? { displaySequence: E(i) } : {},
|
|
5338
5355
|
...P(i) !== null ? { causalSequence: P(i) } : {},
|
|
5339
5356
|
respondsToUserMessageId: O(i) ?? void 0,
|
|
5340
|
-
...
|
|
5357
|
+
...k(i) ? { runId: k(i) } : {},
|
|
5341
5358
|
dataType: "function_call_output",
|
|
5342
5359
|
toolName: "authenticate_pipedream_app",
|
|
5343
5360
|
callId: ue(i) ?? void 0,
|
|
@@ -5347,10 +5364,10 @@ function Ue(s, e) {
|
|
|
5347
5364
|
role: "tool",
|
|
5348
5365
|
content: "Connect WhatsApp to continue",
|
|
5349
5366
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5350
|
-
...
|
|
5367
|
+
...E(i) !== null ? { displaySequence: E(i) } : {},
|
|
5351
5368
|
...P(i) !== null ? { causalSequence: P(i) } : {},
|
|
5352
5369
|
respondsToUserMessageId: O(i) ?? void 0,
|
|
5353
|
-
...
|
|
5370
|
+
...k(i) ? { runId: k(i) } : {},
|
|
5354
5371
|
dataType: "function_call_output",
|
|
5355
5372
|
toolName: "request_personal_channel_connection",
|
|
5356
5373
|
callId: ue(i) ?? void 0,
|
|
@@ -5362,10 +5379,10 @@ function Ue(s, e) {
|
|
|
5362
5379
|
role: "tool",
|
|
5363
5380
|
content: i.type === "mcp_call" ? yr(i) : wr(i),
|
|
5364
5381
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5365
|
-
...
|
|
5382
|
+
...E(i) !== null ? { displaySequence: E(i) } : {},
|
|
5366
5383
|
...P(i) !== null ? { causalSequence: P(i) } : {},
|
|
5367
5384
|
respondsToUserMessageId: O(i) ?? void 0,
|
|
5368
|
-
...
|
|
5385
|
+
...k(i) ? { runId: k(i) } : {},
|
|
5369
5386
|
dataType: String(i.type),
|
|
5370
5387
|
toolName: i.type === "tab_lifecycle_decision" ? "tab_lifecycle_decision" : typeof i.name == "string" ? i.name : void 0,
|
|
5371
5388
|
callId: ue(i) ?? void 0,
|
|
@@ -5376,10 +5393,10 @@ function Ue(s, e) {
|
|
|
5376
5393
|
role: "system",
|
|
5377
5394
|
content: Tr(i),
|
|
5378
5395
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5379
|
-
...
|
|
5396
|
+
...E(i) !== null ? { displaySequence: E(i) } : {},
|
|
5380
5397
|
...P(i) !== null ? { causalSequence: P(i) } : {},
|
|
5381
5398
|
respondsToUserMessageId: O(i) ?? void 0,
|
|
5382
|
-
...
|
|
5399
|
+
...k(i) ? { runId: k(i) } : {},
|
|
5383
5400
|
dataType: String(i.type),
|
|
5384
5401
|
loading: i.steered !== !0 && i.type === "run_status" && (i.status === "running" || i.status === "retrying"),
|
|
5385
5402
|
...i.steered === !0 || i.type === "run_status" && i.status === "steered" ? { steered: !0 } : {},
|
|
@@ -5479,7 +5496,7 @@ function ue(s) {
|
|
|
5479
5496
|
function P(s) {
|
|
5480
5497
|
return typeof s.causalSequence == "number" && Number.isSafeInteger(s.causalSequence) ? s.causalSequence : null;
|
|
5481
5498
|
}
|
|
5482
|
-
function
|
|
5499
|
+
function E(s) {
|
|
5483
5500
|
return typeof s.displaySequence == "number" && Number.isSafeInteger(s.displaySequence) ? s.displaySequence : null;
|
|
5484
5501
|
}
|
|
5485
5502
|
function es(s) {
|
|
@@ -5494,7 +5511,7 @@ function de(s, e) {
|
|
|
5494
5511
|
const t = vs(
|
|
5495
5512
|
s,
|
|
5496
5513
|
bt(s, e)
|
|
5497
|
-
), n =
|
|
5514
|
+
), n = kr(
|
|
5498
5515
|
Rr(
|
|
5499
5516
|
Pr(
|
|
5500
5517
|
br(s, e),
|
|
@@ -5600,7 +5617,7 @@ function is(s) {
|
|
|
5600
5617
|
loading: !0
|
|
5601
5618
|
};
|
|
5602
5619
|
}
|
|
5603
|
-
function
|
|
5620
|
+
function kr(s, e) {
|
|
5604
5621
|
if (e.id.startsWith("transient-activity:"))
|
|
5605
5622
|
return s;
|
|
5606
5623
|
const t = e.toolName === "tab_lifecycle";
|
|
@@ -5626,7 +5643,7 @@ function ct(s, e) {
|
|
|
5626
5643
|
ut
|
|
5627
5644
|
);
|
|
5628
5645
|
}
|
|
5629
|
-
function
|
|
5646
|
+
function Er(s, e) {
|
|
5630
5647
|
const t = new Map(s.map((r) => [r.id, r])), n = e.map(
|
|
5631
5648
|
(r) => bt(s, r, !1)
|
|
5632
5649
|
);
|
|
@@ -5878,7 +5895,7 @@ function os(s, e, t, n, i, r) {
|
|
|
5878
5895
|
if (pe(o) || t !== null && typeof o.id == "string" && o.id !== t)
|
|
5879
5896
|
return !1;
|
|
5880
5897
|
const a = O(o);
|
|
5881
|
-
return n !== null ? a !== null ? a === n : i !== null &&
|
|
5898
|
+
return n !== null ? a !== null ? a === n : i !== null && k(o) === i && r === n : i === null || k(o) === i;
|
|
5882
5899
|
}
|
|
5883
5900
|
function Lr(s, e) {
|
|
5884
5901
|
for (let t = e - 1; t >= 0; t -= 1) {
|
|
@@ -6082,7 +6099,7 @@ function A(s, e) {
|
|
|
6082
6099
|
}
|
|
6083
6100
|
function Zr(s, e) {
|
|
6084
6101
|
try {
|
|
6085
|
-
const t = window.localStorage.getItem(`${
|
|
6102
|
+
const t = window.localStorage.getItem(`${ks}${s}`);
|
|
6086
6103
|
if (!t)
|
|
6087
6104
|
return null;
|
|
6088
6105
|
const n = JSON.parse(t), i = typeof n.sessionId == "string" ? n.sessionId : null;
|
|
@@ -6105,7 +6122,7 @@ function ft(s) {
|
|
|
6105
6122
|
function eo(s, e) {
|
|
6106
6123
|
try {
|
|
6107
6124
|
window.localStorage.setItem(
|
|
6108
|
-
`${
|
|
6125
|
+
`${ks}${s}`,
|
|
6109
6126
|
JSON.stringify({
|
|
6110
6127
|
sessionId: e.sessionId,
|
|
6111
6128
|
messages: e.messages.filter(ft).slice(-wi).map(ho)
|
|
@@ -6317,7 +6334,7 @@ function O(s) {
|
|
|
6317
6334
|
const e = s.respondsToUserMessageId;
|
|
6318
6335
|
return typeof e == "string" && e ? e : null;
|
|
6319
6336
|
}
|
|
6320
|
-
function
|
|
6337
|
+
function k(s) {
|
|
6321
6338
|
const e = s.runId;
|
|
6322
6339
|
return typeof e == "string" && e ? e : null;
|
|
6323
6340
|
}
|
|
@@ -6329,14 +6346,14 @@ function Bs(s) {
|
|
|
6329
6346
|
const e = {};
|
|
6330
6347
|
try {
|
|
6331
6348
|
new Headers(s).forEach((t, n) => {
|
|
6332
|
-
Object.keys(e).length < At && (e[n] =
|
|
6349
|
+
Object.keys(e).length < At && (e[n] = kt(n, t));
|
|
6333
6350
|
});
|
|
6334
6351
|
} catch {
|
|
6335
6352
|
return {};
|
|
6336
6353
|
}
|
|
6337
6354
|
return e;
|
|
6338
6355
|
}
|
|
6339
|
-
function
|
|
6356
|
+
function kt(s, e) {
|
|
6340
6357
|
return Ks(s) ? Be : F(xe(e), Si);
|
|
6341
6358
|
}
|
|
6342
6359
|
function go(s, e) {
|
|
@@ -6459,7 +6476,7 @@ function wo(s) {
|
|
|
6459
6476
|
if (Object.keys(e).length >= At)
|
|
6460
6477
|
break;
|
|
6461
6478
|
const i = t.slice(0, n).trim();
|
|
6462
|
-
e[i] =
|
|
6479
|
+
e[i] = kt(i, t.slice(n + 1).trim());
|
|
6463
6480
|
}
|
|
6464
6481
|
return e;
|
|
6465
6482
|
}
|
|
@@ -6501,7 +6518,7 @@ function bo(s) {
|
|
|
6501
6518
|
function Ro(s) {
|
|
6502
6519
|
return s === 401 || s === 403;
|
|
6503
6520
|
}
|
|
6504
|
-
const Be = "[REDACTED_SECRET]", $ = "[REDACTED_TOKEN]",
|
|
6521
|
+
const Be = "[REDACTED_SECRET]", $ = "[REDACTED_TOKEN]", ko = "[REDACTED_SIGNED_URL]", Eo = 20, Co = /^(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, Ws = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, $s = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, js = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, zs = /\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, _o = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, Po = /\bhttps?:\/\/[^\s"'<>]+/gi, vo = /[),.;\]]+$/;
|
|
6505
6522
|
function L(s) {
|
|
6506
6523
|
return Oe(s, 0, /* @__PURE__ */ new WeakSet());
|
|
6507
6524
|
}
|
|
@@ -6510,7 +6527,7 @@ function Oe(s, e, t) {
|
|
|
6510
6527
|
return s.startsWith("data:image/") || s.startsWith("data:application/pdf;") ? s : xe(s);
|
|
6511
6528
|
if (s === null || typeof s != "object")
|
|
6512
6529
|
return s;
|
|
6513
|
-
if (e >=
|
|
6530
|
+
if (e >= Eo)
|
|
6514
6531
|
return "[REDACTED_MAX_DEPTH]";
|
|
6515
6532
|
if (t.has(s))
|
|
6516
6533
|
return "[REDACTED_CIRCULAR]";
|
|
@@ -6539,7 +6556,7 @@ function Gs(s) {
|
|
|
6539
6556
|
}
|
|
6540
6557
|
}
|
|
6541
6558
|
function xe(s) {
|
|
6542
|
-
return s.replace(_o,
|
|
6559
|
+
return s.replace(_o, ko).replace(Po, qo).replace(Ws, `Bearer ${$}`).replace($s, `Basic ${$}`).replace(js, $).replace(zs, (e, t) => `${t}: ${Be}`);
|
|
6543
6560
|
}
|
|
6544
6561
|
function Do(s) {
|
|
6545
6562
|
return s.replace(Ws, `Bearer ${$}`).replace($s, `Basic ${$}`).replace(js, $).replace(zs, (e, t) => `${t}: ${Be}`);
|
|
@@ -6570,7 +6587,7 @@ export {
|
|
|
6570
6587
|
J as ProductAgentTokenProviderError,
|
|
6571
6588
|
Ri as calculateReconnectDelay,
|
|
6572
6589
|
Lo as createLocalStorageInteractionDecisionStorage,
|
|
6573
|
-
|
|
6590
|
+
ke as createProductAgentQueryState,
|
|
6574
6591
|
jo as createProductAgentRuntime,
|
|
6575
6592
|
Ho as createProductAgentTaskPageTitleDocument,
|
|
6576
6593
|
$o as default,
|
|
@@ -6578,7 +6595,7 @@ export {
|
|
|
6578
6595
|
Xi as getProductAgentOriginAccessErrorMessage,
|
|
6579
6596
|
Bo as isProductAgentRuntimeCommand,
|
|
6580
6597
|
vn as mergeProductAgentEntityPages,
|
|
6581
|
-
|
|
6598
|
+
Ee as normalizeProductAgentEntityPage,
|
|
6582
6599
|
st as normalizeProductAgentSessionItems,
|
|
6583
6600
|
Nn as readLocalStorageInteractionDecisions,
|
|
6584
6601
|
xo as resolveProductAgentComposerAction,
|