@pluno/product-agent-web 0.1.214 → 0.1.216
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 +90 -58
- package/dist/product-agent-sdk.js +616 -573
- package/dist/product-agent-widget.js +1502 -1486
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class Xs {
|
|
2
2
|
constructor(e, t, n) {
|
|
3
3
|
this.handlers = e, this.accept = t, this.errorAdapter = n;
|
|
4
4
|
}
|
|
@@ -37,7 +37,7 @@ class Qs {
|
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
class
|
|
40
|
+
class Ys {
|
|
41
41
|
state;
|
|
42
42
|
reducer;
|
|
43
43
|
selector;
|
|
@@ -47,7 +47,7 @@ class Js {
|
|
|
47
47
|
draining = !1;
|
|
48
48
|
disposed = !1;
|
|
49
49
|
constructor(e) {
|
|
50
|
-
this.state = e.initialState, this.reducer = e.reducer, this.selector = e.selector, this.effectRunner = new
|
|
50
|
+
this.state = e.initialState, this.reducer = e.reducer, this.selector = e.selector, this.effectRunner = new Xs(
|
|
51
51
|
e.effectHandlers,
|
|
52
52
|
(t) => this.acceptEffectResult(t),
|
|
53
53
|
e.errorAdapter
|
|
@@ -117,7 +117,7 @@ function it(s) {
|
|
|
117
117
|
const e = Object.getPrototypeOf(s);
|
|
118
118
|
return e !== Object.prototype && e !== null ? !1 : Object.values(s).every(it);
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Zs(s) {
|
|
121
121
|
if (s.details !== void 0 && !it(s.details))
|
|
122
122
|
throw new TypeError("Product Agent transported error details must be JSON-safe.");
|
|
123
123
|
return {
|
|
@@ -127,7 +127,7 @@ function Xs(s) {
|
|
|
127
127
|
...s.details === void 0 ? {} : { details: s.details }
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
|
-
const
|
|
130
|
+
const en = Object.freeze({
|
|
131
131
|
modelSelection: "legacy",
|
|
132
132
|
directory: "legacy",
|
|
133
133
|
conversation: "legacy",
|
|
@@ -136,18 +136,18 @@ const Ys = Object.freeze({
|
|
|
136
136
|
browserExecution: "legacy"
|
|
137
137
|
});
|
|
138
138
|
function Ut(s, e) {
|
|
139
|
-
const t =
|
|
139
|
+
const t = en[s], n = e[t];
|
|
140
140
|
if (!n) throw new Error(`No ${t} implementation for ${s}.`);
|
|
141
141
|
return n();
|
|
142
142
|
}
|
|
143
|
-
class
|
|
143
|
+
class tn {
|
|
144
144
|
// Stage 3 installs the Stage 1 engine/runner without shadow copies of legacy product slices.
|
|
145
|
-
engine = new
|
|
145
|
+
engine = new Ys({
|
|
146
146
|
initialState: Object.freeze({ revision: 0, slices: Object.freeze({}) }),
|
|
147
147
|
reducer: (e) => ({ state: e, effects: [] }),
|
|
148
148
|
selector: (e) => e,
|
|
149
149
|
effectHandlers: {},
|
|
150
|
-
errorAdapter: (e) =>
|
|
150
|
+
errorAdapter: (e) => Zs({
|
|
151
151
|
code: "runtime_error",
|
|
152
152
|
message: e instanceof Error ? e.message : String(e),
|
|
153
153
|
retryable: !1
|
|
@@ -169,16 +169,16 @@ class Zs {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
const Dt = 500;
|
|
172
|
-
function
|
|
172
|
+
function ys(s) {
|
|
173
173
|
const e = s.replace(/\n\s*at\s[\s\S]*$/, "").replace(/-----BEGIN [^-]*PRIVATE KEY-----[\s\S]*?(?:-----END [^-]*PRIVATE KEY-----|$)/g, "[REDACTED]").replace(/\b(?:set-cookie|cookie)\s*[:=]\s*[^\n]+/gi, "cookie=[REDACTED]").replace(/\bdata:[^\s<>"']+/gi, "[DATA]").replace(/\b(?:https?:\/\/|www\.)[^\s<>"']+/gi, "[URL]").replace(/\b(?:Bearer|Basic)\s+[^\s,;"']+/gi, "[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?/g, "[REDACTED]").replace(/\b(?:sk|pk|ghp|gho|github_pat|xoxb|xoxp)[-_][A-Za-z0-9_-]{8,}/g, "[REDACTED]").replace(/\b((?:access|refresh|id|auth)[_-]?token|api[_-]?key|client[_-]?secret|password|passwd|pwd|secret|token|jwt|authorization|cookie|set-cookie)\b["']?\s*[:=]\s*(?:"[^"]*"|'[^']*'|[^\s,;}&]+)/gi, "$1=[REDACTED]").replace(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi, "[EMAIL]").replace(/(?:[A-Z]:[\\/]|\\\\|(?:~|\.\.?)?\/|[\w.-]+[\\/])[^\s<>"']+/gi, "[FILE]").replace(new RegExp("(?<![\\w.])(?:[\\w.-]+\\.[A-Z][A-Z0-9]{0,15}|\\.[A-Z][\\w.-]*)\\b", "gi"), "[FILE]").replace(/\s+/g, " ").trim();
|
|
174
174
|
return e.length > Dt ? `${e.slice(0, Dt - 1)}…` : e;
|
|
175
175
|
}
|
|
176
|
-
const
|
|
177
|
-
async function
|
|
176
|
+
const sn = "pluno-product-agent-attachments", nn = 1, rt = "files", rn = 1440 * 60 * 1e3;
|
|
177
|
+
async function on(s) {
|
|
178
178
|
const e = await yt();
|
|
179
|
-
await
|
|
179
|
+
await cn(e, "readwrite", (t) => t.put(s));
|
|
180
180
|
}
|
|
181
|
-
async function
|
|
181
|
+
async function an(s, e) {
|
|
182
182
|
const t = await yt();
|
|
183
183
|
await It(t, "readwrite", async (n) => {
|
|
184
184
|
const i = await St(
|
|
@@ -190,7 +190,7 @@ async function rn(s, e) {
|
|
|
190
190
|
});
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
async function
|
|
193
|
+
async function ln(s = rn) {
|
|
194
194
|
const e = await yt(), t = Date.now() - s;
|
|
195
195
|
await It(e, "readwrite", async (n) => {
|
|
196
196
|
const i = n.index("lastUsedAt");
|
|
@@ -199,14 +199,14 @@ async function on(s = sn) {
|
|
|
199
199
|
}
|
|
200
200
|
function yt() {
|
|
201
201
|
return typeof indexedDB > "u" ? Promise.reject(new Error("Product Agent attachment storage is unavailable")) : new Promise((s, e) => {
|
|
202
|
-
const t = indexedDB.open(
|
|
202
|
+
const t = indexedDB.open(sn, nn);
|
|
203
203
|
t.onupgradeneeded = () => {
|
|
204
204
|
const i = t.result.createObjectStore(rt, { keyPath: "attachmentId" });
|
|
205
205
|
i.createIndex("lastUsedAt", "lastUsedAt", { unique: !1 }), i.createIndex("sessionId", "sessionId", { unique: !1 }), i.createIndex("origin", "origin", { unique: !1 });
|
|
206
206
|
}, t.onsuccess = () => s(t.result), t.onerror = () => e(t.error ?? new Error("Failed to open Product Agent attachment storage"));
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
-
async function
|
|
209
|
+
async function cn(s, e, t) {
|
|
210
210
|
return await It(s, e, async (n) => await St(t(n)));
|
|
211
211
|
}
|
|
212
212
|
function It(s, e, t) {
|
|
@@ -236,11 +236,11 @@ function St(s) {
|
|
|
236
236
|
s.onsuccess = () => e(s.result), s.onerror = () => t(s.error ?? new Error("Product Agent attachment storage request failed"));
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function un(s) {
|
|
240
240
|
return s !== null && (typeof s == "object" || typeof s == "function");
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
const n = Reflect.get(s, "pluno"), i =
|
|
242
|
+
function Is(s, e, t) {
|
|
243
|
+
const n = Reflect.get(s, "pluno"), i = un(n) ? n : {};
|
|
244
244
|
if (i !== n && !Reflect.set(s, "pluno", i))
|
|
245
245
|
return null;
|
|
246
246
|
const r = Object.getOwnPropertyDescriptor(i, e);
|
|
@@ -254,20 +254,20 @@ function ms(s, e, t) {
|
|
|
254
254
|
}
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const dn = /(\]\()(\/api\/product-agent\/attachments\/download\?[^)\s]+)(\))/g;
|
|
258
258
|
function qt(s, e) {
|
|
259
259
|
return e ? s.replace(
|
|
260
|
-
|
|
260
|
+
dn,
|
|
261
261
|
(t, n, i, r) => `${n}${new URL(i, e).toString()}${r}`
|
|
262
262
|
) : s;
|
|
263
263
|
}
|
|
264
264
|
const Tt = "suggest_share_on_socials";
|
|
265
|
-
function
|
|
265
|
+
function hn(s) {
|
|
266
266
|
for (let e = s.length - 1; e >= 0; e -= 1) {
|
|
267
267
|
const t = s[e];
|
|
268
268
|
if (t.role !== "tool" || t.toolName !== Tt || t.sharePromptAllowed !== void 0)
|
|
269
269
|
continue;
|
|
270
|
-
if (
|
|
270
|
+
if (gn(s, e, t.callId) !== !0)
|
|
271
271
|
return null;
|
|
272
272
|
const n = Ot(s, e, "assistant");
|
|
273
273
|
if (!n)
|
|
@@ -281,7 +281,7 @@ function un(s) {
|
|
|
281
281
|
}
|
|
282
282
|
return null;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function pn(s) {
|
|
285
285
|
let e = s;
|
|
286
286
|
if (typeof s == "string")
|
|
287
287
|
try {
|
|
@@ -289,10 +289,10 @@ function dn(s) {
|
|
|
289
289
|
} catch {
|
|
290
290
|
return null;
|
|
291
291
|
}
|
|
292
|
-
const t =
|
|
292
|
+
const t = fn(e);
|
|
293
293
|
return t ? typeof t.showSharePrompt == "boolean" ? t.showSharePrompt : t.ok === !0 && typeof t.message == "string" && t.message.includes("social-sharing prompt") ? !0 : null : null;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function gn(s, e, t) {
|
|
296
296
|
if (!t)
|
|
297
297
|
return null;
|
|
298
298
|
for (let n = e + 1; n < s.length; n += 1) {
|
|
@@ -310,14 +310,14 @@ function Ot(s, e, t) {
|
|
|
310
310
|
}
|
|
311
311
|
return null;
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function fn(s) {
|
|
314
314
|
return s && typeof s == "object" && !Array.isArray(s) ? s : null;
|
|
315
315
|
}
|
|
316
|
-
const
|
|
317
|
-
function
|
|
318
|
-
return (s.type === "function_call" || s.type === "tool_call") && s.name ===
|
|
316
|
+
const mn = "save_runtime_captured_skill";
|
|
317
|
+
function yn(s) {
|
|
318
|
+
return (s.type === "function_call" || s.type === "tool_call") && s.name === mn;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function In(s, e, t) {
|
|
321
321
|
const n = e.map((h) => ({ item: h, identity: t(h) })), i = new Set(
|
|
322
322
|
n.flatMap(
|
|
323
323
|
({ identity: h }) => h.isActivity && !h.isTransient ? h.activityKeys ?? [] : []
|
|
@@ -361,10 +361,10 @@ function xt(s, e, t, n) {
|
|
|
361
361
|
return !r.isActivity || !r.isTransient ? !0 : e !== null && r.respondsToUserMessageId !== void 0 ? r.respondsToUserMessageId !== e : t === null || r.runId !== t;
|
|
362
362
|
});
|
|
363
363
|
}
|
|
364
|
-
const Ke = "pluno.productAgent.transportId",
|
|
364
|
+
const Ke = "pluno.productAgent.transportId", Sn = "pluno.productAgent.transportIdentity", Ge = "pluno.productAgent.transportIdentity.event", Tn = 50, wn = globalThis.setTimeout.bind(globalThis);
|
|
365
365
|
let le = null;
|
|
366
366
|
const Re = /* @__PURE__ */ new Set(), Ve = /* @__PURE__ */ new Map();
|
|
367
|
-
async function
|
|
367
|
+
async function An(s = Ss()) {
|
|
368
368
|
const e = s.randomUUID(), t = s.storage.getItem(Ke);
|
|
369
369
|
let n = t ?? s.randomUUID(), i = !1, r = !1;
|
|
370
370
|
const o = s.channel.subscribe((l) => {
|
|
@@ -402,9 +402,9 @@ async function Tn(s = ys()) {
|
|
|
402
402
|
}
|
|
403
403
|
};
|
|
404
404
|
}
|
|
405
|
-
async function
|
|
406
|
-
le || (le =
|
|
407
|
-
...
|
|
405
|
+
async function bn(s = !1) {
|
|
406
|
+
le || (le = An({
|
|
407
|
+
...Ss(),
|
|
408
408
|
skipStoredIdentityCollisionCheck: s
|
|
409
409
|
}), le.then((i) => {
|
|
410
410
|
const r = (o) => {
|
|
@@ -412,7 +412,7 @@ async function wn(s = !1) {
|
|
|
412
412
|
};
|
|
413
413
|
window.addEventListener("pagehide", r);
|
|
414
414
|
}));
|
|
415
|
-
const e = await le, t =
|
|
415
|
+
const e = await le, t = Mn();
|
|
416
416
|
Re.add(t);
|
|
417
417
|
let n = !1;
|
|
418
418
|
return {
|
|
@@ -423,21 +423,21 @@ async function wn(s = !1) {
|
|
|
423
423
|
}
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Mn() {
|
|
427
427
|
let s = 0;
|
|
428
428
|
for (; Re.has(s); )
|
|
429
429
|
s += 1;
|
|
430
430
|
return s;
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function Ss() {
|
|
433
433
|
return {
|
|
434
|
-
storage:
|
|
435
|
-
channel:
|
|
434
|
+
storage: Rn(),
|
|
435
|
+
channel: kn(),
|
|
436
436
|
randomUUID: () => crypto.randomUUID(),
|
|
437
|
-
settle: () => new Promise((s) =>
|
|
437
|
+
settle: () => new Promise((s) => wn(s, Tn))
|
|
438
438
|
};
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function Rn() {
|
|
441
441
|
return {
|
|
442
442
|
getItem: (s) => {
|
|
443
443
|
try {
|
|
@@ -455,9 +455,9 @@ function bn() {
|
|
|
455
455
|
}
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function kn() {
|
|
459
459
|
if (typeof BroadcastChannel < "u") {
|
|
460
|
-
const s = new BroadcastChannel(
|
|
460
|
+
const s = new BroadcastChannel(Sn);
|
|
461
461
|
return {
|
|
462
462
|
postMessage: (e) => s.postMessage(e),
|
|
463
463
|
subscribe: (e) => {
|
|
@@ -467,9 +467,9 @@ function Mn() {
|
|
|
467
467
|
close: () => s.close()
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
|
-
return
|
|
470
|
+
return En();
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function En() {
|
|
473
473
|
const s = /* @__PURE__ */ new Set(), e = (t) => {
|
|
474
474
|
if (t.key !== Ge || !t.newValue)
|
|
475
475
|
return;
|
|
@@ -490,8 +490,8 @@ function Rn() {
|
|
|
490
490
|
}
|
|
491
491
|
};
|
|
492
492
|
}
|
|
493
|
-
const
|
|
494
|
-
function
|
|
493
|
+
const Ts = "schedule_follow_up";
|
|
494
|
+
function Cn(s) {
|
|
495
495
|
let e = s;
|
|
496
496
|
if (typeof e == "string")
|
|
497
497
|
try {
|
|
@@ -502,45 +502,45 @@ function kn(s) {
|
|
|
502
502
|
if (!e || typeof e != "object")
|
|
503
503
|
return null;
|
|
504
504
|
const t = e;
|
|
505
|
-
return t.ok !== !0 || t.toolName !==
|
|
505
|
+
return t.ok !== !0 || t.toolName !== Ts || typeof t.dueAt != "string" || Number.isNaN(Date.parse(t.dueAt)) ? null : {
|
|
506
506
|
id: typeof t.taskId == "string" && t.taskId ? t.taskId : null,
|
|
507
507
|
dueAt: t.dueAt
|
|
508
508
|
};
|
|
509
509
|
}
|
|
510
|
-
const
|
|
510
|
+
const _n = [
|
|
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: "$" }
|
|
514
|
-
],
|
|
514
|
+
], Pn = [
|
|
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
|
-
],
|
|
518
|
-
...
|
|
519
|
-
...
|
|
520
|
-
], Qe = (s) =>
|
|
517
|
+
], vn = [
|
|
518
|
+
..._n,
|
|
519
|
+
...Pn
|
|
520
|
+
], Qe = (s) => vn.some((e) => e.value === s);
|
|
521
521
|
function Lt(s, e) {
|
|
522
522
|
return s.filter((t, n) => {
|
|
523
523
|
const i = Nt(t);
|
|
524
|
-
return
|
|
524
|
+
return ws(i) ? !s.slice(n + 1).some((r) => {
|
|
525
525
|
const o = Nt(r);
|
|
526
|
-
return
|
|
526
|
+
return As(i, o) && bs(i, o);
|
|
527
527
|
}) : !0;
|
|
528
528
|
});
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function ws(s) {
|
|
531
531
|
return s.type === "run_status" && s.status === "stopped" && s.reason === "task_tab_closed";
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
return s.reason === "task_tab_closed" &&
|
|
533
|
+
function Un(s, e) {
|
|
534
|
+
return s.reason === "task_tab_closed" && bs(s, e) && As(s, e);
|
|
535
535
|
}
|
|
536
536
|
function Nt(s) {
|
|
537
537
|
return s.data && typeof s.data == "object" ? s.data : {};
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function As(s, e) {
|
|
540
540
|
const t = typeof s.runId == "string" ? s.runId : null, n = typeof e.runId == "string" ? e.runId : null;
|
|
541
|
-
return t && n && t === n ? !1 : e.type === "message" ? e.role === "assistant" : e.type === "run_status" ? !
|
|
541
|
+
return t && n && t === n ? !1 : e.type === "message" ? e.role === "assistant" : e.type === "run_status" ? !ws(e) : e.type === "run_error";
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function bs(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
546
|
function ke(s) {
|
|
@@ -638,28 +638,28 @@ function Ee(s) {
|
|
|
638
638
|
nextCursor: s.nextCursor
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function Dn(s, e, t) {
|
|
642
642
|
if (t === "replace" || s === null) return e;
|
|
643
643
|
const n = { ...s.entitiesById, ...e.entitiesById }, i = [...s.ids];
|
|
644
644
|
for (const r of e.ids)
|
|
645
645
|
s.entitiesById[r] || i.push(r);
|
|
646
646
|
return { entitiesById: n, ids: i, nextCursor: e.nextCursor };
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function Ms(s) {
|
|
649
649
|
return s ? s.ids.map((e) => s.entitiesById[e]).filter((e) => !!e) : [];
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function No(s) {
|
|
652
652
|
return s.visible ? s.minimized ? { state: "minimized" } : { state: s.open ? "visible_open" : "visible_closed" } : { state: "hidden" };
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function qn(s, e) {
|
|
655
655
|
return e === "limit_exceeded" ? { allowed: !1, reason: "credits_exhausted", actions: ["upgrade", "earn_credits"] } : e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required" ? { allowed: !1, reason: "payment_issue", actions: ["upgrade"] } : s ?? { allowed: !0, reason: "allowed", actions: [] };
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function On(s) {
|
|
658
658
|
if (!s || typeof s != "object") return !1;
|
|
659
659
|
const e = s.paidCreditFallbackModel;
|
|
660
660
|
return typeof e == "string" && e.length > 0;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function Ho(s) {
|
|
663
663
|
const e = s.hasDraftMessage || s.hasPreSubmittedAttachment;
|
|
664
664
|
return s.hasRunningAssistantTurn && !e ? {
|
|
665
665
|
action: "stop",
|
|
@@ -669,7 +669,7 @@ function xo(s) {
|
|
|
669
669
|
disabled: !e || !s.canSubmitMessage
|
|
670
670
|
};
|
|
671
671
|
}
|
|
672
|
-
class
|
|
672
|
+
class xn {
|
|
673
673
|
constructor(e, t, n = 20) {
|
|
674
674
|
this.loadPage = t, this.limit = n, this.recentQuery = new Ht(
|
|
675
675
|
`${e}:recent`,
|
|
@@ -679,7 +679,7 @@ class qn {
|
|
|
679
679
|
nextCursor: r.nextCursor
|
|
680
680
|
}))
|
|
681
681
|
),
|
|
682
|
-
|
|
682
|
+
Dn
|
|
683
683
|
), this.pinnedQuery = new Ht(
|
|
684
684
|
`${e}:pinned`,
|
|
685
685
|
async () => Ee({
|
|
@@ -712,7 +712,7 @@ class qn {
|
|
|
712
712
|
}) : null;
|
|
713
713
|
return {
|
|
714
714
|
key: e.key.slice(0, -7),
|
|
715
|
-
status:
|
|
715
|
+
status: Ln(e, t),
|
|
716
716
|
data: a,
|
|
717
717
|
error: e.error ?? t.error,
|
|
718
718
|
requestId: Math.max(e.requestId, t.requestId),
|
|
@@ -821,7 +821,7 @@ class qn {
|
|
|
821
821
|
function Ie(s) {
|
|
822
822
|
return s ? s.ids.map((e) => s.entitiesById[e]).filter((e) => !!e) : [];
|
|
823
823
|
}
|
|
824
|
-
function
|
|
824
|
+
function Ln(s, e) {
|
|
825
825
|
return s.status === "error" || e.status === "error" ? "error" : s.status === "loading" || e.status === "loading" ? "loading" : s.status === "refreshing" || e.status === "refreshing" ? "refreshing" : s.status === "loading_more" ? "loading_more" : s.status === "ready" || e.status === "ready" ? "ready" : "not_requested";
|
|
826
826
|
}
|
|
827
827
|
class Bt {
|
|
@@ -868,7 +868,7 @@ class Bt {
|
|
|
868
868
|
this.schedule(r, e);
|
|
869
869
|
}
|
|
870
870
|
}
|
|
871
|
-
class
|
|
871
|
+
class Nn {
|
|
872
872
|
constructor(e) {
|
|
873
873
|
this.options = e;
|
|
874
874
|
}
|
|
@@ -920,7 +920,7 @@ class xn {
|
|
|
920
920
|
);
|
|
921
921
|
}
|
|
922
922
|
}
|
|
923
|
-
class
|
|
923
|
+
class Hn {
|
|
924
924
|
constructor(e, t = null) {
|
|
925
925
|
this.storage = e, t && (this.decisions = new Map(
|
|
926
926
|
t.filter(ot).map((n) => [this.getDecisionKey(n), n])
|
|
@@ -973,7 +973,7 @@ class Ln {
|
|
|
973
973
|
async applyAction(e, t, n) {
|
|
974
974
|
if (!e.allowedActions.includes(t))
|
|
975
975
|
throw new Error(`Interaction ${e.key} does not allow ${t}.`);
|
|
976
|
-
if (!
|
|
976
|
+
if (!Rs(t))
|
|
977
977
|
throw new Error(`Interaction action ${t} is not a persistence decision.`);
|
|
978
978
|
const i = n.now ?? /* @__PURE__ */ new Date(), r = {
|
|
979
979
|
promptKey: e.key,
|
|
@@ -1009,13 +1009,13 @@ class Ln {
|
|
|
1009
1009
|
return `${Je(e.scope)}:category:${e.category}`;
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function Bo(s, e) {
|
|
1013
1013
|
return {
|
|
1014
|
-
load: async () =>
|
|
1014
|
+
load: async () => Bn(s, e),
|
|
1015
1015
|
save: async (t) => s.setItem(e, JSON.stringify(t))
|
|
1016
1016
|
};
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1018
|
+
function Bn(s, e) {
|
|
1019
1019
|
const t = s.getItem(e);
|
|
1020
1020
|
if (!t) return [];
|
|
1021
1021
|
const n = JSON.parse(t);
|
|
@@ -1024,26 +1024,26 @@ function Nn(s, e) {
|
|
|
1024
1024
|
function Je(s) {
|
|
1025
1025
|
return `${s.level}:${s.key}`;
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1027
|
+
function Rs(s) {
|
|
1028
1028
|
return s === "dismiss" || s === "later" || s === "snooze" || s === "never" || s === "dont_show_again";
|
|
1029
1029
|
}
|
|
1030
1030
|
function ot(s) {
|
|
1031
1031
|
if (!s || typeof s != "object") return !1;
|
|
1032
1032
|
const e = s;
|
|
1033
|
-
return typeof e.promptKey == "string" && typeof e.category == "string" && typeof e.decidedAt == "string" && (e.nextEligibleAt === null || typeof e.nextEligibleAt == "string") &&
|
|
1033
|
+
return typeof e.promptKey == "string" && typeof e.category == "string" && typeof e.decidedAt == "string" && (e.nextEligibleAt === null || typeof e.nextEligibleAt == "string") && Rs(e.action) && !!(e.scope && typeof e.scope == "object" && typeof e.scope.level == "string" && typeof e.scope.key == "string");
|
|
1034
1034
|
}
|
|
1035
|
-
const
|
|
1035
|
+
const Fn = {
|
|
1036
1036
|
working: "⏳",
|
|
1037
1037
|
completed: "✅",
|
|
1038
1038
|
failed: "❗",
|
|
1039
1039
|
stopped: "⏹️"
|
|
1040
|
-
},
|
|
1041
|
-
function
|
|
1040
|
+
}, Wn = /^(?:⌛|⏳|✅|❗|⏹️) Pluno(?:: )?/;
|
|
1041
|
+
function $n(s, e) {
|
|
1042
1042
|
if (!e) return ve(s);
|
|
1043
|
-
const t = ve(s), n = `${
|
|
1043
|
+
const t = ve(s), n = `${Fn[e]} Pluno`;
|
|
1044
1044
|
return t ? `${n}: ${t}` : n;
|
|
1045
1045
|
}
|
|
1046
|
-
class
|
|
1046
|
+
class Fo {
|
|
1047
1047
|
constructor(e) {
|
|
1048
1048
|
this.titleDocument = e;
|
|
1049
1049
|
}
|
|
@@ -1077,11 +1077,11 @@ class No {
|
|
|
1077
1077
|
applyTitle() {
|
|
1078
1078
|
if (!this.status)
|
|
1079
1079
|
return;
|
|
1080
|
-
const e =
|
|
1080
|
+
const e = $n(this.baseTitle, this.status);
|
|
1081
1081
|
this.lastAppliedTitle = e, this.titleDocument.getTitle() !== e && this.titleDocument.setTitle(e);
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
1084
|
-
function
|
|
1084
|
+
function Wo(s) {
|
|
1085
1085
|
return {
|
|
1086
1086
|
getTitle: () => s.title,
|
|
1087
1087
|
setTitle: (e) => {
|
|
@@ -1098,9 +1098,9 @@ function Ho(s) {
|
|
|
1098
1098
|
};
|
|
1099
1099
|
}
|
|
1100
1100
|
function ve(s) {
|
|
1101
|
-
return s.replace(
|
|
1101
|
+
return s.replace(Wn, "");
|
|
1102
1102
|
}
|
|
1103
|
-
const
|
|
1103
|
+
const jn = {
|
|
1104
1104
|
"duplicate-message-item": "A canonical message rendered more than once.",
|
|
1105
1105
|
"duplicate-canonical-item": "A canonical session item rendered more than once.",
|
|
1106
1106
|
"duplicate-tool-call": "A tool call rendered more than once.",
|
|
@@ -1113,10 +1113,21 @@ const Wn = {
|
|
|
1113
1113
|
"thinking-groups-without-user-message": "Multiple thinking groups appeared without a user message between them.",
|
|
1114
1114
|
"thinking-without-progress": "Thinking remained visible without progress for five minutes."
|
|
1115
1115
|
};
|
|
1116
|
-
function
|
|
1117
|
-
return typeof s == "string" && s.startsWith("ui_invariant:") && Object.prototype.hasOwnProperty.call(
|
|
1116
|
+
function zn(s) {
|
|
1117
|
+
return typeof s == "string" && s.startsWith("ui_invariant:") && Object.prototype.hasOwnProperty.call(jn, s.slice(13));
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function Ft(s) {
|
|
1120
|
+
return {
|
|
1121
|
+
...s.id === void 0 ? {} : { id: s.id },
|
|
1122
|
+
name: s.name,
|
|
1123
|
+
mimeType: s.mimeType,
|
|
1124
|
+
sizeBytes: s.sizeBytes,
|
|
1125
|
+
...s.sandboxPath === void 0 ? {} : { sandboxPath: s.sandboxPath },
|
|
1126
|
+
...s.storageKey === void 0 ? {} : { storageKey: s.storageKey },
|
|
1127
|
+
...s.fileUrl === void 0 ? {} : { fileUrl: s.fileUrl }
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
function $o(s) {
|
|
1120
1131
|
if (!s || typeof s != "object" || !("type" in s)) return !1;
|
|
1121
1132
|
const e = s;
|
|
1122
1133
|
switch (e.type) {
|
|
@@ -1130,7 +1141,7 @@ function Bo(s) {
|
|
|
1130
1141
|
case "runtime.report_displayed_error":
|
|
1131
1142
|
return (e.reason === "conversation_error" || e.reason === "attachment_error" || e.reason === "history_error" || e.reason === "action_error") && typeof e.errorFingerprint == "string" && /^fnv1a-[0-9a-f]{8}$/.test(e.errorFingerprint) && (e.displayedMessage === void 0 || typeof e.displayedMessage == "string" && e.displayedMessage.length <= 500);
|
|
1132
1143
|
case "runtime.report_invalid_state_transition":
|
|
1133
|
-
return (e.reason === "submitted_turn_returned_to_welcome_without_new_chat" || e.reason === "new_messages_button_without_user_scroll" ||
|
|
1144
|
+
return (e.reason === "submitted_turn_returned_to_welcome_without_new_chat" || e.reason === "new_messages_button_without_user_scroll" || zn(e.reason)) && (e.clientMessageId === void 0 || typeof e.clientMessageId == "string");
|
|
1134
1145
|
case "runtime.widget_lifecycle":
|
|
1135
1146
|
return (e.action === "opened" || e.action === "closed" || e.action === "minimized") && typeof e.trigger == "string";
|
|
1136
1147
|
case "session.load":
|
|
@@ -1157,7 +1168,7 @@ function Bo(s) {
|
|
|
1157
1168
|
return !1;
|
|
1158
1169
|
}
|
|
1159
1170
|
}
|
|
1160
|
-
class
|
|
1171
|
+
class jo {
|
|
1161
1172
|
constructor(e, t, n) {
|
|
1162
1173
|
this.adapter = t, this.state = Xe(e), this.model = n;
|
|
1163
1174
|
}
|
|
@@ -1187,16 +1198,24 @@ class Fo {
|
|
|
1187
1198
|
if (!this.destroyed) {
|
|
1188
1199
|
this.state = Xe(e);
|
|
1189
1200
|
for (const [o, a] of this.unacknowledgedSubmissions) {
|
|
1190
|
-
if (e.user?.id !== a.userId || a.sessionId !== null && e.sessionId !== a.sessionId
|
|
1191
|
-
(l) => l.clientMessageId === o
|
|
1192
|
-
)) {
|
|
1201
|
+
if (e.user?.id !== a.userId || a.sessionId !== null && e.sessionId !== a.sessionId) {
|
|
1193
1202
|
this.unacknowledgedSubmissions.delete(o);
|
|
1194
1203
|
continue;
|
|
1195
1204
|
}
|
|
1205
|
+
const l = this.state.messages.find(
|
|
1206
|
+
(c) => c.clientMessageId === o
|
|
1207
|
+
);
|
|
1208
|
+
if (l) {
|
|
1209
|
+
l.attachments = Kn(
|
|
1210
|
+
a.message.attachments,
|
|
1211
|
+
l.attachments
|
|
1212
|
+
), this.unacknowledgedSubmissions.delete(o);
|
|
1213
|
+
continue;
|
|
1214
|
+
}
|
|
1196
1215
|
a.sessionId ??= e.sessionId, this.state.messages.push(a.message), this.state.pendingMessageStatus = "sending", this.state.turnPhase ??= "sending", this.state.taskStatus ??= "working";
|
|
1197
1216
|
}
|
|
1198
1217
|
if (t !== void 0 && (this.model = t), n) {
|
|
1199
|
-
this.sessionHistoryState =
|
|
1218
|
+
this.sessionHistoryState = Wt(n);
|
|
1200
1219
|
for (const o of this.sessionHistoryListeners)
|
|
1201
1220
|
o(this.getSessionHistoryState());
|
|
1202
1221
|
}
|
|
@@ -1241,7 +1260,7 @@ class Fo {
|
|
|
1241
1260
|
type: "runtime.report_displayed_error",
|
|
1242
1261
|
reason: e,
|
|
1243
1262
|
errorFingerprint: t,
|
|
1244
|
-
...n ? { displayedMessage:
|
|
1263
|
+
...n ? { displayedMessage: ys(n) } : {}
|
|
1245
1264
|
}).catch(() => {
|
|
1246
1265
|
});
|
|
1247
1266
|
}
|
|
@@ -1283,7 +1302,8 @@ class Fo {
|
|
|
1283
1302
|
content: i,
|
|
1284
1303
|
clientMessageId: r,
|
|
1285
1304
|
proactiveSuggestionQuestion: t.proactiveSuggestionQuestion,
|
|
1286
|
-
|
|
1305
|
+
// Preview URLs belong to the renderer's optimistic snapshot and are not valid runtime-command metadata.
|
|
1306
|
+
attachments: o.length > 0 ? o.map(Ft) : void 0,
|
|
1287
1307
|
submittedAt: t.submittedAt
|
|
1288
1308
|
}), a = !0, o.length > 0) {
|
|
1289
1309
|
if (!this.adapter.uploadAttachment)
|
|
@@ -1308,7 +1328,7 @@ class Fo {
|
|
|
1308
1328
|
invocation: t.invocation,
|
|
1309
1329
|
proactiveSuggestionQuestion: t.proactiveSuggestionQuestion,
|
|
1310
1330
|
...t.automationOnboarding ? { automationOnboarding: !0 } : {},
|
|
1311
|
-
attachments: o.length > 0 ? o : void 0
|
|
1331
|
+
attachments: o.length > 0 ? o.map(Ft) : void 0
|
|
1312
1332
|
});
|
|
1313
1333
|
for (const c of t.attachments ?? [])
|
|
1314
1334
|
c.id && this.attachmentFiles.delete(c.id);
|
|
@@ -1361,12 +1381,12 @@ class Fo {
|
|
|
1361
1381
|
await this.dispatch({ type: "session.list", ...e });
|
|
1362
1382
|
const t = this.sessionHistoryState.data;
|
|
1363
1383
|
return {
|
|
1364
|
-
sessions:
|
|
1384
|
+
sessions: Ms(t),
|
|
1365
1385
|
nextCursor: t?.nextCursor ?? null
|
|
1366
1386
|
};
|
|
1367
1387
|
}
|
|
1368
1388
|
getSessionHistoryState() {
|
|
1369
|
-
return
|
|
1389
|
+
return Wt(this.sessionHistoryState);
|
|
1370
1390
|
}
|
|
1371
1391
|
subscribeSessionHistory(e) {
|
|
1372
1392
|
return this.sessionHistoryListeners.add(e), e(this.getSessionHistoryState()), () => this.sessionHistoryListeners.delete(e);
|
|
@@ -1445,6 +1465,18 @@ class Fo {
|
|
|
1445
1465
|
for (const i of n ?? []) i(t);
|
|
1446
1466
|
}
|
|
1447
1467
|
}
|
|
1468
|
+
function Kn(s, e) {
|
|
1469
|
+
if (!e || !s) return e;
|
|
1470
|
+
const t = /* @__PURE__ */ new Map();
|
|
1471
|
+
for (const n of s) {
|
|
1472
|
+
const i = n.previewUrl;
|
|
1473
|
+
n.id && i && t.set(n.id, i);
|
|
1474
|
+
}
|
|
1475
|
+
return e.map((n) => {
|
|
1476
|
+
const i = n.id ? t.get(n.id) : void 0;
|
|
1477
|
+
return i ? { ...n, previewUrl: i } : n;
|
|
1478
|
+
});
|
|
1479
|
+
}
|
|
1448
1480
|
function Xe(s) {
|
|
1449
1481
|
return {
|
|
1450
1482
|
...s,
|
|
@@ -1469,16 +1501,16 @@ function Xe(s) {
|
|
|
1469
1501
|
activeScheduledFollowUps: s.activeScheduledFollowUps?.map((e) => ({ ...e })) ?? null
|
|
1470
1502
|
};
|
|
1471
1503
|
}
|
|
1472
|
-
function
|
|
1504
|
+
function Wt(s) {
|
|
1473
1505
|
return {
|
|
1474
1506
|
...s,
|
|
1475
1507
|
data: s.data ? Ee({
|
|
1476
|
-
entities:
|
|
1508
|
+
entities: Ms(s.data).map((e) => ({ ...e })),
|
|
1477
1509
|
nextCursor: s.data.nextCursor
|
|
1478
1510
|
}) : null
|
|
1479
1511
|
};
|
|
1480
1512
|
}
|
|
1481
|
-
const
|
|
1513
|
+
const Gn = globalThis.fetch.bind(globalThis), $t = '.pluno-pa-widget-host[data-pluno-product-agent-ui="widget"]', Vn = '.pluno-pa-widget[data-pluno-product-agent-ui-root="widget"]', Qn = ".pluno-pa-widget__panel", Jn = ".pluno-pa-widget__timeline", Xn = "__plunoExtensionWidgetOwner";
|
|
1482
1514
|
class J extends Error {
|
|
1483
1515
|
constructor(e, t, n, i) {
|
|
1484
1516
|
super(e), this.retryable = t, this.status = n, this.retryAfterMs = i, this.name = "ProductAgentTokenProviderError";
|
|
@@ -1487,11 +1519,11 @@ class J extends Error {
|
|
|
1487
1519
|
status;
|
|
1488
1520
|
retryAfterMs;
|
|
1489
1521
|
}
|
|
1490
|
-
function
|
|
1522
|
+
function Yn(s) {
|
|
1491
1523
|
return s === "dismiss" || s === "later" || s === "snooze" || s === "never" || s === "dont_show_again";
|
|
1492
1524
|
}
|
|
1493
|
-
let
|
|
1494
|
-
function
|
|
1525
|
+
let Zn = 0;
|
|
1526
|
+
function jt(s) {
|
|
1495
1527
|
const e = {};
|
|
1496
1528
|
for (const l of [
|
|
1497
1529
|
"type",
|
|
@@ -1569,7 +1601,7 @@ function Se(s, e, t) {
|
|
|
1569
1601
|
source: "web_sdk",
|
|
1570
1602
|
category: s,
|
|
1571
1603
|
name: e,
|
|
1572
|
-
sequence: ++
|
|
1604
|
+
sequence: ++Zn,
|
|
1573
1605
|
wallTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1574
1606
|
monotonicMs: performance.now(),
|
|
1575
1607
|
data: t
|
|
@@ -1578,27 +1610,27 @@ function Se(s, e, t) {
|
|
|
1578
1610
|
}
|
|
1579
1611
|
class Te extends Error {
|
|
1580
1612
|
}
|
|
1581
|
-
function
|
|
1613
|
+
function ei(s) {
|
|
1582
1614
|
return s === 408 || s === 425 || s === 429 || s >= 500;
|
|
1583
1615
|
}
|
|
1584
|
-
const
|
|
1616
|
+
const ti = "https://app.pluno.ai", si = 2e4, ni = 1e4, ii = 6e4, ri = 6e4, oi = 1e4, ai = 1e4, li = 3e3, ci = 3e4, ui = 1e3, at = 3e4, zt = 0.2, di = 6e4, Kt = 15e3, hi = 6e4, pi = 8, gi = "Browser connection was interrupted.", Gt = 15e3, fi = "Pluno could not send this message. Try it again.", mi = "Still connecting to Pluno. Retrying automatically.", yi = 2e3, Ii = 1e3, Si = 100, Vt = 8e3, Qt = 3, Ti = [300, 1e3], ks = 50 * 1024 * 1024, wi = /* @__PURE__ */ new Set([
|
|
1585
1617
|
".jpeg:image/jpeg",
|
|
1586
1618
|
".jpg:image/jpeg",
|
|
1587
1619
|
".pdf:application/pdf",
|
|
1588
1620
|
".png:image/png",
|
|
1589
1621
|
".webp:image/webp"
|
|
1590
|
-
]),
|
|
1591
|
-
function
|
|
1622
|
+
]), zo = ".pdf,.png,.jpg,.jpeg,.webp", wt = 64e3, Ye = 4e3, At = 30, Ai = 2e3, bi = 1e3, Es = "Image is too large for model vision input.", Mi = 100, Ri = 20, Cs = "pluno.productAgent.state.", lt = "pluno.productAgent.pendingEvents.", Le = "pluno.productAgent.activeToolCalls.", ki = 100;
|
|
1623
|
+
function Ei(s, e = 0) {
|
|
1592
1624
|
const t = s === 0 ? 0 : Math.min(3e4, 1e3 * 2 ** (s - 1));
|
|
1593
1625
|
return Math.max(e, t);
|
|
1594
1626
|
}
|
|
1595
1627
|
const Ce = /* @__PURE__ */ new Set();
|
|
1596
1628
|
let we = null;
|
|
1597
|
-
function
|
|
1598
|
-
const t = Math.min(at,
|
|
1629
|
+
function Ci(s, e = Math.random) {
|
|
1630
|
+
const t = Math.min(at, ui * 2 ** s), n = 1 - zt + e() * zt * 2;
|
|
1599
1631
|
return Math.min(at, Math.round(t * n));
|
|
1600
1632
|
}
|
|
1601
|
-
function
|
|
1633
|
+
function _i(s) {
|
|
1602
1634
|
const e = s.split(".")[1];
|
|
1603
1635
|
if (!e)
|
|
1604
1636
|
return null;
|
|
@@ -1609,7 +1641,7 @@ function ki(s) {
|
|
|
1609
1641
|
return null;
|
|
1610
1642
|
}
|
|
1611
1643
|
}
|
|
1612
|
-
function
|
|
1644
|
+
function Pi(s) {
|
|
1613
1645
|
if (s instanceof J)
|
|
1614
1646
|
return s.retryable;
|
|
1615
1647
|
if (s && typeof s == "object") {
|
|
@@ -1619,7 +1651,7 @@ function Ei(s) {
|
|
|
1619
1651
|
}
|
|
1620
1652
|
return !0;
|
|
1621
1653
|
}
|
|
1622
|
-
function
|
|
1654
|
+
function vi(s) {
|
|
1623
1655
|
if (s instanceof Error)
|
|
1624
1656
|
return s;
|
|
1625
1657
|
if (s && typeof s == "object") {
|
|
@@ -1633,7 +1665,7 @@ function Ci(s) {
|
|
|
1633
1665
|
}
|
|
1634
1666
|
class Ne {
|
|
1635
1667
|
constructor(e, t) {
|
|
1636
|
-
this.options = e, this.transportIdentity = t, this.sessionHistoryManager = new
|
|
1668
|
+
this.options = e, this.transportIdentity = t, this.sessionHistoryManager = new xn(
|
|
1637
1669
|
e.clientId,
|
|
1638
1670
|
async ({ cursor: r, limit: o, pinned: a }) => await this.listSessions({ cursor: r, limit: o, pinned: a })
|
|
1639
1671
|
), this.sessionRecoveryPoller = new Bt({
|
|
@@ -1648,7 +1680,7 @@ class Ne {
|
|
|
1648
1680
|
activeIntervalMs: 3e3,
|
|
1649
1681
|
idleIntervalMs: 15e3,
|
|
1650
1682
|
maxFailureIntervalMs: 3e4
|
|
1651
|
-
}), this.sessionActivityRecovery = new
|
|
1683
|
+
}), this.sessionActivityRecovery = new Nn({
|
|
1652
1684
|
fetchPage: async (r, o) => await this.fetchSessionHistoryPageOnce(
|
|
1653
1685
|
r,
|
|
1654
1686
|
"activity",
|
|
@@ -1676,9 +1708,9 @@ class Ne {
|
|
|
1676
1708
|
maxFailureIntervalMs: 3e4
|
|
1677
1709
|
}), this.personalModelSelectionOverride = e.productVariant === "personal" && Qe(e.model) ? e.model : null, this.state = {
|
|
1678
1710
|
...this.state,
|
|
1679
|
-
starterPrompts:
|
|
1711
|
+
starterPrompts: hr(e.initialStarterPrompts)
|
|
1680
1712
|
}, this.account = e.initialAccount ? { ...e.initialAccount } : null;
|
|
1681
|
-
const n = e.restorePersistedState === !1 ? null :
|
|
1713
|
+
const n = e.restorePersistedState === !1 ? null : so(e.clientId, e.expectedPersistedSessionId);
|
|
1682
1714
|
n && (this.state = {
|
|
1683
1715
|
...this.state,
|
|
1684
1716
|
...n,
|
|
@@ -1699,9 +1731,9 @@ class Ne {
|
|
|
1699
1731
|
taskStatus: null,
|
|
1700
1732
|
isRetrying: !1,
|
|
1701
1733
|
lastError: null
|
|
1702
|
-
}, n.sessionId && this.rememberSessionTimeline(n.sessionId, this.state.messages)), this.queuedClientEvents =
|
|
1703
|
-
|
|
1704
|
-
|
|
1734
|
+
}, n.sessionId && this.rememberSessionTimeline(n.sessionId, this.state.messages)), this.queuedClientEvents = lo(
|
|
1735
|
+
io(e.clientId),
|
|
1736
|
+
ro(e.clientId)
|
|
1705
1737
|
);
|
|
1706
1738
|
const i = [...this.queuedClientEvents].reverse().find(
|
|
1707
1739
|
(r) => r.type === "chat.user_message" && typeof r.clientMessageId == "string"
|
|
@@ -1709,7 +1741,7 @@ class Ne {
|
|
|
1709
1741
|
i?.clientMessageId && (this.pendingClientMessageId = i.clientMessageId, this.pendingUserMessageEvent = i, this.state.pendingMessageStatus = "reconnecting", this.state.turnPhase = "sending"), Q(e.clientId, this.queuedClientEvents);
|
|
1710
1742
|
}
|
|
1711
1743
|
options;
|
|
1712
|
-
clientRuntime = new
|
|
1744
|
+
clientRuntime = new tn();
|
|
1713
1745
|
listeners = {};
|
|
1714
1746
|
socket = null;
|
|
1715
1747
|
reconnectTimer = null;
|
|
@@ -1748,7 +1780,7 @@ class Ne {
|
|
|
1748
1780
|
accountRefresh = null;
|
|
1749
1781
|
runtimeInteractions = [];
|
|
1750
1782
|
interactionListeners = /* @__PURE__ */ new Set();
|
|
1751
|
-
interactionManager = new
|
|
1783
|
+
interactionManager = new Hn(
|
|
1752
1784
|
{ load: async () => [], save: async () => {
|
|
1753
1785
|
} },
|
|
1754
1786
|
[]
|
|
@@ -1848,17 +1880,17 @@ class Ne {
|
|
|
1848
1880
|
lastErrorSecuritySettingsUrl: null
|
|
1849
1881
|
};
|
|
1850
1882
|
static async init(e) {
|
|
1851
|
-
const t = e, n = await
|
|
1883
|
+
const t = e, n = await bn(
|
|
1852
1884
|
t.skipStoredTransportIdentityCollisionCheck === !0
|
|
1853
1885
|
), i = new Ne({
|
|
1854
1886
|
...e,
|
|
1855
|
-
backendUrl:
|
|
1856
|
-
clientId: e.clientId ??
|
|
1887
|
+
backendUrl: Xi(e.backendUrl ?? ti),
|
|
1888
|
+
clientId: e.clientId ?? yr(),
|
|
1857
1889
|
productVariant: e.productVariant ?? "customer_embedded",
|
|
1858
|
-
entrySurface:
|
|
1890
|
+
entrySurface: Yi(e.entrySurface)
|
|
1859
1891
|
}, n);
|
|
1860
1892
|
try {
|
|
1861
|
-
|
|
1893
|
+
ln().catch((r) => {
|
|
1862
1894
|
M("web-sdk.attachments", "Failed to delete stale Product Agent attachments", {
|
|
1863
1895
|
message: r instanceof Error ? r.message : String(r)
|
|
1864
1896
|
});
|
|
@@ -1906,7 +1938,7 @@ class Ne {
|
|
|
1906
1938
|
return this.options.token;
|
|
1907
1939
|
if (!this.options.tokenProvider)
|
|
1908
1940
|
return this.token;
|
|
1909
|
-
const n = Date.now(), i = this.token !== null && this.tokenExpiresAtMs !== null && this.tokenExpiresAtMs -
|
|
1941
|
+
const n = Date.now(), i = this.token !== null && this.tokenExpiresAtMs !== null && this.tokenExpiresAtMs - ri > n;
|
|
1910
1942
|
if (!t.forceRefresh && (i || t.preferCached && this.token !== null))
|
|
1911
1943
|
return this.token;
|
|
1912
1944
|
if (this.tokenRequest && !t.forceRefresh)
|
|
@@ -1919,7 +1951,7 @@ class Ne {
|
|
|
1919
1951
|
const l = new Promise((c, u) => {
|
|
1920
1952
|
a = window.setTimeout(() => {
|
|
1921
1953
|
r.abort(), u(new J("Pluno token provider timed out", !0));
|
|
1922
|
-
},
|
|
1954
|
+
}, ii);
|
|
1923
1955
|
});
|
|
1924
1956
|
try {
|
|
1925
1957
|
const c = await Promise.race([
|
|
@@ -1930,7 +1962,7 @@ class Ne {
|
|
|
1930
1962
|
throw new J("Pluno token request was cancelled", !0);
|
|
1931
1963
|
if (!c)
|
|
1932
1964
|
throw new J("Pluno token provider did not return a token", !1);
|
|
1933
|
-
return this.token = c, this.tokenExpiresAtMs =
|
|
1965
|
+
return this.token = c, this.tokenExpiresAtMs = _i(c), c;
|
|
1934
1966
|
} finally {
|
|
1935
1967
|
a !== null && window.clearTimeout(a);
|
|
1936
1968
|
}
|
|
@@ -1956,10 +1988,10 @@ class Ne {
|
|
|
1956
1988
|
return;
|
|
1957
1989
|
if (!this.token && !this.options.webSocketFactory)
|
|
1958
1990
|
throw new J("Pluno requires a token or tokenProvider", !1);
|
|
1959
|
-
const t =
|
|
1991
|
+
const t = tr(this.options.backendUrl), n = this.options.webSocketFactory?.(t) ?? new WebSocket(t);
|
|
1960
1992
|
this.socket = n, this.socketConnectTimer = window.setTimeout(() => {
|
|
1961
1993
|
this.socket === n && n.readyState === WebSocket.CONNECTING && (M("web-sdk.agent", "Pluno socket opening timed out; reconnecting"), this.reportTransportDiagnostic("connect_timeout"), this.replaceTimedOutSocket(n));
|
|
1962
|
-
},
|
|
1994
|
+
}, oi), n.addEventListener("open", () => {
|
|
1963
1995
|
this.socket !== n || (this.clearSocketConnectTimer(), M("web-sdk.agent", "Pluno socket opened", {
|
|
1964
1996
|
queuedClientEventCount: this.queuedClientEvents.length,
|
|
1965
1997
|
isThinking: this.state.isThinking
|
|
@@ -1971,13 +2003,13 @@ class Ne {
|
|
|
1971
2003
|
pageUrl: location.href
|
|
1972
2004
|
}) : !0)) || (this.socketAuthTimer = window.setTimeout(() => {
|
|
1973
2005
|
this.socket === n && (M("web-sdk.agent", "Pluno socket authentication timed out; reconnecting"), this.reportTransportDiagnostic("auth_timeout"), this.replaceTimedOutSocket(n));
|
|
1974
|
-
},
|
|
2006
|
+
}, ai));
|
|
1975
2007
|
}), n.addEventListener("message", (i) => {
|
|
1976
|
-
this.socket === n && this.handleServerEvent(
|
|
2008
|
+
this.socket === n && this.handleServerEvent(ur(i.data));
|
|
1977
2009
|
}), n.addEventListener("sendfailure", (i) => {
|
|
1978
2010
|
if (this.socket !== n)
|
|
1979
2011
|
return;
|
|
1980
|
-
const r =
|
|
2012
|
+
const r = dr(i?.detail?.data);
|
|
1981
2013
|
r?.type === "chat.user_message" && r.clientMessageId === this.pendingClientMessageId && !this.queuedClientEvents.some(
|
|
1982
2014
|
(o) => o.type === "chat.user_message" && o.clientMessageId === r.clientMessageId
|
|
1983
2015
|
) && (this.queuedClientEvents.push(r), Q(this.options.clientId, this.queuedClientEvents), this.setState({ pendingMessageStatus: "reconnecting" })), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.socket = null, this.setReconnectingState(), this.scheduleReconnect(), n.readyState !== WebSocket.CLOSED && n.readyState !== WebSocket.CLOSING && n.close();
|
|
@@ -2001,14 +2033,14 @@ class Ne {
|
|
|
2001
2033
|
} catch (t) {
|
|
2002
2034
|
if (e !== this.connectionAttemptId || this.state.status === "closed")
|
|
2003
2035
|
return;
|
|
2004
|
-
const n =
|
|
2005
|
-
if (
|
|
2036
|
+
const n = vi(t);
|
|
2037
|
+
if (Pi(t)) {
|
|
2006
2038
|
M("web-sdk.agent", "Pluno connection attempt failed; retrying", {
|
|
2007
2039
|
message: n.message,
|
|
2008
2040
|
reconnectAttempt: this.reconnectAttempts
|
|
2009
2041
|
}), t instanceof J && this.reportTransportDiagnostic("auth_timeout"), this.setState({
|
|
2010
2042
|
status: "reconnecting",
|
|
2011
|
-
lastError:
|
|
2043
|
+
lastError: mi,
|
|
2012
2044
|
lastErrorCode: "connection_failed"
|
|
2013
2045
|
}), this.emit("error", n), this.scheduleReconnect(
|
|
2014
2046
|
t instanceof J ? t.retryAfterMs : void 0
|
|
@@ -2032,7 +2064,7 @@ class Ne {
|
|
|
2032
2064
|
}
|
|
2033
2065
|
destroy() {
|
|
2034
2066
|
if (!this.clientRuntime.isDisposed) {
|
|
2035
|
-
this.disconnect(), this.clearAllFirstResponseTimers(), this.locationChangeCleanup?.(), this.locationChangeCleanup = null, this.cleanupSessionBrowserApis(), this.pageLifecycleCleanup?.(), this.pageLifecycleCleanup = null, this.activeBrowserToolCalls.clear(),
|
|
2067
|
+
this.disconnect(), this.clearAllFirstResponseTimers(), this.locationChangeCleanup?.(), this.locationChangeCleanup = null, this.cleanupSessionBrowserApis(), this.pageLifecycleCleanup?.(), this.pageLifecycleCleanup = null, this.activeBrowserToolCalls.clear(), co(this.options.clientId), this.transportIdentity.release(), this.networkCaptureCleanup?.(), this.networkCaptureCleanup = null, this.networkBatchTimer !== null && (window.clearTimeout(this.networkBatchTimer), this.networkBatchTimer = null), this.queuedNetworkEvents = [], this.detachedSessionIds.clear(), this.detachedClientMessageIds.clear(), this.deferredDetachedSessionEvents.clear();
|
|
2036
2068
|
for (const e of Object.values(this.listeners))
|
|
2037
2069
|
e?.clear();
|
|
2038
2070
|
this.accountListeners.clear(), this.interactionListeners.clear(), this.clientRuntime.dispose();
|
|
@@ -2076,10 +2108,10 @@ class Ne {
|
|
|
2076
2108
|
async sendMessage(e, t = {}) {
|
|
2077
2109
|
return this.clientRuntime.route("conversation", { legacy: async () => {
|
|
2078
2110
|
const n = e.trim(), i = t.attachments ?? [];
|
|
2079
|
-
if (this.options.productVariant === "customer_embedded" && (i.forEach(
|
|
2111
|
+
if (this.options.productVariant === "customer_embedded" && (i.forEach(Fs), i.reduce(
|
|
2080
2112
|
(T, N) => T + N.sizeBytes,
|
|
2081
2113
|
0
|
|
2082
|
-
) >
|
|
2114
|
+
) > ks))
|
|
2083
2115
|
throw new Error("Embedded attachments must total at most 50 MB per message");
|
|
2084
2116
|
let r = i.map(qe);
|
|
2085
2117
|
if (!n && r.length === 0)
|
|
@@ -2172,7 +2204,7 @@ class Ne {
|
|
|
2172
2204
|
sessionId: this.state.sessionId ?? void 0,
|
|
2173
2205
|
clientMessageId: a,
|
|
2174
2206
|
initiatedBy: t.initiatedBy,
|
|
2175
|
-
invocation:
|
|
2207
|
+
invocation: Zi(t.invocation ?? t.initiatedBy),
|
|
2176
2208
|
entrySurface: this.options.entrySurface,
|
|
2177
2209
|
content: n,
|
|
2178
2210
|
proactiveSuggestionQuestion: t.proactiveSuggestionQuestion,
|
|
@@ -2181,7 +2213,7 @@ class Ne {
|
|
|
2181
2213
|
page: o,
|
|
2182
2214
|
model: this.options.model,
|
|
2183
2215
|
metadata: {
|
|
2184
|
-
...
|
|
2216
|
+
...Jt(this.options.metadata),
|
|
2185
2217
|
...t.automationOnboarding ? { automationOnboarding: !0 } : {}
|
|
2186
2218
|
}
|
|
2187
2219
|
};
|
|
@@ -2198,7 +2230,7 @@ class Ne {
|
|
|
2198
2230
|
this.reportHealthSignal("user_visible_error", {
|
|
2199
2231
|
reason: e,
|
|
2200
2232
|
errorFingerprint: t,
|
|
2201
|
-
...n ? { displayedMessage:
|
|
2233
|
+
...n ? { displayedMessage: ys(n) } : {}
|
|
2202
2234
|
});
|
|
2203
2235
|
}
|
|
2204
2236
|
getModel() {
|
|
@@ -2227,7 +2259,7 @@ class Ne {
|
|
|
2227
2259
|
} });
|
|
2228
2260
|
}
|
|
2229
2261
|
createLocalAttachment(e) {
|
|
2230
|
-
this.options.productVariant === "customer_embedded" &&
|
|
2262
|
+
this.options.productVariant === "customer_embedded" && uo(e);
|
|
2231
2263
|
const t = x(), n = {
|
|
2232
2264
|
id: t,
|
|
2233
2265
|
name: e.name || "attachment",
|
|
@@ -2236,7 +2268,7 @@ class Ne {
|
|
|
2236
2268
|
};
|
|
2237
2269
|
this.attachmentFiles.set(t, e);
|
|
2238
2270
|
const i = Date.now();
|
|
2239
|
-
return
|
|
2271
|
+
return on({
|
|
2240
2272
|
attachmentId: t,
|
|
2241
2273
|
name: n.name,
|
|
2242
2274
|
mimeType: n.mimeType,
|
|
@@ -2275,7 +2307,7 @@ class Ne {
|
|
|
2275
2307
|
sizeBytes: e.size,
|
|
2276
2308
|
page: _(),
|
|
2277
2309
|
model: this.options.model,
|
|
2278
|
-
metadata:
|
|
2310
|
+
metadata: Jt(this.options.metadata),
|
|
2279
2311
|
entrySurface: this.options.entrySurface
|
|
2280
2312
|
};
|
|
2281
2313
|
let o;
|
|
@@ -2301,8 +2333,8 @@ class Ne {
|
|
|
2301
2333
|
}, "Failed to upload attachment"), o = l;
|
|
2302
2334
|
}
|
|
2303
2335
|
this.setState({ sessionId: o.sessionId });
|
|
2304
|
-
const a =
|
|
2305
|
-
return this.updateAttachmentInState(t.id, a), t.id &&
|
|
2336
|
+
const a = Bs(o.attachment, this.options.backendUrl);
|
|
2337
|
+
return this.updateAttachmentInState(t.id, a), t.id && an(t.id, {
|
|
2306
2338
|
sessionId: o.sessionId,
|
|
2307
2339
|
fileUrl: a.fileUrl,
|
|
2308
2340
|
sandboxPath: a.sandboxPath,
|
|
@@ -2333,7 +2365,7 @@ class Ne {
|
|
|
2333
2365
|
const n = await this.fetchEmbedAttachmentUpload(e, !1);
|
|
2334
2366
|
if (n.ok)
|
|
2335
2367
|
return await n.json();
|
|
2336
|
-
if (
|
|
2368
|
+
if (Co(n.status) && this.options.tokenProvider && !t) {
|
|
2337
2369
|
t = !0;
|
|
2338
2370
|
const i = await this.fetchEmbedAttachmentUpload(e, !0);
|
|
2339
2371
|
if (i.ok)
|
|
@@ -2359,7 +2391,7 @@ class Ne {
|
|
|
2359
2391
|
if (!this.state.sessionId)
|
|
2360
2392
|
return;
|
|
2361
2393
|
this.send({ type: "run.stop", sessionId: this.state.sessionId, reason: "user_requested" });
|
|
2362
|
-
const e =
|
|
2394
|
+
const e = Kr(
|
|
2363
2395
|
this.state.messages,
|
|
2364
2396
|
this.state.assistantDraftRespondsToUserMessageId,
|
|
2365
2397
|
this.state.assistantDraftRunId,
|
|
@@ -2384,8 +2416,8 @@ class Ne {
|
|
|
2384
2416
|
}), this.stoppedTurns.splice(0, Math.max(0, this.stoppedTurns.length - 20));
|
|
2385
2417
|
for (const [t, n] of this.activeBrowserToolCalls)
|
|
2386
2418
|
n.event.sessionId === this.state.sessionId && this.activeBrowserToolCalls.delete(t);
|
|
2387
|
-
|
|
2388
|
-
messages:
|
|
2419
|
+
hs(this.options.clientId, this.activeBrowserToolCalls.values()), this.setState({
|
|
2420
|
+
messages: cs(
|
|
2389
2421
|
this.state.messages,
|
|
2390
2422
|
e.clientMessageId,
|
|
2391
2423
|
e.runId
|
|
@@ -2433,7 +2465,7 @@ class Ne {
|
|
|
2433
2465
|
const t = x(), n = new Promise((r, o) => {
|
|
2434
2466
|
const a = window.setTimeout(() => {
|
|
2435
2467
|
this.pendingSessionHistoryRequests.delete(t), o(new Error("Session history did not respond in time"));
|
|
2436
|
-
},
|
|
2468
|
+
}, Vt);
|
|
2437
2469
|
this.pendingSessionHistoryRequests.set(t, { resolve: r, reject: o, timeout: a });
|
|
2438
2470
|
}), i = {
|
|
2439
2471
|
type: "sessions.list",
|
|
@@ -2506,7 +2538,7 @@ class Ne {
|
|
|
2506
2538
|
throw new Error("This interaction is no longer available.");
|
|
2507
2539
|
if (!r.allowedActions.includes(t))
|
|
2508
2540
|
throw new Error("This action is not available for the interaction.");
|
|
2509
|
-
if (
|
|
2541
|
+
if (Yn(t) && await this.interactionManager.act(
|
|
2510
2542
|
{
|
|
2511
2543
|
key: r.id,
|
|
2512
2544
|
category: r.category,
|
|
@@ -2545,65 +2577,68 @@ class Ne {
|
|
|
2545
2577
|
this.tabGroupsPermissionNeeded = (await e.getState()).permissionNeeded;
|
|
2546
2578
|
} catch {
|
|
2547
2579
|
}
|
|
2548
|
-
const t
|
|
2549
|
-
|
|
2550
|
-
this.integrationAuthStatusByRequestId.
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2580
|
+
for (const t of ms(this.state.messages)) {
|
|
2581
|
+
if (!this.options.runtimeAdapters?.integrationAuthStatusLoader) break;
|
|
2582
|
+
const n = this.integrationAuthStatusByRequestId.get(t.authRequestId);
|
|
2583
|
+
if (!(n !== void 0 && n !== "pending")) {
|
|
2584
|
+
this.integrationAuthStatusByRequestId.set(t.authRequestId, "checking"), this.rebuildRuntimeInteractions();
|
|
2585
|
+
try {
|
|
2586
|
+
const i = await this.options.runtimeAdapters.integrationAuthStatusLoader(t);
|
|
2587
|
+
this.integrationAuthStatusByRequestId.set(t.authRequestId, i), this.integrationAuthErrorByRequestId.delete(t.authRequestId);
|
|
2588
|
+
} catch {
|
|
2589
|
+
this.integrationAuthStatusByRequestId.set(t.authRequestId, "error"), this.integrationAuthErrorByRequestId.set(t.authRequestId, "Could not check the connection status.");
|
|
2590
|
+
}
|
|
2556
2591
|
}
|
|
2557
2592
|
}
|
|
2558
2593
|
this.rebuildRuntimeInteractions();
|
|
2559
2594
|
}
|
|
2560
2595
|
rebuildRuntimeInteractions() {
|
|
2561
|
-
const e = [], t = this.options.productVariant === "personal" && (this.options.entrySurface === "main_web_chat" || this.options.entrySurface === "automation") ?
|
|
2596
|
+
const e = [], t = this.options.productVariant === "personal" && (this.options.entrySurface === "main_web_chat" || this.options.entrySurface === "automation") ? hn(this.state.messages) : null;
|
|
2562
2597
|
if (t) {
|
|
2563
|
-
const
|
|
2598
|
+
const i = {
|
|
2564
2599
|
key: t.id,
|
|
2565
2600
|
category: "social_share",
|
|
2566
2601
|
scope: this.state.user ? { level: "user", key: this.state.user.id } : { level: "session", key: this.state.sessionId ?? this.options.clientId },
|
|
2567
2602
|
allowedActions: ["dismiss", "dont_show_again"]
|
|
2568
|
-
},
|
|
2603
|
+
}, r = this.interactionManager.getStatus(i);
|
|
2569
2604
|
e.push({
|
|
2570
|
-
id:
|
|
2605
|
+
id: i.key,
|
|
2571
2606
|
kind: "social_share",
|
|
2572
|
-
category:
|
|
2573
|
-
scope:
|
|
2607
|
+
category: i.category,
|
|
2608
|
+
scope: i.scope,
|
|
2574
2609
|
payload: { candidate: t },
|
|
2575
2610
|
presentation: {
|
|
2576
2611
|
title: null,
|
|
2577
2612
|
body: "Share what Pluno helped you accomplish.",
|
|
2578
2613
|
actionLabels: { dismiss: "Not now", dont_show_again: "Don't show again" }
|
|
2579
2614
|
},
|
|
2580
|
-
eligible:
|
|
2581
|
-
status:
|
|
2582
|
-
allowedActions:
|
|
2583
|
-
decision: this.interactionManager.getDecision(
|
|
2615
|
+
eligible: r === "presentable",
|
|
2616
|
+
status: r,
|
|
2617
|
+
allowedActions: i.allowedActions,
|
|
2618
|
+
decision: this.interactionManager.getDecision(i),
|
|
2584
2619
|
eligibleAt: null,
|
|
2585
2620
|
expiresAt: null,
|
|
2586
2621
|
revision: 0
|
|
2587
2622
|
});
|
|
2588
2623
|
}
|
|
2589
|
-
const
|
|
2590
|
-
|
|
2591
|
-
const r = this.integrationAuthStatusByRequestId.get(
|
|
2624
|
+
for (const i of ms(this.state.messages)) {
|
|
2625
|
+
if (!this.options.runtimeAdapters?.integrationAuthHandler) break;
|
|
2626
|
+
const r = this.integrationAuthStatusByRequestId.get(i.authRequestId) ?? "pending", o = r === "completed";
|
|
2592
2627
|
e.push({
|
|
2593
|
-
id: `integration-connection:${
|
|
2628
|
+
id: `integration-connection:${i.authRequestId}`,
|
|
2594
2629
|
kind: "integration_connection",
|
|
2595
2630
|
category: "integration_connection",
|
|
2596
2631
|
scope: { level: "session", key: this.state.sessionId ?? this.options.clientId },
|
|
2597
2632
|
payload: {
|
|
2598
|
-
request:
|
|
2633
|
+
request: i,
|
|
2599
2634
|
status: r,
|
|
2600
|
-
error: this.integrationAuthErrorByRequestId.get(
|
|
2635
|
+
error: this.integrationAuthErrorByRequestId.get(i.authRequestId) ?? null
|
|
2601
2636
|
},
|
|
2602
2637
|
presentation: {
|
|
2603
|
-
title: `Connect ${
|
|
2604
|
-
body: `Connect ${
|
|
2638
|
+
title: `Connect ${i.appName}`,
|
|
2639
|
+
body: `Connect ${i.appName} securely in Pluno, then this task will continue automatically.`,
|
|
2605
2640
|
actionLabels: {
|
|
2606
|
-
connect: r === "expired" || r === "cancelled" ? `Reconnect ${
|
|
2641
|
+
connect: r === "expired" || r === "cancelled" ? `Reconnect ${i.appName}` : r === "error" ? "Try again" : "Connect"
|
|
2607
2642
|
}
|
|
2608
2643
|
},
|
|
2609
2644
|
eligible: !o,
|
|
@@ -2611,17 +2646,17 @@ class Ne {
|
|
|
2611
2646
|
allowedActions: ["connect"],
|
|
2612
2647
|
decision: null,
|
|
2613
2648
|
eligibleAt: null,
|
|
2614
|
-
expiresAt:
|
|
2649
|
+
expiresAt: i.expiresAt,
|
|
2615
2650
|
revision: 0
|
|
2616
2651
|
});
|
|
2617
2652
|
}
|
|
2618
|
-
const
|
|
2619
|
-
if (
|
|
2620
|
-
id: `personal-channel:${
|
|
2653
|
+
const n = [...this.state.messages].reverse().map((i) => i.personalChannelConnectionRequest).find((i) => !!i);
|
|
2654
|
+
if (n && this.options.runtimeAdapters?.personalChannelConnectionHandler && e.push({
|
|
2655
|
+
id: `personal-channel:${n.requestId}`,
|
|
2621
2656
|
kind: "personal_channel_connection",
|
|
2622
2657
|
category: "personal_channel_connection",
|
|
2623
2658
|
scope: { level: "session", key: this.state.sessionId ?? this.options.clientId },
|
|
2624
|
-
payload: { request:
|
|
2659
|
+
payload: { request: n },
|
|
2625
2660
|
presentation: {
|
|
2626
2661
|
title: "Connect WhatsApp",
|
|
2627
2662
|
body: "Connect WhatsApp to continue this task.",
|
|
@@ -2635,34 +2670,34 @@ class Ne {
|
|
|
2635
2670
|
expiresAt: null,
|
|
2636
2671
|
revision: 0
|
|
2637
2672
|
}), this.tabGroupsPermissionNeeded && this.state.sessionId) {
|
|
2638
|
-
const
|
|
2673
|
+
const i = {
|
|
2639
2674
|
key: `tab-group-permission:${this.state.sessionId}`,
|
|
2640
2675
|
category: "tab_group_permission",
|
|
2641
2676
|
scope: { level: "session", key: this.state.sessionId },
|
|
2642
2677
|
allowedActions: ["enable", "later"]
|
|
2643
|
-
},
|
|
2678
|
+
}, r = this.interactionManager.getStatus(i);
|
|
2644
2679
|
e.push({
|
|
2645
|
-
id:
|
|
2680
|
+
id: i.key,
|
|
2646
2681
|
kind: "tab_group_permission",
|
|
2647
|
-
category:
|
|
2648
|
-
scope:
|
|
2682
|
+
category: i.category,
|
|
2683
|
+
scope: i.scope,
|
|
2649
2684
|
payload: { permissionNeeded: !0 },
|
|
2650
2685
|
presentation: {
|
|
2651
2686
|
title: null,
|
|
2652
2687
|
body: "Group the tabs used in this Pluno session?",
|
|
2653
2688
|
actionLabels: { enable: "Enable grouping", later: "Not now" }
|
|
2654
2689
|
},
|
|
2655
|
-
eligible:
|
|
2656
|
-
status:
|
|
2657
|
-
allowedActions:
|
|
2658
|
-
decision: this.interactionManager.getDecision(
|
|
2690
|
+
eligible: r === "presentable",
|
|
2691
|
+
status: r,
|
|
2692
|
+
allowedActions: i.allowedActions,
|
|
2693
|
+
decision: this.interactionManager.getDecision(i),
|
|
2659
2694
|
eligibleAt: null,
|
|
2660
2695
|
expiresAt: null,
|
|
2661
2696
|
revision: 0
|
|
2662
2697
|
});
|
|
2663
2698
|
}
|
|
2664
2699
|
this.runtimeInteractions = e;
|
|
2665
|
-
for (const
|
|
2700
|
+
for (const i of this.interactionListeners) i(this.getInteractions());
|
|
2666
2701
|
}
|
|
2667
2702
|
getAccount() {
|
|
2668
2703
|
return this.clientRuntime.project("account", { legacy: () => this.account ? { ...this.account } : null });
|
|
@@ -2685,7 +2720,7 @@ class Ne {
|
|
|
2685
2720
|
return this.clientRuntime.route("directory", { legacy: () => {
|
|
2686
2721
|
const t = x(), n = this.activeComposerWarmupId;
|
|
2687
2722
|
this.state.sessionId && this.rememberSessionTimeline(this.state.sessionId, this.state.messages);
|
|
2688
|
-
const i = this.getCachedSessionTimeline(e), r = [...i ?? []].reverse().find((a) => a.dataType === "assistant_draft" && a.steered !== !0), o =
|
|
2723
|
+
const i = this.getCachedSessionTimeline(e), r = [...i ?? []].reverse().find((a) => a.dataType === "assistant_draft" && a.steered !== !0), o = jr(i ?? []);
|
|
2689
2724
|
!this.options.keepRunsActiveOnSessionNavigation && this.state.sessionId !== e && this.rememberCurrentRunAsDetached(), this.detachedSessionIds.delete(e), this.deferredDetachedSessionEvents.delete(e), !this.options.keepRunsActiveOnSessionNavigation && this.state.sessionId && (this.state.isThinking || this.state.pendingMessageStatus !== null) && this.send({ type: "run.stop", sessionId: this.state.sessionId, reason: "session_switch" }), this.options.keepRunsActiveOnSessionNavigation && (this.rememberCurrentRunAsBackground(), this.backgroundSessionIds.delete(e), this.deferredSessionUpdatedSessionIds.delete(e)), this.clearPendingComposerWarmup(), n && this.send({
|
|
2690
2725
|
type: "session.reset",
|
|
2691
2726
|
warmupId: n,
|
|
@@ -2820,7 +2855,7 @@ class Ne {
|
|
|
2820
2855
|
});
|
|
2821
2856
|
if (!c.ok) {
|
|
2822
2857
|
const d = await c.text() || `History request failed (${c.status})`;
|
|
2823
|
-
throw
|
|
2858
|
+
throw ei(c.status) ? new Error(d) : new Te(d);
|
|
2824
2859
|
}
|
|
2825
2860
|
const u = await c.json();
|
|
2826
2861
|
if (!u?.session || !Array.isArray(u.items))
|
|
@@ -2875,7 +2910,7 @@ class Ne {
|
|
|
2875
2910
|
return !1;
|
|
2876
2911
|
const t = this.socket;
|
|
2877
2912
|
try {
|
|
2878
|
-
return t.send(JSON.stringify(e)), Se("client_event", e.type,
|
|
2913
|
+
return t.send(JSON.stringify(e)), Se("client_event", e.type, jt(e)), !0;
|
|
2879
2914
|
} catch (n) {
|
|
2880
2915
|
return M("web-sdk.agent", "Pluno socket send failed; scheduling reconnect", {
|
|
2881
2916
|
message: n instanceof Error ? n.message : String(n),
|
|
@@ -2925,7 +2960,7 @@ class Ne {
|
|
|
2925
2960
|
clientMessageId: e,
|
|
2926
2961
|
durationMs: Date.now() - n
|
|
2927
2962
|
});
|
|
2928
|
-
}, Math.max(0,
|
|
2963
|
+
}, Math.max(0, hi - (Date.now() - n)));
|
|
2929
2964
|
this.firstResponseTimersByClientMessageId.set(e, { submittedAt: n, timer: i });
|
|
2930
2965
|
}
|
|
2931
2966
|
clearFirstResponseTimer(e) {
|
|
@@ -3035,7 +3070,7 @@ class Ne {
|
|
|
3035
3070
|
if (this.state.starterPromptsLoading || this.transientStarterPromptsRequestInFlight || this.transientStarterPromptsRequestAttempted)
|
|
3036
3071
|
return;
|
|
3037
3072
|
this.transientStarterPromptsRequestInFlight = !0, this.transientStarterPromptsRequestAttempted = !0, this.setState({ starterPromptsLoading: !0 });
|
|
3038
|
-
const e =
|
|
3073
|
+
const e = sr();
|
|
3039
3074
|
this.sendNow(
|
|
3040
3075
|
L({
|
|
3041
3076
|
type: "starter_prompts.page_context",
|
|
@@ -3046,13 +3081,13 @@ class Ne {
|
|
|
3046
3081
|
) || (this.transientStarterPromptsRequestInFlight = !1, this.transientStarterPromptsRequestAttempted = !1, this.setState({ starterPromptsLoading: !1 }));
|
|
3047
3082
|
}
|
|
3048
3083
|
startStarterPromptUrlWatcher() {
|
|
3049
|
-
this.locationChangeCleanup || (this.locationChangeCleanup =
|
|
3084
|
+
this.locationChangeCleanup || (this.locationChangeCleanup = nr(() => this.handleStarterPromptUrlChange()));
|
|
3050
3085
|
}
|
|
3051
3086
|
handleStarterPromptUrlChange() {
|
|
3052
3087
|
const e = location.href;
|
|
3053
3088
|
e !== this.lastStarterPromptPageUrl && (this.activeComposerWarmupScope && !this.activeComposerWarmupScope.endsWith(`:${e}`) && this.clearPendingComposerWarmup(), this.lastStarterPromptPageUrl = e, this.clearStarterPromptUrlRefreshTimer(), this.starterPromptUrlRefreshTimer = window.setTimeout(() => {
|
|
3054
3089
|
this.starterPromptUrlRefreshTimer = null, this.refreshStarterPromptsForCurrentUrl();
|
|
3055
|
-
},
|
|
3090
|
+
}, ki));
|
|
3056
3091
|
}
|
|
3057
3092
|
refreshStarterPromptsForCurrentUrl() {
|
|
3058
3093
|
this.socket?.readyState !== WebSocket.OPEN || this.state.status === "closed" || (this.setState({ starterPromptsLoading: this.state.messages.length === 0 }), this.sendNow({
|
|
@@ -3082,7 +3117,7 @@ class Ne {
|
|
|
3082
3117
|
}
|
|
3083
3118
|
rememberSessionTimeline(e, t) {
|
|
3084
3119
|
const n = [...t];
|
|
3085
|
-
for (this.sessionTimelineCache.delete(e), this.sessionTimelineCache.set(e, n); this.sessionTimelineCache.size >
|
|
3120
|
+
for (this.sessionTimelineCache.delete(e), this.sessionTimelineCache.set(e, n); this.sessionTimelineCache.size > Ri; ) {
|
|
3086
3121
|
const i = this.sessionTimelineCache.keys().next().value;
|
|
3087
3122
|
if (!i)
|
|
3088
3123
|
break;
|
|
@@ -3112,8 +3147,8 @@ class Ne {
|
|
|
3112
3147
|
return;
|
|
3113
3148
|
this.clearPendingWarmupAckTimer();
|
|
3114
3149
|
const t = Math.min(
|
|
3115
|
-
|
|
3116
|
-
|
|
3150
|
+
li * 2 ** e.retryAttempt,
|
|
3151
|
+
ci
|
|
3117
3152
|
);
|
|
3118
3153
|
e.retryAttempt += 1, this.pendingWarmupAckTimer = window.setTimeout(() => {
|
|
3119
3154
|
this.pendingWarmupAckTimer = null, this.flushPendingComposerWarmup();
|
|
@@ -3157,7 +3192,7 @@ class Ne {
|
|
|
3157
3192
|
if (!e || !t)
|
|
3158
3193
|
return;
|
|
3159
3194
|
const n = this.findStoppedTurn(e, t);
|
|
3160
|
-
!n || n.reason !== "task_tab_closed" ||
|
|
3195
|
+
!n || n.reason !== "task_tab_closed" || Un(n, t) && (this.stoppedTurns.splice(this.stoppedTurns.indexOf(n), 1), n.stoppedItemId && this.setState({
|
|
3161
3196
|
messages: this.state.messages.filter((i) => i.id !== n.stoppedItemId)
|
|
3162
3197
|
}));
|
|
3163
3198
|
}
|
|
@@ -3185,7 +3220,7 @@ class Ne {
|
|
|
3185
3220
|
});
|
|
3186
3221
|
}
|
|
3187
3222
|
handleServerEvent(e) {
|
|
3188
|
-
if (Se("server_event", e.type,
|
|
3223
|
+
if (Se("server_event", e.type, jt(e)), e.type === "session.subscribed") {
|
|
3189
3224
|
const t = typeof e.requestId == "string" ? e.requestId : null, n = typeof e.sessionId == "string" ? e.sessionId : null;
|
|
3190
3225
|
if (t && n && t === this.pendingSessionSubscription?.requestId && n === this.pendingSessionSubscription.sessionId) {
|
|
3191
3226
|
const i = this.pendingSessionSubscription;
|
|
@@ -3236,7 +3271,7 @@ class Ne {
|
|
|
3236
3271
|
}
|
|
3237
3272
|
}
|
|
3238
3273
|
if (!this.shouldIgnoreStoppedTurnEvent(e) && (this.updateInactiveSessionTimelineCache(e), !this.shouldIgnoreBackgroundSessionEvent(e))) {
|
|
3239
|
-
if (
|
|
3274
|
+
if (Oi(e) && this.clearFirstResponseTimer(this.activeClientMessageId), e.type === "run.steered") {
|
|
3240
3275
|
this.handleRunSteered(e);
|
|
3241
3276
|
return;
|
|
3242
3277
|
}
|
|
@@ -3251,17 +3286,17 @@ class Ne {
|
|
|
3251
3286
|
this.activeResponseRunId = t, this.setState({ turnPhase: "thinking", lastError: null }), this.markThinkingProgress();
|
|
3252
3287
|
return;
|
|
3253
3288
|
}
|
|
3254
|
-
if (
|
|
3289
|
+
if (qi(e) && this.markThinkingProgress(), e.type === "auth.ok") {
|
|
3255
3290
|
this.clearSocketAuthTimer(), this.reconnectAttempts = 0, this.transportDiagnosticEpisodes.clear();
|
|
3256
|
-
const t =
|
|
3291
|
+
const t = Ir(e.user);
|
|
3257
3292
|
this.authenticatedSocket !== this.socket && this.authenticatedUserId && t && t.id !== this.authenticatedUserId && this.resetForAuthenticationScopeChange(), this.authenticatedUserId = t?.id ?? null, this.authenticatedSocket = this.socket, this.flushPendingWidgetLifecycleEvents(), this.flushPendingComposerWarmup(), this.flushQueuedClientEvents(), this.pendingClientMessageId && (this.setState({ pendingMessageStatus: "sending" }), this.schedulePendingDeliveryAck(this.pendingClientMessageId)), this.flushPendingPassiveWarmup(), this.startHeartbeat();
|
|
3258
|
-
const n =
|
|
3293
|
+
const n = pr(e), i = Object.prototype.hasOwnProperty.call(e, "appearance");
|
|
3259
3294
|
M("web-sdk.agent", "Received auth.ok appearance", {
|
|
3260
3295
|
hasAppearance: i,
|
|
3261
3296
|
rawAppearance: e.appearance,
|
|
3262
3297
|
normalizedAppearance: n
|
|
3263
|
-
}), this.runtimeHelperJavascript =
|
|
3264
|
-
const r =
|
|
3298
|
+
}), this.runtimeHelperJavascript = gr(e.runtimeHelpers)?.javascript ?? null;
|
|
3299
|
+
const r = Zt(e, "starterPrompts"), o = Object.prototype.hasOwnProperty.call(e, "starterPrompts"), a = e.starterPromptsLoading === !0, l = {
|
|
3265
3300
|
user: t,
|
|
3266
3301
|
status: "connected",
|
|
3267
3302
|
...this.state.lastErrorCode === "connection_failed" ? { lastError: null, lastErrorCode: null } : {}
|
|
@@ -3280,14 +3315,14 @@ class Ne {
|
|
|
3280
3315
|
}
|
|
3281
3316
|
if (e.type === "starterPrompts.updated") {
|
|
3282
3317
|
this.transientStarterPromptsRequestInFlight = !1, this.transientStarterPromptsRequestAttempted = !0, this.setState({
|
|
3283
|
-
starterPrompts:
|
|
3318
|
+
starterPrompts: Zt(e, "starterPrompts"),
|
|
3284
3319
|
starterPromptsLoading: !1
|
|
3285
3320
|
});
|
|
3286
3321
|
return;
|
|
3287
3322
|
}
|
|
3288
3323
|
if (e.type === "scheduled_follow_ups.updated") {
|
|
3289
3324
|
typeof e.sessionId == "string" && e.sessionId === this.state.sessionId && this.setState({
|
|
3290
|
-
activeScheduledFollowUps:
|
|
3325
|
+
activeScheduledFollowUps: es(
|
|
3291
3326
|
e.activeScheduledFollowUps
|
|
3292
3327
|
)
|
|
3293
3328
|
});
|
|
@@ -3311,7 +3346,7 @@ class Ne {
|
|
|
3311
3346
|
runId: u?.runId
|
|
3312
3347
|
}), g = this.filterStoppedSnapshotItems(n, r), f = e.pendingMessageStatus === "sending" ? "sending" : e.pendingMessageStatus === "queued" ? "reconnecting" : null, h = typeof e.pendingClientMessageId == "string" ? e.pendingClientMessageId : null, p = e.isRetrying === !0, y = e.turnPhase === "sending" || e.turnPhase === "starting" || e.turnPhase === "thinking" ? e.turnPhase : null;
|
|
3313
3348
|
f && h && (this.pendingClientMessageId = h);
|
|
3314
|
-
let m =
|
|
3349
|
+
let m = kr(
|
|
3315
3350
|
e.assistantDraft
|
|
3316
3351
|
);
|
|
3317
3352
|
m && this.findStoppedTurn(r, {
|
|
@@ -3320,31 +3355,31 @@ class Ne {
|
|
|
3320
3355
|
}) && (m = void 0);
|
|
3321
3356
|
const b = m !== void 0;
|
|
3322
3357
|
this.rememberUserMessageClientMessageIds(g);
|
|
3323
|
-
const w =
|
|
3358
|
+
const w = Hr(g), D = g.filter((U) => {
|
|
3324
3359
|
const q = C(U);
|
|
3325
|
-
return
|
|
3360
|
+
return Lr(q) ? !1 : !q || !w || !pe(q) ? !0 : ht(g, q) !== w;
|
|
3326
3361
|
}), S = ct(
|
|
3327
3362
|
this.state.messages,
|
|
3328
3363
|
st(D, this.options.backendUrl)
|
|
3329
|
-
), T =
|
|
3330
|
-
(U, q) =>
|
|
3364
|
+
), T = os(S), N = b ? m?.content ?? "" : this.state.assistantDraft, v = b ? m?.itemId ?? null : this.state.assistantDraftItemId, re = b ? m?.respondsToUserMessageId ?? null : this.state.assistantDraftRespondsToUserMessageId, Y = b ? m?.runId ?? null : this.state.assistantDraftRunId, Z = g.some(
|
|
3365
|
+
(U, q) => as(
|
|
3331
3366
|
C(U),
|
|
3332
3367
|
N,
|
|
3333
3368
|
v,
|
|
3334
3369
|
re,
|
|
3335
3370
|
Y,
|
|
3336
|
-
|
|
3371
|
+
Br(g, q)
|
|
3337
3372
|
)
|
|
3338
|
-
), ee = b ? m?.content ?? "" : this.state.assistantDraft, fe = !!m?.content && !Z, B = T && (!ee || Z), V =
|
|
3339
|
-
if (!T &&
|
|
3373
|
+
), ee = b ? m?.content ?? "" : this.state.assistantDraft, fe = !!m?.content && !Z, B = T && (!ee || Z), V = Or(S), oe = B && V ? "completed" : d ? "stopped" : B ? "failed" : null;
|
|
3374
|
+
if (!T && Nr(this.state.messages, g))
|
|
3340
3375
|
return;
|
|
3341
|
-
this.lastUserMessagePageUrl =
|
|
3376
|
+
this.lastUserMessagePageUrl = xr(g);
|
|
3342
3377
|
const j = B || d ? null : dt(g);
|
|
3343
3378
|
if (this.latestRecoverableClientMessageId = j, V && this.clearRetryTimers(), this.setState({
|
|
3344
3379
|
sessionId: A(e.session, "id") ?? this.state.sessionId,
|
|
3345
3380
|
messages: S,
|
|
3346
3381
|
...i ? {
|
|
3347
|
-
activeScheduledFollowUps:
|
|
3382
|
+
activeScheduledFollowUps: es(
|
|
3348
3383
|
e.activeScheduledFollowUps
|
|
3349
3384
|
)
|
|
3350
3385
|
} : {},
|
|
@@ -3411,14 +3446,14 @@ class Ne {
|
|
|
3411
3446
|
this.options.backendUrl
|
|
3412
3447
|
);
|
|
3413
3448
|
t === this.sessionActivityRequestId && (this.sessionActivityRequestId = null), this.setState({
|
|
3414
|
-
messages:
|
|
3449
|
+
messages: Pr(this.state.messages, i)
|
|
3415
3450
|
});
|
|
3416
3451
|
return;
|
|
3417
3452
|
}
|
|
3418
3453
|
if (e.type === "sessions.page") {
|
|
3419
3454
|
const t = typeof e.requestId == "string" ? e.requestId : null, n = t ? this.pendingSessionHistoryRequests.get(t) : null;
|
|
3420
3455
|
t && n && (window.clearTimeout(n.timeout), this.pendingSessionHistoryRequests.delete(t), n.resolve({
|
|
3421
|
-
sessions:
|
|
3456
|
+
sessions: Sr(e.sessions),
|
|
3422
3457
|
nextCursor: typeof e.nextCursor == "string" ? e.nextCursor : null
|
|
3423
3458
|
}));
|
|
3424
3459
|
return;
|
|
@@ -3453,15 +3488,15 @@ class Ne {
|
|
|
3453
3488
|
}
|
|
3454
3489
|
const n = Ue(e.item, this.options.backendUrl);
|
|
3455
3490
|
if (n) {
|
|
3456
|
-
const i =
|
|
3457
|
-
n.callId && r !== void 0 && (n.loading = r, this.pendingToolLoadingByCallId.delete(n.callId)), W(n) && (this.retryableClientMessageId = null, this.clearRetryTimers(), this.clearRunAckResyncRetryTimer()),
|
|
3458
|
-
const o = de(this.state.messages, n), a =
|
|
3491
|
+
const i = Gr(t, n), r = n.callId ? this.pendingToolLoadingByCallId.get(n.callId) : void 0;
|
|
3492
|
+
n.callId && r !== void 0 && (n.loading = r, this.pendingToolLoadingByCallId.delete(n.callId)), W(n) && (this.retryableClientMessageId = null, this.clearRetryTimers(), this.clearRunAckResyncRetryTimer()), Wr(t) && this.clearRunAckResyncRetryTimer();
|
|
3493
|
+
const o = de(this.state.messages, n), a = os(o), l = as(
|
|
3459
3494
|
t,
|
|
3460
3495
|
this.state.assistantDraft,
|
|
3461
3496
|
this.state.assistantDraftItemId,
|
|
3462
3497
|
this.state.assistantDraftRespondsToUserMessageId,
|
|
3463
3498
|
this.state.assistantDraftRunId,
|
|
3464
|
-
|
|
3499
|
+
xs(
|
|
3465
3500
|
o,
|
|
3466
3501
|
o.findIndex((d) => d.id === n.id)
|
|
3467
3502
|
)
|
|
@@ -3537,7 +3572,7 @@ class Ne {
|
|
|
3537
3572
|
);
|
|
3538
3573
|
this.setState({
|
|
3539
3574
|
sessionId: t,
|
|
3540
|
-
messages:
|
|
3575
|
+
messages: ss(
|
|
3541
3576
|
l,
|
|
3542
3577
|
typeof e.responseId == "string" ? e.responseId : null,
|
|
3543
3578
|
n,
|
|
@@ -3560,9 +3595,9 @@ class Ne {
|
|
|
3560
3595
|
if (t)
|
|
3561
3596
|
this.nonTranscriptToolCallIds.add(t);
|
|
3562
3597
|
else {
|
|
3563
|
-
const n =
|
|
3598
|
+
const n = rs(e);
|
|
3564
3599
|
if (n) {
|
|
3565
|
-
const i =
|
|
3600
|
+
const i = ns(
|
|
3566
3601
|
this.state.messages,
|
|
3567
3602
|
n
|
|
3568
3603
|
);
|
|
@@ -3630,13 +3665,13 @@ class Ne {
|
|
|
3630
3665
|
return;
|
|
3631
3666
|
}
|
|
3632
3667
|
o && i && r && (this.retryableClientMessageId = r);
|
|
3633
|
-
const a = new Error(typeof e.message == "string" ? e.message : "Pluno error"), l =
|
|
3668
|
+
const a = new Error(typeof e.message == "string" ? e.message : "Pluno error"), l = er(a.message);
|
|
3634
3669
|
l && console.error(l);
|
|
3635
|
-
const c = r ?? this.activeClientMessageId, u = typeof e.runId == "string" ? e.runId : null, d =
|
|
3670
|
+
const c = r ?? this.activeClientMessageId, u = typeof e.runId == "string" ? e.runId : null, d = cs(
|
|
3636
3671
|
this.state.messages,
|
|
3637
3672
|
c,
|
|
3638
3673
|
u
|
|
3639
|
-
), g =
|
|
3674
|
+
), g = qr(
|
|
3640
3675
|
d,
|
|
3641
3676
|
c,
|
|
3642
3677
|
u
|
|
@@ -3667,7 +3702,7 @@ class Ne {
|
|
|
3667
3702
|
}
|
|
3668
3703
|
applyAccountSubmissionError(e) {
|
|
3669
3704
|
if (!this.account || !e) return;
|
|
3670
|
-
const t =
|
|
3705
|
+
const t = qn(this.account.submissionGate, e);
|
|
3671
3706
|
if (!(t === this.account.submissionGate || t.allowed)) {
|
|
3672
3707
|
this.account = {
|
|
3673
3708
|
...this.account,
|
|
@@ -3683,7 +3718,7 @@ class Ne {
|
|
|
3683
3718
|
this.options.model = Qe(n) ? n : "gpt-5.6-sol";
|
|
3684
3719
|
}
|
|
3685
3720
|
updateAccountFallbackFromSession(e) {
|
|
3686
|
-
const t = e && typeof e == "object" ? e.metadata : null, n =
|
|
3721
|
+
const t = e && typeof e == "object" ? e.metadata : null, n = On(t);
|
|
3687
3722
|
if (this.usingPaidCreditFallback !== n && (this.usingPaidCreditFallback = n, !!this.account)) {
|
|
3688
3723
|
this.account = { ...this.account, usingPaidCreditFallback: n };
|
|
3689
3724
|
for (const i of this.accountListeners) i(this.getAccount());
|
|
@@ -3725,10 +3760,10 @@ class Ne {
|
|
|
3725
3760
|
return;
|
|
3726
3761
|
}
|
|
3727
3762
|
if (e.type === "tool.call") {
|
|
3728
|
-
const i = e.hiddenFromTranscript === !0 ? null :
|
|
3763
|
+
const i = e.hiddenFromTranscript === !0 ? null : rs(e);
|
|
3729
3764
|
i && this.rememberSessionTimeline(
|
|
3730
3765
|
t,
|
|
3731
|
-
|
|
3766
|
+
ns(n, i)
|
|
3732
3767
|
);
|
|
3733
3768
|
return;
|
|
3734
3769
|
}
|
|
@@ -3740,7 +3775,7 @@ class Ne {
|
|
|
3740
3775
|
return;
|
|
3741
3776
|
this.rememberSessionTimeline(
|
|
3742
3777
|
t,
|
|
3743
|
-
|
|
3778
|
+
is(
|
|
3744
3779
|
n,
|
|
3745
3780
|
e.callId,
|
|
3746
3781
|
i
|
|
@@ -3777,7 +3812,7 @@ class Ne {
|
|
|
3777
3812
|
);
|
|
3778
3813
|
this.rememberSessionTimeline(
|
|
3779
3814
|
t,
|
|
3780
|
-
|
|
3815
|
+
ss(
|
|
3781
3816
|
o,
|
|
3782
3817
|
typeof e.responseId == "string" ? e.responseId : null,
|
|
3783
3818
|
i,
|
|
@@ -3792,7 +3827,7 @@ class Ne {
|
|
|
3792
3827
|
return;
|
|
3793
3828
|
this.rememberSessionTimeline(
|
|
3794
3829
|
t,
|
|
3795
|
-
|
|
3830
|
+
us(
|
|
3796
3831
|
n,
|
|
3797
3832
|
i,
|
|
3798
3833
|
null,
|
|
@@ -3801,9 +3836,9 @@ class Ne {
|
|
|
3801
3836
|
);
|
|
3802
3837
|
return;
|
|
3803
3838
|
}
|
|
3804
|
-
e.type === "error" && typeof e.requestId != "string" && !
|
|
3839
|
+
e.type === "error" && typeof e.requestId != "string" && !ls(e, t) && this.rememberSessionTimeline(
|
|
3805
3840
|
t,
|
|
3806
|
-
|
|
3841
|
+
zr(n, e)
|
|
3807
3842
|
);
|
|
3808
3843
|
}
|
|
3809
3844
|
}
|
|
@@ -3837,7 +3872,7 @@ class Ne {
|
|
|
3837
3872
|
}
|
|
3838
3873
|
handleRetryableRecoveryError(e) {
|
|
3839
3874
|
const t = typeof e.sessionId == "string" ? e.sessionId : this.state.sessionId, n = typeof e.clientMessageId == "string" ? e.clientMessageId : null;
|
|
3840
|
-
if (!
|
|
3875
|
+
if (!ls(e, t) || !n)
|
|
3841
3876
|
return !1;
|
|
3842
3877
|
if (et())
|
|
3843
3878
|
return this.retryableClientMessageId = n, this.activeClientMessageId = n, this.latestRecoverableClientMessageId = n, this.setState({ status: "connected", isThinking: !0, isRetrying: !0, lastError: null, lastErrorCode: null }), !0;
|
|
@@ -3878,7 +3913,7 @@ class Ne {
|
|
|
3878
3913
|
const i = new Promise((r, o) => {
|
|
3879
3914
|
const a = window.setTimeout(() => {
|
|
3880
3915
|
e.delete(t.requestId), o(new Error(n));
|
|
3881
|
-
},
|
|
3916
|
+
}, Vt);
|
|
3882
3917
|
e.set(t.requestId, { resolve: r, reject: o, timeout: a });
|
|
3883
3918
|
});
|
|
3884
3919
|
if (!this.sendNow(t)) {
|
|
@@ -3901,7 +3936,7 @@ class Ne {
|
|
|
3901
3936
|
e.clear();
|
|
3902
3937
|
}
|
|
3903
3938
|
markThinkingProgress() {
|
|
3904
|
-
!this.state.isThinking || this.state.status === "closed" || (this.scheduleThinkingWatchdog(
|
|
3939
|
+
!this.state.isThinking || this.state.status === "closed" || (this.scheduleThinkingWatchdog(di), this.activeClientMessageId && this.scheduleRunAckWatchdog(this.activeClientMessageId));
|
|
3905
3940
|
}
|
|
3906
3941
|
scheduleThinkingWatchdog(e) {
|
|
3907
3942
|
this.thinkingWatchdogTimer !== null && window.clearTimeout(this.thinkingWatchdogTimer), this.thinkingWatchdogTimer = window.setTimeout(() => {
|
|
@@ -3959,19 +3994,19 @@ class Ne {
|
|
|
3959
3994
|
schedulePendingDeliveryAck(e) {
|
|
3960
3995
|
this.clearPendingDeliveryTimers(), !et() && (this.pendingDeliveryAckTimer = window.setTimeout(() => {
|
|
3961
3996
|
this.pendingDeliveryAckTimer = null, this.retryPendingDelivery(e);
|
|
3962
|
-
},
|
|
3997
|
+
}, Gt));
|
|
3963
3998
|
}
|
|
3964
3999
|
retryPendingDelivery(e) {
|
|
3965
4000
|
if (this.state.status === "closed" || this.pendingClientMessageId !== e || !this.pendingUserMessageEvent)
|
|
3966
4001
|
return;
|
|
3967
4002
|
const t = this.retryAttemptsByClientMessageId[e] ?? 0;
|
|
3968
|
-
if (t >=
|
|
4003
|
+
if (t >= pi) {
|
|
3969
4004
|
this.failPendingDelivery(e);
|
|
3970
4005
|
return;
|
|
3971
4006
|
}
|
|
3972
4007
|
t === 0 && this.reportHealthSignal("run_ack_missed", { clientMessageId: e }), this.retryAttemptsByClientMessageId[e] = t + 1, this.setState({ pendingMessageStatus: "reconnecting" }), this.pendingDeliveryRetryTimer = window.setTimeout(() => {
|
|
3973
4008
|
this.pendingDeliveryRetryTimer = null, !(this.pendingClientMessageId !== e || !this.pendingUserMessageEvent) && (this.send(this.pendingUserMessageEvent), this.setState({ pendingMessageStatus: "sending" }), this.schedulePendingDeliveryAck(e));
|
|
3974
|
-
},
|
|
4009
|
+
}, Ei(t, yi));
|
|
3975
4010
|
}
|
|
3976
4011
|
failPendingDelivery(e) {
|
|
3977
4012
|
if (this.pendingClientMessageId !== e)
|
|
@@ -3984,7 +4019,7 @@ class Ne {
|
|
|
3984
4019
|
...this.state.isThinking ? {} : { turnPhase: null },
|
|
3985
4020
|
isRetrying: !1,
|
|
3986
4021
|
...this.state.isThinking ? {} : { taskStatus: "failed" },
|
|
3987
|
-
lastError:
|
|
4022
|
+
lastError: fi,
|
|
3988
4023
|
lastErrorCode: "message_delivery_failed"
|
|
3989
4024
|
});
|
|
3990
4025
|
}
|
|
@@ -3996,7 +4031,7 @@ class Ne {
|
|
|
3996
4031
|
if (this.state.isThinking && t) {
|
|
3997
4032
|
const r = this.state.assistantDraftRespondsToUserMessageId !== null && this.state.assistantDraftRespondsToUserMessageId !== t;
|
|
3998
4033
|
this.setState({
|
|
3999
|
-
messages:
|
|
4034
|
+
messages: us(
|
|
4000
4035
|
this.state.messages,
|
|
4001
4036
|
t,
|
|
4002
4037
|
n,
|
|
@@ -4022,13 +4057,13 @@ class Ne {
|
|
|
4022
4057
|
scheduleRunAckWatchdog(e) {
|
|
4023
4058
|
this.runAckWatchdogTimer !== null && window.clearTimeout(this.runAckWatchdogTimer), this.runAckWatchdogTimer = window.setTimeout(() => {
|
|
4024
4059
|
this.runAckWatchdogTimer = null, this.recoverMissedRunAck(e);
|
|
4025
|
-
},
|
|
4060
|
+
}, Gt);
|
|
4026
4061
|
}
|
|
4027
4062
|
recoverMissedRunAck(e) {
|
|
4028
4063
|
!this.state.isThinking || this.state.status === "closed" || this.activeClientMessageId !== e || (M("web-sdk.agent", "Pluno run ack missed; resyncing session", {
|
|
4029
4064
|
sessionId: this.state.sessionId,
|
|
4030
4065
|
clientMessageId: e
|
|
4031
|
-
}), this.reportHealthSignal("run_ack_missed", { clientMessageId: e }), this.resyncThinkingSession(), this.scheduleThinkingWatchdog(
|
|
4066
|
+
}), this.reportHealthSignal("run_ack_missed", { clientMessageId: e }), this.resyncThinkingSession(), this.scheduleThinkingWatchdog(Kt));
|
|
4032
4067
|
}
|
|
4033
4068
|
clearRunAckResyncRetryTimer() {
|
|
4034
4069
|
this.runAckResyncRetryTimer !== null && (window.clearTimeout(this.runAckResyncRetryTimer), this.runAckResyncRetryTimer = null);
|
|
@@ -4051,7 +4086,7 @@ class Ne {
|
|
|
4051
4086
|
),
|
|
4052
4087
|
isThinking: !1,
|
|
4053
4088
|
taskStatus: "failed",
|
|
4054
|
-
lastError:
|
|
4089
|
+
lastError: gi,
|
|
4055
4090
|
lastErrorCode: "run_recovery_exhausted"
|
|
4056
4091
|
}), this.clearThinkingWatchdog();
|
|
4057
4092
|
return;
|
|
@@ -4061,7 +4096,7 @@ class Ne {
|
|
|
4061
4096
|
sessionId: this.state.sessionId,
|
|
4062
4097
|
clientMessageId: e,
|
|
4063
4098
|
resyncAttempts: t + 1
|
|
4064
|
-
}), this.resyncThinkingSession(), this.scheduleThinkingWatchdog(
|
|
4099
|
+
}), this.resyncThinkingSession(), this.scheduleThinkingWatchdog(Kt);
|
|
4065
4100
|
}
|
|
4066
4101
|
resyncThinkingSession() {
|
|
4067
4102
|
this.state.sessionId ? this.send({
|
|
@@ -4078,7 +4113,7 @@ class Ne {
|
|
|
4078
4113
|
if (!t || !n || !i)
|
|
4079
4114
|
return;
|
|
4080
4115
|
const a = i === "execute_code", l = i === "execute_code_in_browser_tab" && o !== null && typeof o == "object" && o.tabId === "local:current";
|
|
4081
|
-
if (!a && !l || !
|
|
4116
|
+
if (!a && !l || !mo(o)) {
|
|
4082
4117
|
this.setToolMessageLoading(n, !1), this.send({
|
|
4083
4118
|
type: "tool.result",
|
|
4084
4119
|
sessionId: t,
|
|
@@ -4125,9 +4160,9 @@ class Ne {
|
|
|
4125
4160
|
startedAtOrigin: location.origin
|
|
4126
4161
|
}), this.installSessionBrowserApis();
|
|
4127
4162
|
let c = null, u;
|
|
4128
|
-
c = await this.executeRuntimeHelper(), u = await
|
|
4163
|
+
c = await this.executeRuntimeHelper(), u = await Xt(
|
|
4129
4164
|
o,
|
|
4130
|
-
|
|
4165
|
+
Qi(e.runtimeContext, this.options.backendUrl)
|
|
4131
4166
|
).catch((d) => ({
|
|
4132
4167
|
ok: !1,
|
|
4133
4168
|
exception: {
|
|
@@ -4140,11 +4175,11 @@ class Ne {
|
|
|
4140
4175
|
toolName: i,
|
|
4141
4176
|
summary: o.summary,
|
|
4142
4177
|
rawInput: L(o),
|
|
4143
|
-
rawOutput: L(
|
|
4144
|
-
}),
|
|
4178
|
+
rawOutput: L(fr(u, c))
|
|
4179
|
+
}), hs(this.options.clientId, this.activeBrowserToolCalls.values()));
|
|
4145
4180
|
}
|
|
4146
4181
|
setToolMessageLoading(e, t) {
|
|
4147
|
-
const n =
|
|
4182
|
+
const n = is(
|
|
4148
4183
|
this.state.messages,
|
|
4149
4184
|
e,
|
|
4150
4185
|
t
|
|
@@ -4155,33 +4190,33 @@ class Ne {
|
|
|
4155
4190
|
if (this.pageLifecycleCleanup)
|
|
4156
4191
|
return;
|
|
4157
4192
|
const e = () => {
|
|
4158
|
-
|
|
4193
|
+
Ns(this.options.clientId, this.activeBrowserToolCalls.values());
|
|
4159
4194
|
};
|
|
4160
4195
|
window.addEventListener("pagehide", e), window.addEventListener("beforeunload", e), this.pageLifecycleCleanup = () => {
|
|
4161
4196
|
window.removeEventListener("pagehide", e), window.removeEventListener("beforeunload", e);
|
|
4162
4197
|
};
|
|
4163
4198
|
}
|
|
4164
4199
|
installSessionBrowserApis() {
|
|
4165
|
-
this.cleanupSessionBrowserApis(), this.sessionBrowserApisCleanup =
|
|
4200
|
+
this.cleanupSessionBrowserApis(), this.sessionBrowserApisCleanup = Hi();
|
|
4166
4201
|
}
|
|
4167
4202
|
cleanupSessionBrowserApis() {
|
|
4168
|
-
this.sessionBrowserApisCleanup && (
|
|
4203
|
+
this.sessionBrowserApisCleanup && (Gi(this.sessionBrowserApisCleanup), this.sessionBrowserApisCleanup = null);
|
|
4169
4204
|
}
|
|
4170
4205
|
async executeRuntimeHelper() {
|
|
4171
4206
|
if (!this.runtimeHelperJavascript?.trim())
|
|
4172
4207
|
return null;
|
|
4173
|
-
const e = await
|
|
4208
|
+
const e = await Xt({
|
|
4174
4209
|
javascript: this.runtimeHelperJavascript
|
|
4175
4210
|
});
|
|
4176
|
-
return e.ok === !1 ?
|
|
4211
|
+
return e.ok === !1 ? mr(e) : null;
|
|
4177
4212
|
}
|
|
4178
4213
|
enableNetworkCapture() {
|
|
4179
|
-
this.networkCaptureCleanup || (this.networkCaptureCleanup =
|
|
4180
|
-
|
|
4214
|
+
this.networkCaptureCleanup || (this.networkCaptureCleanup = Ui((e) => {
|
|
4215
|
+
Ao(e.url, this.options.backendUrl) || this.enqueueNetworkEvent(e);
|
|
4181
4216
|
}));
|
|
4182
4217
|
}
|
|
4183
4218
|
enqueueNetworkEvent(e) {
|
|
4184
|
-
this.queuedNetworkEvents.length >=
|
|
4219
|
+
this.queuedNetworkEvents.length >= Si || (this.queuedNetworkEvents.push(wo(e)), this.networkBatchTimer === null && (this.networkBatchTimer = window.setTimeout(() => {
|
|
4185
4220
|
this.networkBatchTimer = null;
|
|
4186
4221
|
const t = this.queuedNetworkEvents.splice(0, this.queuedNetworkEvents.length);
|
|
4187
4222
|
t.length === 0 || this.socket?.readyState !== WebSocket.OPEN || this.sendNow({
|
|
@@ -4190,14 +4225,14 @@ class Ne {
|
|
|
4190
4225
|
page: _(),
|
|
4191
4226
|
events: t
|
|
4192
4227
|
});
|
|
4193
|
-
},
|
|
4228
|
+
}, Ii)));
|
|
4194
4229
|
}
|
|
4195
4230
|
scheduleReconnect(e = 0) {
|
|
4196
4231
|
if (this.reconnectTimer !== null || this.state.status === "closed")
|
|
4197
4232
|
return;
|
|
4198
4233
|
const t = Math.min(
|
|
4199
4234
|
at,
|
|
4200
|
-
Math.max(
|
|
4235
|
+
Math.max(Ci(this.reconnectAttempts), e)
|
|
4201
4236
|
);
|
|
4202
4237
|
this.reconnectAttempts += 1, this.reconnectTimer = window.setTimeout(() => {
|
|
4203
4238
|
this.reconnectTimer = null, this.connect().catch((n) => {
|
|
@@ -4214,8 +4249,8 @@ class Ne {
|
|
|
4214
4249
|
const e = this.socket;
|
|
4215
4250
|
!e || !this.sendNow({ type: "runtime.ping" }) || (this.clearHeartbeatAckTimer(), this.heartbeatAckTimer = window.setTimeout(() => {
|
|
4216
4251
|
this.socket === e && (M("web-sdk.agent", "Pluno heartbeat acknowledgement timed out; reconnecting"), this.replaceTimedOutSocket(e));
|
|
4217
|
-
},
|
|
4218
|
-
},
|
|
4252
|
+
}, ni));
|
|
4253
|
+
}, si);
|
|
4219
4254
|
}
|
|
4220
4255
|
stopHeartbeat() {
|
|
4221
4256
|
this.heartbeatTimer !== null && (window.clearInterval(this.heartbeatTimer), this.heartbeatTimer = null), this.clearHeartbeatAckTimer();
|
|
@@ -4253,12 +4288,12 @@ class Ne {
|
|
|
4253
4288
|
...e.lastError === null && e.lastErrorCode === void 0 ? { lastErrorCode: null } : {},
|
|
4254
4289
|
...e.lastError !== void 0 && e.lastErrorSecuritySettingsUrl === void 0 ? { lastErrorSecuritySettingsUrl: null } : {}
|
|
4255
4290
|
}, a = this.state.sessionId, l = this.state.isThinking || this.state.pendingMessageStatus !== null, c = o.isThinking || o.pendingMessageStatus !== null, u = this.activeClientMessageId ?? this.pendingClientMessageId;
|
|
4256
|
-
u && u === this.lastProjectedTurnClientMessageId && c &&
|
|
4291
|
+
u && u === this.lastProjectedTurnClientMessageId && c && xi(this.lastProjectedTurnPhase, o.turnPhase) && this.reportHealthSignal("invalid_state_transition", {
|
|
4257
4292
|
clientMessageId: u,
|
|
4258
4293
|
reason: "active_turn_phase_moved_backward",
|
|
4259
4294
|
previousPhase: this.lastProjectedTurnPhase,
|
|
4260
4295
|
nextPhase: o.turnPhase
|
|
4261
|
-
}), this.state = o, this.lastProjectedTurnClientMessageId = u, this.lastProjectedTurnPhase = o.turnPhase, o.sessionId && (o.sessionId === a && c !== l || o.sessionId !== a && c) && this.sessionHistoryManager.setActivity(o.sessionId, c), this.rebuildRuntimeInteractions(), e.messages !== void 0 && this.refreshRuntimeInteractions(), this.state.sessionId && this.rememberSessionTimeline(this.state.sessionId, this.state.messages),
|
|
4296
|
+
}), this.state = o, this.lastProjectedTurnClientMessageId = u, this.lastProjectedTurnPhase = o.turnPhase, o.sessionId && (o.sessionId === a && c !== l || o.sessionId !== a && c) && this.sessionHistoryManager.setActivity(o.sessionId, c), this.rebuildRuntimeInteractions(), e.messages !== void 0 && this.refreshRuntimeInteractions(), this.state.sessionId && this.rememberSessionTimeline(this.state.sessionId, this.state.messages), no(this.options.clientId, this.state), this.emit("state", this.getState()), Se("state", this.state.status, {
|
|
4262
4297
|
status: this.state.status,
|
|
4263
4298
|
sessionId: this.state.sessionId,
|
|
4264
4299
|
messageCount: this.state.messages.length,
|
|
@@ -4317,13 +4352,13 @@ class Ne {
|
|
|
4317
4352
|
}
|
|
4318
4353
|
}
|
|
4319
4354
|
const Ze = /* @__PURE__ */ new WeakMap();
|
|
4320
|
-
function
|
|
4321
|
-
const e = window.__plunoProductAgentNetworkCapture ??
|
|
4355
|
+
function Ui(s) {
|
|
4356
|
+
const e = window.__plunoProductAgentNetworkCapture ?? Di();
|
|
4322
4357
|
return e.subscribers.add(s), () => {
|
|
4323
4358
|
e.subscribers.delete(s), !(e.subscribers.size > 0) && (e.destroy(), window.__plunoProductAgentNetworkCapture === e && delete window.__plunoProductAgentNetworkCapture);
|
|
4324
4359
|
};
|
|
4325
4360
|
}
|
|
4326
|
-
function
|
|
4361
|
+
function Di() {
|
|
4327
4362
|
const s = /* @__PURE__ */ new Set(), e = (g) => {
|
|
4328
4363
|
s.forEach((f) => {
|
|
4329
4364
|
try {
|
|
@@ -4340,20 +4375,20 @@ function Pi() {
|
|
|
4340
4375
|
throw m;
|
|
4341
4376
|
}
|
|
4342
4377
|
try {
|
|
4343
|
-
const m = f instanceof Request ? f : null, b =
|
|
4378
|
+
const m = f instanceof Request ? f : null, b = yo(f, m), w = Ws(h?.headers ?? m?.headers);
|
|
4344
4379
|
if (!te(b, w, h?.body)) {
|
|
4345
4380
|
const H = {
|
|
4346
4381
|
requestId: nt("fetch"),
|
|
4347
4382
|
url: F(b, Ye),
|
|
4348
4383
|
method: (h?.method ?? m?.method ?? "GET").toUpperCase(),
|
|
4349
4384
|
requestHeaders: w,
|
|
4350
|
-
requestBody:
|
|
4385
|
+
requestBody: gs(h?.body),
|
|
4351
4386
|
resourceType: "fetch",
|
|
4352
4387
|
startedAt: new Date(p).toISOString()
|
|
4353
4388
|
};
|
|
4354
4389
|
y.then(
|
|
4355
4390
|
(S) => {
|
|
4356
|
-
|
|
4391
|
+
Io(S, H, p, e).catch(() => {
|
|
4357
4392
|
e({
|
|
4358
4393
|
...H,
|
|
4359
4394
|
responseStatus: S.status,
|
|
@@ -4390,12 +4425,12 @@ function Pi() {
|
|
|
4390
4425
|
}, c = function(f) {
|
|
4391
4426
|
try {
|
|
4392
4427
|
const h = Ze.get(this);
|
|
4393
|
-
h && (h.excluded = h.excluded || te(h.url, h.requestHeaders, f), h.requestBody =
|
|
4428
|
+
h && (h.excluded = h.excluded || te(h.url, h.requestHeaders, f), h.requestBody = gs(f), h.excluded || this.addEventListener(
|
|
4394
4429
|
"loadend",
|
|
4395
4430
|
() => {
|
|
4396
4431
|
queueMicrotask(() => {
|
|
4397
4432
|
try {
|
|
4398
|
-
const p =
|
|
4433
|
+
const p = Mo(this.getAllResponseHeaders());
|
|
4399
4434
|
e({
|
|
4400
4435
|
requestId: h.requestId,
|
|
4401
4436
|
url: h.url,
|
|
@@ -4405,7 +4440,7 @@ function Pi() {
|
|
|
4405
4440
|
resourceType: "xhr",
|
|
4406
4441
|
responseStatus: this.status,
|
|
4407
4442
|
responseHeaders: p,
|
|
4408
|
-
responseBody:
|
|
4443
|
+
responseBody: To(this, p),
|
|
4409
4444
|
errorText: this.status === 0 ? "XHR request failed or was aborted" : void 0,
|
|
4410
4445
|
startedAt: h.startedAt,
|
|
4411
4446
|
durationMs: Date.now() - h.startedAtMs
|
|
@@ -4497,14 +4532,14 @@ function M(s, e, t) {
|
|
|
4497
4532
|
}, r = n.__plunoProductAgentDiagnostics__ ?? [];
|
|
4498
4533
|
r.push(i), r.length > 120 && r.splice(0, r.length - 120), n.__plunoProductAgentDiagnostics__ = r, n.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(new CustomEvent("product-agent:preview-diagnostic", { detail: i }));
|
|
4499
4534
|
}
|
|
4500
|
-
function
|
|
4535
|
+
function Jt(s) {
|
|
4501
4536
|
const e = typeof s == "function" ? s() : s;
|
|
4502
4537
|
return e && Object.keys(e).length > 0 ? e : void 0;
|
|
4503
4538
|
}
|
|
4504
|
-
function
|
|
4539
|
+
function qi(s) {
|
|
4505
4540
|
return s.type === "run.model_started" || s.type === "conversation.state" || s.type === "session.updated" || s.type === "session.item" || s.type === "chat.assistant_delta" || s.type === "chat.assistant_done" || s.type === "tool.call";
|
|
4506
4541
|
}
|
|
4507
|
-
function
|
|
4542
|
+
function Oi(s) {
|
|
4508
4543
|
if (s.type === "chat.assistant_delta")
|
|
4509
4544
|
return typeof s.delta == "string" && s.delta.trim().length > 0;
|
|
4510
4545
|
if (s.type === "tool.call")
|
|
@@ -4514,7 +4549,7 @@ function Ui(s) {
|
|
|
4514
4549
|
const e = C(s.item);
|
|
4515
4550
|
return e ? e.type === "message" && e.role === "assistant" ? typeof e.content == "string" && e.content.trim().length > 0 : e.type === "tool_call" || e.type === "function_call" : !1;
|
|
4516
4551
|
}
|
|
4517
|
-
function
|
|
4552
|
+
function xi(s, e) {
|
|
4518
4553
|
if (!s || !e)
|
|
4519
4554
|
return !1;
|
|
4520
4555
|
const t = {
|
|
@@ -4542,31 +4577,31 @@ function K(s) {
|
|
|
4542
4577
|
}
|
|
4543
4578
|
return null;
|
|
4544
4579
|
}
|
|
4545
|
-
const
|
|
4546
|
-
function
|
|
4580
|
+
const Li = 5e3, Ni = 12e4;
|
|
4581
|
+
function Hi() {
|
|
4547
4582
|
const s = [
|
|
4548
|
-
|
|
4549
|
-
|
|
4583
|
+
Fi(),
|
|
4584
|
+
Bi()
|
|
4550
4585
|
].filter((e) => typeof e == "function");
|
|
4551
4586
|
return () => {
|
|
4552
4587
|
for (const e of s.reverse())
|
|
4553
4588
|
e();
|
|
4554
4589
|
};
|
|
4555
4590
|
}
|
|
4556
|
-
function
|
|
4557
|
-
return
|
|
4591
|
+
function Bi() {
|
|
4592
|
+
return Is(globalThis, "getPageSnapshot", async () => bt());
|
|
4558
4593
|
}
|
|
4559
|
-
function
|
|
4560
|
-
return
|
|
4561
|
-
inspectImage: async (e, t) => await
|
|
4594
|
+
function Fi() {
|
|
4595
|
+
return Is(globalThis, "pageImages", {
|
|
4596
|
+
inspectImage: async (e, t) => await Wi(e, t)
|
|
4562
4597
|
});
|
|
4563
4598
|
}
|
|
4564
|
-
async function
|
|
4565
|
-
const t =
|
|
4599
|
+
async function Wi(s, e = {}) {
|
|
4600
|
+
const t = Ki(e.name), n = await $i(s);
|
|
4566
4601
|
return n.ok ? n.sizeBytes > 8 * 1024 * 1024 ? {
|
|
4567
4602
|
type: "pluno.pageImages.inspectImage",
|
|
4568
4603
|
imageAttached: !1,
|
|
4569
|
-
imageAttachmentError:
|
|
4604
|
+
imageAttachmentError: Es
|
|
4570
4605
|
} : {
|
|
4571
4606
|
type: "pluno.pageImages.inspectImage",
|
|
4572
4607
|
imageAttached: !0,
|
|
@@ -4580,15 +4615,15 @@ async function Hi(s, e = {}) {
|
|
|
4580
4615
|
imageAttachmentError: n.error
|
|
4581
4616
|
};
|
|
4582
4617
|
}
|
|
4583
|
-
async function
|
|
4584
|
-
return s instanceof Blob ? s.type.startsWith("image/") ? s.size === 0 ? { ok: !1, error: "Page image is empty." } : s.size > 8 * 1024 * 1024 ? { ok: !1, error:
|
|
4618
|
+
async function $i(s) {
|
|
4619
|
+
return s instanceof Blob ? s.type.startsWith("image/") ? s.size === 0 ? { ok: !1, error: "Page image is empty." } : s.size > 8 * 1024 * 1024 ? { ok: !1, error: Es } : {
|
|
4585
4620
|
ok: !0,
|
|
4586
4621
|
mimeType: s.type,
|
|
4587
4622
|
sizeBytes: s.size,
|
|
4588
|
-
dataUrl: await
|
|
4589
|
-
} : { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : typeof s != "string" ? { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } :
|
|
4623
|
+
dataUrl: await Vi(s)
|
|
4624
|
+
} : { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : typeof s != "string" ? { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : ji(s);
|
|
4590
4625
|
}
|
|
4591
|
-
function
|
|
4626
|
+
function ji(s) {
|
|
4592
4627
|
if (!s.startsWith("data:") || !s.includes(","))
|
|
4593
4628
|
return { ok: !1, error: "Page image must be a complete data:image/* URL, not bare base64." };
|
|
4594
4629
|
const [e, t] = s.slice(5).split(",", 2), n = e.split(";").map((a) => a.trim()).filter(Boolean), i = n[0] ?? "";
|
|
@@ -4599,7 +4634,7 @@ function Fi(s) {
|
|
|
4599
4634
|
const r = t.replace(/[ \t\r\n\f]+/g, "");
|
|
4600
4635
|
if (!/^[A-Za-z0-9+/]*={0,2}$/.test(r))
|
|
4601
4636
|
return { ok: !1, error: "Page image data URL has invalid base64." };
|
|
4602
|
-
const o =
|
|
4637
|
+
const o = zi(r);
|
|
4603
4638
|
return o === null ? { ok: !1, error: "Page image data URL has invalid base64." } : o === 0 ? { ok: !1, error: "Page image is empty." } : {
|
|
4604
4639
|
ok: !0,
|
|
4605
4640
|
mimeType: i,
|
|
@@ -4607,22 +4642,22 @@ function Fi(s) {
|
|
|
4607
4642
|
dataUrl: `data:${i};base64,${r}`
|
|
4608
4643
|
};
|
|
4609
4644
|
}
|
|
4610
|
-
function
|
|
4645
|
+
function zi(s) {
|
|
4611
4646
|
if (s.length === 0 || s.length % 4 !== 0)
|
|
4612
4647
|
return null;
|
|
4613
4648
|
const e = s.length - s.replace(/=+$/, "").length;
|
|
4614
4649
|
return e > 2 ? null : s.length / 4 * 3 - e;
|
|
4615
4650
|
}
|
|
4616
|
-
function
|
|
4651
|
+
function Ki(s) {
|
|
4617
4652
|
return (typeof s == "string" ? s.trim() : "") || "Page image";
|
|
4618
4653
|
}
|
|
4619
|
-
function
|
|
4654
|
+
function Gi(s) {
|
|
4620
4655
|
try {
|
|
4621
4656
|
s();
|
|
4622
4657
|
} catch {
|
|
4623
4658
|
}
|
|
4624
4659
|
}
|
|
4625
|
-
function
|
|
4660
|
+
function Vi(s) {
|
|
4626
4661
|
return new Promise((e, t) => {
|
|
4627
4662
|
const n = new FileReader();
|
|
4628
4663
|
n.onload = () => {
|
|
@@ -4634,9 +4669,9 @@ function zi(s) {
|
|
|
4634
4669
|
}, n.onerror = () => t(n.error ?? new Error("Failed to read page image")), n.readAsDataURL(s);
|
|
4635
4670
|
});
|
|
4636
4671
|
}
|
|
4637
|
-
async function
|
|
4672
|
+
async function Xt(s, e) {
|
|
4638
4673
|
const t = Object.getPrototypeOf(async function() {
|
|
4639
|
-
}).constructor, n = s.timeoutMs ??
|
|
4674
|
+
}).constructor, n = s.timeoutMs ?? Li, i = Date.now(), r = [];
|
|
4640
4675
|
let o;
|
|
4641
4676
|
const a = {
|
|
4642
4677
|
log: console.log,
|
|
@@ -4654,7 +4689,7 @@ async function Jt(s, e) {
|
|
|
4654
4689
|
o = window.setTimeout(() => d(c), n);
|
|
4655
4690
|
})
|
|
4656
4691
|
]);
|
|
4657
|
-
return u === c ?
|
|
4692
|
+
return u === c ? Ji(n) : {
|
|
4658
4693
|
ok: !0,
|
|
4659
4694
|
result: u,
|
|
4660
4695
|
console: r,
|
|
@@ -4683,7 +4718,7 @@ async function Jt(s, e) {
|
|
|
4683
4718
|
e?.deactivate(), o !== void 0 && window.clearTimeout(o), console.log = a.log, console.info = a.info, console.warn = a.warn, console.error = a.error;
|
|
4684
4719
|
}
|
|
4685
4720
|
}
|
|
4686
|
-
function
|
|
4721
|
+
function Qi(s, e) {
|
|
4687
4722
|
if (!s || typeof s != "object")
|
|
4688
4723
|
return;
|
|
4689
4724
|
const t = s.sandboxFilesToken;
|
|
@@ -4693,7 +4728,7 @@ function Ki(s, e) {
|
|
|
4693
4728
|
const i = () => {
|
|
4694
4729
|
if (!n)
|
|
4695
4730
|
throw new Error("sandboxFiles is only available during browser-code execution");
|
|
4696
|
-
}, r = async (a, l) => await
|
|
4731
|
+
}, r = async (a, l) => await Gn(`${e.replace(/\/$/, "")}${a}`, l);
|
|
4697
4732
|
return {
|
|
4698
4733
|
value: Object.freeze({
|
|
4699
4734
|
upload: async (a) => {
|
|
@@ -4727,7 +4762,7 @@ function Ki(s, e) {
|
|
|
4727
4762
|
}
|
|
4728
4763
|
};
|
|
4729
4764
|
}
|
|
4730
|
-
function
|
|
4765
|
+
function Ji(s) {
|
|
4731
4766
|
return {
|
|
4732
4767
|
ok: !1,
|
|
4733
4768
|
exception: {
|
|
@@ -4741,10 +4776,10 @@ function Gi(s) {
|
|
|
4741
4776
|
}
|
|
4742
4777
|
};
|
|
4743
4778
|
}
|
|
4744
|
-
function
|
|
4779
|
+
function Xi(s) {
|
|
4745
4780
|
return s.replace(/\/+$/, "");
|
|
4746
4781
|
}
|
|
4747
|
-
function
|
|
4782
|
+
function Yi(s) {
|
|
4748
4783
|
const e = {
|
|
4749
4784
|
sidepanel: "extension_sidepanel",
|
|
4750
4785
|
browser_extension_page_ui: "extension_widget",
|
|
@@ -4756,18 +4791,18 @@ function Qi(s) {
|
|
|
4756
4791
|
};
|
|
4757
4792
|
return s && s in e ? e[s] : s ?? "embedded_custom_ui";
|
|
4758
4793
|
}
|
|
4759
|
-
function
|
|
4794
|
+
function Zi(s) {
|
|
4760
4795
|
return s === "pluno" ? "scheduled_continuation" : s ?? "user";
|
|
4761
4796
|
}
|
|
4762
|
-
function
|
|
4797
|
+
function er(s, e = location.origin) {
|
|
4763
4798
|
return /origin (?:is not allowed|does not match browser origin)/i.test(s) ? `Pluno widget blocked on ${e}: this domain is not allowed. Add ${e} in Pluno under Integration > Domains.` : null;
|
|
4764
4799
|
}
|
|
4765
|
-
function
|
|
4800
|
+
function tr(s) {
|
|
4766
4801
|
const e = new URL("/api/product-agent/embed/ws", s);
|
|
4767
4802
|
return e.protocol = e.protocol === "https:" ? "wss:" : "ws:", e.toString();
|
|
4768
4803
|
}
|
|
4769
4804
|
function _() {
|
|
4770
|
-
const s =
|
|
4805
|
+
const s = Us();
|
|
4771
4806
|
return {
|
|
4772
4807
|
url: location.href,
|
|
4773
4808
|
title: document.title,
|
|
@@ -4775,19 +4810,19 @@ function _() {
|
|
|
4775
4810
|
...s ? { plunoProductAgentUi: s } : {}
|
|
4776
4811
|
};
|
|
4777
4812
|
}
|
|
4778
|
-
function
|
|
4813
|
+
function sr() {
|
|
4779
4814
|
return {
|
|
4780
4815
|
pageUrl: location.href,
|
|
4781
4816
|
pageTitle: document.title,
|
|
4782
4817
|
htmlContent: bt()
|
|
4783
4818
|
};
|
|
4784
4819
|
}
|
|
4785
|
-
function
|
|
4786
|
-
return Ce.add(s), we || (we =
|
|
4820
|
+
function nr(s) {
|
|
4821
|
+
return Ce.add(s), we || (we = ir()), () => {
|
|
4787
4822
|
Ce.delete(s), Ce.size === 0 && (we?.(), we = null);
|
|
4788
4823
|
};
|
|
4789
4824
|
}
|
|
4790
|
-
function
|
|
4825
|
+
function ir() {
|
|
4791
4826
|
const s = () => {
|
|
4792
4827
|
for (const r of Array.from(Ce))
|
|
4793
4828
|
r();
|
|
@@ -4803,7 +4838,7 @@ function tr() {
|
|
|
4803
4838
|
};
|
|
4804
4839
|
}
|
|
4805
4840
|
function et() {
|
|
4806
|
-
return
|
|
4841
|
+
return Us()?.surface === "browser_extension_sdk_preview";
|
|
4807
4842
|
}
|
|
4808
4843
|
function bt() {
|
|
4809
4844
|
if (!document.body)
|
|
@@ -4814,16 +4849,16 @@ function bt() {
|
|
|
4814
4849
|
};
|
|
4815
4850
|
t("Selected text", window.getSelection()?.toString() ?? "");
|
|
4816
4851
|
const n = "[role='dialog'], [role='alertdialog'], dialog[open], [aria-modal='true']", i = Array.from(document.querySelectorAll(n)).filter(
|
|
4817
|
-
(p) =>
|
|
4852
|
+
(p) => _s(p) && !p.parentElement?.closest(n)
|
|
4818
4853
|
);
|
|
4819
4854
|
for (const p of i.slice(0, 3))
|
|
4820
4855
|
t("Active overlay", tt(he(p), e));
|
|
4821
|
-
const r =
|
|
4856
|
+
const r = rr(), o = r ? tt(he(r), e) : "";
|
|
4822
4857
|
t("Main page content", o), t("Additional visible page text", tt(he(document.body), e));
|
|
4823
4858
|
const a = s.map(([p, y]) => `${p}:
|
|
4824
4859
|
${y}`).join(`
|
|
4825
4860
|
|
|
4826
|
-
`).trim().slice(0, 12e3), l =
|
|
4861
|
+
`).trim().slice(0, 12e3), l = or(i, r).trim(), c = `Simplified DOM outline:
|
|
4827
4862
|
`, u = `
|
|
4828
4863
|
|
|
4829
4864
|
Visible page text:
|
|
@@ -4847,14 +4882,14 @@ function tt(s, e) {
|
|
|
4847
4882
|
t = t.replace(n, "");
|
|
4848
4883
|
return ne(t);
|
|
4849
4884
|
}
|
|
4850
|
-
function
|
|
4885
|
+
function _s(s) {
|
|
4851
4886
|
const e = window.getComputedStyle(s);
|
|
4852
4887
|
return e.display !== "none" && e.visibility !== "hidden" && s.getClientRects().length > 0;
|
|
4853
4888
|
}
|
|
4854
|
-
function
|
|
4855
|
-
return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(
|
|
4889
|
+
function rr() {
|
|
4890
|
+
return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(_s).sort((s, e) => he(e).length - he(s).length)[0] ?? null;
|
|
4856
4891
|
}
|
|
4857
|
-
function
|
|
4892
|
+
function or(s, e) {
|
|
4858
4893
|
const t = /* @__PURE__ */ new Set([
|
|
4859
4894
|
"main",
|
|
4860
4895
|
"nav",
|
|
@@ -4934,7 +4969,7 @@ function nr(s, e) {
|
|
|
4934
4969
|
"data-test",
|
|
4935
4970
|
"data-qa",
|
|
4936
4971
|
"data-cy"
|
|
4937
|
-
], c = ["aria-label", "placeholder", "data-testid", "data-test", "data-qa", "data-cy"], { priorityElements: u, priorityTargets: d } =
|
|
4972
|
+
], c = ["aria-label", "placeholder", "data-testid", "data-test", "data-qa", "data-cy"], { priorityElements: u, priorityTargets: d } = ar(), g = new Set(s);
|
|
4938
4973
|
e && g.add(e);
|
|
4939
4974
|
let f = 0;
|
|
4940
4975
|
const h = (w) => {
|
|
@@ -4949,7 +4984,7 @@ function nr(s, e) {
|
|
|
4949
4984
|
if (f >= 1e3 && !Y || H.has(T) || r.has(v) || T.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") || re.display === "none" || re.visibility === "hidden")
|
|
4950
4985
|
return { lines: [], hasUsefulContent: !1, textPreview: "", containsTextElement: !1 };
|
|
4951
4986
|
f += 1;
|
|
4952
|
-
const Z = h(T), ee =
|
|
4987
|
+
const Z = h(T), ee = vs(T), fe = a.has(Z) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(v) || v === "a" && T.hasAttribute("href"), B = Array.from(T.children).filter((I) => I instanceof HTMLElement), V = /* @__PURE__ */ new Map();
|
|
4953
4988
|
for (const I of B) {
|
|
4954
4989
|
const R = p(I);
|
|
4955
4990
|
V.set(R, (V.get(R) ?? 0) + 1);
|
|
@@ -4975,10 +5010,10 @@ function nr(s, e) {
|
|
|
4975
5010
|
I instanceof HTMLElement && Fe.push(S(I, N + 1));
|
|
4976
5011
|
const ye = [...Et, ...Fe], We = ee.length > 0 || fe || ye.some((I) => I.hasUsefulContent), Ct = ne(
|
|
4977
5012
|
[ee, ...ye.map((I) => I.textPreview)].filter(Boolean).join(" ")
|
|
4978
|
-
).slice(0, 180),
|
|
5013
|
+
).slice(0, 180), Js = T.hasAttribute("contenteditable") && (ee.length > 0 || !T.querySelector("[contenteditable]")), _t = c.some((I) => T.hasAttribute(I)) || !!Z || Js, $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 = [];
|
|
4979
5014
|
if ($e) {
|
|
4980
5015
|
const I = ye.some((z) => z.containsTextElement), R = n.has(v) && !I ? Ct : ee;
|
|
4981
|
-
ae.push(
|
|
5016
|
+
ae.push(Ps(T, l, o, R.slice(0, 180)));
|
|
4982
5017
|
}
|
|
4983
5018
|
for (const I of q)
|
|
4984
5019
|
ae.push(...Ae(I, je));
|
|
@@ -5004,7 +5039,7 @@ function nr(s, e) {
|
|
|
5004
5039
|
`);
|
|
5005
5040
|
}, m = [], b = ne(window.getSelection()?.toString() ?? "");
|
|
5006
5041
|
b && m.push(`--- selected text ---
|
|
5007
|
-
${JSON.stringify(b)}`), d.length > 0 && m.push(
|
|
5042
|
+
${JSON.stringify(b)}`), d.length > 0 && m.push(lr(d, t, l, o));
|
|
5008
5043
|
for (const w of s.slice(0, 3))
|
|
5009
5044
|
m.push(y(w, "active overlay DOM", /* @__PURE__ */ new Set()));
|
|
5010
5045
|
if (e && m.push(y(e, "main DOM", /* @__PURE__ */ new Set())), document.body) {
|
|
@@ -5015,11 +5050,11 @@ ${JSON.stringify(b)}`), d.length > 0 && m.push(rr(d, t, l, o));
|
|
|
5015
5050
|
|
|
5016
5051
|
`);
|
|
5017
5052
|
}
|
|
5018
|
-
function
|
|
5053
|
+
function Ps(s, e, t, n) {
|
|
5019
5054
|
const i = s.tagName.toLowerCase();
|
|
5020
5055
|
let r = i;
|
|
5021
5056
|
const o = s.getAttribute("id");
|
|
5022
|
-
o &&
|
|
5057
|
+
o && cr(o) && (r += `#${o}`);
|
|
5023
5058
|
for (const a of e) {
|
|
5024
5059
|
const l = s.getAttribute(a);
|
|
5025
5060
|
l && l.length <= 160 && (a !== "role" || !t.has(l)) && (r += `[${a}=${JSON.stringify(l)}]`);
|
|
@@ -5032,7 +5067,7 @@ function Cs(s, e, t, n) {
|
|
|
5032
5067
|
s.hasAttribute(a) && (r += `[${a}]`);
|
|
5033
5068
|
return `${r}${n ? ` ${JSON.stringify(n)}` : ""}`;
|
|
5034
5069
|
}
|
|
5035
|
-
function
|
|
5070
|
+
function ar() {
|
|
5036
5071
|
const s = /* @__PURE__ */ new Set(), e = /* @__PURE__ */ new Map(), t = (a, l) => {
|
|
5037
5072
|
if (!a)
|
|
5038
5073
|
return;
|
|
@@ -5053,7 +5088,7 @@ function ir() {
|
|
|
5053
5088
|
n = n.shadowRoot.activeElement;
|
|
5054
5089
|
n !== document.body && n !== document.documentElement && t(n, "focused");
|
|
5055
5090
|
const i = window.getSelection();
|
|
5056
|
-
i && !i.isCollapsed && (t(
|
|
5091
|
+
i && !i.isCollapsed && (t(Yt(i.anchorNode), "selected text"), t(Yt(i.focusNode), "selected text"));
|
|
5057
5092
|
const r = [
|
|
5058
5093
|
["[aria-selected='true']", "selected"],
|
|
5059
5094
|
["[aria-current]:not([aria-current='false'])", "current"],
|
|
@@ -5075,7 +5110,7 @@ function ir() {
|
|
|
5075
5110
|
priorityTargets: Array.from(e, ([a, l]) => ({ element: a, labels: Array.from(l) }))
|
|
5076
5111
|
};
|
|
5077
5112
|
}
|
|
5078
|
-
function
|
|
5113
|
+
function lr(s, e, t, n) {
|
|
5079
5114
|
const i = ["--- active/current elements ---"];
|
|
5080
5115
|
for (const r of s) {
|
|
5081
5116
|
const o = [];
|
|
@@ -5086,18 +5121,18 @@ function rr(s, e, t, n) {
|
|
|
5086
5121
|
const d = a.getRootNode();
|
|
5087
5122
|
a = a.parentElement ?? (d instanceof ShadowRoot && d.host instanceof HTMLElement ? d.host : null);
|
|
5088
5123
|
}
|
|
5089
|
-
const l = o.length > 6 ? [o[0], ...o.slice(-5)] : o, c = l.map((u, d) =>
|
|
5124
|
+
const l = o.length > 6 ? [o[0], ...o.slice(-5)] : o, c = l.map((u, d) => Ps(
|
|
5090
5125
|
u,
|
|
5091
5126
|
t,
|
|
5092
5127
|
n,
|
|
5093
|
-
d === l.length - 1 ?
|
|
5128
|
+
d === l.length - 1 ? vs(u).slice(0, 180) : ""
|
|
5094
5129
|
));
|
|
5095
5130
|
o.length > l.length && c.splice(1, 0, "…"), i.push(`${r.labels.join(", ")}: ${c.join(" > ")}`);
|
|
5096
5131
|
}
|
|
5097
5132
|
return i.join(`
|
|
5098
5133
|
`);
|
|
5099
5134
|
}
|
|
5100
|
-
function
|
|
5135
|
+
function Yt(s) {
|
|
5101
5136
|
return s instanceof HTMLElement ? s : s?.parentElement instanceof HTMLElement ? s.parentElement : null;
|
|
5102
5137
|
}
|
|
5103
5138
|
function Ae(s, e) {
|
|
@@ -5106,17 +5141,17 @@ function Ae(s, e) {
|
|
|
5106
5141
|
const t = " ".repeat(e);
|
|
5107
5142
|
return s.map((n) => `${t}${n}`);
|
|
5108
5143
|
}
|
|
5109
|
-
function
|
|
5144
|
+
function vs(s) {
|
|
5110
5145
|
return ne(
|
|
5111
5146
|
Array.from(s.childNodes).filter((e) => e.nodeType === Node.TEXT_NODE).map((e) => e.textContent ?? "").join(" ")
|
|
5112
5147
|
);
|
|
5113
5148
|
}
|
|
5114
|
-
function
|
|
5149
|
+
function cr(s) {
|
|
5115
5150
|
return s.length <= 64 && /^[A-Za-z_][A-Za-z0-9_:.-]*$/.test(s) && !/[a-f0-9]{12,}/i.test(s) && !/:r[0-9a-z]+:/i.test(s);
|
|
5116
5151
|
}
|
|
5117
|
-
function
|
|
5118
|
-
const s = Array.from(document.querySelectorAll(
|
|
5119
|
-
(r) => typeof r[
|
|
5152
|
+
function Us() {
|
|
5153
|
+
const s = Array.from(document.querySelectorAll($t)), e = s.find(
|
|
5154
|
+
(r) => typeof r[Xn] == "string"
|
|
5120
5155
|
);
|
|
5121
5156
|
if (!(e ?? s[0]))
|
|
5122
5157
|
return;
|
|
@@ -5127,28 +5162,28 @@ function Ps() {
|
|
|
5127
5162
|
selectors: [
|
|
5128
5163
|
{
|
|
5129
5164
|
name: "widget_host",
|
|
5130
|
-
selector:
|
|
5165
|
+
selector: $t,
|
|
5131
5166
|
description: "Finds Pluno's shadow-host element in the host page DOM."
|
|
5132
5167
|
},
|
|
5133
5168
|
{
|
|
5134
5169
|
name: "widget_root",
|
|
5135
|
-
selector:
|
|
5170
|
+
selector: Vn,
|
|
5136
5171
|
description: "Finds Pluno's widget root inside the widget host shadow root."
|
|
5137
5172
|
},
|
|
5138
5173
|
{
|
|
5139
5174
|
name: "widget_panel",
|
|
5140
|
-
selector:
|
|
5175
|
+
selector: Qn,
|
|
5141
5176
|
description: "Finds Pluno's open chat panel inside the widget host shadow root."
|
|
5142
5177
|
},
|
|
5143
5178
|
{
|
|
5144
5179
|
name: "widget_timeline",
|
|
5145
|
-
selector:
|
|
5180
|
+
selector: Jn,
|
|
5146
5181
|
description: "Finds Pluno's chat timeline inside the widget host shadow root."
|
|
5147
5182
|
}
|
|
5148
5183
|
]
|
|
5149
5184
|
};
|
|
5150
5185
|
}
|
|
5151
|
-
function
|
|
5186
|
+
function ur(s) {
|
|
5152
5187
|
try {
|
|
5153
5188
|
const e = JSON.parse(s);
|
|
5154
5189
|
return e && typeof e == "object" ? e : { type: "error", message: "Invalid server event" };
|
|
@@ -5156,7 +5191,7 @@ function ar(s) {
|
|
|
5156
5191
|
return { type: "error", message: "Invalid server event" };
|
|
5157
5192
|
}
|
|
5158
5193
|
}
|
|
5159
|
-
function
|
|
5194
|
+
function dr(s) {
|
|
5160
5195
|
if (typeof s != "string")
|
|
5161
5196
|
return null;
|
|
5162
5197
|
try {
|
|
@@ -5166,13 +5201,13 @@ function lr(s) {
|
|
|
5166
5201
|
return null;
|
|
5167
5202
|
}
|
|
5168
5203
|
}
|
|
5169
|
-
function
|
|
5204
|
+
function Zt(s, e) {
|
|
5170
5205
|
if (!s || typeof s != "object")
|
|
5171
5206
|
return [];
|
|
5172
5207
|
const t = s[e];
|
|
5173
5208
|
return Array.isArray(t) ? t.filter((n) => typeof n == "string" && n.trim().length > 0) : [];
|
|
5174
5209
|
}
|
|
5175
|
-
function
|
|
5210
|
+
function es(s) {
|
|
5176
5211
|
return Array.isArray(s) ? s.flatMap((e) => {
|
|
5177
5212
|
if (!e || typeof e != "object")
|
|
5178
5213
|
return [];
|
|
@@ -5180,10 +5215,10 @@ function Zt(s) {
|
|
|
5180
5215
|
return typeof t.taskId != "string" || !t.taskId || typeof t.dueAt != "string" || Number.isNaN(Date.parse(t.dueAt)) ? [] : [{ taskId: t.taskId, dueAt: t.dueAt }];
|
|
5181
5216
|
}) : [];
|
|
5182
5217
|
}
|
|
5183
|
-
function
|
|
5218
|
+
function hr(s) {
|
|
5184
5219
|
return Array.isArray(s) ? s.filter((e) => typeof e == "string" && e.trim().length > 0) : [];
|
|
5185
5220
|
}
|
|
5186
|
-
function
|
|
5221
|
+
function pr(s) {
|
|
5187
5222
|
if (!s || typeof s != "object")
|
|
5188
5223
|
return null;
|
|
5189
5224
|
const e = s, t = e.appearance, n = t && typeof t == "object" ? t : e, i = typeof n.accentColor == "string" ? n.accentColor : null, r = n.colorScheme === "dark" ? "dark" : n.colorScheme === "light" ? "light" : null, o = typeof n.fontFamily == "string" && n.fontFamily.trim() ? n.fontFamily : null, a = typeof n.scribbleStyle == "boolean" ? n.scribbleStyle : null;
|
|
@@ -5194,13 +5229,13 @@ function ur(s) {
|
|
|
5194
5229
|
...a !== null ? { scribbleStyle: a } : {}
|
|
5195
5230
|
};
|
|
5196
5231
|
}
|
|
5197
|
-
function
|
|
5232
|
+
function gr(s) {
|
|
5198
5233
|
if (!s || typeof s != "object")
|
|
5199
5234
|
return null;
|
|
5200
5235
|
const e = s.javascript;
|
|
5201
5236
|
return typeof e != "string" || !e.trim() ? null : { javascript: e };
|
|
5202
5237
|
}
|
|
5203
|
-
function
|
|
5238
|
+
function fr(s, e) {
|
|
5204
5239
|
return e ? s && typeof s == "object" ? {
|
|
5205
5240
|
...s,
|
|
5206
5241
|
helperError: e
|
|
@@ -5210,13 +5245,13 @@ function hr(s, e) {
|
|
|
5210
5245
|
helperError: e
|
|
5211
5246
|
} : s;
|
|
5212
5247
|
}
|
|
5213
|
-
function
|
|
5248
|
+
function mr(s) {
|
|
5214
5249
|
if (!s || typeof s != "object")
|
|
5215
5250
|
return s;
|
|
5216
5251
|
const e = s;
|
|
5217
5252
|
return typeof e.exception?.message == "string" ? e.exception.message : typeof e.error == "string" ? e.error : s;
|
|
5218
5253
|
}
|
|
5219
|
-
function
|
|
5254
|
+
function yr() {
|
|
5220
5255
|
const s = "pluno.productAgent.clientId", e = window.localStorage.getItem(s);
|
|
5221
5256
|
if (e)
|
|
5222
5257
|
return e;
|
|
@@ -5226,7 +5261,7 @@ function gr() {
|
|
|
5226
5261
|
function x() {
|
|
5227
5262
|
return crypto.randomUUID();
|
|
5228
5263
|
}
|
|
5229
|
-
function
|
|
5264
|
+
function Ir(s) {
|
|
5230
5265
|
if (!s || typeof s != "object")
|
|
5231
5266
|
return null;
|
|
5232
5267
|
const e = s, t = typeof e.id == "string" ? e.id : null;
|
|
@@ -5242,7 +5277,7 @@ function st(s, e) {
|
|
|
5242
5277
|
s.map((t) => Ue(t, e)).filter((t) => t !== null)
|
|
5243
5278
|
) : [];
|
|
5244
5279
|
}
|
|
5245
|
-
function
|
|
5280
|
+
function Sr(s) {
|
|
5246
5281
|
return Array.isArray(s) ? s.flatMap((e) => {
|
|
5247
5282
|
if (!e || typeof e != "object")
|
|
5248
5283
|
return [];
|
|
@@ -5270,7 +5305,7 @@ function Ue(s, e) {
|
|
|
5270
5305
|
if (!n || typeof n != "object")
|
|
5271
5306
|
return null;
|
|
5272
5307
|
const i = n;
|
|
5273
|
-
if (i.hiddenFromTranscript === !0 ||
|
|
5308
|
+
if (i.hiddenFromTranscript === !0 || yn(i) || i.type === "tab_lifecycle_decision" && i.decision === "keep")
|
|
5274
5309
|
return null;
|
|
5275
5310
|
if (i.type === "assistant_draft")
|
|
5276
5311
|
return {
|
|
@@ -5278,7 +5313,7 @@ function Ue(s, e) {
|
|
|
5278
5313
|
role: "assistant",
|
|
5279
5314
|
...i.phase === "commentary" || i.phase === "final_answer" ? { phase: i.phase } : {},
|
|
5280
5315
|
content: qt(
|
|
5281
|
-
|
|
5316
|
+
ts(i.content),
|
|
5282
5317
|
e
|
|
5283
5318
|
),
|
|
5284
5319
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -5295,7 +5330,7 @@ function Ue(s, e) {
|
|
|
5295
5330
|
role: r,
|
|
5296
5331
|
...i.phase === "commentary" || i.phase === "final_answer" ? { phase: i.phase } : {},
|
|
5297
5332
|
content: qt(
|
|
5298
|
-
|
|
5333
|
+
ts(i.content),
|
|
5299
5334
|
e
|
|
5300
5335
|
),
|
|
5301
5336
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -5303,7 +5338,7 @@ function Ue(s, e) {
|
|
|
5303
5338
|
...P(i) !== null ? { causalSequence: P(i) } : {},
|
|
5304
5339
|
respondsToUserMessageId: O(i) ?? void 0,
|
|
5305
5340
|
...k(i) ? { runId: k(i) } : {},
|
|
5306
|
-
attachments:
|
|
5341
|
+
attachments: Hs(i.attachments, e),
|
|
5307
5342
|
...i.steered === !0 ? { steered: !0 } : {}
|
|
5308
5343
|
};
|
|
5309
5344
|
return r === "assistant" && typeof i.id == "string" && Object.defineProperty(o, "assistantDraftItemId", {
|
|
@@ -5318,7 +5353,7 @@ function Ue(s, e) {
|
|
|
5318
5353
|
}), o;
|
|
5319
5354
|
}
|
|
5320
5355
|
if (i.type === "function_call_output") {
|
|
5321
|
-
const r =
|
|
5356
|
+
const r = pn(i.output);
|
|
5322
5357
|
if (r !== null)
|
|
5323
5358
|
return {
|
|
5324
5359
|
id: String(t.id ?? crypto.randomUUID()),
|
|
@@ -5333,7 +5368,7 @@ function Ue(s, e) {
|
|
|
5333
5368
|
callId: ue(i) ?? void 0,
|
|
5334
5369
|
sharePromptAllowed: r
|
|
5335
5370
|
};
|
|
5336
|
-
const o =
|
|
5371
|
+
const o = Cn(i.output);
|
|
5337
5372
|
if (o)
|
|
5338
5373
|
return {
|
|
5339
5374
|
id: String(t.id ?? crypto.randomUUID()),
|
|
@@ -5344,12 +5379,12 @@ function Ue(s, e) {
|
|
|
5344
5379
|
respondsToUserMessageId: O(i) ?? void 0,
|
|
5345
5380
|
...k(i) ? { runId: k(i) } : {},
|
|
5346
5381
|
dataType: "scheduled_check_in",
|
|
5347
|
-
toolName:
|
|
5382
|
+
toolName: Ts,
|
|
5348
5383
|
callId: ue(i) ?? void 0,
|
|
5349
5384
|
scheduledCheckInId: o.id ?? void 0,
|
|
5350
5385
|
scheduledCheckInAt: o.dueAt
|
|
5351
5386
|
};
|
|
5352
|
-
const a =
|
|
5387
|
+
const a = wr(i.output), l = Ar(i.output);
|
|
5353
5388
|
return a ? {
|
|
5354
5389
|
id: String(t.id ?? crypto.randomUUID()),
|
|
5355
5390
|
role: "tool",
|
|
@@ -5381,7 +5416,7 @@ function Ue(s, e) {
|
|
|
5381
5416
|
return i.type === "function_call" || i.type === "tool_call" || i.type === "web_search_call" || i.type === "mcp_call" || i.type === "tab_lifecycle_decision" ? {
|
|
5382
5417
|
id: String(t.id ?? crypto.randomUUID()),
|
|
5383
5418
|
role: "tool",
|
|
5384
|
-
content: i.type === "mcp_call" ?
|
|
5419
|
+
content: i.type === "mcp_call" ? Tr(i) : Mr(i),
|
|
5385
5420
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5386
5421
|
...E(i) !== null ? { displaySequence: E(i) } : {},
|
|
5387
5422
|
...P(i) !== null ? { causalSequence: P(i) } : {},
|
|
@@ -5395,7 +5430,7 @@ function Ue(s, e) {
|
|
|
5395
5430
|
} : i.type === "run_status" || i.type === "run_error" ? i.type === "run_error" && i.stage === "tool_execution" ? null : {
|
|
5396
5431
|
id: String(t.id ?? crypto.randomUUID()),
|
|
5397
5432
|
role: "system",
|
|
5398
|
-
content:
|
|
5433
|
+
content: br(i),
|
|
5399
5434
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5400
5435
|
...E(i) !== null ? { displaySequence: E(i) } : {},
|
|
5401
5436
|
...P(i) !== null ? { causalSequence: P(i) } : {},
|
|
@@ -5408,11 +5443,11 @@ function Ue(s, e) {
|
|
|
5408
5443
|
...typeof i.securitySettingsUrl == "string" ? { securitySettingsUrl: i.securitySettingsUrl } : {}
|
|
5409
5444
|
} : null;
|
|
5410
5445
|
}
|
|
5411
|
-
function
|
|
5446
|
+
function Tr(s) {
|
|
5412
5447
|
const t = (typeof s.server_label == "string" ? s.server_label : "").replace(/^pipedream_/, "").split(/[_-]+/).filter(Boolean).map((n) => `${n.charAt(0).toUpperCase()}${n.slice(1)}`).join(" ");
|
|
5413
5448
|
return t ? `🔌 Using ${t}` : "🔌 Using connected integration";
|
|
5414
5449
|
}
|
|
5415
|
-
function
|
|
5450
|
+
function wr(s) {
|
|
5416
5451
|
if (typeof s != "string")
|
|
5417
5452
|
return null;
|
|
5418
5453
|
try {
|
|
@@ -5429,7 +5464,7 @@ function Ir(s) {
|
|
|
5429
5464
|
return null;
|
|
5430
5465
|
}
|
|
5431
5466
|
}
|
|
5432
|
-
function
|
|
5467
|
+
function Ar(s) {
|
|
5433
5468
|
if (typeof s != "string")
|
|
5434
5469
|
return null;
|
|
5435
5470
|
try {
|
|
@@ -5444,10 +5479,10 @@ function Sr(s) {
|
|
|
5444
5479
|
return null;
|
|
5445
5480
|
}
|
|
5446
5481
|
}
|
|
5447
|
-
function
|
|
5482
|
+
function br(s) {
|
|
5448
5483
|
return s.type === "run_status" && s.status === "steered" ? "Steered" : typeof s.message == "string" && s.message.trim().length > 0 ? s.message : "";
|
|
5449
5484
|
}
|
|
5450
|
-
function
|
|
5485
|
+
function Mr(s) {
|
|
5451
5486
|
if (s.type === "web_search_call") {
|
|
5452
5487
|
const e = s.action;
|
|
5453
5488
|
if (e && typeof e == "object") {
|
|
@@ -5459,9 +5494,9 @@ function wr(s) {
|
|
|
5459
5494
|
}
|
|
5460
5495
|
return "🔎 Searching the web";
|
|
5461
5496
|
}
|
|
5462
|
-
return
|
|
5497
|
+
return Rr(s);
|
|
5463
5498
|
}
|
|
5464
|
-
function
|
|
5499
|
+
function Rr(s) {
|
|
5465
5500
|
if (typeof s.summary == "string" && s.summary.trim().length > 0)
|
|
5466
5501
|
return se(s.summary);
|
|
5467
5502
|
if (typeof s.arguments == "string")
|
|
@@ -5478,7 +5513,7 @@ function se(s) {
|
|
|
5478
5513
|
const e = s.trim() || "Run tool", t = e.codePointAt(0) ?? 0;
|
|
5479
5514
|
return t >= 126976 && t <= 129791 || t >= 9728 && t <= 10175 || t >= 127462 && t <= 127487 ? e : `🛠️ ${e}`;
|
|
5480
5515
|
}
|
|
5481
|
-
function
|
|
5516
|
+
function kr(s) {
|
|
5482
5517
|
if (s == null)
|
|
5483
5518
|
return s;
|
|
5484
5519
|
if (typeof s != "object")
|
|
@@ -5503,7 +5538,7 @@ function P(s) {
|
|
|
5503
5538
|
function E(s) {
|
|
5504
5539
|
return typeof s.displaySequence == "number" && Number.isSafeInteger(s.displaySequence) ? s.displaySequence : null;
|
|
5505
5540
|
}
|
|
5506
|
-
function
|
|
5541
|
+
function ts(s) {
|
|
5507
5542
|
return typeof s == "string" ? s : Array.isArray(s) ? s.map((e) => {
|
|
5508
5543
|
if (!e || typeof e != "object")
|
|
5509
5544
|
return "";
|
|
@@ -5512,13 +5547,13 @@ function es(s) {
|
|
|
5512
5547
|
}).filter(Boolean).join("") : "";
|
|
5513
5548
|
}
|
|
5514
5549
|
function de(s, e) {
|
|
5515
|
-
const t =
|
|
5550
|
+
const t = Ds(
|
|
5516
5551
|
s,
|
|
5517
5552
|
Mt(s, e)
|
|
5518
|
-
), n =
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5553
|
+
), n = _r(
|
|
5554
|
+
Cr(
|
|
5555
|
+
Dr(
|
|
5556
|
+
Er(s, e),
|
|
5522
5557
|
e
|
|
5523
5558
|
),
|
|
5524
5559
|
t
|
|
@@ -5543,7 +5578,7 @@ function Mt(s, e, t = !0) {
|
|
|
5543
5578
|
const i = s.flatMap((r) => (e.respondsToUserMessageId !== void 0 ? r.respondsToUserMessageId === e.respondsToUserMessageId : e.runId !== void 0 && r.respondsToUserMessageId === void 0 && r.runId === e.runId) && r.displaySequence !== void 0 ? [r.displaySequence] : []);
|
|
5544
5579
|
return e.displaySequence = (i.length > 0 ? Math.max(...i) : 0) + 1, e;
|
|
5545
5580
|
}
|
|
5546
|
-
function
|
|
5581
|
+
function Er(s, e) {
|
|
5547
5582
|
const t = e.proactiveSuggestionClientMessageId;
|
|
5548
5583
|
if (!t)
|
|
5549
5584
|
return s;
|
|
@@ -5553,7 +5588,7 @@ function Mr(s, e) {
|
|
|
5553
5588
|
const r = [...s];
|
|
5554
5589
|
return r[i] = e, r;
|
|
5555
5590
|
}
|
|
5556
|
-
function
|
|
5591
|
+
function Cr(s, e) {
|
|
5557
5592
|
const t = e.assistantDraftItemId;
|
|
5558
5593
|
return t ? s.map(
|
|
5559
5594
|
(n) => n.dataType === "assistant_draft" && n.id === t ? e : n
|
|
@@ -5562,7 +5597,7 @@ function Rr(s, e) {
|
|
|
5562
5597
|
function be(s, e, t) {
|
|
5563
5598
|
return e !== null ? s.respondsToUserMessageId === e : t !== null && s.runId === t;
|
|
5564
5599
|
}
|
|
5565
|
-
function
|
|
5600
|
+
function ss(s, e, t, n) {
|
|
5566
5601
|
if (t === null) return s;
|
|
5567
5602
|
let i = -1;
|
|
5568
5603
|
for (let o = s.length - 1; o >= 0; o -= 1) {
|
|
@@ -5579,7 +5614,7 @@ function ts(s, e, t, n) {
|
|
|
5579
5614
|
respondsToUserMessageId: t
|
|
5580
5615
|
}, r;
|
|
5581
5616
|
}
|
|
5582
|
-
function
|
|
5617
|
+
function ns(s, e) {
|
|
5583
5618
|
const t = s.findIndex(
|
|
5584
5619
|
(i) => !i.id.startsWith("transient-activity:") && i.callId === e.callId
|
|
5585
5620
|
);
|
|
@@ -5596,12 +5631,12 @@ function ss(s, e) {
|
|
|
5596
5631
|
...n[t].runId ? {} : { runId: e.runId }
|
|
5597
5632
|
}, n;
|
|
5598
5633
|
}
|
|
5599
|
-
function
|
|
5634
|
+
function is(s, e, t) {
|
|
5600
5635
|
let n = !1;
|
|
5601
5636
|
const i = s.map((r) => r.callId !== e || r.loading === t ? r : (n = !0, { ...r, loading: t }));
|
|
5602
5637
|
return n ? i : s;
|
|
5603
5638
|
}
|
|
5604
|
-
function
|
|
5639
|
+
function rs(s) {
|
|
5605
5640
|
if (s.hiddenFromTranscript === !0)
|
|
5606
5641
|
return null;
|
|
5607
5642
|
const e = typeof s.callId == "string" ? s.callId : null, t = typeof s.toolName == "string" ? s.toolName : null;
|
|
@@ -5621,7 +5656,7 @@ function is(s) {
|
|
|
5621
5656
|
loading: !0
|
|
5622
5657
|
};
|
|
5623
5658
|
}
|
|
5624
|
-
function
|
|
5659
|
+
function _r(s, e) {
|
|
5625
5660
|
if (e.id.startsWith("transient-activity:"))
|
|
5626
5661
|
return s;
|
|
5627
5662
|
const t = e.toolName === "tab_lifecycle";
|
|
@@ -5635,19 +5670,19 @@ function ct(s, e) {
|
|
|
5635
5670
|
for (const n of e) {
|
|
5636
5671
|
const i = [...s, ...t];
|
|
5637
5672
|
t.push(
|
|
5638
|
-
|
|
5673
|
+
Ds(
|
|
5639
5674
|
i,
|
|
5640
5675
|
Mt(i, n, !1)
|
|
5641
5676
|
)
|
|
5642
5677
|
);
|
|
5643
5678
|
}
|
|
5644
|
-
return
|
|
5679
|
+
return In(
|
|
5645
5680
|
s,
|
|
5646
5681
|
t,
|
|
5647
5682
|
ut
|
|
5648
5683
|
);
|
|
5649
5684
|
}
|
|
5650
|
-
function
|
|
5685
|
+
function Pr(s, e) {
|
|
5651
5686
|
const t = new Map(s.map((r) => [r.id, r])), n = e.map(
|
|
5652
5687
|
(r) => Mt(s, r, !1)
|
|
5653
5688
|
);
|
|
@@ -5688,42 +5723,42 @@ function ut(s) {
|
|
|
5688
5723
|
isTransient: s.id.startsWith("transient-activity:") || s.dataType === "assistant_draft"
|
|
5689
5724
|
};
|
|
5690
5725
|
}
|
|
5691
|
-
function
|
|
5726
|
+
function Ds(s, e) {
|
|
5692
5727
|
if (e.role !== "user" || !e.attachments?.length)
|
|
5693
5728
|
return e;
|
|
5694
5729
|
const t = s.find(
|
|
5695
|
-
(o) => o.role === "user" && (o.id === e.id || He(o) &&
|
|
5730
|
+
(o) => o.role === "user" && (o.id === e.id || He(o) && qs(o, e))
|
|
5696
5731
|
);
|
|
5697
5732
|
if (!t?.attachments?.length)
|
|
5698
5733
|
return e;
|
|
5699
5734
|
const n = e.attachments.map((o) => {
|
|
5700
|
-
const a =
|
|
5701
|
-
return a ?
|
|
5735
|
+
const a = vr(t.attachments ?? [], o);
|
|
5736
|
+
return a ? Ur(o, a) : o;
|
|
5702
5737
|
}), i = { ...e, attachments: n }, r = X(e);
|
|
5703
5738
|
return r && Object.defineProperty(i, "clientMessageId", {
|
|
5704
5739
|
value: r,
|
|
5705
5740
|
enumerable: !1
|
|
5706
5741
|
}), i;
|
|
5707
5742
|
}
|
|
5708
|
-
function
|
|
5743
|
+
function vr(s, e) {
|
|
5709
5744
|
return e.id ? s.find((t) => t.id === e.id) ?? null : null;
|
|
5710
5745
|
}
|
|
5711
|
-
function
|
|
5746
|
+
function Ur(s, e) {
|
|
5712
5747
|
const { previewUrl: t } = e;
|
|
5713
5748
|
return t ? { ...s, previewUrl: t } : s;
|
|
5714
5749
|
}
|
|
5715
|
-
function
|
|
5750
|
+
function Dr(s, e) {
|
|
5716
5751
|
if (e.role !== "user")
|
|
5717
5752
|
return s;
|
|
5718
5753
|
const t = s.findIndex(
|
|
5719
|
-
(i) => He(i) &&
|
|
5754
|
+
(i) => He(i) && qs(i, e)
|
|
5720
5755
|
);
|
|
5721
5756
|
if (t === -1)
|
|
5722
5757
|
return s;
|
|
5723
5758
|
const n = [...s];
|
|
5724
5759
|
return n.splice(t, 1), n;
|
|
5725
5760
|
}
|
|
5726
|
-
function
|
|
5761
|
+
function qs(s, e) {
|
|
5727
5762
|
const t = X(s), n = X(e);
|
|
5728
5763
|
return t && n ? t === n : s.content === e.content;
|
|
5729
5764
|
}
|
|
@@ -5739,8 +5774,8 @@ function X(s) {
|
|
|
5739
5774
|
);
|
|
5740
5775
|
return n ? s.id.slice(n.length) : null;
|
|
5741
5776
|
}
|
|
5742
|
-
function
|
|
5743
|
-
const e =
|
|
5777
|
+
function os(s) {
|
|
5778
|
+
const e = Os(s);
|
|
5744
5779
|
if (e === null)
|
|
5745
5780
|
return !1;
|
|
5746
5781
|
const t = s[e].id;
|
|
@@ -5763,7 +5798,7 @@ function rs(s) {
|
|
|
5763
5798
|
}
|
|
5764
5799
|
return !1;
|
|
5765
5800
|
}
|
|
5766
|
-
function
|
|
5801
|
+
function qr(s, e, t) {
|
|
5767
5802
|
const n = new Set(
|
|
5768
5803
|
s.filter(
|
|
5769
5804
|
(i) => i.role === "user" && e !== null && X(i) === e
|
|
@@ -5777,14 +5812,14 @@ function vr(s, e, t) {
|
|
|
5777
5812
|
if (t && i.runId === t) {
|
|
5778
5813
|
if (n.size === 0)
|
|
5779
5814
|
return !0;
|
|
5780
|
-
const o =
|
|
5815
|
+
const o = xs(s, r);
|
|
5781
5816
|
return !i.respondsToUserMessageId && o !== null && n.has(o);
|
|
5782
5817
|
}
|
|
5783
5818
|
return !1;
|
|
5784
5819
|
});
|
|
5785
5820
|
}
|
|
5786
|
-
function
|
|
5787
|
-
const e =
|
|
5821
|
+
function Or(s) {
|
|
5822
|
+
const e = Os(s);
|
|
5788
5823
|
if (e === null)
|
|
5789
5824
|
return s.some(W);
|
|
5790
5825
|
const t = s[e].id;
|
|
@@ -5792,7 +5827,7 @@ function Ur(s) {
|
|
|
5792
5827
|
(n) => n.respondsToUserMessageId === t && W(n)
|
|
5793
5828
|
) : s.slice(e + 1).some(W);
|
|
5794
5829
|
}
|
|
5795
|
-
function
|
|
5830
|
+
function Os(s) {
|
|
5796
5831
|
for (let e = s.length - 1; e >= 0; e -= 1)
|
|
5797
5832
|
if (s[e].role === "user" && !He(s[e]))
|
|
5798
5833
|
return e;
|
|
@@ -5815,7 +5850,7 @@ function ie(s) {
|
|
|
5815
5850
|
}
|
|
5816
5851
|
return null;
|
|
5817
5852
|
}
|
|
5818
|
-
function
|
|
5853
|
+
function xr(s) {
|
|
5819
5854
|
const e = ie(s);
|
|
5820
5855
|
if (e === null)
|
|
5821
5856
|
return null;
|
|
@@ -5834,10 +5869,10 @@ function C(s) {
|
|
|
5834
5869
|
function pe(s) {
|
|
5835
5870
|
return s?.retryable !== !0 ? !1 : s.type === "run_error" ? !0 : s.type === "run_status" && s.status === "interrupted";
|
|
5836
5871
|
}
|
|
5837
|
-
function
|
|
5872
|
+
function Lr(s) {
|
|
5838
5873
|
return s?.type === "run_status" && s.status === "interrupted" && s.reason === "backend_restart";
|
|
5839
5874
|
}
|
|
5840
|
-
function
|
|
5875
|
+
function Nr(s, e) {
|
|
5841
5876
|
const t = ie(e);
|
|
5842
5877
|
if (t === null)
|
|
5843
5878
|
return !1;
|
|
@@ -5862,7 +5897,7 @@ function dt(s) {
|
|
|
5862
5897
|
const i = n.clientMessageId;
|
|
5863
5898
|
return typeof i == "string" ? i : null;
|
|
5864
5899
|
}
|
|
5865
|
-
function
|
|
5900
|
+
function Hr(s) {
|
|
5866
5901
|
const e = ie(s);
|
|
5867
5902
|
if (e === null)
|
|
5868
5903
|
return null;
|
|
@@ -5892,8 +5927,8 @@ function ht(s, e) {
|
|
|
5892
5927
|
const n = s.find((r) => A(r, "id") === t), i = C(n);
|
|
5893
5928
|
return i?.type === "message" && i.role === "user" && typeof i.clientMessageId == "string" ? i.clientMessageId : null;
|
|
5894
5929
|
}
|
|
5895
|
-
function
|
|
5896
|
-
if (!e || !
|
|
5930
|
+
function as(s, e, t, n, i, r) {
|
|
5931
|
+
if (!e || !Fr(s))
|
|
5897
5932
|
return !1;
|
|
5898
5933
|
const o = s;
|
|
5899
5934
|
if (pe(o) || t !== null && typeof o.id == "string" && o.id !== t)
|
|
@@ -5901,7 +5936,7 @@ function os(s, e, t, n, i, r) {
|
|
|
5901
5936
|
const a = O(o);
|
|
5902
5937
|
return n !== null ? a !== null ? a === n : i !== null && k(o) === i && r === n : i === null || k(o) === i;
|
|
5903
5938
|
}
|
|
5904
|
-
function
|
|
5939
|
+
function Br(s, e) {
|
|
5905
5940
|
for (let t = e - 1; t >= 0; t -= 1) {
|
|
5906
5941
|
const n = C(s[t]);
|
|
5907
5942
|
if (n?.type === "message" && n.role === "user")
|
|
@@ -5909,13 +5944,13 @@ function Lr(s, e) {
|
|
|
5909
5944
|
}
|
|
5910
5945
|
return null;
|
|
5911
5946
|
}
|
|
5912
|
-
function
|
|
5947
|
+
function xs(s, e) {
|
|
5913
5948
|
for (let t = e - 1; t >= 0; t -= 1)
|
|
5914
5949
|
if (s[t].role === "user")
|
|
5915
5950
|
return s[t].id;
|
|
5916
5951
|
return null;
|
|
5917
5952
|
}
|
|
5918
|
-
function
|
|
5953
|
+
function Fr(s) {
|
|
5919
5954
|
if (!s || typeof s != "object")
|
|
5920
5955
|
return !1;
|
|
5921
5956
|
const e = s;
|
|
@@ -5924,16 +5959,16 @@ function Nr(s) {
|
|
|
5924
5959
|
function W(s) {
|
|
5925
5960
|
return s.role === "assistant" && s.phase !== "commentary";
|
|
5926
5961
|
}
|
|
5927
|
-
function
|
|
5962
|
+
function Wr(s) {
|
|
5928
5963
|
if (!s || typeof s != "object")
|
|
5929
5964
|
return !1;
|
|
5930
5965
|
const e = s;
|
|
5931
5966
|
return e.type === "message" && e.role === "user" ? !1 : e.type === "message" || e.type === "function_call" || e.type === "function_call_output" || e.type === "run_error" || e.type === "run_status";
|
|
5932
5967
|
}
|
|
5933
5968
|
function pt(s) {
|
|
5934
|
-
return s.filter((e, t) => G(e) ? !
|
|
5969
|
+
return s.filter((e, t) => G(e) ? !to(s, t) && !Ls(s, t) && !Zr(s, t) && !eo(s, t) : $r(e) ? e.retryable === !0 && Yr(s, t) ? !1 : !Xr(s, t) : !0);
|
|
5935
5970
|
}
|
|
5936
|
-
function
|
|
5971
|
+
function $r(s) {
|
|
5937
5972
|
return s.role === "system" && (s.dataType === "run_error" || s.dataType === "run_status" && s.steered !== !0);
|
|
5938
5973
|
}
|
|
5939
5974
|
function G(s) {
|
|
@@ -5942,19 +5977,19 @@ function G(s) {
|
|
|
5942
5977
|
function gt(s) {
|
|
5943
5978
|
return s.steered !== !0 && (s.dataType === "assistant_draft" || s.loading === !0);
|
|
5944
5979
|
}
|
|
5945
|
-
function
|
|
5980
|
+
function jr(s) {
|
|
5946
5981
|
return s.some(gt);
|
|
5947
5982
|
}
|
|
5948
|
-
function
|
|
5983
|
+
function ls(s, e) {
|
|
5949
5984
|
return (s.retryable === !0 || s.code === "transient_model_error") && s.code !== "run_recovery_exhausted" && e !== null && typeof s.clientMessageId == "string";
|
|
5950
5985
|
}
|
|
5951
|
-
function
|
|
5986
|
+
function zr(s, e) {
|
|
5952
5987
|
const t = [...s].reverse().find(gt), n = typeof e.respondsToUserMessageId == "string" ? e.respondsToUserMessageId : t?.respondsToUserMessageId ?? null, i = typeof e.runId == "string" ? e.runId : t?.runId ?? null;
|
|
5953
5988
|
return s.flatMap((r) => (n ? r.respondsToUserMessageId === n || !r.respondsToUserMessageId && i !== null && r.runId === i : i ? r.runId === i : gt(r)) ? r.dataType === "assistant_draft" || G(r) ? [] : r.loading === !0 ? [{ ...r, loading: !1 }] : [r] : [r]);
|
|
5954
5989
|
}
|
|
5955
|
-
function
|
|
5990
|
+
function Kr(s, e, t, n) {
|
|
5956
5991
|
const i = s.findIndex(
|
|
5957
|
-
(l, c) => G(l) && !
|
|
5992
|
+
(l, c) => G(l) && !Ls(s, c)
|
|
5958
5993
|
), r = i === -1 ? null : s[i], o = e ?? r?.respondsToUserMessageId ?? null, a = o ? s.find(
|
|
5959
5994
|
(l) => l.role === "user" && l.id === o
|
|
5960
5995
|
) : null;
|
|
@@ -5967,10 +6002,10 @@ function $r(s, e, t, n) {
|
|
|
5967
6002
|
function _e(s) {
|
|
5968
6003
|
return s?.type === "run_status" && s.status === "stopped";
|
|
5969
6004
|
}
|
|
5970
|
-
function
|
|
6005
|
+
function Gr(s, e) {
|
|
5971
6006
|
return W(e) ? "completed" : _e(s) ? "stopped" : !pe(s) && (s?.type === "run_error" || s?.type === "run_status" && (s.status === "failed" || s.status === "interrupted")) ? "failed" : null;
|
|
5972
6007
|
}
|
|
5973
|
-
function
|
|
6008
|
+
function cs(s, e, t) {
|
|
5974
6009
|
const n = new Set(
|
|
5975
6010
|
s.filter(
|
|
5976
6011
|
(i) => i.role === "user" && e !== null && X(i) === e
|
|
@@ -5980,16 +6015,16 @@ function ls(s, e, t) {
|
|
|
5980
6015
|
(i) => !G(i) || (n.size > 0 ? !i.respondsToUserMessageId || !n.has(i.respondsToUserMessageId) : !t || i.runId !== t)
|
|
5981
6016
|
);
|
|
5982
6017
|
}
|
|
5983
|
-
function
|
|
6018
|
+
function Ls(s, e) {
|
|
5984
6019
|
return s.some(
|
|
5985
|
-
(t, n) => n !== e && t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.loading !== !0 && t.steered !== !0) &&
|
|
6020
|
+
(t, n) => n !== e && t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.loading !== !0 && t.steered !== !0) && Vr(
|
|
5986
6021
|
s,
|
|
5987
6022
|
e,
|
|
5988
6023
|
n
|
|
5989
6024
|
)
|
|
5990
6025
|
);
|
|
5991
6026
|
}
|
|
5992
|
-
function
|
|
6027
|
+
function Vr(s, e, t) {
|
|
5993
6028
|
const n = s[e], i = s[t];
|
|
5994
6029
|
if (ge(n, i))
|
|
5995
6030
|
return !0;
|
|
@@ -6000,20 +6035,20 @@ function zr(s, e, t) {
|
|
|
6000
6035
|
return s[r].id === n.respondsToUserMessageId;
|
|
6001
6036
|
return !1;
|
|
6002
6037
|
}
|
|
6003
|
-
function
|
|
6038
|
+
function us(s, e, t, n) {
|
|
6004
6039
|
const i = (t && t !== e ? t : null) ?? [...s].reverse().find(
|
|
6005
|
-
(l) => l.respondsToUserMessageId !== void 0 && l.respondsToUserMessageId !== e &&
|
|
6040
|
+
(l) => l.respondsToUserMessageId !== void 0 && l.respondsToUserMessageId !== e && ds(l) && !Jr(
|
|
6006
6041
|
s,
|
|
6007
6042
|
l.respondsToUserMessageId
|
|
6008
6043
|
)
|
|
6009
|
-
)?.respondsToUserMessageId ??
|
|
6044
|
+
)?.respondsToUserMessageId ?? Qr(
|
|
6010
6045
|
s,
|
|
6011
6046
|
e
|
|
6012
6047
|
);
|
|
6013
6048
|
if (!i)
|
|
6014
6049
|
return s;
|
|
6015
6050
|
let r = !1;
|
|
6016
|
-
const o = s.map((l) => l.respondsToUserMessageId !== i || !
|
|
6051
|
+
const o = s.map((l) => l.respondsToUserMessageId !== i || !ds(l) ? l : (r = !0, { ...l, steered: !0 }));
|
|
6017
6052
|
if (r)
|
|
6018
6053
|
return o;
|
|
6019
6054
|
const a = s.find(
|
|
@@ -6035,7 +6070,7 @@ function cs(s, e, t, n) {
|
|
|
6035
6070
|
}
|
|
6036
6071
|
];
|
|
6037
6072
|
}
|
|
6038
|
-
function
|
|
6073
|
+
function Qr(s, e) {
|
|
6039
6074
|
const t = s.findIndex(
|
|
6040
6075
|
(n) => n.role === "user" && n.id === e
|
|
6041
6076
|
);
|
|
@@ -6046,15 +6081,15 @@ function Kr(s, e) {
|
|
|
6046
6081
|
return s[n].id;
|
|
6047
6082
|
return null;
|
|
6048
6083
|
}
|
|
6049
|
-
function
|
|
6084
|
+
function ds(s) {
|
|
6050
6085
|
return s.role === "tool" || G(s) ? !0 : s.role === "assistant" && s.phase === "commentary";
|
|
6051
6086
|
}
|
|
6052
|
-
function
|
|
6087
|
+
function Jr(s, e) {
|
|
6053
6088
|
return s.some(
|
|
6054
6089
|
(t) => t.respondsToUserMessageId === e && (W(t) || t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.loading !== !0))
|
|
6055
6090
|
);
|
|
6056
6091
|
}
|
|
6057
|
-
function
|
|
6092
|
+
function Xr(s, e) {
|
|
6058
6093
|
const t = s[e];
|
|
6059
6094
|
for (let n = e + 1; n < s.length; n += 1) {
|
|
6060
6095
|
const i = s[n];
|
|
@@ -6063,7 +6098,7 @@ function Vr(s, e) {
|
|
|
6063
6098
|
}
|
|
6064
6099
|
return !1;
|
|
6065
6100
|
}
|
|
6066
|
-
function
|
|
6101
|
+
function Yr(s, e) {
|
|
6067
6102
|
const t = s[e];
|
|
6068
6103
|
if (!t.respondsToUserMessageId)
|
|
6069
6104
|
return !1;
|
|
@@ -6076,19 +6111,19 @@ function Qr(s, e) {
|
|
|
6076
6111
|
}
|
|
6077
6112
|
return !1;
|
|
6078
6113
|
}
|
|
6079
|
-
function
|
|
6114
|
+
function Zr(s, e) {
|
|
6080
6115
|
const t = s[e];
|
|
6081
6116
|
return s.some(
|
|
6082
6117
|
(n, i) => i !== e && n.role === "assistant" && ge(t, n)
|
|
6083
6118
|
);
|
|
6084
6119
|
}
|
|
6085
|
-
function
|
|
6120
|
+
function eo(s, e) {
|
|
6086
6121
|
const t = s[e];
|
|
6087
6122
|
return s.some(
|
|
6088
6123
|
(n, i) => i !== e && n.role === "tool" && ge(t, n)
|
|
6089
6124
|
);
|
|
6090
6125
|
}
|
|
6091
|
-
function
|
|
6126
|
+
function to(s, e) {
|
|
6092
6127
|
const t = s[e];
|
|
6093
6128
|
for (let n = e + 1; n < s.length; n += 1)
|
|
6094
6129
|
if (G(s[n]) && ge(t, s[n]))
|
|
@@ -6101,15 +6136,15 @@ function ge(s, e) {
|
|
|
6101
6136
|
function A(s, e) {
|
|
6102
6137
|
return s && typeof s == "object" && typeof s[e] == "string" ? s[e] : null;
|
|
6103
6138
|
}
|
|
6104
|
-
function
|
|
6139
|
+
function so(s, e) {
|
|
6105
6140
|
try {
|
|
6106
|
-
const t = window.localStorage.getItem(`${
|
|
6141
|
+
const t = window.localStorage.getItem(`${Cs}${s}`);
|
|
6107
6142
|
if (!t)
|
|
6108
6143
|
return null;
|
|
6109
6144
|
const n = JSON.parse(t), i = typeof n.sessionId == "string" ? n.sessionId : null;
|
|
6110
6145
|
if (e !== void 0 && i !== e)
|
|
6111
6146
|
return null;
|
|
6112
|
-
const r = Array.isArray(n.messages) ? n.messages.map(
|
|
6147
|
+
const r = Array.isArray(n.messages) ? n.messages.map(go).filter((o) => !!o) : [];
|
|
6113
6148
|
return {
|
|
6114
6149
|
sessionId: i,
|
|
6115
6150
|
messages: r
|
|
@@ -6123,20 +6158,20 @@ function ft(s) {
|
|
|
6123
6158
|
// running tool or commentary history from disappearing while authoritative hydration is still in flight.
|
|
6124
6159
|
s.role === "tool" || s.dataType === "run_status" || s.dataType === "run_error";
|
|
6125
6160
|
}
|
|
6126
|
-
function
|
|
6161
|
+
function no(s, e) {
|
|
6127
6162
|
try {
|
|
6128
6163
|
window.localStorage.setItem(
|
|
6129
|
-
`${
|
|
6164
|
+
`${Cs}${s}`,
|
|
6130
6165
|
JSON.stringify({
|
|
6131
6166
|
sessionId: e.sessionId,
|
|
6132
|
-
messages: e.messages.filter(ft).slice(-
|
|
6167
|
+
messages: e.messages.filter(ft).slice(-Mi).map(fo)
|
|
6133
6168
|
})
|
|
6134
6169
|
);
|
|
6135
6170
|
} catch {
|
|
6136
6171
|
return;
|
|
6137
6172
|
}
|
|
6138
6173
|
}
|
|
6139
|
-
function
|
|
6174
|
+
function io(s) {
|
|
6140
6175
|
try {
|
|
6141
6176
|
const e = window.localStorage.getItem(`${lt}${s}`);
|
|
6142
6177
|
if (!e)
|
|
@@ -6162,7 +6197,7 @@ function Q(s, e) {
|
|
|
6162
6197
|
return;
|
|
6163
6198
|
}
|
|
6164
6199
|
}
|
|
6165
|
-
function
|
|
6200
|
+
function Ns(s, e) {
|
|
6166
6201
|
try {
|
|
6167
6202
|
const t = `${Le}${s}`, n = location.href, i = location.origin, r = Array.from(e, (o) => ({
|
|
6168
6203
|
...o,
|
|
@@ -6178,28 +6213,28 @@ function xs(s, e) {
|
|
|
6178
6213
|
} catch {
|
|
6179
6214
|
}
|
|
6180
6215
|
}
|
|
6181
|
-
function
|
|
6216
|
+
function hs(s, e) {
|
|
6182
6217
|
try {
|
|
6183
6218
|
if (window.sessionStorage.getItem(`${Le}${s}`) === null)
|
|
6184
6219
|
return;
|
|
6185
6220
|
} catch {
|
|
6186
6221
|
return;
|
|
6187
6222
|
}
|
|
6188
|
-
|
|
6223
|
+
Ns(s, e);
|
|
6189
6224
|
}
|
|
6190
|
-
function
|
|
6225
|
+
function ro(s) {
|
|
6191
6226
|
try {
|
|
6192
6227
|
const e = `${Le}${s}`, t = window.sessionStorage.getItem(e);
|
|
6193
6228
|
if (window.sessionStorage.removeItem(e), !t)
|
|
6194
6229
|
return [];
|
|
6195
6230
|
const n = JSON.parse(t);
|
|
6196
|
-
return Array.isArray(n) ? n.flatMap((i) =>
|
|
6231
|
+
return Array.isArray(n) ? n.flatMap((i) => ao(i) ? [{
|
|
6197
6232
|
...i.event,
|
|
6198
6233
|
page: _(),
|
|
6199
6234
|
rawOutput: {
|
|
6200
6235
|
pageContextRestarted: !0,
|
|
6201
6236
|
outcome: "unknown",
|
|
6202
|
-
message:
|
|
6237
|
+
message: oo(location.href),
|
|
6203
6238
|
currentUrl: location.href,
|
|
6204
6239
|
console: [],
|
|
6205
6240
|
metadata: {
|
|
@@ -6216,17 +6251,17 @@ function so(s) {
|
|
|
6216
6251
|
return [];
|
|
6217
6252
|
}
|
|
6218
6253
|
}
|
|
6219
|
-
function
|
|
6254
|
+
function oo(s) {
|
|
6220
6255
|
return `The page context restarted. This is expected when the action included page navigation. Otherwise, it's unknown whether the action completed.
|
|
6221
6256
|
Current URL: ${s}`;
|
|
6222
6257
|
}
|
|
6223
|
-
function
|
|
6258
|
+
function ao(s) {
|
|
6224
6259
|
if (!s || typeof s != "object")
|
|
6225
6260
|
return !1;
|
|
6226
6261
|
const e = s, t = e.event;
|
|
6227
6262
|
return typeof e.startedAtMs == "number" && typeof e.startedAtUrl == "string" && e.startedAtOrigin === location.origin && e.unloadOrigin === location.origin && typeof e.unloadUrl == "string" && Rt(t) && t.type === "tool.result";
|
|
6228
6263
|
}
|
|
6229
|
-
function
|
|
6264
|
+
function lo(s, e) {
|
|
6230
6265
|
const t = new Set(
|
|
6231
6266
|
s.flatMap((n) => n.type === "tool.result" ? [n.callId] : [])
|
|
6232
6267
|
);
|
|
@@ -6235,7 +6270,7 @@ function ro(s, e) {
|
|
|
6235
6270
|
...e.filter((n) => !t.has(n.callId))
|
|
6236
6271
|
];
|
|
6237
6272
|
}
|
|
6238
|
-
function
|
|
6273
|
+
function co(s) {
|
|
6239
6274
|
try {
|
|
6240
6275
|
window.sessionStorage.removeItem(`${Le}${s}`);
|
|
6241
6276
|
} catch {
|
|
@@ -6246,15 +6281,15 @@ function Rt(s) {
|
|
|
6246
6281
|
if (!s || typeof s != "object")
|
|
6247
6282
|
return !1;
|
|
6248
6283
|
const e = s;
|
|
6249
|
-
return e.type === "chat.user_message" ? typeof e.content == "string" &&
|
|
6284
|
+
return e.type === "chat.user_message" ? typeof e.content == "string" && ps(e.page) : e.type === "page.upsert" || e.type === "session.reset" || e.type === "network.batch" ? ps(e.page) : e.type === "tool.result" ? typeof e.sessionId == "string" && typeof e.callId == "string" && (e.toolName === "execute_code" || e.toolName === "execute_code_in_browser_tab") : e.type === "chat.retry_last_user_message" ? typeof e.sessionId == "string" && typeof e.clientMessageId == "string" : e.type === "run.stop" ? typeof e.sessionId == "string" && (e.reason === "user_requested" || e.reason === "new_chat" || e.reason === "session_switch") : !1;
|
|
6250
6285
|
}
|
|
6251
|
-
function
|
|
6286
|
+
function ps(s) {
|
|
6252
6287
|
if (!s || typeof s != "object")
|
|
6253
6288
|
return !1;
|
|
6254
6289
|
const e = s;
|
|
6255
6290
|
return typeof e.url == "string" && typeof e.title == "string" && typeof e.origin == "string";
|
|
6256
6291
|
}
|
|
6257
|
-
function
|
|
6292
|
+
function Hs(s, e) {
|
|
6258
6293
|
if (!Array.isArray(s))
|
|
6259
6294
|
return;
|
|
6260
6295
|
const t = s.filter((i) => {
|
|
@@ -6262,41 +6297,41 @@ function Ls(s, e) {
|
|
|
6262
6297
|
return !1;
|
|
6263
6298
|
const r = i;
|
|
6264
6299
|
return typeof r.name == "string" && typeof r.mimeType == "string" && typeof r.sizeBytes == "number";
|
|
6265
|
-
}), n = e ? t.map((i) =>
|
|
6300
|
+
}), n = e ? t.map((i) => Bs(i, e)) : t;
|
|
6266
6301
|
return n.length > 0 ? n : void 0;
|
|
6267
6302
|
}
|
|
6268
|
-
function
|
|
6303
|
+
function Bs(s, e) {
|
|
6269
6304
|
return s.fileUrl?.startsWith("/") ? {
|
|
6270
6305
|
...s,
|
|
6271
6306
|
fileUrl: new URL(s.fileUrl, e).toString()
|
|
6272
6307
|
} : s;
|
|
6273
6308
|
}
|
|
6274
6309
|
function mt(s) {
|
|
6275
|
-
return s.type ||
|
|
6310
|
+
return s.type || po(s.name) || "application/octet-stream";
|
|
6276
6311
|
}
|
|
6277
|
-
function
|
|
6278
|
-
|
|
6312
|
+
function uo(s) {
|
|
6313
|
+
Fs({
|
|
6279
6314
|
name: s.name,
|
|
6280
6315
|
mimeType: mt(s),
|
|
6281
6316
|
sizeBytes: s.size
|
|
6282
6317
|
});
|
|
6283
6318
|
}
|
|
6284
|
-
function
|
|
6285
|
-
const e =
|
|
6286
|
-
if (!
|
|
6319
|
+
function Fs(s) {
|
|
6320
|
+
const e = ho(s.name), t = s.mimeType.trim().toLowerCase();
|
|
6321
|
+
if (!wi.has(`${e}:${t}`))
|
|
6287
6322
|
throw new Error("This attachment type is not supported by the embedded model provider");
|
|
6288
|
-
if (s.sizeBytes <= 0 || s.sizeBytes >=
|
|
6323
|
+
if (s.sizeBytes <= 0 || s.sizeBytes >= ks)
|
|
6289
6324
|
throw new Error("Embedded attachments must be between 1 byte and less than 50 MB");
|
|
6290
6325
|
}
|
|
6291
|
-
function
|
|
6326
|
+
function ho(s) {
|
|
6292
6327
|
const e = s.trim().toLowerCase(), t = e.lastIndexOf(".");
|
|
6293
6328
|
return t >= 0 ? e.slice(t) : "";
|
|
6294
6329
|
}
|
|
6295
|
-
function
|
|
6330
|
+
function po(s) {
|
|
6296
6331
|
const e = s.toLowerCase();
|
|
6297
6332
|
return e.endsWith(".png") ? "image/png" : e.endsWith(".jpg") || e.endsWith(".jpeg") ? "image/jpeg" : e.endsWith(".webp") ? "image/webp" : e.endsWith(".gif") ? "image/gif" : e.endsWith(".pdf") ? "application/pdf" : null;
|
|
6298
6333
|
}
|
|
6299
|
-
function
|
|
6334
|
+
function go(s) {
|
|
6300
6335
|
if (!s || typeof s != "object")
|
|
6301
6336
|
return null;
|
|
6302
6337
|
const e = s;
|
|
@@ -6314,11 +6349,11 @@ function uo(s) {
|
|
|
6314
6349
|
scheduledCheckInId: typeof e.scheduledCheckInId == "string" ? e.scheduledCheckInId : void 0,
|
|
6315
6350
|
scheduledCheckInAt: typeof e.scheduledCheckInAt == "string" ? e.scheduledCheckInAt : void 0,
|
|
6316
6351
|
securitySettingsUrl: typeof e.securitySettingsUrl == "string" ? e.securitySettingsUrl : void 0,
|
|
6317
|
-
attachments:
|
|
6352
|
+
attachments: Hs(e.attachments)?.map(qe),
|
|
6318
6353
|
loading: typeof e.loading == "boolean" ? e.loading : void 0
|
|
6319
6354
|
};
|
|
6320
6355
|
}
|
|
6321
|
-
function
|
|
6356
|
+
function fo(s) {
|
|
6322
6357
|
return s.attachments?.length ? {
|
|
6323
6358
|
...s,
|
|
6324
6359
|
attachments: s.attachments.map(qe)
|
|
@@ -6342,11 +6377,11 @@ function k(s) {
|
|
|
6342
6377
|
const e = s.runId;
|
|
6343
6378
|
return typeof e == "string" && e ? e : null;
|
|
6344
6379
|
}
|
|
6345
|
-
function
|
|
6380
|
+
function mo(s) {
|
|
6346
6381
|
const e = s?.timeoutMs;
|
|
6347
|
-
return !!s && typeof s == "object" && typeof s.summary == "string" && typeof s.javascript == "string" && (e === void 0 || typeof e == "number" && Number.isInteger(e) && e > 0 && e <=
|
|
6382
|
+
return !!s && typeof s == "object" && typeof s.summary == "string" && typeof s.javascript == "string" && (e === void 0 || typeof e == "number" && Number.isInteger(e) && e > 0 && e <= Ni);
|
|
6348
6383
|
}
|
|
6349
|
-
function
|
|
6384
|
+
function Ws(s) {
|
|
6350
6385
|
const e = {};
|
|
6351
6386
|
try {
|
|
6352
6387
|
new Headers(s).forEach((t, n) => {
|
|
@@ -6358,23 +6393,23 @@ function Bs(s) {
|
|
|
6358
6393
|
return e;
|
|
6359
6394
|
}
|
|
6360
6395
|
function kt(s, e) {
|
|
6361
|
-
return
|
|
6396
|
+
return Vs(s) ? Be : F(xe(e), Ai);
|
|
6362
6397
|
}
|
|
6363
|
-
function
|
|
6398
|
+
function yo(s, e) {
|
|
6364
6399
|
return typeof s == "string" ? s : s instanceof URL ? s.toString() : e?.url ?? "";
|
|
6365
6400
|
}
|
|
6366
|
-
async function
|
|
6367
|
-
const i =
|
|
6401
|
+
async function Io(s, e, t, n) {
|
|
6402
|
+
const i = Ws(s.headers);
|
|
6368
6403
|
n({
|
|
6369
6404
|
...e,
|
|
6370
6405
|
responseStatus: s.status,
|
|
6371
6406
|
responseHeaders: i,
|
|
6372
|
-
responseBody: await
|
|
6407
|
+
responseBody: await So(s),
|
|
6373
6408
|
durationMs: Date.now() - t
|
|
6374
6409
|
});
|
|
6375
6410
|
}
|
|
6376
|
-
async function
|
|
6377
|
-
if (
|
|
6411
|
+
async function So(s) {
|
|
6412
|
+
if (!$s(s.headers))
|
|
6378
6413
|
return;
|
|
6379
6414
|
let e = null, t = null;
|
|
6380
6415
|
try {
|
|
@@ -6383,7 +6418,7 @@ async function mo(s) {
|
|
|
6383
6418
|
const n = new Promise((a) => {
|
|
6384
6419
|
t = window.setTimeout(() => {
|
|
6385
6420
|
e?.cancel(), a("timeout");
|
|
6386
|
-
},
|
|
6421
|
+
}, bi);
|
|
6387
6422
|
}), i = new TextDecoder();
|
|
6388
6423
|
let r = "", o = 0;
|
|
6389
6424
|
for (; ; ) {
|
|
@@ -6405,26 +6440,26 @@ async function mo(s) {
|
|
|
6405
6440
|
t !== null && window.clearTimeout(t);
|
|
6406
6441
|
}
|
|
6407
6442
|
}
|
|
6408
|
-
function
|
|
6409
|
-
if (
|
|
6443
|
+
function To(s, e) {
|
|
6444
|
+
if ($s(new Headers(e)))
|
|
6410
6445
|
try {
|
|
6411
6446
|
return s.responseType === "" || s.responseType === "text" ? F(s.responseText ?? "") : void 0;
|
|
6412
6447
|
} catch {
|
|
6413
6448
|
return;
|
|
6414
6449
|
}
|
|
6415
6450
|
}
|
|
6416
|
-
function
|
|
6451
|
+
function gs(s) {
|
|
6417
6452
|
if (typeof s == "string")
|
|
6418
6453
|
return F(s);
|
|
6419
6454
|
}
|
|
6420
|
-
function
|
|
6455
|
+
function wo(s) {
|
|
6421
6456
|
return L({
|
|
6422
6457
|
...s,
|
|
6423
|
-
requestBody:
|
|
6424
|
-
responseBody:
|
|
6458
|
+
requestBody: fs(s.requestBody),
|
|
6459
|
+
responseBody: fs(s.responseBody)
|
|
6425
6460
|
});
|
|
6426
6461
|
}
|
|
6427
|
-
function
|
|
6462
|
+
function fs(s) {
|
|
6428
6463
|
if (typeof s != "string")
|
|
6429
6464
|
return s;
|
|
6430
6465
|
const e = s.trim();
|
|
@@ -6436,14 +6471,14 @@ function gs(s) {
|
|
|
6436
6471
|
return xe(s);
|
|
6437
6472
|
}
|
|
6438
6473
|
}
|
|
6439
|
-
function
|
|
6474
|
+
function $s(s) {
|
|
6440
6475
|
if (!s)
|
|
6441
6476
|
return !1;
|
|
6442
6477
|
const e = s.get("content-type")?.toLowerCase() ?? "", t = s.get("content-length"), n = Number(t);
|
|
6443
6478
|
return t !== null && Number.isInteger(n) && n >= 0 && n <= wt && (e.startsWith("text/") || e.includes("json") || e.includes("javascript"));
|
|
6444
6479
|
}
|
|
6445
6480
|
function te(s, e = {}, t) {
|
|
6446
|
-
if (
|
|
6481
|
+
if (bo(t))
|
|
6447
6482
|
return !0;
|
|
6448
6483
|
const n = Object.entries(e).find(([i]) => i.toLowerCase() === "content-type")?.[1]?.toLowerCase();
|
|
6449
6484
|
if (n?.includes("multipart/form-data") || n?.includes("application/octet-stream"))
|
|
@@ -6458,7 +6493,7 @@ function te(s, e = {}, t) {
|
|
|
6458
6493
|
return !0;
|
|
6459
6494
|
}
|
|
6460
6495
|
}
|
|
6461
|
-
function
|
|
6496
|
+
function Ao(s, e) {
|
|
6462
6497
|
if (te(s))
|
|
6463
6498
|
return !0;
|
|
6464
6499
|
try {
|
|
@@ -6468,10 +6503,10 @@ function So(s, e) {
|
|
|
6468
6503
|
return !0;
|
|
6469
6504
|
}
|
|
6470
6505
|
}
|
|
6471
|
-
function
|
|
6506
|
+
function bo(s) {
|
|
6472
6507
|
return s instanceof FormData || s instanceof Blob || s instanceof ArrayBuffer || ArrayBuffer.isView(s) || typeof ReadableStream < "u" && s instanceof ReadableStream;
|
|
6473
6508
|
}
|
|
6474
|
-
function
|
|
6509
|
+
function Mo(s) {
|
|
6475
6510
|
const e = {};
|
|
6476
6511
|
for (const t of s.trim().split(/[\r\n]+/)) {
|
|
6477
6512
|
const n = t.indexOf(":");
|
|
@@ -6498,31 +6533,31 @@ class Pe extends Error {
|
|
|
6498
6533
|
}
|
|
6499
6534
|
async function Me(s, e) {
|
|
6500
6535
|
let t = null;
|
|
6501
|
-
for (let n = 0; n <
|
|
6536
|
+
for (let n = 0; n < Qt; n += 1)
|
|
6502
6537
|
try {
|
|
6503
6538
|
return await s();
|
|
6504
6539
|
} catch (i) {
|
|
6505
|
-
if (t = i, n >=
|
|
6540
|
+
if (t = i, n >= Qt - 1 || !ko(i))
|
|
6506
6541
|
throw i;
|
|
6507
|
-
await
|
|
6542
|
+
await Ro(n);
|
|
6508
6543
|
}
|
|
6509
6544
|
throw t instanceof Error ? t : new Error(e);
|
|
6510
6545
|
}
|
|
6511
|
-
function
|
|
6546
|
+
function Ro(s) {
|
|
6512
6547
|
return new Promise((e) => {
|
|
6513
|
-
window.setTimeout(e,
|
|
6548
|
+
window.setTimeout(e, Ti[s] ?? 0);
|
|
6514
6549
|
});
|
|
6515
6550
|
}
|
|
6516
|
-
function
|
|
6517
|
-
return s instanceof Pe ?
|
|
6551
|
+
function ko(s) {
|
|
6552
|
+
return s instanceof Pe ? Eo(s.status) : s instanceof TypeError;
|
|
6518
6553
|
}
|
|
6519
|
-
function
|
|
6554
|
+
function Eo(s) {
|
|
6520
6555
|
return s === 408 || s === 409 || s === 429 || s >= 500;
|
|
6521
6556
|
}
|
|
6522
|
-
function
|
|
6557
|
+
function Co(s) {
|
|
6523
6558
|
return s === 401 || s === 403;
|
|
6524
6559
|
}
|
|
6525
|
-
const Be = "[REDACTED_SECRET]", $ = "[REDACTED_TOKEN]",
|
|
6560
|
+
const Be = "[REDACTED_SECRET]", $ = "[REDACTED_TOKEN]", _o = "[REDACTED_SIGNED_URL]", Po = 20, vo = /^(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, js = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, zs = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, Ks = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, Gs = /\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, Uo = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, Do = /\bhttps?:\/\/[^\s"'<>]+/gi, qo = /[),.;\]]+$/;
|
|
6526
6561
|
function L(s) {
|
|
6527
6562
|
return Oe(s, 0, /* @__PURE__ */ new WeakSet());
|
|
6528
6563
|
}
|
|
@@ -6531,7 +6566,7 @@ function Oe(s, e, t) {
|
|
|
6531
6566
|
return s.startsWith("data:image/") || s.startsWith("data:application/pdf;") ? s : xe(s);
|
|
6532
6567
|
if (s === null || typeof s != "object")
|
|
6533
6568
|
return s;
|
|
6534
|
-
if (e >=
|
|
6569
|
+
if (e >= Po)
|
|
6535
6570
|
return "[REDACTED_MAX_DEPTH]";
|
|
6536
6571
|
if (t.has(s))
|
|
6537
6572
|
return "[REDACTED_CIRCULAR]";
|
|
@@ -6539,71 +6574,79 @@ function Oe(s, e, t) {
|
|
|
6539
6574
|
return s.map((i) => Oe(i, e + 1, t));
|
|
6540
6575
|
const n = {};
|
|
6541
6576
|
for (const [i, r] of Object.entries(s))
|
|
6542
|
-
i === "pageContent" ? n[i] = r :
|
|
6577
|
+
i === "pageContent" ? n[i] = r : Vs(i) ? n[i] = Be : n[i] = i.toLowerCase() === "url" ? Oo(r) : Oe(r, e + 1, t);
|
|
6543
6578
|
return n;
|
|
6544
6579
|
}
|
|
6545
|
-
function
|
|
6580
|
+
function Vs(s) {
|
|
6546
6581
|
const e = s.replace(/[^a-z0-9]/gi, "").toLowerCase();
|
|
6547
6582
|
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");
|
|
6548
6583
|
}
|
|
6549
|
-
function
|
|
6550
|
-
return typeof s == "string" ?
|
|
6584
|
+
function Oo(s) {
|
|
6585
|
+
return typeof s == "string" ? Qs(s) : Oe(s, 0, /* @__PURE__ */ new WeakSet());
|
|
6551
6586
|
}
|
|
6552
|
-
function
|
|
6587
|
+
function Qs(s) {
|
|
6553
6588
|
try {
|
|
6554
6589
|
const e = new URL(s, location.href);
|
|
6555
6590
|
for (const t of Array.from(e.searchParams.keys()))
|
|
6556
|
-
|
|
6591
|
+
vo.test(t) && e.searchParams.set(t, $);
|
|
6557
6592
|
return e.username && (e.username = $), e.password && (e.password = $), e.toString();
|
|
6558
6593
|
} catch {
|
|
6559
|
-
return
|
|
6594
|
+
return xo(s);
|
|
6560
6595
|
}
|
|
6561
6596
|
}
|
|
6562
6597
|
function xe(s) {
|
|
6563
|
-
return s.replace(
|
|
6598
|
+
return s.replace(Uo, _o).replace(Do, Lo).replace(js, `Bearer ${$}`).replace(zs, `Basic ${$}`).replace(Ks, $).replace(Gs, (e, t) => `${t}: ${Be}`);
|
|
6564
6599
|
}
|
|
6565
|
-
function
|
|
6566
|
-
return s.replace(
|
|
6600
|
+
function xo(s) {
|
|
6601
|
+
return s.replace(js, `Bearer ${$}`).replace(zs, `Basic ${$}`).replace(Ks, $).replace(Gs, (e, t) => `${t}: ${Be}`);
|
|
6567
6602
|
}
|
|
6568
|
-
function
|
|
6569
|
-
const e = s.match(
|
|
6570
|
-
return `${
|
|
6603
|
+
function Lo(s) {
|
|
6604
|
+
const e = s.match(qo)?.[0] ?? "", t = e ? s.slice(0, -e.length) : s;
|
|
6605
|
+
return `${Qs(t)}${e}`;
|
|
6571
6606
|
}
|
|
6572
|
-
const
|
|
6607
|
+
const Ko = Object.freeze({
|
|
6573
6608
|
init: (s) => Ne.init(s)
|
|
6574
6609
|
});
|
|
6575
|
-
function
|
|
6610
|
+
function Go(s) {
|
|
6576
6611
|
return Ne.init(s);
|
|
6577
6612
|
}
|
|
6613
|
+
function ms(s) {
|
|
6614
|
+
const e = /* @__PURE__ */ new Map();
|
|
6615
|
+
for (const t of [...s].reverse()) {
|
|
6616
|
+
const n = t.integrationAuthRequest;
|
|
6617
|
+
n && !e.has(n.authRequestId) && e.set(n.authRequestId, n);
|
|
6618
|
+
}
|
|
6619
|
+
return [...e.values()];
|
|
6620
|
+
}
|
|
6578
6621
|
export {
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6622
|
+
$t as PLUNO_PRODUCT_AGENT_WIDGET_HOST_SELECTOR,
|
|
6623
|
+
Qn as PLUNO_PRODUCT_AGENT_WIDGET_PANEL_SELECTOR,
|
|
6624
|
+
Vn as PLUNO_PRODUCT_AGENT_WIDGET_ROOT_SELECTOR,
|
|
6625
|
+
Jn as PLUNO_PRODUCT_AGENT_WIDGET_TIMELINE_SELECTOR,
|
|
6626
|
+
zo as PRODUCT_AGENT_PROVIDER_INPUT_ATTACHMENT_ACCEPT,
|
|
6627
|
+
Ko as PlunoProductAgent,
|
|
6628
|
+
Hn as ProductAgentInteractionManager,
|
|
6586
6629
|
Ht as ProductAgentQueryController,
|
|
6587
|
-
|
|
6630
|
+
jo as ProductAgentRemoteRuntimeClient,
|
|
6588
6631
|
Ne as ProductAgentSessionEngine,
|
|
6589
|
-
|
|
6590
|
-
|
|
6632
|
+
xn as ProductAgentSessionHistoryManager,
|
|
6633
|
+
Fo as ProductAgentTaskPageTitleController,
|
|
6591
6634
|
J as ProductAgentTokenProviderError,
|
|
6592
|
-
|
|
6593
|
-
|
|
6635
|
+
Ci as calculateReconnectDelay,
|
|
6636
|
+
Bo as createLocalStorageInteractionDecisionStorage,
|
|
6594
6637
|
ke as createProductAgentQueryState,
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6638
|
+
Go as createProductAgentRuntime,
|
|
6639
|
+
Wo as createProductAgentTaskPageTitleDocument,
|
|
6640
|
+
Ko as default,
|
|
6641
|
+
$n as formatProductAgentTaskPageTitle,
|
|
6642
|
+
er as getProductAgentOriginAccessErrorMessage,
|
|
6643
|
+
$o as isProductAgentRuntimeCommand,
|
|
6644
|
+
Dn as mergeProductAgentEntityPages,
|
|
6602
6645
|
Ee as normalizeProductAgentEntityPage,
|
|
6603
6646
|
st as normalizeProductAgentSessionItems,
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6647
|
+
Bn as readLocalStorageInteractionDecisions,
|
|
6648
|
+
Ho as resolveProductAgentComposerAction,
|
|
6649
|
+
No as resolveProductAgentWidgetPresentation,
|
|
6650
|
+
Ms as selectProductAgentQueryEntities,
|
|
6651
|
+
uo as validateProductAgentProviderInputFile
|
|
6609
6652
|
};
|