@pluno/product-agent-web 0.1.258 → 0.1.259
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/conversation/contracts.d.ts +3 -1
- package/dist/core/conversation/display.d.ts +1 -0
- package/dist/core/conversation/selectors.d.ts +1 -0
- package/dist/product-agent-runtime.cjs +1 -1
- package/dist/product-agent-runtime.js +1 -1
- package/dist/product-agent-sdk.js +749 -729
- package/dist/product-agent-widget.js +1771 -1751
- package/package.json +1 -1
|
@@ -1,4 +1,50 @@
|
|
|
1
|
+
function ze(s) {
|
|
2
|
+
if (!s || typeof s != "object") return !1;
|
|
3
|
+
const e = s;
|
|
4
|
+
return Object.keys(s).every((t) => ["boundary", "category", "messageKind"].includes(t)) && ["runtime", "web_transport", "extension_ipc"].includes(e.boundary) && ["error", "object", "null", "array", "string", "undefined", "number", "boolean", "bigint", "symbol", "function"].includes(e.category) && ["object_coercion", "text", "blank", "non_text"].includes(e.messageKind);
|
|
5
|
+
}
|
|
1
6
|
function Le(s) {
|
|
7
|
+
if (s === null || typeof s == "string" || typeof s == "boolean") return !0;
|
|
8
|
+
if (typeof s == "number") return Number.isFinite(s);
|
|
9
|
+
if (Array.isArray(s)) return s.every(Le);
|
|
10
|
+
if (typeof s != "object") return !1;
|
|
11
|
+
const e = Object.getPrototypeOf(s);
|
|
12
|
+
return e !== Object.prototype && e !== null ? !1 : Object.values(s).every(Le);
|
|
13
|
+
}
|
|
14
|
+
function Vn(s) {
|
|
15
|
+
if (s.details !== void 0 && !Le(s.details))
|
|
16
|
+
throw new TypeError("Product Agent transported error details must be JSON-safe.");
|
|
17
|
+
return {
|
|
18
|
+
code: s.code,
|
|
19
|
+
message: s.message,
|
|
20
|
+
retryable: s.retryable,
|
|
21
|
+
...s.details === void 0 ? {} : { details: s.details }
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function J(s, e = "runtime_error", t = "runtime") {
|
|
25
|
+
const i = s !== null && typeof s == "object" ? s : null, n = typeof s == "string" ? s : i && "message" in i && typeof i.message == "string" ? i.message : "", r = i && "code" in i && typeof i.code == "string" && i.code.trim() ? i.code : e, a = i && "details" in i ? i.details : null, o = a && typeof a == "object" ? a : {}, c = {
|
|
26
|
+
// Preserve the first boundary's shape after normalization replaces the original message/prototype.
|
|
27
|
+
errorNormalization: ze(o.errorNormalization) ? o.errorNormalization : {
|
|
28
|
+
boundary: t,
|
|
29
|
+
category: s instanceof Error ? "error" : s === null ? "null" : Array.isArray(s) ? "array" : typeof s,
|
|
30
|
+
messageKind: n.trim() === "[object Object]" ? "object_coercion" : n.trim() ? "text" : typeof s == "string" || i && "message" in i && typeof i.message == "string" ? "blank" : "non_text"
|
|
31
|
+
},
|
|
32
|
+
...o.allocation === "unissued" ? { allocation: "unissued" } : {},
|
|
33
|
+
...["unissued", "rejected"].includes(String(o.acceptance)) ? { acceptance: String(o.acceptance) } : {},
|
|
34
|
+
...typeof o.securitySettingsUrl == "string" ? { securitySettingsUrl: o.securitySettingsUrl } : {},
|
|
35
|
+
...typeof o.transportCode == "string" && /^[a-z0-9_]{1,80}$/.test(o.transportCode) ? { transportCode: o.transportCode } : {},
|
|
36
|
+
...typeof o.requestId == "string" && /^[a-zA-Z0-9_-]{1,160}$/.test(o.requestId) ? { requestId: o.requestId } : {},
|
|
37
|
+
...typeof o.durationMs == "number" && Number.isFinite(o.durationMs) && o.durationMs >= 0 ? { durationMs: o.durationMs } : {},
|
|
38
|
+
...typeof o.successfulRequests == "number" && Number.isSafeInteger(o.successfulRequests) && o.successfulRequests >= 0 ? { successfulRequests: o.successfulRequests } : {}
|
|
39
|
+
};
|
|
40
|
+
return Vn({
|
|
41
|
+
code: r,
|
|
42
|
+
message: n.trim() && n.trim() !== "[object Object]" ? n : "The Product Agent operation failed. Try again.",
|
|
43
|
+
retryable: !!(i && "retryable" in i && i.retryable === !0),
|
|
44
|
+
...Object.keys(c).length ? { details: c } : {}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function $e(s) {
|
|
2
48
|
return {
|
|
3
49
|
key: s,
|
|
4
50
|
status: "not_requested",
|
|
@@ -23,11 +69,11 @@ function zi(s, e) {
|
|
|
23
69
|
updatedAt: t ? s.updatedAt : null
|
|
24
70
|
};
|
|
25
71
|
}
|
|
26
|
-
const Rs = (s) => s.selectedModel ?? s.historyModel ?? s.defaultModel,
|
|
27
|
-
function
|
|
72
|
+
const Rs = (s) => s.selectedModel ?? s.historyModel ?? s.defaultModel, Gn = (s, e) => s.scopes[e];
|
|
73
|
+
function ie(s) {
|
|
28
74
|
return s?.execution_message_ids ?? s?.user_message_ids ?? [];
|
|
29
75
|
}
|
|
30
|
-
function
|
|
76
|
+
function ae(s) {
|
|
31
77
|
const e = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d{1,6}))?(?:Z|\+00:00)$/.exec(s);
|
|
32
78
|
if (!e) throw new Error("Display timestamps must retain the backend UTC precision.");
|
|
33
79
|
return `${e[1]}.${(e[2] ?? "").padEnd(6, "0")}`;
|
|
@@ -35,23 +81,15 @@ function oe(s) {
|
|
|
35
81
|
function pt(s) {
|
|
36
82
|
return "revision" in s.data ? s.data.revision : null;
|
|
37
83
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
if (typeof s == "number") return Number.isFinite(s);
|
|
41
|
-
if (Array.isArray(s)) return s.every($e);
|
|
42
|
-
if (typeof s != "object") return !1;
|
|
43
|
-
const e = Object.getPrototypeOf(s);
|
|
44
|
-
return e !== Object.prototype && e !== null ? !1 : Object.values(s).every($e);
|
|
45
|
-
}
|
|
46
|
-
function ne(s) {
|
|
47
|
-
return s !== null && typeof s == "object" && !Object.isFrozen(s) && (Object.values(s).forEach(ne), Object.freeze(s)), s;
|
|
84
|
+
function re(s) {
|
|
85
|
+
return s !== null && typeof s == "object" && !Object.isFrozen(s) && (Object.values(s).forEach(re), Object.freeze(s)), s;
|
|
48
86
|
}
|
|
49
|
-
function
|
|
50
|
-
if (
|
|
87
|
+
function Z(s) {
|
|
88
|
+
if (!Le(s)) throw new Error("Conversation inputs must be JSON-safe values.");
|
|
51
89
|
return JSON.parse(JSON.stringify(s));
|
|
52
90
|
}
|
|
53
91
|
function Hi(s = "", e = 0) {
|
|
54
|
-
return
|
|
92
|
+
return re({ authorityId: s, generation: e, pendingRestoration: {}, proactiveQuestions: {}, sessions: {}, submissions: {}, submissionOrder: [], stops: {}, requests: {}, requestSequence: 0, deliveries: {}, operations: {}, effectsEnabled: !1, checkpointEffectId: null, checkpointError: null });
|
|
55
93
|
}
|
|
56
94
|
function ss(s) {
|
|
57
95
|
return {
|
|
@@ -63,7 +101,7 @@ function ss(s) {
|
|
|
63
101
|
executionByUserMessage: {},
|
|
64
102
|
followUps: [],
|
|
65
103
|
followUpsVersion: -1,
|
|
66
|
-
queries: { current:
|
|
104
|
+
queries: { current: $e(`${s}:current`), history: $e(`${s}:history`) }
|
|
67
105
|
};
|
|
68
106
|
}
|
|
69
107
|
function Ki(s) {
|
|
@@ -75,19 +113,19 @@ function yt(s) {
|
|
|
75
113
|
function is(s, e) {
|
|
76
114
|
if (e.conversation_id !== s.sessionId) throw new Error("Display item belongs to another conversation.");
|
|
77
115
|
if (s.removedItems[e.id]) return s;
|
|
78
|
-
const t =
|
|
79
|
-
|
|
116
|
+
const t = ae(e.created_at);
|
|
117
|
+
ae(e.updated_at);
|
|
80
118
|
const i = pt(e);
|
|
81
119
|
i !== null && yt(i);
|
|
82
120
|
const n = s.streams[e.id];
|
|
83
121
|
if (i !== null && n && (n.state === "stopped" || n.state === "finished") && i > n.revision) return s;
|
|
84
122
|
const r = s.items[e.id];
|
|
85
123
|
if (r) {
|
|
86
|
-
if (
|
|
124
|
+
if (ae(r.created_at) !== t) throw new Error("Display shell timestamp changed.");
|
|
87
125
|
const a = pt(r);
|
|
88
126
|
if (a !== null && i !== null) {
|
|
89
127
|
if (i <= a) return s;
|
|
90
|
-
} else if (
|
|
128
|
+
} else if (ae(e.updated_at) <= ae(r.updated_at)) return s;
|
|
91
129
|
}
|
|
92
130
|
return { ...s, items: { ...s.items, [e.id]: { ...e, created_at: r?.created_at ?? e.created_at } } };
|
|
93
131
|
}
|
|
@@ -100,10 +138,14 @@ function ns(s, e) {
|
|
|
100
138
|
if (e.conversation_id !== s.sessionId) throw new Error("Execution belongs to another conversation.");
|
|
101
139
|
if (yt(e.version), s.execution && e.version <= s.execution.version) return s;
|
|
102
140
|
const t = { ...s.executionByUserMessage };
|
|
103
|
-
for (const i of
|
|
141
|
+
for (const i of ie(e)) t[i] = {
|
|
142
|
+
version: e.version,
|
|
143
|
+
phase: e.phase,
|
|
144
|
+
responseMessageIds: e.response_message_groups?.find((n) => n.includes(i)) ?? [i]
|
|
145
|
+
};
|
|
104
146
|
return { ...s, execution: e, executionByUserMessage: t };
|
|
105
147
|
}
|
|
106
|
-
function
|
|
148
|
+
function Jn(s) {
|
|
107
149
|
const e = /* @__PURE__ */ new Set();
|
|
108
150
|
for (const t of Object.values(s.items)) {
|
|
109
151
|
const i = pt(t), n = s.streams[t.id];
|
|
@@ -170,12 +212,12 @@ function as(s, e) {
|
|
|
170
212
|
queries: { ...o.queries, [r.lane]: { ...c, requestId: null, status: c.data === null ? "not_requested" : "ready" } }
|
|
171
213
|
} } };
|
|
172
214
|
}
|
|
173
|
-
return
|
|
215
|
+
return re(i);
|
|
174
216
|
}
|
|
175
217
|
function Ge(s) {
|
|
176
218
|
return JSON.stringify(s, (e, t) => t && typeof t == "object" && !Array.isArray(t) ? Object.fromEntries(Object.entries(t).sort(([i], [n]) => i.localeCompare(n))) : t);
|
|
177
219
|
}
|
|
178
|
-
function
|
|
220
|
+
function Qn(s, e, t, i) {
|
|
179
221
|
let n = s;
|
|
180
222
|
const r = [];
|
|
181
223
|
let a = null;
|
|
@@ -210,10 +252,10 @@ function Jn(s, e, t, i) {
|
|
|
210
252
|
...d,
|
|
211
253
|
status: "error",
|
|
212
254
|
requestId: null,
|
|
213
|
-
error: e.type === "effect.failed" ?
|
|
255
|
+
error: e.type === "effect.failed" ? Z(e.error) : e.output.snapshot.preparation === "failed" || e.output.snapshot.preparation === "disabled" ? { code: "history_preparation_failed", message: "We couldn’t prepare this conversation. Try loading it again.", retryable: !1 } : { code: "projection_not_ready", message: "This conversation isn’t available yet. Try loading it again.", retryable: !0 }
|
|
214
256
|
} } };
|
|
215
257
|
else {
|
|
216
|
-
const m =
|
|
258
|
+
const m = Z(e.output.snapshot);
|
|
217
259
|
o.lane === "current" && (c = { ...c, preparation: null });
|
|
218
260
|
const h = c.queries.history, y = o.lane === "current" && (h.status === "not_requested" || m.next_cursor !== null && !c.items[m.next_cursor]);
|
|
219
261
|
if (m.conversation_id !== o.sessionId) throw new Error("Snapshot belongs to another conversation.");
|
|
@@ -263,7 +305,7 @@ function Jn(s, e, t, i) {
|
|
|
263
305
|
case "conversation.context_prepared": {
|
|
264
306
|
const o = s.submissions[e.userMessageId];
|
|
265
307
|
if (!o || o.cancelled || o.delivery === "failed") return { state: s, effects: r };
|
|
266
|
-
const c =
|
|
308
|
+
const c = Z({ pageContent: e.pageContent, sessionTabs: e.sessionTabs });
|
|
267
309
|
if (o.contextPreparation !== null) {
|
|
268
310
|
if (Ge(o.contextPreparation) !== Ge(c)) throw new Error("Prepared submission context cannot change.");
|
|
269
311
|
return { state: s, effects: r };
|
|
@@ -275,12 +317,12 @@ function Jn(s, e, t, i) {
|
|
|
275
317
|
if (t.clients[e.clientScopeId] !== e.conversationScopeId) throw new Error("Submission selection has changed.");
|
|
276
318
|
const { type: o, authorityId: c, generation: d, prepareContext: l, ...u } = e, p = s.submissions[e.userMessageId];
|
|
277
319
|
if (p) {
|
|
278
|
-
const { contextPreparation: b, requestedModel: v, sessionId: _, delivery: S, cancelled: A, cancellationReason: C, error: H, executionVersion: B, ...
|
|
279
|
-
if (Ge(
|
|
320
|
+
const { contextPreparation: b, requestedModel: v, sessionId: _, delivery: S, cancelled: A, cancellationReason: C, error: H, executionVersion: B, ...Q } = p;
|
|
321
|
+
if (Ge(Q) !== Ge(u)) throw new Error("User-message identity cannot be reused with different input.");
|
|
280
322
|
return { state: s, effects: r };
|
|
281
323
|
}
|
|
282
324
|
const f = t.selections[e.conversationScopeId], m = Object.values(s.submissions).find((b) => b.conversationScopeId === e.conversationScopeId && !b.cancelled && b.sessionId !== null), h = i.scopes[e.clientScopeId], y = {
|
|
283
|
-
...
|
|
325
|
+
...Z(u),
|
|
284
326
|
...l ? { contextPreparation: null } : {},
|
|
285
327
|
// Extension staging can await page context after the picker has already changed.
|
|
286
328
|
requestedModel: h?.submissions[e.userMessageId] ? h.submissions[e.userMessageId].requestedModel ?? null : h ? Rs(h) ?? null : null,
|
|
@@ -302,14 +344,14 @@ function Jn(s, e, t, i) {
|
|
|
302
344
|
case "conversation.submission_delivery": {
|
|
303
345
|
const o = s.submissions[e.userMessageId];
|
|
304
346
|
if (!o || o.cancelled || o.delivery === "accepted" || o.requestId !== e.requestId) return { state: s, effects: r };
|
|
305
|
-
n = { ...s, submissions: { ...s.submissions, [e.userMessageId]: { ...o, delivery: e.delivery, error:
|
|
347
|
+
n = { ...s, submissions: { ...s.submissions, [e.userMessageId]: { ...o, delivery: e.delivery, error: Z(e.error) } } };
|
|
306
348
|
break;
|
|
307
349
|
}
|
|
308
350
|
case "conversation.stop": {
|
|
309
351
|
if (t.clients[e.clientScopeId] !== e.conversationScopeId) return { state: s, effects: r };
|
|
310
|
-
const o = t.selections[e.conversationScopeId].sessionId, c = o ? s.sessions[o]?.execution : null, d = Object.values(s.submissions).filter((h) => (o ? h.sessionId === o : h.conversationScopeId === e.conversationScopeId) && (!e.userMessageIds || e.userMessageIds.includes(h.userMessageId))), l = d.filter((h) => !h.cancelled && (h.delivery !== "failed" || s.deliveries[h.userMessageId]?.phase === "paused") && (h.delivery !== "accepted" || h.executionVersion === null)), u = l.length > 0, p = c && ["queued", "thinking", "steering", "stopping"].includes(c.phase) && (!e.userMessageIds ||
|
|
352
|
+
const o = t.selections[e.conversationScopeId].sessionId, c = o ? s.sessions[o]?.execution : null, d = Object.values(s.submissions).filter((h) => (o ? h.sessionId === o : h.conversationScopeId === e.conversationScopeId) && (!e.userMessageIds || e.userMessageIds.includes(h.userMessageId))), l = d.filter((h) => !h.cancelled && (h.delivery !== "failed" || s.deliveries[h.userMessageId]?.phase === "paused") && (h.delivery !== "accepted" || h.executionVersion === null)), u = l.length > 0, p = c && ["queued", "thinking", "steering", "stopping"].includes(c.phase) && (!e.userMessageIds || ie(c).some((h) => e.userMessageIds.includes(h)));
|
|
311
353
|
if (!u && !p && (c || !e.userMessageIds?.length)) return { state: s, effects: r };
|
|
312
|
-
const f = Array.from(new Set(e.userMessageIds ?? [...l.map((h) => h.userMessageId), ...p ?
|
|
354
|
+
const f = Array.from(new Set(e.userMessageIds ?? [...l.map((h) => h.userMessageId), ...p ? ie(c) : []])), m = { ...s.submissions };
|
|
313
355
|
for (const h of d)
|
|
314
356
|
f.includes(h.userMessageId) && h.delivery !== "accepted" && (m[h.userMessageId] = { ...h, cancelled: !0, cancellationReason: e.reason ?? "user_requested" });
|
|
315
357
|
n = { ...s, submissions: m, stops: { ...s.stops, [e.conversationScopeId]: {
|
|
@@ -321,7 +363,7 @@ function Jn(s, e, t, i) {
|
|
|
321
363
|
break;
|
|
322
364
|
}
|
|
323
365
|
case "conversation.display_received": {
|
|
324
|
-
const o =
|
|
366
|
+
const o = Z(e.event), c = o.type === "conversation.item.updated" ? o.item.conversation_id : o.type === "conversation.execution.updated" ? o.execution.conversation_id : o.type === "conversation.interaction.updated" ? o.interaction.conversation_id : o.conversation_id, d = o.type === "conversation.item.updated" && o.item.type === "user_message" ? s.submissions[o.item.id] : void 0;
|
|
325
367
|
if (d && (n = rs(s, d, c)), !n.sessions[c] && !t.memberships[c]?.members.length && !d) return { state: s, effects: r };
|
|
326
368
|
t.memberships[c]?.members.length && (o.type === "conversation.interaction.updated" || o.type === "conversation.execution.updated" || o.type === "conversation.item.updated" && o.item.type === "user_message") && (a = {
|
|
327
369
|
authorityId: s.authorityId,
|
|
@@ -343,7 +385,7 @@ function Jn(s, e, t, i) {
|
|
|
343
385
|
const p = d[u.lane];
|
|
344
386
|
d[u.lane] = { ...p, requestId: null, status: p.data === null ? "not_requested" : "ready" };
|
|
345
387
|
}
|
|
346
|
-
d.history =
|
|
388
|
+
d.history = $e(d.history.key), n = { ...s, requests: c, sessions: { ...s.sessions, [e.sessionId]: { ...o, queries: d } } };
|
|
347
389
|
break;
|
|
348
390
|
}
|
|
349
391
|
case "conversation.snapshot": {
|
|
@@ -357,7 +399,7 @@ function Jn(s, e, t, i) {
|
|
|
357
399
|
requestId: e.requestId,
|
|
358
400
|
lane: e.lane,
|
|
359
401
|
before: e.lane === "history" ? c.cursor : null,
|
|
360
|
-
refreshItemIds:
|
|
402
|
+
refreshItemIds: Jn(o),
|
|
361
403
|
retryPreparation: c.error?.code === "history_preparation_failed"
|
|
362
404
|
}, l = Object.values(s.submissions).filter((f) => f.sessionId === e.sessionId && f.delivery === "accepted" && f.executionVersion === null).map((f) => f.userMessageId), u = s.requestSequence + 1, p = `conversation:${s.generation}:${u}`;
|
|
363
405
|
n = {
|
|
@@ -377,7 +419,7 @@ function Jn(s, e, t, i) {
|
|
|
377
419
|
const c = o.sessionId ? n.sessions[o.sessionId]?.execution : null;
|
|
378
420
|
c?.user_message_ids.includes(o.userMessageId) && o.executionVersion !== c.version && (n = { ...n, submissions: { ...n.submissions, [o.userMessageId]: { ...o, executionVersion: c.version } } });
|
|
379
421
|
}
|
|
380
|
-
return a && (n = { ...n, requestSequence: n.requestSequence + 1 }, r.push({ id: `conversation:${n.generation}:${n.requestSequence}`, kind: "conversation.interactions", input: a })), { state:
|
|
422
|
+
return a && (n = { ...n, requestSequence: n.requestSequence + 1 }, r.push({ id: `conversation:${n.generation}:${n.requestSequence}`, kind: "conversation.interactions", input: a })), { state: re(n), effects: r };
|
|
381
423
|
}
|
|
382
424
|
const Ys = (s, e) => ({
|
|
383
425
|
acceptance: "unissued",
|
|
@@ -416,7 +458,7 @@ function As(s, e) {
|
|
|
416
458
|
const u = l.command.payload.source;
|
|
417
459
|
return !Object.values(s.submissions).some((p) => p.conversationScopeId === l.conversationScopeId && p.delivery === "accepted" && p.attachments.some((f) => f.sourceId === u.sourceId));
|
|
418
460
|
}));
|
|
419
|
-
return
|
|
461
|
+
return re({
|
|
420
462
|
schema: 1,
|
|
421
463
|
authorityId: s.authorityId,
|
|
422
464
|
submissions: r,
|
|
@@ -436,7 +478,7 @@ function pe(s, e) {
|
|
|
436
478
|
}
|
|
437
479
|
function cs(s, e, t, i = !1) {
|
|
438
480
|
if (!e.effectsEnabled || !i && s.submissions === e.submissions && s.deliveries === e.deliveries && s.operations === e.operations && s.stops === e.stops && s.sessions === e.sessions) return { state: e, effects: [] };
|
|
439
|
-
const n = e.requestSequence + 1, r = `conversation:${e.generation}:${n}`, a =
|
|
481
|
+
const n = e.requestSequence + 1, r = `conversation:${e.generation}:${n}`, a = re({ ...e, requestSequence: n, checkpointEffectId: r });
|
|
440
482
|
return { state: a, effects: [{ id: r, kind: "conversation.checkpoint", input: {
|
|
441
483
|
authorityId: a.authorityId,
|
|
442
484
|
generation: a.generation,
|
|
@@ -444,9 +486,9 @@ function cs(s, e, t, i = !1) {
|
|
|
444
486
|
} }] };
|
|
445
487
|
}
|
|
446
488
|
function ds(s, e = null) {
|
|
447
|
-
return { command:
|
|
489
|
+
return { command: Z(s), conversationScopeId: e, phase: "waiting", effectId: null, result: null, error: null };
|
|
448
490
|
}
|
|
449
|
-
function
|
|
491
|
+
function Xn(s) {
|
|
450
492
|
const e = { ...s.context, ...s.contextPreparation };
|
|
451
493
|
return Object.fromEntries(["page", "pageContent", "agentMode", "metadata", "sessionTabs", "proactiveSuggestionQuestion"].filter((t) => t in e).map((t) => [t, e[t]]));
|
|
452
494
|
}
|
|
@@ -496,7 +538,7 @@ function ls(s) {
|
|
|
496
538
|
request_id: c.requestId,
|
|
497
539
|
type: "chat.user_message",
|
|
498
540
|
payload: {
|
|
499
|
-
...
|
|
541
|
+
...Xn(c),
|
|
500
542
|
sessionId: c.sessionId,
|
|
501
543
|
clientMessageId: o,
|
|
502
544
|
content: c.content,
|
|
@@ -522,7 +564,7 @@ function ls(s) {
|
|
|
522
564
|
};
|
|
523
565
|
for (const [o, c] of Object.entries(e.stops))
|
|
524
566
|
for (const d of c.userMessageIds) {
|
|
525
|
-
const l = e.submissions[d], u = l?.sessionId ?? Object.values(e.sessions).find((f) =>
|
|
567
|
+
const l = e.submissions[d], u = l?.sessionId ?? Object.values(e.sessions).find((f) => ie(f.execution).includes(d))?.sessionId, p = l?.delivery === "accepted" || u && ie(e.sessions[u]?.execution).includes(d);
|
|
526
568
|
u && p && a(`stop:${o}:${c.requestId}:${d}`, u, d, c.reason);
|
|
527
569
|
}
|
|
528
570
|
for (const o of Object.values(e.submissions))
|
|
@@ -555,9 +597,9 @@ function ls(s) {
|
|
|
555
597
|
}
|
|
556
598
|
} }) : t.push({ id: p, kind: "conversation.command", input: { ...i, command: c.command } });
|
|
557
599
|
}
|
|
558
|
-
return { state:
|
|
600
|
+
return { state: re(e), effects: t };
|
|
559
601
|
}
|
|
560
|
-
function
|
|
602
|
+
function Yn(s, e, t, i) {
|
|
561
603
|
let n = s, r = e;
|
|
562
604
|
if (e.type === "effect.completed" || e.type === "effect.failed") {
|
|
563
605
|
e.effectKind === "conversation.checkpoint" && e.effectId === s.checkpointEffectId && (n = { ...n, checkpointEffectId: null, checkpointError: e.type === "effect.failed" ? e.error : null });
|
|
@@ -581,7 +623,7 @@ function Xn(s, e, t, i) {
|
|
|
581
623
|
error: { code: "message_delivery_failed", message: "Pluno could not send this message. Try it again.", retryable: !0 }
|
|
582
624
|
} } }));
|
|
583
625
|
else if (e.effectKind === "conversation.upload") {
|
|
584
|
-
const h =
|
|
626
|
+
const h = Z(e.output), y = f.attachments[p.uploads.length];
|
|
585
627
|
if (h.attachment.id !== y.sourceId || h.attachment.size_bytes !== y.sizeBytes || f.sessionId !== null && f.sessionId !== h.sessionId)
|
|
586
628
|
throw new Error("Upload does not match the captured attachment or conversation.");
|
|
587
629
|
m = { ...m, allocation: "resolved", uploads: [...p.uploads, h.attachment] };
|
|
@@ -627,7 +669,7 @@ function Xn(s, e, t, i) {
|
|
|
627
669
|
effectId: null,
|
|
628
670
|
phase: e.type === "effect.failed" ? e.error.retryable ? "uncertain" : "failed" : "done",
|
|
629
671
|
error: e.type === "effect.failed" ? e.error : null,
|
|
630
|
-
result: e.type === "effect.completed" ?
|
|
672
|
+
result: e.type === "effect.completed" ? Z(e.output) : null
|
|
631
673
|
} } }, e.type === "effect.completed" && ["runtime.warmup", "attachment.prepare"].includes(p.command.type) && !p.command.payload.sessionId && p.conversationScopeId && !Object.values(t.clients).includes(p.conversationScopeId)) {
|
|
632
674
|
const f = e.output;
|
|
633
675
|
f?.sessionId && (n = { ...n, operations: {
|
|
@@ -646,10 +688,10 @@ function Xn(s, e, t, i) {
|
|
|
646
688
|
}
|
|
647
689
|
} else if (e.authorityId === s.authorityId && e.generation === s.generation && t.authorityId) {
|
|
648
690
|
if (e.type === "conversation.enable_effects" && (n = { ...s, effectsEnabled: !0 }), e.type === "conversation.restore_delivery") {
|
|
649
|
-
const l =
|
|
691
|
+
const l = Z(e.checkpoint);
|
|
650
692
|
if (l.schema !== 1 || l.authorityId !== s.authorityId || s.submissionOrder.length || Object.keys(s.operations).length)
|
|
651
693
|
throw new Error("Delivery restoration requires an empty engine with the same authenticated authority.");
|
|
652
|
-
const { schema: u, authorityId: p, ...f } = l, m =
|
|
694
|
+
const { schema: u, authorityId: p, ...f } = l, m = Z(e.pendingRestoration ?? {}), h = (y) => !t.clients[y.clientScopeId] && m[y.clientScopeId] === y.conversationScopeId;
|
|
653
695
|
n = {
|
|
654
696
|
...s,
|
|
655
697
|
...f,
|
|
@@ -761,7 +803,7 @@ function Xn(s, e, t, i) {
|
|
|
761
803
|
l?.phase === "uncertain" && (n = { ...s, operations: { ...s.operations, [e.requestId]: { ...l, phase: "waiting" } } });
|
|
762
804
|
}
|
|
763
805
|
}
|
|
764
|
-
const a =
|
|
806
|
+
const a = Qn(n, r, t, i);
|
|
765
807
|
let o = a.state;
|
|
766
808
|
e.type === "conversation.submission_stage" && o !== n && !o.deliveries[e.userMessageId] && (o = {
|
|
767
809
|
...o,
|
|
@@ -790,7 +832,7 @@ function Xn(s, e, t, i) {
|
|
|
790
832
|
const c = ls(o), d = cs(s, c.state, t, e.type === "conversation.recover" && s.checkpointError !== null);
|
|
791
833
|
return { state: d.state, effects: [...d.effects, ...a.effects, ...c.effects] };
|
|
792
834
|
}
|
|
793
|
-
const
|
|
835
|
+
const Zn = [
|
|
794
836
|
"submit",
|
|
795
837
|
"stop",
|
|
796
838
|
"staging_ipc",
|
|
@@ -849,17 +891,17 @@ const Yn = [
|
|
|
849
891
|
"backend_refusal",
|
|
850
892
|
"unknown"
|
|
851
893
|
];
|
|
852
|
-
function
|
|
894
|
+
function er(s) {
|
|
853
895
|
const e = s, t = e?.code;
|
|
854
896
|
return e?.backendRefusal === !0 ? "backend_refusal" : typeof t == "string" && t !== "backend_refusal" && Gi.includes(t) ? t : e?.name === "AbortError" ? "aborted" : e?.name === "TypeError" ? "type_error" : "unknown";
|
|
855
897
|
}
|
|
856
|
-
const
|
|
857
|
-
let
|
|
858
|
-
const ei = () => `timing:${
|
|
859
|
-
function
|
|
898
|
+
const tr = Math.random().toString(36).slice(2);
|
|
899
|
+
let sr = 0;
|
|
900
|
+
const ei = () => `timing:${tr}:${++sr}`, Je = (s) => typeof s == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(s);
|
|
901
|
+
function He(s) {
|
|
860
902
|
if (!s || typeof s != "object") return !1;
|
|
861
903
|
const e = s;
|
|
862
|
-
return Object.keys(e).every((t) => ["entrySurface", "operation", "layer", "stage", "status", "spanId", "requestId", "clientMessageId", "sessionId", "occurredAt", "durationMs", "failureCategory"].includes(t)) && (e.failureCategory === void 0 || e.status === "failed" && Gi.includes(e.failureCategory)) && (e.entrySurface === void 0 || ["extension_sidepanel", "extension_widget", "main_web_chat", "embedded_widget", "embedded_custom_ui", "automation", "mcp", "whatsapp", "email"].includes(e.entrySurface)) && ["send", "stop"].includes(e.operation) && ["renderer", "sdk", "extension", "http"].includes(e.layer) &&
|
|
904
|
+
return Object.keys(e).every((t) => ["entrySurface", "operation", "layer", "stage", "status", "spanId", "requestId", "clientMessageId", "sessionId", "occurredAt", "durationMs", "failureCategory"].includes(t)) && (e.failureCategory === void 0 || e.status === "failed" && Gi.includes(e.failureCategory)) && (e.entrySurface === void 0 || ["extension_sidepanel", "extension_widget", "main_web_chat", "embedded_widget", "embedded_custom_ui", "automation", "mcp", "whatsapp", "email"].includes(e.entrySurface)) && ["send", "stop"].includes(e.operation) && ["renderer", "sdk", "extension", "http"].includes(e.layer) && Zn.includes(e.stage) && ["started", "completed", "failed", "observed"].includes(e.status) && Je(e.spanId) && Je(e.requestId) && (e.clientMessageId === null || Je(e.clientMessageId)) && (e.sessionId === null || Je(e.sessionId)) && typeof e.occurredAt == "string" && e.occurredAt.length <= 40 && Number.isFinite(Date.parse(e.occurredAt)) && Number.isSafeInteger(e.durationMs) && e.durationMs >= 0;
|
|
863
905
|
}
|
|
864
906
|
function G(s, e) {
|
|
865
907
|
if (!s) return {
|
|
@@ -875,9 +917,9 @@ function G(s, e) {
|
|
|
875
917
|
spanId: o,
|
|
876
918
|
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
877
919
|
durationMs: Math.max(0, Math.round(performance.now() - a)),
|
|
878
|
-
...r === "failed" ? { failureCategory:
|
|
920
|
+
...r === "failed" ? { failureCategory: er(c) } : {}
|
|
879
921
|
};
|
|
880
|
-
s &&
|
|
922
|
+
s && He(d) && Promise.resolve().then(() => s(d)).catch(() => {
|
|
881
923
|
});
|
|
882
924
|
};
|
|
883
925
|
return {
|
|
@@ -893,7 +935,7 @@ function G(s, e) {
|
|
|
893
935
|
}
|
|
894
936
|
};
|
|
895
937
|
}
|
|
896
|
-
function
|
|
938
|
+
function ir(s) {
|
|
897
939
|
let e = [], t;
|
|
898
940
|
const i = () => {
|
|
899
941
|
clearTimeout(t), t = void 0;
|
|
@@ -902,10 +944,10 @@ function sr(s) {
|
|
|
902
944
|
});
|
|
903
945
|
};
|
|
904
946
|
return (n) => {
|
|
905
|
-
|
|
947
|
+
He(n) && (JSON.stringify([...e, n]).length > 2800 && i(), e.push(n), e.length === 8 ? i() : t ??= setTimeout(i, 250));
|
|
906
948
|
};
|
|
907
949
|
}
|
|
908
|
-
function
|
|
950
|
+
function nr(s) {
|
|
909
951
|
let e = Promise.resolve(), t = null, i = null;
|
|
910
952
|
const n = () => i ??= s.read().catch((a) => {
|
|
911
953
|
throw i = null, a;
|
|
@@ -970,7 +1012,7 @@ function ir(s) {
|
|
|
970
1012
|
}
|
|
971
1013
|
};
|
|
972
1014
|
}
|
|
973
|
-
function
|
|
1015
|
+
function rr(s, e, t, i) {
|
|
974
1016
|
if (s !== e)
|
|
975
1017
|
for (const n of Object.values(e.submissions))
|
|
976
1018
|
n.delivery !== "accepted" || s.submissions[n.userMessageId]?.delivery === "accepted" || G(t, {
|
|
@@ -982,15 +1024,15 @@ function nr(s, e, t, i) {
|
|
|
982
1024
|
sessionId: n.sessionId
|
|
983
1025
|
}).mark("acceptance_applied");
|
|
984
1026
|
}
|
|
985
|
-
const Ts = "0.1.
|
|
1027
|
+
const Ts = "0.1.259", Ji = {
|
|
986
1028
|
version: Ts
|
|
987
1029
|
}, O = (s) => typeof s == "string" && /^[a-zA-Z0-9:_.-]{1,160}$/.test(s) ? s : null;
|
|
988
|
-
function
|
|
1030
|
+
function or(s) {
|
|
989
1031
|
if (!s || typeof s != "object") return !1;
|
|
990
1032
|
const e = s, t = (n) => Number.isSafeInteger(n) && n >= 0, i = (n) => n && typeof n == "object" && Object.keys(n).every((r) => ["sequence", "at", "type", "changed", "generation", "sessionId", "scopeId", "requestId", "effectId", "clientScopeId", "reason", "effectKind", "eventType", "itemCount", "removedCount", "projectionReady"].includes(r)) && t(n.sequence) && t(n.at) && O(n.type) !== null && typeof n.changed == "boolean" && [n.generation, n.itemCount, n.removedCount].every((r) => r === null || t(r)) && [n.sessionId, n.scopeId, n.requestId, n.effectId, n.clientScopeId, n.reason, n.effectKind, n.eventType].every((r) => r === null || O(r) !== null) && (n.projectionReady === null || typeof n.projectionReady == "boolean");
|
|
991
1033
|
return Object.keys(e).every((n) => ["ownerId", "revision", "dropped", "lastIntent", "lastSelection", "transitions"].includes(n)) && O(e.ownerId) !== null && t(e.revision) && t(e.dropped) && (e.lastIntent == null || i(e.lastIntent)) && (e.lastSelection === null || i(e.lastSelection)) && Array.isArray(e.transitions) && e.transitions.length <= 16 && e.transitions.every(i);
|
|
992
1034
|
}
|
|
993
|
-
function
|
|
1035
|
+
function ar(s, e, t) {
|
|
994
1036
|
const i = s;
|
|
995
1037
|
if (!/^(directory\.|conversation\.|session\.)/.test(i.type ?? "") && !/^(directory\.|conversation\.|session\.)/.test(i.effectKind ?? "") || i.type === "conversation.display_received" && !["conversation.execution.updated", "conversation.item.removed"].includes(i.event?.type ?? "")) return null;
|
|
996
1038
|
const n = i.output?.snapshot;
|
|
@@ -1018,23 +1060,23 @@ function Es(s) {
|
|
|
1018
1060
|
const e = s;
|
|
1019
1061
|
return Object.keys(e).every((t) => ["sessionId", "episodeId", "consecutiveFailures", "transportCode", "requestId", "durationMs"].includes(t)) && typeof e.sessionId == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(e.sessionId) && typeof e.episodeId == "string" && /^[a-zA-Z0-9:_-]{1,500}$/.test(e.episodeId) && (e.transportCode === void 0 || typeof e.transportCode == "string" && /^[a-z0-9_]{1,80}$/.test(e.transportCode)) && (e.requestId === void 0 || typeof e.requestId == "string" && /^[a-zA-Z0-9_-]{1,160}$/.test(e.requestId)) && (e.durationMs === void 0 || typeof e.durationMs == "number" && Number.isFinite(e.durationMs) && e.durationMs >= 0) && Number.isSafeInteger(e.consecutiveFailures) && e.consecutiveFailures >= 1;
|
|
1020
1062
|
}
|
|
1021
|
-
const ti = ["messageKeys", "canonicalItemKeys", "terminalResponseKeys", "toolCallKeys", "activeResponseKeys"], ks = (s) => typeof s == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(s), ve = (s) => s === null || ks(s),
|
|
1063
|
+
const ti = ["messageKeys", "canonicalItemKeys", "terminalResponseKeys", "toolCallKeys", "activeResponseKeys"], ks = (s) => typeof s == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(s), ve = (s) => s === null || ks(s), cr = (s) => typeof s == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?(?:Z|\+00:00)$/.test(s) && Number.isFinite(Date.parse(s));
|
|
1022
1064
|
function qs(s) {
|
|
1023
1065
|
if (!s || typeof s != "object") return !1;
|
|
1024
1066
|
const e = s;
|
|
1025
|
-
return Object.keys(s).every((t) => ["sessionId", "itemId", "userMessageId", "createdAt", "runId", "retryable"].includes(t)) && ve(e.sessionId) && ks(e.itemId) && ve(e.userMessageId) && (e.retryable === void 0 || typeof e.retryable == "boolean") && ve(e.runId) && (e.createdAt === null ||
|
|
1067
|
+
return Object.keys(s).every((t) => ["sessionId", "itemId", "userMessageId", "createdAt", "runId", "retryable"].includes(t)) && ve(e.sessionId) && ks(e.itemId) && ve(e.userMessageId) && (e.retryable === void 0 || typeof e.retryable == "boolean") && ve(e.runId) && (e.createdAt === null || cr(e.createdAt));
|
|
1026
1068
|
}
|
|
1027
|
-
function
|
|
1069
|
+
function dr(s) {
|
|
1028
1070
|
if (!s || typeof s != "object") return !1;
|
|
1029
1071
|
const e = s, t = (i) => Number.isSafeInteger(i) && i >= 0;
|
|
1030
|
-
return Object.keys(e).every((i) => ["capturedAt", "selectionKey", "userId", "loading", "draft", "thinking", "connected", "hasError", "phase", "queryStatus", "queryRequestId", "queryUpdatedAt", "renderSource", "selectionFencePending", "guardCreatedAt", "owner", "sdkVersion", "presentationGate", "firstObservedAt", "confirmationMs"].includes(i)) && t(e.capturedAt) && [e.queryUpdatedAt, e.guardCreatedAt].every((i) => i === null || t(i)) && [e.selectionKey, e.userId, e.phase, e.queryStatus, e.queryRequestId].every((i) => i === null || O(i) !== null) && [e.loading, e.draft, e.thinking, e.connected, e.hasError, e.selectionFencePending].every((i) => typeof i == "boolean") && ["state", "account", "interactions", "local", "sidepanel_layout", "observer"].includes(e.renderSource) && (e.owner === void 0 ||
|
|
1072
|
+
return Object.keys(e).every((i) => ["capturedAt", "selectionKey", "userId", "loading", "draft", "thinking", "connected", "hasError", "phase", "queryStatus", "queryRequestId", "queryUpdatedAt", "renderSource", "selectionFencePending", "guardCreatedAt", "owner", "sdkVersion", "presentationGate", "firstObservedAt", "confirmationMs"].includes(i)) && t(e.capturedAt) && [e.queryUpdatedAt, e.guardCreatedAt].every((i) => i === null || t(i)) && [e.selectionKey, e.userId, e.phase, e.queryStatus, e.queryRequestId].every((i) => i === null || O(i) !== null) && [e.loading, e.draft, e.thinking, e.connected, e.hasError, e.selectionFencePending].every((i) => typeof i == "boolean") && ["state", "account", "interactions", "local", "sidepanel_layout", "observer"].includes(e.renderSource) && (e.owner === void 0 || or(e.owner)) && (e.sdkVersion === void 0 || typeof e.sdkVersion == "string" && e.sdkVersion.length <= 32 && /^\d+\.\d+\.\d+(?:[-+][a-zA-Z0-9.-]+)?$/.test(e.sdkVersion)) && (e.presentationGate === void 0 || ["none", "authentication", "signup"].includes(e.presentationGate)) && [e.firstObservedAt, e.confirmationMs].every((i) => i === void 0 || t(i));
|
|
1031
1073
|
}
|
|
1032
1074
|
function Cs(s) {
|
|
1033
1075
|
if (!s || typeof s != "object" || Object.keys(s).some((i) => i !== "before" && i !== "current")) return !1;
|
|
1034
1076
|
const e = (i) => {
|
|
1035
1077
|
if (!i || typeof i != "object") return !1;
|
|
1036
1078
|
const n = i;
|
|
1037
|
-
return Object.keys(i).every((r) => [...ti, "sessionId", "runtimeItemCount", "welcome", "truncated", "thinkingSequence", "context", "duplicateToolCalls"].includes(r)) && (n.duplicateToolCalls === void 0 || Array.isArray(n.duplicateToolCalls) && n.duplicateToolCalls.length <= 5 && n.duplicateToolCalls.every((r) => r && Object.keys(r).every((a) => ["key", "count", "rows", "truncated"].includes(a)) && ve(r.key) && Number.isSafeInteger(r.count) && r.count >= 2 && typeof r.truncated == "boolean" && Array.isArray(r.rows) && r.rows.length >= 1 && r.rows.length <= 5 && r.rows.length <= r.count && r.rows.every((a) => a && Object.keys(a).every((o) => ["itemId", "groupId"].includes(o)) && ve(a.itemId) && ve(a.groupId)))) && (n.context === void 0 ||
|
|
1079
|
+
return Object.keys(i).every((r) => [...ti, "sessionId", "runtimeItemCount", "welcome", "truncated", "thinkingSequence", "context", "duplicateToolCalls"].includes(r)) && (n.duplicateToolCalls === void 0 || Array.isArray(n.duplicateToolCalls) && n.duplicateToolCalls.length <= 5 && n.duplicateToolCalls.every((r) => r && Object.keys(r).every((a) => ["key", "count", "rows", "truncated"].includes(a)) && ve(r.key) && Number.isSafeInteger(r.count) && r.count >= 2 && typeof r.truncated == "boolean" && Array.isArray(r.rows) && r.rows.length >= 1 && r.rows.length <= 5 && r.rows.length <= r.count && r.rows.every((a) => a && Object.keys(a).every((o) => ["itemId", "groupId"].includes(o)) && ve(a.itemId) && ve(a.groupId)))) && (n.context === void 0 || dr(n.context)) && (n.thinkingSequence === void 0 || Array.isArray(n.thinkingSequence) && n.thinkingSequence.length <= 20 && n.thinkingSequence.every((r) => r === "user" || r === "thinking")) && ve(n.sessionId) && Number.isSafeInteger(n.runtimeItemCount) && n.runtimeItemCount >= 0 && typeof n.welcome == "boolean" && typeof n.truncated == "boolean" && ti.every((r) => Array.isArray(n[r]) && n[r].length <= 20 && n[r].every(ks));
|
|
1038
1080
|
}, t = s;
|
|
1039
1081
|
return (t.before === null || e(t.before)) && e(t.current);
|
|
1040
1082
|
}
|
|
@@ -1049,15 +1091,10 @@ function Qi(s) {
|
|
|
1049
1091
|
e ^= s.charCodeAt(t), e = Math.imul(e, 16777619);
|
|
1050
1092
|
return `fnv1a-${(e >>> 0).toString(16).padStart(8, "0")}`;
|
|
1051
1093
|
}
|
|
1052
|
-
function
|
|
1053
|
-
if (!s || typeof s != "object") return !1;
|
|
1054
|
-
const e = s;
|
|
1055
|
-
return Object.keys(s).every((t) => ["boundary", "category", "messageKind"].includes(t)) && ["runtime", "web_transport", "extension_ipc"].includes(e.boundary) && ["error", "object", "null", "array", "string", "undefined", "number", "boolean", "bigint", "symbol", "function"].includes(e.category) && ["object_coercion", "text", "blank", "non_text"].includes(e.messageKind);
|
|
1056
|
-
}
|
|
1057
|
-
function dr(s) {
|
|
1094
|
+
function lr(s) {
|
|
1058
1095
|
if (!s || typeof s != "object") return !1;
|
|
1059
1096
|
const e = s;
|
|
1060
|
-
return Object.keys(e).every((t) => ["sessionId", "requestId", "code", "normalization", "builds", "clientMessageId"].includes(t)) && (e.clientMessageId === void 0 || O(e.clientMessageId) !== null) && [e.sessionId, e.requestId, e.code].every((t) => t === null || O(t) !== null) && (e.normalization === void 0 ||
|
|
1097
|
+
return Object.keys(e).every((t) => ["sessionId", "requestId", "code", "normalization", "builds", "clientMessageId"].includes(t)) && (e.clientMessageId === void 0 || O(e.clientMessageId) !== null) && [e.sessionId, e.requestId, e.code].every((t) => t === null || O(t) !== null) && (e.normalization === void 0 || ze(e.normalization)) && !!e.builds && typeof e.builds == "object" && typeof e.builds.sdk == "string" && Object.entries(e.builds).every(([t, i]) => ["sdk", "rendererExtension", "contentExtension", "backgroundExtension"].includes(t) && typeof i == "string" && /^\d{1,5}\.\d{1,5}\.\d{1,5}$/.test(i));
|
|
1061
1098
|
}
|
|
1062
1099
|
function Xi(s, e, t, i, n = {}) {
|
|
1063
1100
|
const r = !i && e === "conversation_error" && t !== void 0 && s.conversationDiagnostics?.errorMessageFingerprint === Qi(_e(t)) ? s.conversationDiagnostics : void 0;
|
|
@@ -1066,57 +1103,24 @@ function Xi(s, e, t, i, n = {}) {
|
|
|
1066
1103
|
requestId: O(r?.httpRequest?.requestId ?? r?.errorRequestId ?? r?.queryRequestId),
|
|
1067
1104
|
...O(r?.failedClientMessageId) ? { clientMessageId: r.failedClientMessageId } : {},
|
|
1068
1105
|
code: r ? O(s.lastErrorCode) : null,
|
|
1069
|
-
...
|
|
1106
|
+
...ze(r?.errorNormalization) ? { normalization: r.errorNormalization } : {},
|
|
1070
1107
|
builds: { sdk: Ji.version, ...n }
|
|
1071
1108
|
};
|
|
1072
1109
|
}
|
|
1073
|
-
function lr(s) {
|
|
1074
|
-
if (s.details !== void 0 && !$e(s.details))
|
|
1075
|
-
throw new TypeError("Product Agent transported error details must be JSON-safe.");
|
|
1076
|
-
return {
|
|
1077
|
-
code: s.code,
|
|
1078
|
-
message: s.message,
|
|
1079
|
-
retryable: s.retryable,
|
|
1080
|
-
...s.details === void 0 ? {} : { details: s.details }
|
|
1081
|
-
};
|
|
1082
|
-
}
|
|
1083
|
-
function he(s, e = "runtime_error", t = "runtime") {
|
|
1084
|
-
const i = s !== null && typeof s == "object" ? s : null, n = typeof s == "string" ? s : i && "message" in i && typeof i.message == "string" ? i.message : "", r = i && "code" in i && typeof i.code == "string" && i.code.trim() ? i.code : e, a = i && "details" in i ? i.details : null, o = a && typeof a == "object" ? a : {}, c = {
|
|
1085
|
-
// Preserve the first boundary's shape after normalization replaces the original message/prototype.
|
|
1086
|
-
errorNormalization: He(o.errorNormalization) ? o.errorNormalization : {
|
|
1087
|
-
boundary: t,
|
|
1088
|
-
category: s instanceof Error ? "error" : s === null ? "null" : Array.isArray(s) ? "array" : typeof s,
|
|
1089
|
-
messageKind: n.trim() === "[object Object]" ? "object_coercion" : n.trim() ? "text" : typeof s == "string" || i && "message" in i && typeof i.message == "string" ? "blank" : "non_text"
|
|
1090
|
-
},
|
|
1091
|
-
...o.allocation === "unissued" ? { allocation: "unissued" } : {},
|
|
1092
|
-
...["unissued", "rejected"].includes(String(o.acceptance)) ? { acceptance: String(o.acceptance) } : {},
|
|
1093
|
-
...typeof o.securitySettingsUrl == "string" ? { securitySettingsUrl: o.securitySettingsUrl } : {},
|
|
1094
|
-
...typeof o.transportCode == "string" && /^[a-z0-9_]{1,80}$/.test(o.transportCode) ? { transportCode: o.transportCode } : {},
|
|
1095
|
-
...typeof o.requestId == "string" && /^[a-zA-Z0-9_-]{1,160}$/.test(o.requestId) ? { requestId: o.requestId } : {},
|
|
1096
|
-
...typeof o.durationMs == "number" && Number.isFinite(o.durationMs) && o.durationMs >= 0 ? { durationMs: o.durationMs } : {},
|
|
1097
|
-
...typeof o.successfulRequests == "number" && Number.isSafeInteger(o.successfulRequests) && o.successfulRequests >= 0 ? { successfulRequests: o.successfulRequests } : {}
|
|
1098
|
-
};
|
|
1099
|
-
return lr({
|
|
1100
|
-
code: r,
|
|
1101
|
-
message: n.trim() && n.trim() !== "[object Object]" ? n : "The Product Agent operation failed. Try again.",
|
|
1102
|
-
retryable: !!(i && "retryable" in i && i.retryable === !0),
|
|
1103
|
-
...Object.keys(c).length ? { details: c } : {}
|
|
1104
|
-
});
|
|
1105
|
-
}
|
|
1106
1110
|
function ur(s, e = "runtime") {
|
|
1107
|
-
const t =
|
|
1111
|
+
const t = J(s, "runtime_error", e), i = s !== null && typeof s == "object" && "stack" in s && typeof s.stack == "string" ? _e(s.stack.slice(0, 4e3).split(`
|
|
1108
1112
|
`).slice(0, 6).join(`
|
|
1109
1113
|
`).replace(/\n\s*at\s/g, `
|
|
1110
1114
|
frame `)) : void 0;
|
|
1111
1115
|
return {
|
|
1112
|
-
...
|
|
1116
|
+
...ze(t.details?.errorNormalization) ? { normalization: t.details.errorNormalization } : {},
|
|
1113
1117
|
category: s instanceof Error ? "error" : s === null ? "null" : Array.isArray(s) ? "array" : typeof s,
|
|
1114
1118
|
code: _e(t.code),
|
|
1115
1119
|
message: _e(t.message),
|
|
1116
1120
|
...i ? { stack: i } : {}
|
|
1117
1121
|
};
|
|
1118
1122
|
}
|
|
1119
|
-
function
|
|
1123
|
+
function le(s) {
|
|
1120
1124
|
if (!s || typeof s != "object") return !1;
|
|
1121
1125
|
const e = s, t = (i) => Number.isSafeInteger(i) && i >= 0;
|
|
1122
1126
|
return Object.keys(e).every((i) => [
|
|
@@ -1301,7 +1305,7 @@ function K(s, e) {
|
|
|
1301
1305
|
throw Object.assign(new Error("Conversation authority was retired."), { code: "authority_retired", retryable: !0 });
|
|
1302
1306
|
}
|
|
1303
1307
|
function me(s, e) {
|
|
1304
|
-
const t =
|
|
1308
|
+
const t = J(s, "connection_interrupted", "web_transport"), { code: i, message: n } = t, r = s instanceof Error && "detail" in s ? s.detail : s instanceof Error && "details" in s ? s.details : void 0, a = r && typeof r == "object" && "httpRequest" in r ? r.httpRequest : r, o = a && typeof a == "object" ? a : {}, c = o.category ?? o.transportCode, d = o.elapsedMs ?? o.durationMs, l = r && typeof r == "object" && "successfulRequests" in r && typeof r.successfulRequests == "number" ? r.successfulRequests : 0, u = r && typeof r == "object" && "securitySettingsUrl" in r && typeof r.securitySettingsUrl == "string" ? r.securitySettingsUrl : void 0, p = r && typeof r == "object" && "httpRequest" in r && le(r.httpRequest) ? r.httpRequest : void 0;
|
|
1305
1309
|
return Object.assign(new Error(n), {
|
|
1306
1310
|
code: i,
|
|
1307
1311
|
// Keep the actionable public URL without copying arbitrary transport internals into durable errors.
|
|
@@ -1423,7 +1427,7 @@ function vr(s) {
|
|
|
1423
1427
|
"conversations",
|
|
1424
1428
|
{ timing: u }
|
|
1425
1429
|
);
|
|
1426
|
-
if (K(s, o), p.request_id !== o.command.request_id ||
|
|
1430
|
+
if (K(s, o), p.request_id !== o.command.request_id || !Le(p.result)) throw Object.assign(new Error("Conversation response identity mismatch."), { code: "acceptance_identity_mismatch" });
|
|
1427
1431
|
if (o.command.type.startsWith("chat.")) {
|
|
1428
1432
|
const f = p.result;
|
|
1429
1433
|
if (typeof f?.sessionId != "string" || !f.sessionId || f.clientMessageId !== o.command.payload.clientMessageId || o.command.payload.sessionId && f.sessionId !== o.command.payload.sessionId) throw Object.assign(new Error("Conversation acceptance identity mismatch."), { code: "acceptance_identity_mismatch" });
|
|
@@ -1684,9 +1688,13 @@ class Ir {
|
|
|
1684
1688
|
}
|
|
1685
1689
|
}
|
|
1686
1690
|
}
|
|
1691
|
+
function br(s, e) {
|
|
1692
|
+
const t = s?.executionByUserMessage[e]?.responseMessageIds, i = t?.indexOf(e) ?? -1;
|
|
1693
|
+
return t && i >= 0 ? t.slice(0, i + 1) : [e];
|
|
1694
|
+
}
|
|
1687
1695
|
function Ie(s, e, t) {
|
|
1688
1696
|
const i = s.submissionOrder.map((I) => s.submissions[I]).filter((I) => I.conversationScopeId === t), n = e.selections[t]?.sessionId ?? i.find((I) => !I.cancelled && I.sessionId !== null)?.sessionId ?? null, r = n ? s.sessions[n] : void 0, a = s.submissionOrder.map((I) => s.submissions[I]).filter((I) => n ? I.sessionId === n || I.sessionId === null && I.conversationScopeId === t : I.conversationScopeId === t), o = Object.values(r?.items ?? {}).sort((I, k) => {
|
|
1689
|
-
const P =
|
|
1697
|
+
const P = ae(I.created_at), L = ae(k.created_at);
|
|
1690
1698
|
return P < L ? -1 : P > L ? 1 : I.id < k.id ? -1 : I.id > k.id ? 1 : 0;
|
|
1691
1699
|
}), c = a.filter((I) => (!I.cancelled || I.conversationScopeId === t && (I.sessionId === null || I.sessionId === n || n === null && I === a[a.length - 1])) && !r?.items[I.userMessageId] && !r?.removedItems[I.userMessageId]), d = {};
|
|
1692
1700
|
for (const I of o) {
|
|
@@ -1719,14 +1727,14 @@ function Ie(s, e, t) {
|
|
|
1719
1727
|
}
|
|
1720
1728
|
const u = r?.execution, p = a.filter((I) => !I.cancelled && I.delivery !== "failed"), f = p.filter((I) => I.delivery !== "accepted" && I.executionVersion === null), m = p.filter((I) => I.delivery === "accepted" && I.executionVersion === null), h = p[p.length - 1], y = f.length > 0, g = h !== void 0 && m.includes(h);
|
|
1721
1729
|
let b = y ? "submitting" : g ? "awaiting_execution" : u?.phase ?? "idle";
|
|
1722
|
-
const v = Object.entries(s.stops).filter(([I]) => I === t || n !== null && e.selections[I]?.sessionId === n).map(([, I]) => I).find((I) => (!a.length || I.userMessageIds.includes(a[a.length - 1].userMessageId) || !y && !g &&
|
|
1723
|
-
v && _ && !y && (!u || !["thinking", "steering", "queued", "stopping"].includes(u.phase) ||
|
|
1730
|
+
const v = Object.entries(s.stops).filter(([I]) => I === t || n !== null && e.selections[I]?.sessionId === n).map(([, I]) => I).find((I) => (!a.length || I.userMessageIds.includes(a[a.length - 1].userMessageId) || !y && !g && ie(u).some((k) => I.userMessageIds.includes(k))) && (!u || u.version <= I.executionVersion || ["thinking", "steering", "queued", "stopping"].includes(u.phase) || a.some((k) => k.cancelled && k.executionVersion === null && I.userMessageIds.includes(k.userMessageId)))), _ = u && ["thinking", "steering", "queued", "stopping"].includes(u.phase) || a.some((I) => I.delivery === "accepted" && I.executionVersion === null && v?.userMessageIds.includes(I.userMessageId));
|
|
1731
|
+
v && _ && !y && (!u || !["thinking", "steering", "queued", "stopping"].includes(u.phase) || ie(u).every((I) => v.userMessageIds.includes(I))) && (b = "stopping"), v && !_ && !y && a.some((I) => I.cancelled && I.executionVersion === null && v.userMessageIds.includes(I.userMessageId)) && (b = a.some((I) => v.userMessageIds.includes(I.userMessageId) && ["sending", "uncertain"].includes(I.delivery)) ? "stopping" : "stopped");
|
|
1724
1732
|
const S = ["thinking", "steering", "queued"].includes(b), A = s.stops[t] ?? v, C = A?.userMessageIds.filter((I) => !["completed", "failed"].includes(r?.executionByUserMessage[I]?.phase ?? "")) ?? [], H = C.some((I) => {
|
|
1725
1733
|
const k = a.find((L) => L.userMessageId === I);
|
|
1726
|
-
return !Object.values(s.operations).some((L) => L.command.type === "run.stop" && L.command.payload.expectedUserMessageId === I && L.phase === "done") && (k?.executionVersion === null && ["sending", "uncertain", "accepted"].includes(k.delivery) || !!(u &&
|
|
1727
|
-
}), B = u?.user_message_ids ?? [],
|
|
1734
|
+
return !Object.values(s.operations).some((L) => L.command.type === "run.stop" && L.command.payload.expectedUserMessageId === I && L.phase === "done") && (k?.executionVersion === null && ["sending", "uncertain", "accepted"].includes(k.delivery) || !!(u && ie(u).includes(I) && ["thinking", "steering", "queued", "stopping"].includes(u.phase)));
|
|
1735
|
+
}), B = u?.user_message_ids ?? [], Q = y || g ? h?.userMessageId ?? null : B[B.length - 1] ?? null, R = l.find((I) => I.userMessageId === Q), M = S ? [...R?.activityIds ?? []].reverse().find((I) => d[I] === "open") ?? null : null, E = n !== null && !!e.selections[t]?.provisionalId && o.length === 0 && a.length === 0 && // The first persisted idle snapshot already has a positive synchronization version.
|
|
1728
1736
|
(!r?.execution || r.execution.phase === "idle" && r.execution.user_message_ids.length === 0) && Object.values(s.operations).some((I) => I.conversationScopeId === t && I.phase === "done" && ["runtime.warmup", "attachment.prepare"].includes(I.command.type) && !I.command.payload.sessionId && I.result?.sessionId === n);
|
|
1729
|
-
return
|
|
1737
|
+
return re({
|
|
1730
1738
|
historyRefreshFailure: r?.historyRefreshFailure ?? null,
|
|
1731
1739
|
selectionKey: t ? JSON.stringify([s.authorityId, s.generation, t]) : void 0,
|
|
1732
1740
|
isDraftSession: E,
|
|
@@ -1742,8 +1750,8 @@ function Ie(s, e, t) {
|
|
|
1742
1750
|
streamStates: d,
|
|
1743
1751
|
preparation: r?.preparation ?? null,
|
|
1744
1752
|
stop: A ? { ...A, userMessageIds: C, pending: H } : null,
|
|
1745
|
-
segments: l.map((I, k) => ({ ...I, collapsed: S ? I.userMessageId !==
|
|
1746
|
-
activity: { phase: b, activeItemId: M, userMessageId:
|
|
1753
|
+
segments: l.map((I, k) => ({ ...I, collapsed: S ? I.userMessageId !== Q : k < l.length - 1 || I.activityIds.length > 0 })),
|
|
1754
|
+
activity: { phase: b, activeItemId: M, userMessageId: Q, executionKey: JSON.stringify([...ie(u)].sort()) },
|
|
1747
1755
|
// Staging transfers the immutable input to the core. Waiting for backend acceptance leaves
|
|
1748
1756
|
// the same submitted text in the optimistic transcript and composer during delivery.
|
|
1749
1757
|
receipts: i.filter((I) => !I.cancelled && e.clients[I.clientScopeId] === t).map((I) => ({ viewId: I.viewId, userMessageId: I.userMessageId, acceptedRendererRevision: I.rendererRevision }))
|
|
@@ -1762,24 +1770,24 @@ function Yi(s, e) {
|
|
|
1762
1770
|
const a = e ?? [...s.items].reverse().find((o) => o.type === "user_message")?.id ?? [...s.submissions].reverse().find((o) => !o.cancelled && o.delivery === "accepted")?.userMessageId;
|
|
1763
1771
|
return s.sessionId && a ? { type: "execution", userMessageId: a, sessionId: s.sessionId } : null;
|
|
1764
1772
|
}
|
|
1765
|
-
function br(s, e) {
|
|
1766
|
-
return ne({ scopes: Object.fromEntries([...new Set(Object.values(e.clients))].map((t) => [t, Ie(s, e, t)])) });
|
|
1767
|
-
}
|
|
1768
1773
|
function wr(s, e) {
|
|
1774
|
+
return re({ scopes: Object.fromEntries([...new Set(Object.values(e.clients))].map((t) => [t, Ie(s, e, t)])) });
|
|
1775
|
+
}
|
|
1776
|
+
function _r(s, e) {
|
|
1769
1777
|
if (!e) return !1;
|
|
1770
1778
|
const t = s.executionByUserMessage[e];
|
|
1771
1779
|
if (t) return ["completed", "stopped", "failed"].includes(t.phase);
|
|
1772
|
-
const i = Object.values(s.items).sort((r, a) =>
|
|
1780
|
+
const i = Object.values(s.items).sort((r, a) => ae(r.created_at).localeCompare(ae(a.created_at)) || r.id.localeCompare(a.id));
|
|
1773
1781
|
let n = !1;
|
|
1774
1782
|
for (const r of i)
|
|
1775
1783
|
if (r.type === "user_message" && (n = r.id === e), !!n && (r.type === "stopped" || r.type === "error" || r.type === "final_response" && s.streams[r.id]?.state === "finished" && s.streams[r.id].revision >= r.data.revision))
|
|
1776
1784
|
return !0;
|
|
1777
1785
|
return !1;
|
|
1778
1786
|
}
|
|
1779
|
-
const
|
|
1787
|
+
const Sr = /(\]\()(\/api\/product-agent\/attachments\/download\?[^)\s]+)(\))/g;
|
|
1780
1788
|
function Ae(s, e) {
|
|
1781
1789
|
return e ? s.replace(
|
|
1782
|
-
|
|
1790
|
+
Sr,
|
|
1783
1791
|
(t, i, n, r) => `${i}${new URL(n, e).toString()}${r}`
|
|
1784
1792
|
) : s;
|
|
1785
1793
|
}
|
|
@@ -1820,7 +1828,7 @@ function ii(s, e) {
|
|
|
1820
1828
|
...s.file_url === null ? {} : { fileUrl: new URL(s.file_url, e).toString() }
|
|
1821
1829
|
};
|
|
1822
1830
|
}
|
|
1823
|
-
function
|
|
1831
|
+
function Rr(s, e, t, i) {
|
|
1824
1832
|
const n = t === "open" || t === "awaiting_content", r = {
|
|
1825
1833
|
id: s.id,
|
|
1826
1834
|
createdAt: s.created_at,
|
|
@@ -1861,7 +1869,7 @@ function Ot(s, e, t, i) {
|
|
|
1861
1869
|
const n = /* @__PURE__ */ new Map();
|
|
1862
1870
|
for (const v of s.segments)
|
|
1863
1871
|
for (const _ of [...v.activityIds, ...v.outcomeIds]) n.set(_, v.userMessageId);
|
|
1864
|
-
const r = s.items.map((v) =>
|
|
1872
|
+
const r = s.items.map((v) => Rr(
|
|
1865
1873
|
v,
|
|
1866
1874
|
n.get(v.id) ?? null,
|
|
1867
1875
|
s.streamStates[v.id],
|
|
@@ -1909,9 +1917,9 @@ function Ot(s, e, t, i) {
|
|
|
1909
1917
|
...h ? { errorMessageFingerprint: Qi(_e(h.message)) } : {},
|
|
1910
1918
|
...d && h && h === d.error && !p ? { failedClientMessageId: d.userMessageId } : {},
|
|
1911
1919
|
...typeof h?.details?.requestId == "string" ? { errorRequestId: h.details.requestId } : {},
|
|
1912
|
-
...
|
|
1920
|
+
...ze(h?.details?.errorNormalization) ? { errorNormalization: h.details.errorNormalization } : {},
|
|
1913
1921
|
...i ? { owner: i } : {},
|
|
1914
|
-
...
|
|
1922
|
+
...le(h?.details?.httpRequest) ? { httpRequest: h.details.httpRequest } : {},
|
|
1915
1923
|
queryStatus: e?.status ?? null,
|
|
1916
1924
|
queryRequestId: e?.requestId ?? null,
|
|
1917
1925
|
queryUpdatedAt: e?.updatedAt ?? null
|
|
@@ -1980,7 +1988,7 @@ function ni(s) {
|
|
|
1980
1988
|
return "This request was interrupted before acceptance could be confirmed.";
|
|
1981
1989
|
}
|
|
1982
1990
|
}
|
|
1983
|
-
function
|
|
1991
|
+
function Ar(s) {
|
|
1984
1992
|
return {
|
|
1985
1993
|
content: s.content,
|
|
1986
1994
|
...typeof s.context.proactiveSuggestionQuestion == "string" ? { proactiveSuggestionQuestion: s.context.proactiveSuggestionQuestion } : {},
|
|
@@ -1997,7 +2005,7 @@ function Rr(s) {
|
|
|
1997
2005
|
}))
|
|
1998
2006
|
};
|
|
1999
2007
|
}
|
|
2000
|
-
function
|
|
2008
|
+
function Tr(s) {
|
|
2001
2009
|
const e = () => {
|
|
2002
2010
|
const t = s.runtime(), i = t.engine.getState().slices.directory;
|
|
2003
2011
|
return !t.isDisposed && i.authorityId === s.authority.authorityId && i.generation === s.authority.generation;
|
|
@@ -2102,31 +2110,31 @@ function it(s) {
|
|
|
2102
2110
|
nextCursor: s.nextCursor
|
|
2103
2111
|
};
|
|
2104
2112
|
}
|
|
2105
|
-
function
|
|
2113
|
+
function Er(s, e, t) {
|
|
2106
2114
|
if (t === "replace" || s === null) return e;
|
|
2107
2115
|
const i = { ...s.entitiesById, ...e.entitiesById }, n = [...s.ids];
|
|
2108
2116
|
for (const r of e.ids)
|
|
2109
2117
|
s.entitiesById[r] || n.push(r);
|
|
2110
2118
|
return { entitiesById: i, ids: n, nextCursor: e.nextCursor };
|
|
2111
2119
|
}
|
|
2112
|
-
function
|
|
2120
|
+
function kr(s) {
|
|
2113
2121
|
return s ? s.ids.map((e) => s.entitiesById[e]).filter((e) => !!e) : [];
|
|
2114
2122
|
}
|
|
2115
|
-
function
|
|
2123
|
+
function Fd(s) {
|
|
2116
2124
|
return s.visible ? s.minimized ? { state: "minimized" } : { state: s.open ? "visible_open" : "visible_closed" } : { state: "hidden" };
|
|
2117
2125
|
}
|
|
2118
2126
|
function nt(s, e) {
|
|
2119
2127
|
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: [] };
|
|
2120
2128
|
}
|
|
2121
|
-
function
|
|
2129
|
+
function qr(s) {
|
|
2122
2130
|
if (!s || typeof s != "object") return !1;
|
|
2123
2131
|
const e = s.paidCreditFallbackModel;
|
|
2124
2132
|
return typeof e == "string" && e.length > 0;
|
|
2125
2133
|
}
|
|
2126
|
-
function
|
|
2134
|
+
function zd(s) {
|
|
2127
2135
|
return s.submissionAllowed && s.isAuthenticated && s.hasWorkspace && !s.isWebsiteBlocked && s.isCurrentPageResolved && !s.isSubmitting && !s.hasPendingMessage;
|
|
2128
2136
|
}
|
|
2129
|
-
function
|
|
2137
|
+
function Hd(s) {
|
|
2130
2138
|
const e = s.hasDraftMessage || s.hasPreSubmittedAttachment;
|
|
2131
2139
|
return s.hasRunningAssistantTurn && !e ? {
|
|
2132
2140
|
action: "stop",
|
|
@@ -2136,23 +2144,23 @@ function zd(s) {
|
|
|
2136
2144
|
disabled: !e || !s.canSubmitMessage
|
|
2137
2145
|
};
|
|
2138
2146
|
}
|
|
2139
|
-
const
|
|
2140
|
-
function
|
|
2141
|
-
return (s instanceof Error ? s.message : s) ===
|
|
2142
|
-
}
|
|
2143
|
-
const
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2147
|
+
const Cr = "Pluno is reconnecting. Try again in a moment.";
|
|
2148
|
+
function Mr(s) {
|
|
2149
|
+
return (s instanceof Error ? s.message : s) === Cr;
|
|
2150
|
+
}
|
|
2151
|
+
const ne = /* @__PURE__ */ Object.create(null);
|
|
2152
|
+
ne.open = "0";
|
|
2153
|
+
ne.close = "1";
|
|
2154
|
+
ne.ping = "2";
|
|
2155
|
+
ne.pong = "3";
|
|
2156
|
+
ne.message = "4";
|
|
2157
|
+
ne.upgrade = "5";
|
|
2158
|
+
ne.noop = "6";
|
|
2151
2159
|
const rt = /* @__PURE__ */ Object.create(null);
|
|
2152
|
-
Object.keys(
|
|
2153
|
-
rt[
|
|
2160
|
+
Object.keys(ne).forEach((s) => {
|
|
2161
|
+
rt[ne[s]] = s;
|
|
2154
2162
|
});
|
|
2155
|
-
const hs = { type: "error", data: "parser error" }, Zi = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", en = typeof ArrayBuffer == "function", tn = (s) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(s) : s && s.buffer instanceof ArrayBuffer, Ms = ({ type: s, data: e }, t, i) => Zi && e instanceof Blob ? t ? i(e) : oi(e, i) : en && (e instanceof ArrayBuffer || tn(e)) ? t ? i(e) : oi(new Blob([e]), i) : i(
|
|
2163
|
+
const hs = { type: "error", data: "parser error" }, Zi = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", en = typeof ArrayBuffer == "function", tn = (s) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(s) : s && s.buffer instanceof ArrayBuffer, Ms = ({ type: s, data: e }, t, i) => Zi && e instanceof Blob ? t ? i(e) : oi(e, i) : en && (e instanceof ArrayBuffer || tn(e)) ? t ? i(e) : oi(new Blob([e]), i) : i(ne[s] + (e || "")), oi = (s, e) => {
|
|
2156
2164
|
const t = new FileReader();
|
|
2157
2165
|
return t.onload = function() {
|
|
2158
2166
|
const i = t.result.split(",")[1];
|
|
@@ -2163,7 +2171,7 @@ function ai(s) {
|
|
|
2163
2171
|
return s instanceof Uint8Array ? s : s instanceof ArrayBuffer ? new Uint8Array(s) : new Uint8Array(s.buffer, s.byteOffset, s.byteLength);
|
|
2164
2172
|
}
|
|
2165
2173
|
let Pt;
|
|
2166
|
-
function
|
|
2174
|
+
function Or(s, e) {
|
|
2167
2175
|
if (Zi && s.data instanceof Blob)
|
|
2168
2176
|
return s.data.arrayBuffer().then(ai).then(e);
|
|
2169
2177
|
if (en && (s.data instanceof ArrayBuffer || tn(s.data)))
|
|
@@ -2175,14 +2183,14 @@ function Mr(s, e) {
|
|
|
2175
2183
|
const ci = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ue = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
|
|
2176
2184
|
for (let s = 0; s < ci.length; s++)
|
|
2177
2185
|
Ue[ci.charCodeAt(s)] = s;
|
|
2178
|
-
const
|
|
2186
|
+
const Pr = (s) => {
|
|
2179
2187
|
let e = s.length * 0.75, t = s.length, i, n = 0, r, a, o, c;
|
|
2180
2188
|
s[s.length - 1] === "=" && (e--, s[s.length - 2] === "=" && e--);
|
|
2181
2189
|
const d = new ArrayBuffer(e), l = new Uint8Array(d);
|
|
2182
2190
|
for (i = 0; i < t; i += 4)
|
|
2183
2191
|
r = Ue[s.charCodeAt(i)], a = Ue[s.charCodeAt(i + 1)], o = Ue[s.charCodeAt(i + 2)], c = Ue[s.charCodeAt(i + 3)], l[n++] = r << 2 | a >> 4, l[n++] = (a & 15) << 4 | o >> 2, l[n++] = (o & 3) << 6 | c & 63;
|
|
2184
2192
|
return d;
|
|
2185
|
-
},
|
|
2193
|
+
}, xr = typeof ArrayBuffer == "function", Os = (s, e) => {
|
|
2186
2194
|
if (typeof s != "string")
|
|
2187
2195
|
return {
|
|
2188
2196
|
type: "message",
|
|
@@ -2191,20 +2199,20 @@ const Or = (s) => {
|
|
|
2191
2199
|
const t = s.charAt(0);
|
|
2192
2200
|
return t === "b" ? {
|
|
2193
2201
|
type: "message",
|
|
2194
|
-
data:
|
|
2202
|
+
data: Dr(s.substring(1), e)
|
|
2195
2203
|
} : rt[t] ? s.length > 1 ? {
|
|
2196
2204
|
type: rt[t],
|
|
2197
2205
|
data: s.substring(1)
|
|
2198
2206
|
} : {
|
|
2199
2207
|
type: rt[t]
|
|
2200
2208
|
} : hs;
|
|
2201
|
-
},
|
|
2202
|
-
if (
|
|
2203
|
-
const t =
|
|
2209
|
+
}, Dr = (s, e) => {
|
|
2210
|
+
if (xr) {
|
|
2211
|
+
const t = Pr(s);
|
|
2204
2212
|
return sn(t, e);
|
|
2205
2213
|
} else
|
|
2206
2214
|
return { base64: !0, data: s };
|
|
2207
|
-
}, sn = (s, e) => e === "blob" ? s instanceof Blob ? s : new Blob([s]) : s instanceof ArrayBuffer ? s : s.buffer, nn = "",
|
|
2215
|
+
}, sn = (s, e) => e === "blob" ? s instanceof Blob ? s : new Blob([s]) : s instanceof ArrayBuffer ? s : s.buffer, nn = "", Ur = (s, e) => {
|
|
2208
2216
|
const t = s.length, i = new Array(t);
|
|
2209
2217
|
let n = 0;
|
|
2210
2218
|
s.forEach((r, a) => {
|
|
@@ -2212,7 +2220,7 @@ const Or = (s) => {
|
|
|
2212
2220
|
i[a] = o, ++n === t && e(i.join(nn));
|
|
2213
2221
|
});
|
|
2214
2222
|
});
|
|
2215
|
-
},
|
|
2223
|
+
}, Nr = (s, e) => {
|
|
2216
2224
|
const t = s.split(nn), i = [];
|
|
2217
2225
|
for (let n = 0; n < t.length; n++) {
|
|
2218
2226
|
const r = Os(t[n], e);
|
|
@@ -2221,10 +2229,10 @@ const Or = (s) => {
|
|
|
2221
2229
|
}
|
|
2222
2230
|
return i;
|
|
2223
2231
|
};
|
|
2224
|
-
function
|
|
2232
|
+
function Br() {
|
|
2225
2233
|
return new TransformStream({
|
|
2226
2234
|
transform(s, e) {
|
|
2227
|
-
|
|
2235
|
+
Or(s, (t) => {
|
|
2228
2236
|
const i = t.length;
|
|
2229
2237
|
let n;
|
|
2230
2238
|
if (i < 126)
|
|
@@ -2256,7 +2264,7 @@ function Xe(s, e) {
|
|
|
2256
2264
|
t[n] = s[0][i++], i === s[0].length && (s.shift(), i = 0);
|
|
2257
2265
|
return s.length && i < s[0].length && (s[0] = s[0].slice(i)), t;
|
|
2258
2266
|
}
|
|
2259
|
-
function
|
|
2267
|
+
function jr(s, e) {
|
|
2260
2268
|
xt || (xt = new TextDecoder());
|
|
2261
2269
|
const t = [];
|
|
2262
2270
|
let i = 0, n = -1, r = !1;
|
|
@@ -2298,9 +2306,9 @@ function Br(s, e) {
|
|
|
2298
2306
|
}
|
|
2299
2307
|
const rn = 4;
|
|
2300
2308
|
function U(s) {
|
|
2301
|
-
if (s) return
|
|
2309
|
+
if (s) return Lr(s);
|
|
2302
2310
|
}
|
|
2303
|
-
function
|
|
2311
|
+
function Lr(s) {
|
|
2304
2312
|
for (var e in U.prototype)
|
|
2305
2313
|
s[e] = U.prototype[e];
|
|
2306
2314
|
return s;
|
|
@@ -2346,19 +2354,19 @@ U.prototype.listeners = function(s) {
|
|
|
2346
2354
|
U.prototype.hasListeners = function(s) {
|
|
2347
2355
|
return !!this.listeners(s).length;
|
|
2348
2356
|
};
|
|
2349
|
-
const vt = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, t) => t(e, 0),
|
|
2357
|
+
const vt = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, t) => t(e, 0), ee = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), $r = "arraybuffer";
|
|
2350
2358
|
function on(s, ...e) {
|
|
2351
2359
|
return e.reduce((t, i) => (s.hasOwnProperty(i) && (t[i] = s[i]), t), {});
|
|
2352
2360
|
}
|
|
2353
|
-
const
|
|
2361
|
+
const Fr = ee.setTimeout, zr = ee.clearTimeout;
|
|
2354
2362
|
function It(s, e) {
|
|
2355
|
-
e.useNativeTimers ? (s.setTimeoutFn =
|
|
2356
|
-
}
|
|
2357
|
-
const zr = 1.33;
|
|
2358
|
-
function Hr(s) {
|
|
2359
|
-
return typeof s == "string" ? Kr(s) : Math.ceil((s.byteLength || s.size) * zr);
|
|
2363
|
+
e.useNativeTimers ? (s.setTimeoutFn = Fr.bind(ee), s.clearTimeoutFn = zr.bind(ee)) : (s.setTimeoutFn = ee.setTimeout.bind(ee), s.clearTimeoutFn = ee.clearTimeout.bind(ee));
|
|
2360
2364
|
}
|
|
2365
|
+
const Hr = 1.33;
|
|
2361
2366
|
function Kr(s) {
|
|
2367
|
+
return typeof s == "string" ? Wr(s) : Math.ceil((s.byteLength || s.size) * Hr);
|
|
2368
|
+
}
|
|
2369
|
+
function Wr(s) {
|
|
2362
2370
|
let e = 0, t = 0;
|
|
2363
2371
|
for (let i = 0, n = s.length; i < n; i++)
|
|
2364
2372
|
e = s.charCodeAt(i), e < 128 ? t += 1 : e < 2048 ? t += 2 : e < 55296 || e >= 57344 ? t += 3 : (i++, t += 4);
|
|
@@ -2367,13 +2375,13 @@ function Kr(s) {
|
|
|
2367
2375
|
function an() {
|
|
2368
2376
|
return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
|
|
2369
2377
|
}
|
|
2370
|
-
function
|
|
2378
|
+
function Vr(s) {
|
|
2371
2379
|
let e = "";
|
|
2372
2380
|
for (let t in s)
|
|
2373
2381
|
s.hasOwnProperty(t) && (e.length && (e += "&"), e += encodeURIComponent(t) + "=" + encodeURIComponent(s[t]));
|
|
2374
2382
|
return e;
|
|
2375
2383
|
}
|
|
2376
|
-
function
|
|
2384
|
+
function Gr(s) {
|
|
2377
2385
|
let e = {}, t = s.split("&");
|
|
2378
2386
|
for (let i = 0, n = t.length; i < n; i++) {
|
|
2379
2387
|
let r = t[i].split("=");
|
|
@@ -2381,7 +2389,7 @@ function Vr(s) {
|
|
|
2381
2389
|
}
|
|
2382
2390
|
return e;
|
|
2383
2391
|
}
|
|
2384
|
-
class
|
|
2392
|
+
class Jr extends Error {
|
|
2385
2393
|
constructor(e, t, i) {
|
|
2386
2394
|
super(e), this.description = t, this.context = i, this.type = "TransportError";
|
|
2387
2395
|
}
|
|
@@ -2406,7 +2414,7 @@ class Ps extends U {
|
|
|
2406
2414
|
* @protected
|
|
2407
2415
|
*/
|
|
2408
2416
|
onError(e, t, i) {
|
|
2409
|
-
return super.emitReserved("error", new
|
|
2417
|
+
return super.emitReserved("error", new Jr(e, t, i)), this;
|
|
2410
2418
|
}
|
|
2411
2419
|
/**
|
|
2412
2420
|
* Opens the transport.
|
|
@@ -2480,11 +2488,11 @@ class Ps extends U {
|
|
|
2480
2488
|
return this.opts.port && (this.opts.secure && Number(this.opts.port) !== 443 || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : "";
|
|
2481
2489
|
}
|
|
2482
2490
|
_query(e) {
|
|
2483
|
-
const t =
|
|
2491
|
+
const t = Vr(e);
|
|
2484
2492
|
return t.length ? "?" + t : "";
|
|
2485
2493
|
}
|
|
2486
2494
|
}
|
|
2487
|
-
class
|
|
2495
|
+
class Qr extends Ps {
|
|
2488
2496
|
constructor() {
|
|
2489
2497
|
super(...arguments), this._polling = !1;
|
|
2490
2498
|
}
|
|
@@ -2540,7 +2548,7 @@ class Jr extends Ps {
|
|
|
2540
2548
|
return this.onClose({ description: "transport closed by the server" }), !1;
|
|
2541
2549
|
this.onPacket(i);
|
|
2542
2550
|
};
|
|
2543
|
-
|
|
2551
|
+
Nr(e, this.socket.binaryType).forEach(t), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
|
|
2544
2552
|
}
|
|
2545
2553
|
/**
|
|
2546
2554
|
* For polling, send a close packet.
|
|
@@ -2560,7 +2568,7 @@ class Jr extends Ps {
|
|
|
2560
2568
|
* @protected
|
|
2561
2569
|
*/
|
|
2562
2570
|
write(e) {
|
|
2563
|
-
this.writable = !1,
|
|
2571
|
+
this.writable = !1, Ur(e, (t) => {
|
|
2564
2572
|
this.doWrite(t, () => {
|
|
2565
2573
|
this.writable = !0, this.emitReserved("drain");
|
|
2566
2574
|
});
|
|
@@ -2581,10 +2589,10 @@ try {
|
|
|
2581
2589
|
cn = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
|
|
2582
2590
|
} catch {
|
|
2583
2591
|
}
|
|
2584
|
-
const
|
|
2585
|
-
function
|
|
2592
|
+
const Xr = cn;
|
|
2593
|
+
function Yr() {
|
|
2586
2594
|
}
|
|
2587
|
-
class
|
|
2595
|
+
class Zr extends Qr {
|
|
2588
2596
|
/**
|
|
2589
2597
|
* XHR Polling constructor.
|
|
2590
2598
|
*
|
|
@@ -2697,7 +2705,7 @@ let Te = class ot extends U {
|
|
|
2697
2705
|
*/
|
|
2698
2706
|
_cleanup(e) {
|
|
2699
2707
|
if (!(typeof this._xhr > "u" || this._xhr === null)) {
|
|
2700
|
-
if (this._xhr.onreadystatechange =
|
|
2708
|
+
if (this._xhr.onreadystatechange = Yr, e)
|
|
2701
2709
|
try {
|
|
2702
2710
|
this._xhr.abort();
|
|
2703
2711
|
} catch {
|
|
@@ -2729,7 +2737,7 @@ if (typeof document < "u") {
|
|
|
2729
2737
|
if (typeof attachEvent == "function")
|
|
2730
2738
|
attachEvent("onunload", di);
|
|
2731
2739
|
else if (typeof addEventListener == "function") {
|
|
2732
|
-
const s = "onpagehide" in
|
|
2740
|
+
const s = "onpagehide" in ee ? "pagehide" : "unload";
|
|
2733
2741
|
addEventListener(s, di, !1);
|
|
2734
2742
|
}
|
|
2735
2743
|
}
|
|
@@ -2737,17 +2745,17 @@ function di() {
|
|
|
2737
2745
|
for (let s in Te.requests)
|
|
2738
2746
|
Te.requests.hasOwnProperty(s) && Te.requests[s].abort();
|
|
2739
2747
|
}
|
|
2740
|
-
const
|
|
2748
|
+
const eo = (function() {
|
|
2741
2749
|
const s = dn({
|
|
2742
2750
|
xdomain: !1
|
|
2743
2751
|
});
|
|
2744
2752
|
return s && s.responseType !== null;
|
|
2745
2753
|
})();
|
|
2746
|
-
class
|
|
2754
|
+
class to extends Zr {
|
|
2747
2755
|
constructor(e) {
|
|
2748
2756
|
super(e);
|
|
2749
2757
|
const t = e && e.forceBase64;
|
|
2750
|
-
this.supportsBinary =
|
|
2758
|
+
this.supportsBinary = eo && !t;
|
|
2751
2759
|
}
|
|
2752
2760
|
request(e = {}) {
|
|
2753
2761
|
return Object.assign(e, { xd: this.xd }, this.opts), new Te(dn, this.uri(), e);
|
|
@@ -2756,18 +2764,18 @@ class eo extends Yr {
|
|
|
2756
2764
|
function dn(s) {
|
|
2757
2765
|
const e = s.xdomain;
|
|
2758
2766
|
try {
|
|
2759
|
-
if (typeof XMLHttpRequest < "u" && (!e ||
|
|
2767
|
+
if (typeof XMLHttpRequest < "u" && (!e || Xr))
|
|
2760
2768
|
return new XMLHttpRequest();
|
|
2761
2769
|
} catch {
|
|
2762
2770
|
}
|
|
2763
2771
|
if (!e)
|
|
2764
2772
|
try {
|
|
2765
|
-
return new
|
|
2773
|
+
return new ee[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP");
|
|
2766
2774
|
} catch {
|
|
2767
2775
|
}
|
|
2768
2776
|
}
|
|
2769
2777
|
const ln = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative";
|
|
2770
|
-
class
|
|
2778
|
+
class so extends Ps {
|
|
2771
2779
|
get name() {
|
|
2772
2780
|
return "websocket";
|
|
2773
2781
|
}
|
|
@@ -2823,8 +2831,8 @@ class to extends Ps {
|
|
|
2823
2831
|
return this.opts.timestampRequests && (t[this.opts.timestampParam] = an()), this.supportsBinary || (t.b64 = 1), this.createUri(e, t);
|
|
2824
2832
|
}
|
|
2825
2833
|
}
|
|
2826
|
-
const Dt =
|
|
2827
|
-
class
|
|
2834
|
+
const Dt = ee.WebSocket || ee.MozWebSocket;
|
|
2835
|
+
class io extends so {
|
|
2828
2836
|
createSocket(e, t, i) {
|
|
2829
2837
|
return ln ? new Dt(e, t, i) : t ? new Dt(e, t) : new Dt(e);
|
|
2830
2838
|
}
|
|
@@ -2832,7 +2840,7 @@ class so extends to {
|
|
|
2832
2840
|
this.ws.send(t);
|
|
2833
2841
|
}
|
|
2834
2842
|
}
|
|
2835
|
-
class
|
|
2843
|
+
class no extends Ps {
|
|
2836
2844
|
get name() {
|
|
2837
2845
|
return "webtransport";
|
|
2838
2846
|
}
|
|
@@ -2848,7 +2856,7 @@ class io extends Ps {
|
|
|
2848
2856
|
this.onError("webtransport error", e);
|
|
2849
2857
|
}), this._transport.ready.then(() => {
|
|
2850
2858
|
this._transport.createBidirectionalStream().then((e) => {
|
|
2851
|
-
const t =
|
|
2859
|
+
const t = jr(Number.MAX_SAFE_INTEGER, this.socket.binaryType), i = e.readable.pipeThrough(t).getReader(), n = Br();
|
|
2852
2860
|
n.readable.pipeTo(e.writable), this._writer = n.writable.getWriter();
|
|
2853
2861
|
const r = () => {
|
|
2854
2862
|
i.read().then(({ done: o, value: c }) => {
|
|
@@ -2878,11 +2886,11 @@ class io extends Ps {
|
|
|
2878
2886
|
(e = this._transport) === null || e === void 0 || e.close();
|
|
2879
2887
|
}
|
|
2880
2888
|
}
|
|
2881
|
-
const
|
|
2882
|
-
websocket:
|
|
2883
|
-
webtransport:
|
|
2884
|
-
polling:
|
|
2885
|
-
},
|
|
2889
|
+
const ro = {
|
|
2890
|
+
websocket: io,
|
|
2891
|
+
webtransport: no,
|
|
2892
|
+
polling: to
|
|
2893
|
+
}, oo = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, ao = [
|
|
2886
2894
|
"source",
|
|
2887
2895
|
"protocol",
|
|
2888
2896
|
"authority",
|
|
@@ -2903,16 +2911,16 @@ function ps(s) {
|
|
|
2903
2911
|
throw "URI too long";
|
|
2904
2912
|
const e = s, t = s.indexOf("["), i = s.indexOf("]");
|
|
2905
2913
|
t != -1 && i != -1 && (s = s.substring(0, t) + s.substring(t, i).replace(/:/g, ";") + s.substring(i, s.length));
|
|
2906
|
-
let n =
|
|
2914
|
+
let n = oo.exec(s || ""), r = {}, a = 14;
|
|
2907
2915
|
for (; a--; )
|
|
2908
|
-
r[
|
|
2909
|
-
return t != -1 && i != -1 && (r.source = e, r.host = r.host.substring(1, r.host.length - 1).replace(/;/g, ":"), r.authority = r.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), r.ipv6uri = !0), r.pathNames =
|
|
2916
|
+
r[ao[a]] = n[a] || "";
|
|
2917
|
+
return t != -1 && i != -1 && (r.source = e, r.host = r.host.substring(1, r.host.length - 1).replace(/;/g, ":"), r.authority = r.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), r.ipv6uri = !0), r.pathNames = co(r, r.path), r.queryKey = lo(r, r.query), r;
|
|
2910
2918
|
}
|
|
2911
|
-
function
|
|
2919
|
+
function co(s, e) {
|
|
2912
2920
|
const t = /\/{2,9}/g, i = e.replace(t, "/").split("/");
|
|
2913
2921
|
return (e.slice(0, 1) == "/" || e.length === 0) && i.splice(0, 1), e.slice(-1) == "/" && i.splice(i.length - 1, 1), i;
|
|
2914
2922
|
}
|
|
2915
|
-
function
|
|
2923
|
+
function lo(s, e) {
|
|
2916
2924
|
const t = {};
|
|
2917
2925
|
return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function(i, n, r) {
|
|
2918
2926
|
n && (t[n] = r);
|
|
@@ -2930,7 +2938,7 @@ class fe extends U {
|
|
|
2930
2938
|
* @param {Object} opts - options
|
|
2931
2939
|
*/
|
|
2932
2940
|
constructor(e, t) {
|
|
2933
|
-
if (super(), this.binaryType =
|
|
2941
|
+
if (super(), this.binaryType = $r, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = 1 / 0, e && typeof e == "object" && (t = e, e = null), e) {
|
|
2934
2942
|
const i = ps(e);
|
|
2935
2943
|
t.hostname = i.host, t.secure = i.protocol === "https" || i.protocol === "wss", t.port = i.port, i.query && (t.query = i.query);
|
|
2936
2944
|
} else t.host && (t.hostname = ps(t.host).host);
|
|
@@ -2951,7 +2959,7 @@ class fe extends U {
|
|
|
2951
2959
|
},
|
|
2952
2960
|
transportOptions: {},
|
|
2953
2961
|
closeOnBeforeunload: !1
|
|
2954
|
-
}, t), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query =
|
|
2962
|
+
}, t), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = Gr(this.opts.query)), fs && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
|
|
2955
2963
|
this.transport && (this.transport.removeAllListeners(), this.transport.close());
|
|
2956
2964
|
}, addEventListener("beforeunload", this._beforeunloadEventListener, !1)), this.hostname !== "localhost" && (this._offlineEventListener = () => {
|
|
2957
2965
|
this._onClose("transport close", {
|
|
@@ -3086,7 +3094,7 @@ class fe extends U {
|
|
|
3086
3094
|
let t = 1;
|
|
3087
3095
|
for (let i = 0; i < this.writeBuffer.length; i++) {
|
|
3088
3096
|
const n = this.writeBuffer[i].data;
|
|
3089
|
-
if (n && (t +=
|
|
3097
|
+
if (n && (t += Kr(n)), i > 0 && t > this._maxPayload)
|
|
3090
3098
|
return this.writeBuffer.slice(0, i);
|
|
3091
3099
|
t += 2;
|
|
3092
3100
|
}
|
|
@@ -3193,7 +3201,7 @@ class fe extends U {
|
|
|
3193
3201
|
}
|
|
3194
3202
|
}
|
|
3195
3203
|
fe.protocol = rn;
|
|
3196
|
-
class
|
|
3204
|
+
class uo extends fe {
|
|
3197
3205
|
constructor() {
|
|
3198
3206
|
super(...arguments), this._upgrades = [];
|
|
3199
3207
|
}
|
|
@@ -3265,21 +3273,21 @@ class lo extends fe {
|
|
|
3265
3273
|
return t;
|
|
3266
3274
|
}
|
|
3267
3275
|
}
|
|
3268
|
-
let
|
|
3276
|
+
let ho = class extends uo {
|
|
3269
3277
|
constructor(e, t = {}) {
|
|
3270
3278
|
const i = typeof e == "object", n = i ? { ...e } : { ...t };
|
|
3271
|
-
(!n.transports || n.transports && typeof n.transports[0] == "string") && (n.transports = (n.transports || ["polling", "websocket", "webtransport"]).map((r) =>
|
|
3279
|
+
(!n.transports || n.transports && typeof n.transports[0] == "string") && (n.transports = (n.transports || ["polling", "websocket", "webtransport"]).map((r) => ro[r]).filter((r) => !!r)), super(i ? n : e, n);
|
|
3272
3280
|
}
|
|
3273
3281
|
};
|
|
3274
|
-
function
|
|
3282
|
+
function po(s, e = "", t) {
|
|
3275
3283
|
let i = s;
|
|
3276
3284
|
t = t || typeof location < "u" && location, s == null && (s = t.protocol + "//" + t.host), typeof s == "string" && (s.charAt(0) === "/" && (s.charAt(1) === "/" ? s = t.protocol + s : s = t.host + s), /^(https?|wss?):\/\//.test(s) || (typeof t < "u" ? s = t.protocol + "//" + s : s = "https://" + s), i = ps(s)), i.port || (/^(http|ws)$/.test(i.protocol) ? i.port = "80" : /^(http|ws)s$/.test(i.protocol) && (i.port = "443")), i.path = i.path || "/";
|
|
3277
3285
|
const r = i.host.indexOf(":") !== -1 ? "[" + i.host + "]" : i.host;
|
|
3278
3286
|
return i.id = i.protocol + "://" + r + ":" + i.port + e, i.href = i.protocol + "://" + r + (t && t.port === i.port ? "" : ":" + i.port), i;
|
|
3279
3287
|
}
|
|
3280
|
-
const
|
|
3288
|
+
const fo = typeof ArrayBuffer == "function", mo = (s) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(s) : s.buffer instanceof ArrayBuffer, un = Object.prototype.toString, go = typeof Blob == "function" || typeof Blob < "u" && un.call(Blob) === "[object BlobConstructor]", yo = typeof File == "function" || typeof File < "u" && un.call(File) === "[object FileConstructor]";
|
|
3281
3289
|
function xs(s) {
|
|
3282
|
-
return
|
|
3290
|
+
return fo && (s instanceof ArrayBuffer || mo(s)) || go && s instanceof Blob || yo && s instanceof File;
|
|
3283
3291
|
}
|
|
3284
3292
|
function ct(s, e) {
|
|
3285
3293
|
if (!s || typeof s != "object")
|
|
@@ -3299,7 +3307,7 @@ function ct(s, e) {
|
|
|
3299
3307
|
return !0;
|
|
3300
3308
|
return !1;
|
|
3301
3309
|
}
|
|
3302
|
-
function
|
|
3310
|
+
function vo(s) {
|
|
3303
3311
|
const e = [], t = s.data, i = s;
|
|
3304
3312
|
return i.data = dt(t, e), i.attachments = e.length, { packet: i, buffers: e };
|
|
3305
3313
|
}
|
|
@@ -3324,7 +3332,7 @@ function dt(s, e, t) {
|
|
|
3324
3332
|
}
|
|
3325
3333
|
return s;
|
|
3326
3334
|
}
|
|
3327
|
-
function
|
|
3335
|
+
function Io(s, e) {
|
|
3328
3336
|
return s.data = ms(s.data, e), delete s.attachments, s;
|
|
3329
3337
|
}
|
|
3330
3338
|
function ms(s, e) {
|
|
@@ -3342,7 +3350,7 @@ function ms(s, e) {
|
|
|
3342
3350
|
Object.prototype.hasOwnProperty.call(s, t) && (s[t] = ms(s[t], e));
|
|
3343
3351
|
return s;
|
|
3344
3352
|
}
|
|
3345
|
-
const
|
|
3353
|
+
const bo = [
|
|
3346
3354
|
"connect",
|
|
3347
3355
|
// used on the client side
|
|
3348
3356
|
"connect_error",
|
|
@@ -3360,7 +3368,7 @@ var T;
|
|
|
3360
3368
|
(function(s) {
|
|
3361
3369
|
s[s.CONNECT = 0] = "CONNECT", s[s.DISCONNECT = 1] = "DISCONNECT", s[s.EVENT = 2] = "EVENT", s[s.ACK = 3] = "ACK", s[s.CONNECT_ERROR = 4] = "CONNECT_ERROR", s[s.BINARY_EVENT = 5] = "BINARY_EVENT", s[s.BINARY_ACK = 6] = "BINARY_ACK";
|
|
3362
3370
|
})(T || (T = {}));
|
|
3363
|
-
class
|
|
3371
|
+
class wo {
|
|
3364
3372
|
/**
|
|
3365
3373
|
* Encoder constructor
|
|
3366
3374
|
*
|
|
@@ -3396,7 +3404,7 @@ class bo {
|
|
|
3396
3404
|
* a list of buffers.
|
|
3397
3405
|
*/
|
|
3398
3406
|
encodeAsBinary(e) {
|
|
3399
|
-
const t =
|
|
3407
|
+
const t = vo(e), i = this.encodeAsString(t.packet), n = t.buffers;
|
|
3400
3408
|
return n.unshift(i), n;
|
|
3401
3409
|
}
|
|
3402
3410
|
}
|
|
@@ -3422,7 +3430,7 @@ class Ds extends U {
|
|
|
3422
3430
|
throw new Error("got plaintext data when reconstructing a packet");
|
|
3423
3431
|
t = this.decodeString(e);
|
|
3424
3432
|
const i = t.type === T.BINARY_EVENT;
|
|
3425
|
-
i || t.type === T.BINARY_ACK ? (t.type = i ? T.EVENT : T.ACK, this.reconstructor = new
|
|
3433
|
+
i || t.type === T.BINARY_ACK ? (t.type = i ? T.EVENT : T.ACK, this.reconstructor = new _o(t)) : super.emitReserved("decoded", t);
|
|
3426
3434
|
} else if (xs(e) || e.base64)
|
|
3427
3435
|
if (this.reconstructor)
|
|
3428
3436
|
t = this.reconstructor.takeBinaryData(e), t && (this.reconstructor = null, super.emitReserved("decoded", t));
|
|
@@ -3452,7 +3460,7 @@ class Ds extends U {
|
|
|
3452
3460
|
if (a != Number(a) || e.charAt(t) !== "-")
|
|
3453
3461
|
throw new Error("Illegal attachments");
|
|
3454
3462
|
const o = Number(a);
|
|
3455
|
-
if (!
|
|
3463
|
+
if (!So(o) || o < 1)
|
|
3456
3464
|
throw new Error("Illegal attachments");
|
|
3457
3465
|
if (o > this.opts.maxAttachments)
|
|
3458
3466
|
throw new Error("too many attachments");
|
|
@@ -3505,7 +3513,7 @@ class Ds extends U {
|
|
|
3505
3513
|
return typeof t == "string" || li(t);
|
|
3506
3514
|
case T.EVENT:
|
|
3507
3515
|
case T.BINARY_EVENT:
|
|
3508
|
-
return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" &&
|
|
3516
|
+
return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && bo.indexOf(t[0]) === -1);
|
|
3509
3517
|
case T.ACK:
|
|
3510
3518
|
case T.BINARY_ACK:
|
|
3511
3519
|
return Array.isArray(t);
|
|
@@ -3518,7 +3526,7 @@ class Ds extends U {
|
|
|
3518
3526
|
this.reconstructor && (this.reconstructor.finishedReconstruction(), this.reconstructor = null);
|
|
3519
3527
|
}
|
|
3520
3528
|
}
|
|
3521
|
-
class
|
|
3529
|
+
class _o {
|
|
3522
3530
|
constructor(e) {
|
|
3523
3531
|
this.packet = e, this.buffers = [], this.reconPack = e;
|
|
3524
3532
|
}
|
|
@@ -3532,7 +3540,7 @@ class wo {
|
|
|
3532
3540
|
*/
|
|
3533
3541
|
takeBinaryData(e) {
|
|
3534
3542
|
if (this.buffers.push(e), this.buffers.length === this.reconPack.attachments) {
|
|
3535
|
-
const t =
|
|
3543
|
+
const t = Io(this.reconPack, this.buffers);
|
|
3536
3544
|
return this.finishedReconstruction(), t;
|
|
3537
3545
|
}
|
|
3538
3546
|
return null;
|
|
@@ -3544,26 +3552,26 @@ class wo {
|
|
|
3544
3552
|
this.reconPack = null, this.buffers = [];
|
|
3545
3553
|
}
|
|
3546
3554
|
}
|
|
3547
|
-
const
|
|
3555
|
+
const So = Number.isInteger || function(s) {
|
|
3548
3556
|
return typeof s == "number" && isFinite(s) && Math.floor(s) === s;
|
|
3549
3557
|
};
|
|
3550
3558
|
function li(s) {
|
|
3551
3559
|
return Object.prototype.toString.call(s) === "[object Object]";
|
|
3552
3560
|
}
|
|
3553
|
-
const
|
|
3561
|
+
const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3554
3562
|
__proto__: null,
|
|
3555
3563
|
Decoder: Ds,
|
|
3556
|
-
Encoder:
|
|
3564
|
+
Encoder: wo,
|
|
3557
3565
|
get PacketType() {
|
|
3558
3566
|
return T;
|
|
3559
3567
|
}
|
|
3560
3568
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3561
|
-
function
|
|
3569
|
+
function se(s, e, t) {
|
|
3562
3570
|
return s.on(e, t), function() {
|
|
3563
3571
|
s.off(e, t);
|
|
3564
3572
|
};
|
|
3565
3573
|
}
|
|
3566
|
-
const
|
|
3574
|
+
const Ao = Object.freeze({
|
|
3567
3575
|
connect: 1,
|
|
3568
3576
|
connect_error: 1,
|
|
3569
3577
|
disconnect: 1,
|
|
@@ -3606,10 +3614,10 @@ class hn extends U {
|
|
|
3606
3614
|
return;
|
|
3607
3615
|
const e = this.io;
|
|
3608
3616
|
this.subs = [
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3617
|
+
se(e, "open", this.onopen.bind(this)),
|
|
3618
|
+
se(e, "packet", this.onpacket.bind(this)),
|
|
3619
|
+
se(e, "error", this.onerror.bind(this)),
|
|
3620
|
+
se(e, "close", this.onclose.bind(this))
|
|
3613
3621
|
];
|
|
3614
3622
|
}
|
|
3615
3623
|
/**
|
|
@@ -3688,7 +3696,7 @@ class hn extends U {
|
|
|
3688
3696
|
*/
|
|
3689
3697
|
emit(e, ...t) {
|
|
3690
3698
|
var i, n, r;
|
|
3691
|
-
if (
|
|
3699
|
+
if (Ao.hasOwnProperty(e))
|
|
3692
3700
|
throw new Error('"' + e.toString() + '" is a reserved event name');
|
|
3693
3701
|
if (t.unshift(e), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile)
|
|
3694
3702
|
return this._addToQueue(t), this;
|
|
@@ -4195,7 +4203,7 @@ class gs extends U {
|
|
|
4195
4203
|
max: this.reconnectionDelayMax(),
|
|
4196
4204
|
jitter: this.randomizationFactor()
|
|
4197
4205
|
}), this.timeout(t.timeout == null ? 2e4 : t.timeout), this._readyState = "closed", this.uri = e;
|
|
4198
|
-
const n = t.parser ||
|
|
4206
|
+
const n = t.parser || Ro;
|
|
4199
4207
|
this.encoder = new n.Encoder(), this.decoder = new n.Decoder(), this._autoConnect = t.autoConnect !== !1, this._autoConnect && this.open();
|
|
4200
4208
|
}
|
|
4201
4209
|
reconnection(e) {
|
|
@@ -4238,14 +4246,14 @@ class gs extends U {
|
|
|
4238
4246
|
open(e) {
|
|
4239
4247
|
if (~this._readyState.indexOf("open"))
|
|
4240
4248
|
return this;
|
|
4241
|
-
this.engine = new
|
|
4249
|
+
this.engine = new ho(this.uri, this.opts);
|
|
4242
4250
|
const t = this.engine, i = this;
|
|
4243
4251
|
this._readyState = "opening", this.skipReconnect = !1;
|
|
4244
|
-
const n =
|
|
4252
|
+
const n = se(t, "open", function() {
|
|
4245
4253
|
i.onopen(), e && e();
|
|
4246
4254
|
}), r = (o) => {
|
|
4247
4255
|
this.cleanup(), this._readyState = "closed", this.emitReserved("error", o), e ? e(o) : this.maybeReconnectOnOpen();
|
|
4248
|
-
}, a =
|
|
4256
|
+
}, a = se(t, "error", r);
|
|
4249
4257
|
if (this._timeout !== !1) {
|
|
4250
4258
|
const o = this._timeout, c = this.setTimeoutFn(() => {
|
|
4251
4259
|
n(), r(new Error("timeout")), t.close();
|
|
@@ -4274,12 +4282,12 @@ class gs extends U {
|
|
|
4274
4282
|
this.cleanup(), this._readyState = "open", this.emitReserved("open");
|
|
4275
4283
|
const e = this.engine;
|
|
4276
4284
|
this.subs.push(
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4285
|
+
se(e, "ping", this.onping.bind(this)),
|
|
4286
|
+
se(e, "data", this.ondata.bind(this)),
|
|
4287
|
+
se(e, "error", this.onerror.bind(this)),
|
|
4288
|
+
se(e, "close", this.onclose.bind(this)),
|
|
4281
4289
|
// @ts-ignore
|
|
4282
|
-
|
|
4290
|
+
se(this.decoder, "decoded", this.ondecoded.bind(this))
|
|
4283
4291
|
);
|
|
4284
4292
|
}
|
|
4285
4293
|
/**
|
|
@@ -4428,7 +4436,7 @@ class gs extends U {
|
|
|
4428
4436
|
const Me = {};
|
|
4429
4437
|
function lt(s, e) {
|
|
4430
4438
|
typeof s == "object" && (e = s, s = void 0), e = e || {};
|
|
4431
|
-
const t =
|
|
4439
|
+
const t = po(s, e.path || "/socket.io"), i = t.source, n = t.id, r = t.path, a = Me[n] && r in Me[n].nsps, o = e.forceNew || e["force new connection"] || e.multiplex === !1 || a;
|
|
4432
4440
|
let c;
|
|
4433
4441
|
return o ? c = new gs(i, e) : (Me[n] || (Me[n] = new gs(i, e)), c = Me[n]), t.query && !e.query && (e.query = t.queryKey), c.socket(t.path, e);
|
|
4434
4442
|
}
|
|
@@ -4438,7 +4446,7 @@ Object.assign(lt, {
|
|
|
4438
4446
|
io: lt,
|
|
4439
4447
|
connect: lt
|
|
4440
4448
|
});
|
|
4441
|
-
const
|
|
4449
|
+
const To = 9e4, Eo = /* @__PURE__ */ new Set([
|
|
4442
4450
|
"chat.user_message",
|
|
4443
4451
|
"chat.retry_last_user_message",
|
|
4444
4452
|
"run.stop",
|
|
@@ -4463,7 +4471,7 @@ function ui(s, e) {
|
|
|
4463
4471
|
const t = s.result && typeof s.result == "object" ? s.result : void 0, i = typeof t?.message == "string" && t.message.trim() ? t.message : `${e} (${s.code ?? "request_rejected"})`;
|
|
4464
4472
|
return new w(i, s.code ?? "request_rejected", !1, s.result, !0);
|
|
4465
4473
|
}
|
|
4466
|
-
class
|
|
4474
|
+
class ko {
|
|
4467
4475
|
constructor(e) {
|
|
4468
4476
|
this.options = e, this.socket = lt(`${e.backendUrl.replace(/\/$/, "")}/product-agent`, {
|
|
4469
4477
|
path: "/api/product-agent/socket.io",
|
|
@@ -4615,7 +4623,7 @@ class Eo {
|
|
|
4615
4623
|
readinessPhase: this.ready ? "bootstrap" : this.admitted ? "activation" : "namespace_ready"
|
|
4616
4624
|
})), e === this.generation && this.recover(i));
|
|
4617
4625
|
};
|
|
4618
|
-
this.admissionTimer = setTimeout(() => t("connect_timeout"), 6e4), this.readinessTimer = setTimeout(() => t("auth_timeout"),
|
|
4626
|
+
this.admissionTimer = setTimeout(() => t("connect_timeout"), 6e4), this.readinessTimer = setTimeout(() => t("auth_timeout"), To);
|
|
4619
4627
|
}
|
|
4620
4628
|
clearReadinessTimers() {
|
|
4621
4629
|
this.admissionTimer !== null && clearTimeout(this.admissionTimer), this.readinessTimer !== null && clearTimeout(this.readinessTimer), this.admissionTimer = null, this.readinessTimer = null;
|
|
@@ -4636,7 +4644,7 @@ class Eo {
|
|
|
4636
4644
|
this.bindings.get(e)?.owners.delete(t), this.ready && await this.synchronize();
|
|
4637
4645
|
}
|
|
4638
4646
|
async rpc(e, t) {
|
|
4639
|
-
if (!
|
|
4647
|
+
if (!Eo.has(e)) throw new w("Operation requires its HTTP adapter", "unsupported_rpc");
|
|
4640
4648
|
const i = this.generation, n = JSON.stringify(t);
|
|
4641
4649
|
return e === "run.stop" && this.uploadingResult ? (this.assertReady(i), this.request("runtime.rpc", { type: e, payload: JSON.parse(n) }, i)) : this.enqueue(async () => {
|
|
4642
4650
|
if (this.assertReady(i), e === "tool.result") {
|
|
@@ -4656,13 +4664,18 @@ class Eo {
|
|
|
4656
4664
|
this.ready = t, await this.synchronize(!0), e === this.generation && this.ready && (this.options.bootstrapRequired || this.markReady(), this.options.onReady(t));
|
|
4657
4665
|
} catch (n) {
|
|
4658
4666
|
if (e === this.generation) {
|
|
4659
|
-
const r = n instanceof w ? n : new w(
|
|
4660
|
-
this.activationFailed(new w(
|
|
4667
|
+
const r = J(n, "activation_error", "web_transport"), a = n instanceof w ? n : new w(
|
|
4661
4668
|
r.message,
|
|
4662
4669
|
r.code,
|
|
4663
|
-
|
|
4664
|
-
{ ...r.
|
|
4665
|
-
|
|
4670
|
+
!1,
|
|
4671
|
+
{ ...r.details, retryable: r.retryable }
|
|
4672
|
+
);
|
|
4673
|
+
this.activationFailed(new w(
|
|
4674
|
+
a.message,
|
|
4675
|
+
a.code,
|
|
4676
|
+
a.outcomeUnknown,
|
|
4677
|
+
{ ...a.detail && typeof a.detail == "object" ? a.detail : {}, stage: i },
|
|
4678
|
+
a.backendRefusal
|
|
4666
4679
|
));
|
|
4667
4680
|
}
|
|
4668
4681
|
} finally {
|
|
@@ -4773,7 +4786,7 @@ class Eo {
|
|
|
4773
4786
|
}
|
|
4774
4787
|
}
|
|
4775
4788
|
}
|
|
4776
|
-
function
|
|
4789
|
+
function qo() {
|
|
4777
4790
|
const s = crypto.getRandomValues(new Uint8Array(16));
|
|
4778
4791
|
s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128;
|
|
4779
4792
|
const e = Array.from(s, (t) => t.toString(16).padStart(2, "0")).join("");
|
|
@@ -4837,8 +4850,8 @@ class pn {
|
|
|
4837
4850
|
p.signal.aborted || (f.trigger = R, p.abort());
|
|
4838
4851
|
}, h = () => m("transport_disposed"), y = () => m(["owner_disposed", "authority_retired", "observation_released", "request_replaced"].includes(a?.reason) ? a.reason : "caller_cancelled");
|
|
4839
4852
|
this.requests.signal.addEventListener("abort", h, { once: !0 }), a?.addEventListener("abort", y, { once: !0 });
|
|
4840
|
-
const g = r === "conversations" && /^\/[^/]+\/snapshot$/.test(e) && n === "POST", b = /^\/conversations(?:\/[^/]+)?$/.test(e) && (n ?? (i === void 0 ? "GET" : "POST")) === "GET", v = setTimeout(() => m("deadline"), b ? 6e4 : g ? 3e4 : 15e3), _ =
|
|
4841
|
-
let A = null, C = !1, H = null, B = null,
|
|
4853
|
+
const g = r === "conversations" && /^\/[^/]+\/snapshot$/.test(e) && n === "POST", b = /^\/conversations(?:\/[^/]+)?$/.test(e) && (n ?? (i === void 0 ? "GET" : "POST")) === "GET", v = setTimeout(() => m("deadline"), b ? 6e4 : g ? 3e4 : 15e3), _ = qo(), S = Date.now();
|
|
4854
|
+
let A = null, C = !1, H = null, B = null, Q = null;
|
|
4842
4855
|
try {
|
|
4843
4856
|
const R = await Promise.resolve(fetch(l, {
|
|
4844
4857
|
method: n ?? (i === void 0 ? "GET" : "POST"),
|
|
@@ -4849,7 +4862,7 @@ class pn {
|
|
|
4849
4862
|
})).catch((M) => {
|
|
4850
4863
|
throw C = !0, M;
|
|
4851
4864
|
});
|
|
4852
|
-
if (A = Date.now(), H = R.status, B = hi(R.headers.get("x-request-id")),
|
|
4865
|
+
if (A = Date.now(), H = R.status, B = hi(R.headers.get("x-request-id")), Q = hi(R.headers.get("x-cloud-trace-context")), !R.ok) {
|
|
4853
4866
|
const M = R.status === 401 ? "unauthorized" : R.status === 426 ? "update_required" : String(R.status), E = (await R.json().catch(() => null))?.detail;
|
|
4854
4867
|
if (d && R.status === 403 && (r === "conversations" && /^\/[^/]+\/snapshot$/.test(e) || (!r || r === "embed") && /^\/conversations\/[^/]+$/.test(e)) && ["Conversation unavailable", "Integration mismatch", "Embedded origin mismatch"].includes(E))
|
|
4855
4868
|
throw new w("Conversation unavailable", "conversation_access_denied");
|
|
@@ -4885,11 +4898,11 @@ class pn {
|
|
|
4885
4898
|
sessionId: O(o?.sessionId),
|
|
4886
4899
|
release: this.auth.extension_version ? `extension-${this.auth.extension_version}` : `sdk-${Ji.version}`,
|
|
4887
4900
|
upstreamRequestId: B,
|
|
4888
|
-
upstreamTraceId:
|
|
4901
|
+
upstreamTraceId: Q
|
|
4889
4902
|
};
|
|
4890
|
-
|
|
4903
|
+
le(E) && Promise.resolve().then(() => this.options.onRequestFailure ? this.options.onRequestFailure(E) : console.warn("Product Agent HTTP request failed", E)).catch(() => {
|
|
4891
4904
|
});
|
|
4892
|
-
const I =
|
|
4905
|
+
const I = le(E) ? { httpRequest: E } : void 0;
|
|
4893
4906
|
if (M !== null) {
|
|
4894
4907
|
const k = M !== "deadline" && M !== "unexpected_abort";
|
|
4895
4908
|
throw new w(
|
|
@@ -4942,11 +4955,11 @@ function fn() {
|
|
|
4942
4955
|
function x(s) {
|
|
4943
4956
|
return JSON.stringify([s.kind, s.origin, s.limit]);
|
|
4944
4957
|
}
|
|
4945
|
-
function
|
|
4958
|
+
function Co(s) {
|
|
4946
4959
|
const e = s.map((t) => Ne(t) || t.requestId !== null && t.status !== "error" ? { ...t, status: t.status === "error" ? t.data?.length ? "refreshing" : "loading" : t.status, error: null } : t);
|
|
4947
4960
|
return e.find((t) => t.status === "error") ?? e.find((t) => t.status === "loading_more" || t.status === "loading" || t.status === "refreshing") ?? e.find((t) => t.query.kind === "recent") ?? e[0];
|
|
4948
4961
|
}
|
|
4949
|
-
function
|
|
4962
|
+
function Mo(s) {
|
|
4950
4963
|
return [...new Set(s.flatMap((e) => e.data ?? []))];
|
|
4951
4964
|
}
|
|
4952
4965
|
function Ne(s) {
|
|
@@ -4988,7 +5001,7 @@ function pi(s) {
|
|
|
4988
5001
|
c() || (i = s.runtime.engine.subscribe(c), n = s.runtime.onDispose(o));
|
|
4989
5002
|
});
|
|
4990
5003
|
}
|
|
4991
|
-
function
|
|
5004
|
+
function Oo(s) {
|
|
4992
5005
|
const e = s.http.auth.client_kind === "extension" ? "extension" : void 0, t = /* @__PURE__ */ new Map();
|
|
4993
5006
|
return {
|
|
4994
5007
|
"directory.query": async (i) => {
|
|
@@ -5028,7 +5041,7 @@ function Mo(s) {
|
|
|
5028
5041
|
}
|
|
5029
5042
|
};
|
|
5030
5043
|
}
|
|
5031
|
-
class
|
|
5044
|
+
class Po {
|
|
5032
5045
|
constructor(e) {
|
|
5033
5046
|
this.options = e, this.owner = `directory:${e.authority.authorityId}:${e.authority.generation}`, this.boundary = { authority: e.authority, currentAuthority: () => e.runtime.engine.getState().slices.directory }, this.unsubscribe = e.runtime.engine.subscribe(() => this.reconcile());
|
|
5034
5047
|
}
|
|
@@ -5201,7 +5214,7 @@ class Oo {
|
|
|
5201
5214
|
this.unsubscribe(), this.reconcile();
|
|
5202
5215
|
}
|
|
5203
5216
|
}
|
|
5204
|
-
function
|
|
5217
|
+
function xo(s) {
|
|
5205
5218
|
if (!s || typeof s != "object") return !1;
|
|
5206
5219
|
const e = s;
|
|
5207
5220
|
if (e.version !== 1 || typeof e.authorityId != "string" || typeof e.browserSessionId != "string" || !Array.isArray(e.bindings) || !e.mains || typeof e.mains != "object" || Array.isArray(e.mains)) return !1;
|
|
@@ -5218,7 +5231,7 @@ function Po(s) {
|
|
|
5218
5231
|
return !0;
|
|
5219
5232
|
}
|
|
5220
5233
|
const fi = /* @__PURE__ */ new WeakMap();
|
|
5221
|
-
class
|
|
5234
|
+
class Do {
|
|
5222
5235
|
constructor(e) {
|
|
5223
5236
|
this.options = e;
|
|
5224
5237
|
}
|
|
@@ -5288,7 +5301,7 @@ class xo {
|
|
|
5288
5301
|
const t = this.state();
|
|
5289
5302
|
if (!this.current() || Object.keys(t.clients).length || Object.keys(t.selections).length) return !1;
|
|
5290
5303
|
const i = await this.options.persistence.read();
|
|
5291
|
-
if (!
|
|
5304
|
+
if (!xo(i) || i.authorityId !== this.options.authority.authorityId || i.browserSessionId !== this.options.persistence.sessionId()) return !1;
|
|
5292
5305
|
const n = new Set(await this.options.persistence.liveClients());
|
|
5293
5306
|
if (!this.current() || this.state().clients !== t.clients) return !1;
|
|
5294
5307
|
const r = i.bindings.filter((c) => n.has(c.clientScopeId));
|
|
@@ -5310,7 +5323,7 @@ class xo {
|
|
|
5310
5323
|
return await Promise.all(a.map((c) => this.options.runtime.engine.dispatch(c))), !0;
|
|
5311
5324
|
}
|
|
5312
5325
|
}
|
|
5313
|
-
function
|
|
5326
|
+
function Uo(s, e, t, i = () => crypto.randomUUID()) {
|
|
5314
5327
|
const n = `pluno.productAgent.directory:${encodeURIComponent(t)}:${encodeURIComponent(e)}`, r = `${n}:tabSession`, a = s.getItem(r) ?? i();
|
|
5315
5328
|
return s.setItem(r, a), {
|
|
5316
5329
|
sessionId: () => a,
|
|
@@ -5322,9 +5335,9 @@ function Do(s, e, t, i = () => crypto.randomUUID()) {
|
|
|
5322
5335
|
};
|
|
5323
5336
|
}
|
|
5324
5337
|
const mi = /* @__PURE__ */ new Map(), gi = /* @__PURE__ */ new Map();
|
|
5325
|
-
function
|
|
5338
|
+
function No(s, e, t = () => crypto.randomUUID()) {
|
|
5326
5339
|
try {
|
|
5327
|
-
return
|
|
5340
|
+
return Uo(window.sessionStorage, s, e, t);
|
|
5328
5341
|
} catch (i) {
|
|
5329
5342
|
if (!(i instanceof DOMException) || i.name !== "SecurityError" && i.name !== "QuotaExceededError") throw i;
|
|
5330
5343
|
const n = `${e}:${s}`, r = gi.get(n) ?? t();
|
|
@@ -5344,7 +5357,7 @@ class D extends EventTarget {
|
|
|
5344
5357
|
...e,
|
|
5345
5358
|
executorConnection: () => this.connectionId,
|
|
5346
5359
|
restoreExecutor: (t) => this.restoreExecutor(t)
|
|
5347
|
-
}), this.transport = new
|
|
5360
|
+
}), this.transport = new ko({
|
|
5348
5361
|
backendUrl: e.backendUrl,
|
|
5349
5362
|
auth: e.auth,
|
|
5350
5363
|
displaySchema: e.displaySchema,
|
|
@@ -5560,19 +5573,24 @@ class D extends EventTarget {
|
|
|
5560
5573
|
e.push(t);
|
|
5561
5574
|
}
|
|
5562
5575
|
fail(e, t, i = !1) {
|
|
5563
|
-
const n = e instanceof w ? e : new w(
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
...
|
|
5576
|
+
const n = J(e, "request_failed", "web_transport"), r = e instanceof w ? e : new w(
|
|
5577
|
+
n.message,
|
|
5578
|
+
n.code,
|
|
5579
|
+
!1,
|
|
5580
|
+
{ ...n.details, retryable: n.retryable }
|
|
5581
|
+
);
|
|
5582
|
+
if (r.code === "disconnected" || r.outcomeUnknown) return;
|
|
5583
|
+
const a = r.detail && typeof r.detail == "object" ? r.detail : {};
|
|
5584
|
+
this.options.auth.client_kind === "extension" && r.code === "update_required" && a.version_status && this.receive(a.version_status), this.receive({
|
|
5585
|
+
...a,
|
|
5568
5586
|
type: "error",
|
|
5569
|
-
code:
|
|
5570
|
-
message:
|
|
5571
|
-
retryable:
|
|
5587
|
+
code: r.code,
|
|
5588
|
+
message: r.message,
|
|
5589
|
+
retryable: a.retryable === !0,
|
|
5572
5590
|
...t?.requestId ? { requestId: t.requestId } : {},
|
|
5573
5591
|
...t?.sessionId ? { sessionId: t.sessionId } : {},
|
|
5574
5592
|
...t?.clientMessageId ? { clientMessageId: t.clientMessageId } : {},
|
|
5575
|
-
outcomeUnknown:
|
|
5593
|
+
outcomeUnknown: r.outcomeUnknown,
|
|
5576
5594
|
...t && !i ? { requestType: t.type } : {}
|
|
5577
5595
|
});
|
|
5578
5596
|
}
|
|
@@ -5721,7 +5739,7 @@ function gn(s) {
|
|
|
5721
5739
|
const e = s;
|
|
5722
5740
|
return typeof e.observedAt == "string" && e.observedAt.length <= 40 && Number.isFinite(Date.parse(e.observedAt)) && be(e.sessionId) && be(e.responseItemId) && be(e.respondsToUserMessageId) && typeof e.panelVisible == "boolean" && typeof e.documentVisible == "boolean" && typeof e.loading == "boolean";
|
|
5723
5741
|
}
|
|
5724
|
-
function
|
|
5742
|
+
function Bo(s, e, t) {
|
|
5725
5743
|
if (!gn(t)) return;
|
|
5726
5744
|
const i = ys.get(s) ?? /* @__PURE__ */ new Map();
|
|
5727
5745
|
i.set(e, {
|
|
@@ -5734,11 +5752,11 @@ function No(s, e, t) {
|
|
|
5734
5752
|
loading: t.loading
|
|
5735
5753
|
}), i.size > 2 && i.delete(i.keys().next().value), ys.set(s, i);
|
|
5736
5754
|
}
|
|
5737
|
-
function
|
|
5755
|
+
function jo(s, e, t) {
|
|
5738
5756
|
const i = ys.get(s)?.get(e);
|
|
5739
5757
|
return i?.sessionId === t ? i : null;
|
|
5740
5758
|
}
|
|
5741
|
-
function
|
|
5759
|
+
function Lo(s, e, t, i, n, r, a, o, c = null, d = !1) {
|
|
5742
5760
|
const l = i ? o.find((p) => p.role === "user" && (p.id === i || p.clientMessageId === i)) : void 0, u = l ? [...o].reverse().find((p) => (p.role === "assistant" || p.dataType === "commentary_history" || p.dataType === "tool_summary") && p.respondsToUserMessageId === l.id) : void 0;
|
|
5743
5761
|
return {
|
|
5744
5762
|
capturedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -5748,14 +5766,14 @@ function jo(s, e, t, i, n, r, a, o, c = null, d = !1) {
|
|
|
5748
5766
|
clientUserMessageItemId: l && be(l.id) ? l.id : null,
|
|
5749
5767
|
clientResponseItemId: u && be(u.id) ? u.id : null,
|
|
5750
5768
|
clientDraftObserved: !!(l && d && c === l.id),
|
|
5751
|
-
renderer:
|
|
5769
|
+
renderer: jo(s, e, t)
|
|
5752
5770
|
};
|
|
5753
5771
|
}
|
|
5754
|
-
const
|
|
5772
|
+
const $o = 1e4, Fo = 3e3;
|
|
5755
5773
|
function yn() {
|
|
5756
|
-
return { authenticated: !1, generation: 0, sequence: 0, displaySequence: 0, backendCount: null, query:
|
|
5774
|
+
return { authenticated: !1, generation: 0, sequence: 0, displaySequence: 0, backendCount: null, query: $e("activeUsers") };
|
|
5757
5775
|
}
|
|
5758
|
-
function
|
|
5776
|
+
function zo(s, e) {
|
|
5759
5777
|
if (e.type === "activeUsers.authenticate") {
|
|
5760
5778
|
if (s.authenticated === e.authenticated) return { state: s, effects: [] };
|
|
5761
5779
|
const i = { ...yn(), authenticated: e.authenticated, generation: s.generation + 1 };
|
|
@@ -5777,7 +5795,7 @@ function Fo(s, e) {
|
|
|
5777
5795
|
return s.backendCount === null ? vi(t) : { state: t, effects: [] };
|
|
5778
5796
|
}
|
|
5779
5797
|
function yi(s) {
|
|
5780
|
-
const e = s.sequence + 1, t = `activeUsers:${s.generation}:${e}`, i = [{ id: `${t}:wait`, kind: "activeUsers.wait", input: { milliseconds:
|
|
5798
|
+
const e = s.sequence + 1, t = `activeUsers:${s.generation}:${e}`, i = [{ id: `${t}:wait`, kind: "activeUsers.wait", input: { milliseconds: $o } }];
|
|
5781
5799
|
return s.query.status === "loading" || s.query.status === "refreshing" ? { state: { ...s, sequence: e }, effects: i } : (i.push({ id: `${t}:load`, kind: "activeUsers.load", input: { generation: s.generation } }), { state: { ...s, sequence: e, query: { ...s.query, requestId: `${t}:load`, status: s.query.data === null ? "loading" : "refreshing", error: null } }, effects: i });
|
|
5782
5800
|
}
|
|
5783
5801
|
function vi(s) {
|
|
@@ -5785,11 +5803,11 @@ function vi(s) {
|
|
|
5785
5803
|
return { state: { ...s, displaySequence: e }, effects: [{
|
|
5786
5804
|
id: `activeUsers:${s.generation}:display:${e}`,
|
|
5787
5805
|
kind: "activeUsers.displayWait",
|
|
5788
|
-
input: { milliseconds:
|
|
5806
|
+
input: { milliseconds: Fo }
|
|
5789
5807
|
}] };
|
|
5790
5808
|
}
|
|
5791
|
-
const
|
|
5792
|
-
function
|
|
5809
|
+
const Ho = () => Object.freeze({ scopes: Object.freeze({}) });
|
|
5810
|
+
function Ko(s, e) {
|
|
5793
5811
|
const t = s.scopes[e.clientScopeId];
|
|
5794
5812
|
let i;
|
|
5795
5813
|
if (e.type === "model.scope_close") {
|
|
@@ -5902,7 +5920,7 @@ function bi(s, e, t, i) {
|
|
|
5902
5920
|
membershipRevision: s.membershipRevision + 1
|
|
5903
5921
|
};
|
|
5904
5922
|
}
|
|
5905
|
-
function
|
|
5923
|
+
function Wo(s, e) {
|
|
5906
5924
|
switch (e.type) {
|
|
5907
5925
|
case "directory.bind":
|
|
5908
5926
|
case "directory.provisional": {
|
|
@@ -5914,7 +5932,7 @@ function Ko(s, e) {
|
|
|
5914
5932
|
const n = s.clients[e.clientScopeId];
|
|
5915
5933
|
if (n === e.conversationScopeId) return s;
|
|
5916
5934
|
const r = s.selections[n];
|
|
5917
|
-
if (e.type === "directory.bind" && e.reason === "tool" && !
|
|
5935
|
+
if (e.type === "directory.bind" && e.reason === "tool" && !Vo(s, e.clientScopeId, e.sessionId))
|
|
5918
5936
|
throw new Error("Tool target is already bound to another conversation.");
|
|
5919
5937
|
return r && r.sessionId !== null && r.sessionId === t.sessionId ? {
|
|
5920
5938
|
...s,
|
|
@@ -5949,7 +5967,7 @@ function Ko(s, e) {
|
|
|
5949
5967
|
return s;
|
|
5950
5968
|
}
|
|
5951
5969
|
}
|
|
5952
|
-
function
|
|
5970
|
+
function Vo(s, e, t) {
|
|
5953
5971
|
const i = s.clients[e];
|
|
5954
5972
|
return i === void 0 || s.selections[i].sessionId === t;
|
|
5955
5973
|
}
|
|
@@ -6074,7 +6092,7 @@ function we(s, e) {
|
|
|
6074
6092
|
query: d,
|
|
6075
6093
|
cursor: e.cursor !== void 0 ? e.cursor : e.mode === "append" ? c?.cursor ?? null : null
|
|
6076
6094
|
} }, t = { ...s, queries: { ...s.queries, [o]: {
|
|
6077
|
-
...zi(c ??
|
|
6095
|
+
...zi(c ?? $e(o), { key: o, requestId: e.requestId, mode: e.mode }),
|
|
6078
6096
|
query: d,
|
|
6079
6097
|
requestSequence: s.requestSequence + 1,
|
|
6080
6098
|
mode: e.mode,
|
|
@@ -6097,11 +6115,11 @@ function we(s, e) {
|
|
|
6097
6115
|
}
|
|
6098
6116
|
t = { ...t, requestSequence: s.requestSequence + 1, requests: { ...t.requests, [n]: a } }, i.push({ id: n, ...a });
|
|
6099
6117
|
} else
|
|
6100
|
-
t =
|
|
6118
|
+
t = Wo(s, e);
|
|
6101
6119
|
}
|
|
6102
6120
|
return { state: Fe(t), effects: i };
|
|
6103
6121
|
}
|
|
6104
|
-
function
|
|
6122
|
+
function Go(s) {
|
|
6105
6123
|
const e = { ...s.entities };
|
|
6106
6124
|
for (const [a, o] of Object.entries(s.mutations)) {
|
|
6107
6125
|
if (!e[a]) continue;
|
|
@@ -6130,7 +6148,7 @@ function Vo(s) {
|
|
|
6130
6148
|
]))
|
|
6131
6149
|
});
|
|
6132
6150
|
}
|
|
6133
|
-
class
|
|
6151
|
+
class Jo {
|
|
6134
6152
|
constructor(e, t, i) {
|
|
6135
6153
|
this.handlers = e, this.accept = t, this.errorAdapter = i;
|
|
6136
6154
|
}
|
|
@@ -6169,7 +6187,7 @@ class Go {
|
|
|
6169
6187
|
);
|
|
6170
6188
|
}
|
|
6171
6189
|
}
|
|
6172
|
-
class
|
|
6190
|
+
class Qo {
|
|
6173
6191
|
state;
|
|
6174
6192
|
reducer;
|
|
6175
6193
|
selector;
|
|
@@ -6183,7 +6201,7 @@ class Jo {
|
|
|
6183
6201
|
scopedDiagnostics = /* @__PURE__ */ new Map();
|
|
6184
6202
|
diagnostics = { ownerId: `owner-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, revision: 0, dropped: 0, lastSelection: null, transitions: [] };
|
|
6185
6203
|
constructor(e) {
|
|
6186
|
-
this.state = e.initialState, this.reducer = e.reducer, this.selector = e.selector, this.effectRunner = new
|
|
6204
|
+
this.state = e.initialState, this.reducer = e.reducer, this.selector = e.selector, this.effectRunner = new Jo(
|
|
6187
6205
|
e.effectHandlers,
|
|
6188
6206
|
(t) => this.acceptEffectResult(t),
|
|
6189
6207
|
e.errorAdapter
|
|
@@ -6201,7 +6219,7 @@ class Jo {
|
|
|
6201
6219
|
return this.state;
|
|
6202
6220
|
}
|
|
6203
6221
|
recordDiagnosticTransition(e, t = !1) {
|
|
6204
|
-
let i =
|
|
6222
|
+
let i = ar(e, this.diagnostics.revision + 1, t);
|
|
6205
6223
|
if (i?.effectId) {
|
|
6206
6224
|
if (i.type === "effect.started")
|
|
6207
6225
|
this.diagnosticEffects.set(i.effectId, i), this.diagnosticEffects.size > 128 && this.diagnosticEffects.delete(this.diagnosticEffects.keys().next().value);
|
|
@@ -6317,7 +6335,7 @@ class Jo {
|
|
|
6317
6335
|
for (const t of this.listeners) t(e);
|
|
6318
6336
|
}
|
|
6319
6337
|
}
|
|
6320
|
-
const
|
|
6338
|
+
const Xo = Object.freeze({
|
|
6321
6339
|
modelSelection: "core",
|
|
6322
6340
|
directory: "core",
|
|
6323
6341
|
activeUsers: "core",
|
|
@@ -6327,24 +6345,24 @@ const Qo = Object.freeze({
|
|
|
6327
6345
|
browserExecution: "legacy"
|
|
6328
6346
|
});
|
|
6329
6347
|
function wi(s, e) {
|
|
6330
|
-
const t =
|
|
6348
|
+
const t = Xo[s], i = e[t];
|
|
6331
6349
|
if (!i) throw new Error(`No ${t} implementation for ${s}.`);
|
|
6332
6350
|
return i();
|
|
6333
6351
|
}
|
|
6334
|
-
function
|
|
6352
|
+
function Yo(s) {
|
|
6335
6353
|
return s.type === "effect.completed" || s.type === "effect.failed" ? s.effectKind === "directory.query" || s.effectKind === "directory.mutate" : s.type.startsWith("directory.");
|
|
6336
6354
|
}
|
|
6337
|
-
function
|
|
6355
|
+
function Zo(s) {
|
|
6338
6356
|
return s.type === "effect.completed" || s.type === "effect.failed" ? s.effectKind.startsWith("conversation.") : s.type.startsWith("conversation.");
|
|
6339
6357
|
}
|
|
6340
|
-
const
|
|
6358
|
+
const ea = {
|
|
6341
6359
|
"directory.query": async () => {
|
|
6342
6360
|
throw new Error("Directory ports are not installed before S5-C.");
|
|
6343
6361
|
},
|
|
6344
6362
|
"directory.mutate": async () => {
|
|
6345
6363
|
throw new Error("Directory ports are not installed before S5-C.");
|
|
6346
6364
|
}
|
|
6347
|
-
},
|
|
6365
|
+
}, ta = {
|
|
6348
6366
|
"conversation.prepare": async () => {
|
|
6349
6367
|
throw new Error("Conversation preparation adapter is not installed.");
|
|
6350
6368
|
},
|
|
@@ -6401,14 +6419,14 @@ function _i(s, e, t) {
|
|
|
6401
6419
|
}
|
|
6402
6420
|
return i;
|
|
6403
6421
|
}
|
|
6404
|
-
class
|
|
6422
|
+
class sa {
|
|
6405
6423
|
engine;
|
|
6406
6424
|
disposeListeners = /* @__PURE__ */ new Set();
|
|
6407
6425
|
conversationPorts;
|
|
6408
|
-
constructor(e =
|
|
6409
|
-
this.conversationPorts = { ...
|
|
6426
|
+
constructor(e = ea, t = {}, i) {
|
|
6427
|
+
this.conversationPorts = { ...ta, ...t }, this.engine = new Qo({
|
|
6410
6428
|
initialState: Object.freeze({ revision: 0, slices: Object.freeze({
|
|
6411
|
-
modelSelection:
|
|
6429
|
+
modelSelection: Ho(),
|
|
6412
6430
|
directory: fn(),
|
|
6413
6431
|
conversation: Hi(),
|
|
6414
6432
|
activeUsers: yn()
|
|
@@ -6416,18 +6434,18 @@ class ta {
|
|
|
6416
6434
|
reducer: (n, r) => {
|
|
6417
6435
|
const a = r.value;
|
|
6418
6436
|
if (a.type.startsWith("activeUsers.") || (a.type === "effect.completed" || a.type === "effect.failed") && a.effectKind.startsWith("activeUsers.")) {
|
|
6419
|
-
const c =
|
|
6437
|
+
const c = zo(n.slices.activeUsers, a);
|
|
6420
6438
|
return { state: c.state === n.slices.activeUsers ? n : Object.freeze({ revision: n.revision + 1, slices: Object.freeze({ ...n.slices, activeUsers: c.state }) }), effects: c.effects };
|
|
6421
6439
|
}
|
|
6422
|
-
if (
|
|
6440
|
+
if (Yo(a)) {
|
|
6423
6441
|
const c = we(n.slices.directory, a), d = ls(as(n.slices.conversation, c.state)), l = cs(n.slices.conversation, d.state, c.state, c.state.clients !== n.slices.directory.clients), u = l.state, p = _i(n.slices.conversation, u, c.state);
|
|
6424
6442
|
return { state: p === n.slices.directory && u === n.slices.conversation ? n : Object.freeze({
|
|
6425
6443
|
revision: n.revision + 1,
|
|
6426
6444
|
slices: Object.freeze({ ...n.slices, directory: p, conversation: u })
|
|
6427
6445
|
}), effects: [...l.effects, ...c.effects, ...d.effects] };
|
|
6428
6446
|
}
|
|
6429
|
-
if (
|
|
6430
|
-
const c =
|
|
6447
|
+
if (Zo(a)) {
|
|
6448
|
+
const c = Yn(n.slices.conversation, a, n.slices.directory, n.slices.modelSelection);
|
|
6431
6449
|
let d = n.slices.directory;
|
|
6432
6450
|
for (const [f, m] of Object.entries(c.state.operations)) {
|
|
6433
6451
|
if (!["runtime.warmup", "attachment.prepare"].includes(m.command.type) || !m.conversationScopeId || m.phase !== "done" || n.slices.conversation.operations[f]?.phase === "done") continue;
|
|
@@ -6460,13 +6478,13 @@ class ta {
|
|
|
6460
6478
|
slices: Object.freeze({ ...n.slices, directory: d, conversation: p.state })
|
|
6461
6479
|
}), effects: [...c.effects, ...p.effects, ...u.effects] };
|
|
6462
6480
|
}
|
|
6463
|
-
const o =
|
|
6481
|
+
const o = Ko(n.slices.modelSelection, a);
|
|
6464
6482
|
return { state: o === n.slices.modelSelection ? n : Object.freeze({
|
|
6465
6483
|
revision: n.revision + 1,
|
|
6466
6484
|
slices: Object.freeze({ ...n.slices, modelSelection: o })
|
|
6467
6485
|
}), effects: [] };
|
|
6468
6486
|
},
|
|
6469
|
-
selector: (n) => Object.freeze({ ...n.slices, directory:
|
|
6487
|
+
selector: (n) => Object.freeze({ ...n.slices, directory: Go(n.slices.directory), conversation: wr(n.slices.conversation, n.slices.directory) }),
|
|
6470
6488
|
effectHandlers: {
|
|
6471
6489
|
...e,
|
|
6472
6490
|
"conversation.prepare": (n) => this.conversationPorts["conversation.prepare"](n),
|
|
@@ -6488,8 +6506,8 @@ class ta {
|
|
|
6488
6506
|
})
|
|
6489
6507
|
},
|
|
6490
6508
|
errorAdapter: (n) => {
|
|
6491
|
-
const r =
|
|
6492
|
-
return { ...r, ...
|
|
6509
|
+
const r = J(n), a = n !== null && typeof n == "object" ? "details" in n ? n.details : "detail" in n ? n.detail : void 0 : void 0, o = a && typeof a == "object" && "httpRequest" in a ? a.httpRequest : void 0;
|
|
6510
|
+
return { ...r, ...le(o) ? { details: { ...r.details, httpRequest: o } } : {} };
|
|
6493
6511
|
}
|
|
6494
6512
|
});
|
|
6495
6513
|
}
|
|
@@ -6520,8 +6538,8 @@ class ta {
|
|
|
6520
6538
|
}
|
|
6521
6539
|
}
|
|
6522
6540
|
}
|
|
6523
|
-
const
|
|
6524
|
-
async function
|
|
6541
|
+
const ia = "pluno-product-agent-attachments", na = 1, Is = "files", ra = 1440 * 60 * 1e3;
|
|
6542
|
+
async function oa(s) {
|
|
6525
6543
|
const e = await bt();
|
|
6526
6544
|
await In(e, "readwrite", (t) => t.put(s));
|
|
6527
6545
|
}
|
|
@@ -6548,7 +6566,7 @@ async function vn(s, e) {
|
|
|
6548
6566
|
});
|
|
6549
6567
|
});
|
|
6550
6568
|
}
|
|
6551
|
-
async function
|
|
6569
|
+
async function aa(s = ra) {
|
|
6552
6570
|
const e = await bt(), t = Date.now() - s;
|
|
6553
6571
|
await Us(e, "readwrite", async (i) => {
|
|
6554
6572
|
const n = i.index("lastUsedAt");
|
|
@@ -6557,7 +6575,7 @@ async function oa(s = na) {
|
|
|
6557
6575
|
}
|
|
6558
6576
|
function bt() {
|
|
6559
6577
|
return typeof indexedDB > "u" ? Promise.reject(new Error("Product Agent attachment storage is unavailable")) : new Promise((s, e) => {
|
|
6560
|
-
const t = indexedDB.open(
|
|
6578
|
+
const t = indexedDB.open(ia, na);
|
|
6561
6579
|
t.onupgradeneeded = () => {
|
|
6562
6580
|
const n = t.result.createObjectStore(Is, { keyPath: "attachmentId" });
|
|
6563
6581
|
n.createIndex("lastUsedAt", "lastUsedAt", { unique: !1 }), n.createIndex("sessionId", "sessionId", { unique: !1 }), n.createIndex("origin", "origin", { unique: !1 });
|
|
@@ -6594,11 +6612,11 @@ function Ns(s) {
|
|
|
6594
6612
|
s.onsuccess = () => e(s.result), s.onerror = () => t(s.error ?? new Error("Product Agent attachment storage request failed"));
|
|
6595
6613
|
});
|
|
6596
6614
|
}
|
|
6597
|
-
function
|
|
6615
|
+
function ca(s) {
|
|
6598
6616
|
return s !== null && (typeof s == "object" || typeof s == "function");
|
|
6599
6617
|
}
|
|
6600
6618
|
function bn(s, e, t) {
|
|
6601
|
-
const i = Reflect.get(s, "pluno"), n =
|
|
6619
|
+
const i = Reflect.get(s, "pluno"), n = ca(i) ? i : {};
|
|
6602
6620
|
if (n !== i && !Reflect.set(s, "pluno", n))
|
|
6603
6621
|
return null;
|
|
6604
6622
|
const r = Object.getOwnPropertyDescriptor(n, e);
|
|
@@ -6613,12 +6631,12 @@ function bn(s, e, t) {
|
|
|
6613
6631
|
};
|
|
6614
6632
|
}
|
|
6615
6633
|
const Bs = "suggest_share_on_socials";
|
|
6616
|
-
function
|
|
6634
|
+
function da(s) {
|
|
6617
6635
|
for (let e = s.length - 1; e >= 0; e -= 1) {
|
|
6618
6636
|
const t = s[e];
|
|
6619
6637
|
if (t.role !== "tool" || t.toolName !== Bs || t.sharePromptAllowed !== void 0)
|
|
6620
6638
|
continue;
|
|
6621
|
-
if (
|
|
6639
|
+
if (ua(s, e, t.callId) !== !0)
|
|
6622
6640
|
return null;
|
|
6623
6641
|
const i = Ri(s, e, "assistant");
|
|
6624
6642
|
if (!i)
|
|
@@ -6632,7 +6650,7 @@ function ca(s) {
|
|
|
6632
6650
|
}
|
|
6633
6651
|
return null;
|
|
6634
6652
|
}
|
|
6635
|
-
function
|
|
6653
|
+
function la(s) {
|
|
6636
6654
|
let e = s;
|
|
6637
6655
|
if (typeof s == "string")
|
|
6638
6656
|
try {
|
|
@@ -6640,10 +6658,10 @@ function da(s) {
|
|
|
6640
6658
|
} catch {
|
|
6641
6659
|
return null;
|
|
6642
6660
|
}
|
|
6643
|
-
const t =
|
|
6661
|
+
const t = ha(e);
|
|
6644
6662
|
return t ? typeof t.showSharePrompt == "boolean" ? t.showSharePrompt : t.ok === !0 && typeof t.message == "string" && t.message.includes("social-sharing prompt") ? !0 : null : null;
|
|
6645
6663
|
}
|
|
6646
|
-
function
|
|
6664
|
+
function ua(s, e, t) {
|
|
6647
6665
|
if (!t)
|
|
6648
6666
|
return null;
|
|
6649
6667
|
for (let i = e + 1; i < s.length; i += 1) {
|
|
@@ -6661,17 +6679,17 @@ function Ri(s, e, t) {
|
|
|
6661
6679
|
}
|
|
6662
6680
|
return null;
|
|
6663
6681
|
}
|
|
6664
|
-
function
|
|
6682
|
+
function ha(s) {
|
|
6665
6683
|
return s && typeof s == "object" && !Array.isArray(s) ? s : null;
|
|
6666
6684
|
}
|
|
6667
|
-
const
|
|
6668
|
-
function
|
|
6669
|
-
return (s.type === "function_call" || s.type === "tool_call") && s.name ===
|
|
6685
|
+
const pa = "save_runtime_captured_skill";
|
|
6686
|
+
function fa(s) {
|
|
6687
|
+
return (s.type === "function_call" || s.type === "tool_call") && s.name === pa;
|
|
6670
6688
|
}
|
|
6671
|
-
const Bt = "pluno.productAgent.transportId",
|
|
6689
|
+
const Bt = "pluno.productAgent.transportId", ma = "pluno.productAgent.transportIdentity", jt = "pluno.productAgent.transportIdentity.event", ga = 50, ya = globalThis.setTimeout.bind(globalThis);
|
|
6672
6690
|
let Pe = null;
|
|
6673
6691
|
const ut = /* @__PURE__ */ new Set(), Lt = /* @__PURE__ */ new Map();
|
|
6674
|
-
async function
|
|
6692
|
+
async function va(s = wn()) {
|
|
6675
6693
|
const e = s.randomUUID(), t = s.storage.getItem(Bt);
|
|
6676
6694
|
let i = t ?? s.randomUUID(), n = !1, r = !1;
|
|
6677
6695
|
const a = s.channel.subscribe((c) => {
|
|
@@ -6709,8 +6727,8 @@ async function ya(s = wn()) {
|
|
|
6709
6727
|
}
|
|
6710
6728
|
};
|
|
6711
6729
|
}
|
|
6712
|
-
async function
|
|
6713
|
-
Pe || (Pe =
|
|
6730
|
+
async function Ia(s = !1) {
|
|
6731
|
+
Pe || (Pe = va({
|
|
6714
6732
|
...wn(),
|
|
6715
6733
|
skipStoredIdentityCollisionCheck: s
|
|
6716
6734
|
}), Pe.then((n) => {
|
|
@@ -6719,7 +6737,7 @@ async function va(s = !1) {
|
|
|
6719
6737
|
};
|
|
6720
6738
|
window.addEventListener("pagehide", r);
|
|
6721
6739
|
}));
|
|
6722
|
-
const e = await Pe, t =
|
|
6740
|
+
const e = await Pe, t = ba();
|
|
6723
6741
|
ut.add(t);
|
|
6724
6742
|
let i = !1;
|
|
6725
6743
|
return {
|
|
@@ -6730,7 +6748,7 @@ async function va(s = !1) {
|
|
|
6730
6748
|
}
|
|
6731
6749
|
};
|
|
6732
6750
|
}
|
|
6733
|
-
function
|
|
6751
|
+
function ba() {
|
|
6734
6752
|
let s = 0;
|
|
6735
6753
|
for (; ut.has(s); )
|
|
6736
6754
|
s += 1;
|
|
@@ -6738,13 +6756,13 @@ function Ia() {
|
|
|
6738
6756
|
}
|
|
6739
6757
|
function wn() {
|
|
6740
6758
|
return {
|
|
6741
|
-
storage:
|
|
6742
|
-
channel:
|
|
6759
|
+
storage: wa(),
|
|
6760
|
+
channel: _a(),
|
|
6743
6761
|
randomUUID: () => crypto.randomUUID(),
|
|
6744
|
-
settle: () => new Promise((s) =>
|
|
6762
|
+
settle: () => new Promise((s) => ya(s, ga))
|
|
6745
6763
|
};
|
|
6746
6764
|
}
|
|
6747
|
-
function
|
|
6765
|
+
function wa() {
|
|
6748
6766
|
return {
|
|
6749
6767
|
getItem: (s) => {
|
|
6750
6768
|
try {
|
|
@@ -6762,9 +6780,9 @@ function ba() {
|
|
|
6762
6780
|
}
|
|
6763
6781
|
};
|
|
6764
6782
|
}
|
|
6765
|
-
function
|
|
6783
|
+
function _a() {
|
|
6766
6784
|
if (typeof BroadcastChannel < "u") {
|
|
6767
|
-
const s = new BroadcastChannel(
|
|
6785
|
+
const s = new BroadcastChannel(ma);
|
|
6768
6786
|
return {
|
|
6769
6787
|
postMessage: (e) => s.postMessage(e),
|
|
6770
6788
|
subscribe: (e) => {
|
|
@@ -6774,9 +6792,9 @@ function wa() {
|
|
|
6774
6792
|
close: () => s.close()
|
|
6775
6793
|
};
|
|
6776
6794
|
}
|
|
6777
|
-
return
|
|
6795
|
+
return Sa();
|
|
6778
6796
|
}
|
|
6779
|
-
function
|
|
6797
|
+
function Sa() {
|
|
6780
6798
|
const s = /* @__PURE__ */ new Set(), e = (t) => {
|
|
6781
6799
|
if (t.key !== jt || !t.newValue)
|
|
6782
6800
|
return;
|
|
@@ -6798,7 +6816,7 @@ function _a() {
|
|
|
6798
6816
|
};
|
|
6799
6817
|
}
|
|
6800
6818
|
const _n = "schedule_follow_up";
|
|
6801
|
-
function
|
|
6819
|
+
function Ra(s) {
|
|
6802
6820
|
let e = s;
|
|
6803
6821
|
if (typeof e == "string")
|
|
6804
6822
|
try {
|
|
@@ -6814,7 +6832,7 @@ function Sa(s) {
|
|
|
6814
6832
|
dueAt: t.dueAt
|
|
6815
6833
|
};
|
|
6816
6834
|
}
|
|
6817
|
-
const
|
|
6835
|
+
const Aa = [
|
|
6818
6836
|
"anthropic/claude-opus-5",
|
|
6819
6837
|
"anthropic/claude-sonnet-5",
|
|
6820
6838
|
"deepseek/deepseek-chat-v3.1",
|
|
@@ -6825,16 +6843,16 @@ const Ra = [
|
|
|
6825
6843
|
"gpt-5.6-luna",
|
|
6826
6844
|
"gpt-5.6-terra",
|
|
6827
6845
|
"gpt-5.6-sol"
|
|
6828
|
-
], bs = (s) => typeof s == "string" &&
|
|
6829
|
-
function
|
|
6846
|
+
], bs = (s) => typeof s == "string" && Aa.includes(s), $t = /* @__PURE__ */ new Map();
|
|
6847
|
+
function Ta(s, e, t) {
|
|
6830
6848
|
const i = `pluno.productAgent.modelClientScope:${e}`, n = s.getItem(i);
|
|
6831
6849
|
if (n) return n;
|
|
6832
6850
|
const r = t();
|
|
6833
6851
|
return s.setItem(i, r), r;
|
|
6834
6852
|
}
|
|
6835
|
-
function
|
|
6853
|
+
function Ea(s, e) {
|
|
6836
6854
|
try {
|
|
6837
|
-
const t =
|
|
6855
|
+
const t = Ta(window.sessionStorage, s, e);
|
|
6838
6856
|
return $t.set(s, t), t;
|
|
6839
6857
|
} catch (t) {
|
|
6840
6858
|
if (!(t instanceof DOMException) || t.name !== "SecurityError" && t.name !== "QuotaExceededError") throw t;
|
|
@@ -6842,16 +6860,16 @@ function Ta(s, e) {
|
|
|
6842
6860
|
return $t.set(s, i), i;
|
|
6843
6861
|
}
|
|
6844
6862
|
}
|
|
6845
|
-
function
|
|
6863
|
+
function ka(s) {
|
|
6846
6864
|
if (!s || typeof s != "object") return;
|
|
6847
6865
|
const e = s, t = e.requestedModel ?? e.requested_model, i = e.effectiveModel ?? e.effective_model, n = e.provider;
|
|
6848
6866
|
if (!(!bs(t) || !bs(i) || n !== "openrouter" && n !== "azure" && n !== "openai"))
|
|
6849
6867
|
return Object.freeze({ requestedModel: t, effectiveModel: i, provider: n });
|
|
6850
6868
|
}
|
|
6851
|
-
const js = (s, e) =>
|
|
6869
|
+
const js = (s, e) => Gn(
|
|
6852
6870
|
s.engine.getState().slices.modelSelection,
|
|
6853
6871
|
e
|
|
6854
|
-
),
|
|
6872
|
+
), qa = (s, e) => Rs(js(s, e));
|
|
6855
6873
|
function Ft(s, e, t, i) {
|
|
6856
6874
|
return s.engine.dispatch({
|
|
6857
6875
|
type: "model.submission_capture",
|
|
@@ -6860,8 +6878,8 @@ function Ft(s, e, t, i) {
|
|
|
6860
6878
|
requestedModel: i
|
|
6861
6879
|
}), js(s, e).submissions[t].requestedModel;
|
|
6862
6880
|
}
|
|
6863
|
-
function
|
|
6864
|
-
const a =
|
|
6881
|
+
function Ca(s, e, t, i, n, r) {
|
|
6882
|
+
const a = ka(n);
|
|
6865
6883
|
a && s.engine.accept({
|
|
6866
6884
|
type: "model.routing_accepted",
|
|
6867
6885
|
clientScopeId: e,
|
|
@@ -6876,7 +6894,7 @@ function zt(s, e, t, i) {
|
|
|
6876
6894
|
for (const n of i) {
|
|
6877
6895
|
if (!n || typeof n != "object") continue;
|
|
6878
6896
|
const r = n, a = r.clientMessageId ?? r.client_message_id, o = r.updatedAt ?? r.updated_at;
|
|
6879
|
-
typeof a == "string" &&
|
|
6897
|
+
typeof a == "string" && Ca(
|
|
6880
6898
|
s,
|
|
6881
6899
|
e,
|
|
6882
6900
|
t,
|
|
@@ -6886,7 +6904,7 @@ function zt(s, e, t, i) {
|
|
|
6886
6904
|
);
|
|
6887
6905
|
}
|
|
6888
6906
|
}
|
|
6889
|
-
class
|
|
6907
|
+
class Ma {
|
|
6890
6908
|
constructor(e, t = null) {
|
|
6891
6909
|
this.storage = e, t && (this.decisions = new Map(
|
|
6892
6910
|
t.filter(ws).map((i) => [this.getDecisionKey(i), i])
|
|
@@ -6911,7 +6929,7 @@ class Ca {
|
|
|
6911
6929
|
if (n && n.version >= t.version) continue;
|
|
6912
6930
|
if (n && n.payload.kind !== t.payload.kind) throw new Error("Interaction kind changed.");
|
|
6913
6931
|
const r = n?.payload.kind === "personal_channel" && n.lifecycle === "completed" ? "completed" : t.lifecycle, a = n?.payload.kind === "sharing" && t.payload.kind === "sharing" ? { ...t.payload, variant: n.payload.variant } : t.payload;
|
|
6914
|
-
this.sources.set(i,
|
|
6932
|
+
this.sources.set(i, re(Z({ ...t, lifecycle: r, payload: a }))), t.payload.kind === "integration_auth" && this.invalidateAuth(t.payload.request_id);
|
|
6915
6933
|
}
|
|
6916
6934
|
}
|
|
6917
6935
|
/** @internal */
|
|
@@ -6937,7 +6955,7 @@ class Ca {
|
|
|
6937
6955
|
userPrompt: o?.type === "user_message" ? o.data.content : "",
|
|
6938
6956
|
assistantAnswer: ""
|
|
6939
6957
|
},
|
|
6940
|
-
terminal: !a.wait_for_terminal ||
|
|
6958
|
+
terminal: !a.wait_for_terminal || _r(i, r.user_message_id)
|
|
6941
6959
|
};
|
|
6942
6960
|
} else a.kind === "integration_auth" ? t.integrations.push({
|
|
6943
6961
|
revision: r.version,
|
|
@@ -7039,13 +7057,13 @@ class Ca {
|
|
|
7039
7057
|
return `${Ht(e.scope)}:category:${e.category}`;
|
|
7040
7058
|
}
|
|
7041
7059
|
}
|
|
7042
|
-
function
|
|
7060
|
+
function Wd(s, e) {
|
|
7043
7061
|
return {
|
|
7044
|
-
load: async () =>
|
|
7062
|
+
load: async () => Oa(s, e),
|
|
7045
7063
|
save: async (t) => s.setItem(e, JSON.stringify(t))
|
|
7046
7064
|
};
|
|
7047
7065
|
}
|
|
7048
|
-
function
|
|
7066
|
+
function Oa(s, e) {
|
|
7049
7067
|
const t = s.getItem(e);
|
|
7050
7068
|
if (!t) return [];
|
|
7051
7069
|
const i = JSON.parse(t);
|
|
@@ -7062,7 +7080,7 @@ function ws(s) {
|
|
|
7062
7080
|
const e = s;
|
|
7063
7081
|
return typeof e.promptKey == "string" && typeof e.category == "string" && typeof e.decidedAt == "string" && (e.nextEligibleAt === null || typeof e.nextEligibleAt == "string") && Sn(e.action) && !!(e.scope && typeof e.scope == "object" && typeof e.scope.level == "string" && typeof e.scope.key == "string");
|
|
7064
7082
|
}
|
|
7065
|
-
class
|
|
7083
|
+
class Vd {
|
|
7066
7084
|
constructor(e, t, i = 20) {
|
|
7067
7085
|
this.loadPage = t, this.limit = i, this.recentQuery = new ri(
|
|
7068
7086
|
`${e}:recent`,
|
|
@@ -7072,7 +7090,7 @@ class Wd {
|
|
|
7072
7090
|
nextCursor: r.nextCursor
|
|
7073
7091
|
}))
|
|
7074
7092
|
),
|
|
7075
|
-
|
|
7093
|
+
Er
|
|
7076
7094
|
), this.pinnedQuery = new ri(
|
|
7077
7095
|
`${e}:pinned`,
|
|
7078
7096
|
async () => it({
|
|
@@ -7105,7 +7123,7 @@ class Wd {
|
|
|
7105
7123
|
}) : null;
|
|
7106
7124
|
return {
|
|
7107
7125
|
key: e.key.slice(0, -7),
|
|
7108
|
-
status:
|
|
7126
|
+
status: Pa(e, t),
|
|
7109
7127
|
data: o,
|
|
7110
7128
|
error: e.error ?? t.error,
|
|
7111
7129
|
requestId: Math.max(e.requestId, t.requestId),
|
|
@@ -7214,21 +7232,21 @@ class Wd {
|
|
|
7214
7232
|
function Ye(s) {
|
|
7215
7233
|
return s ? s.ids.map((e) => s.entitiesById[e]).filter((e) => !!e) : [];
|
|
7216
7234
|
}
|
|
7217
|
-
function
|
|
7235
|
+
function Pa(s, e) {
|
|
7218
7236
|
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";
|
|
7219
7237
|
}
|
|
7220
|
-
const
|
|
7238
|
+
const xa = {
|
|
7221
7239
|
working: "⏳",
|
|
7222
7240
|
completed: "✅",
|
|
7223
7241
|
failed: "❗",
|
|
7224
7242
|
stopped: "⏹️"
|
|
7225
|
-
},
|
|
7226
|
-
function
|
|
7243
|
+
}, Da = /^(?:⌛|⏳|✅|❗|⏹️) Pluno(?:: )?/;
|
|
7244
|
+
function Ua(s, e) {
|
|
7227
7245
|
if (!e) return ft(s);
|
|
7228
|
-
const t = ft(s), i = `${
|
|
7246
|
+
const t = ft(s), i = `${xa[e]} Pluno`;
|
|
7229
7247
|
return t ? `${i}: ${t}` : i;
|
|
7230
7248
|
}
|
|
7231
|
-
class
|
|
7249
|
+
class Gd {
|
|
7232
7250
|
constructor(e) {
|
|
7233
7251
|
this.titleDocument = e;
|
|
7234
7252
|
}
|
|
@@ -7262,11 +7280,11 @@ class Vd {
|
|
|
7262
7280
|
applyTitle() {
|
|
7263
7281
|
if (!this.status)
|
|
7264
7282
|
return;
|
|
7265
|
-
const e =
|
|
7283
|
+
const e = Ua(this.baseTitle, this.status);
|
|
7266
7284
|
this.lastAppliedTitle = e, this.titleDocument.getTitle() !== e && this.titleDocument.setTitle(e);
|
|
7267
7285
|
}
|
|
7268
7286
|
}
|
|
7269
|
-
function
|
|
7287
|
+
function Jd(s) {
|
|
7270
7288
|
return {
|
|
7271
7289
|
getTitle: () => s.title,
|
|
7272
7290
|
setTitle: (e) => {
|
|
@@ -7283,9 +7301,9 @@ function Gd(s) {
|
|
|
7283
7301
|
};
|
|
7284
7302
|
}
|
|
7285
7303
|
function ft(s) {
|
|
7286
|
-
return s.replace(
|
|
7304
|
+
return s.replace(Da, "");
|
|
7287
7305
|
}
|
|
7288
|
-
const
|
|
7306
|
+
const Na = {
|
|
7289
7307
|
"stop-without-rendered-message": "Stop is enabled while no message is rendered or the welcome screen is still visible.",
|
|
7290
7308
|
"in-progress-stop-unavailable": "An in-progress response has no visible enabled interrupt control.",
|
|
7291
7309
|
"stop-did-not-interrupt": "The stopped response remained in progress after an interrupt click.",
|
|
@@ -7301,8 +7319,8 @@ const Ua = {
|
|
|
7301
7319
|
"thinking-groups-without-user-message": "Multiple thinking groups appeared without a user message between them.",
|
|
7302
7320
|
"thinking-without-progress": "Thinking remained visible without progress for five minutes."
|
|
7303
7321
|
};
|
|
7304
|
-
function
|
|
7305
|
-
return typeof s == "string" && s.startsWith("ui_invariant:") && Object.prototype.hasOwnProperty.call(
|
|
7322
|
+
function Ba(s) {
|
|
7323
|
+
return typeof s == "string" && s.startsWith("ui_invariant:") && Object.prototype.hasOwnProperty.call(Na, s.slice(13));
|
|
7306
7324
|
}
|
|
7307
7325
|
function Ai(s) {
|
|
7308
7326
|
return {
|
|
@@ -7315,7 +7333,7 @@ function Ai(s) {
|
|
|
7315
7333
|
...s.fileUrl === void 0 ? {} : { fileUrl: s.fileUrl }
|
|
7316
7334
|
};
|
|
7317
7335
|
}
|
|
7318
|
-
function
|
|
7336
|
+
function Qd(s) {
|
|
7319
7337
|
if (!s || typeof s != "object" || !("type" in s)) return !1;
|
|
7320
7338
|
const e = s;
|
|
7321
7339
|
switch (e.type) {
|
|
@@ -7331,11 +7349,11 @@ function Jd(s) {
|
|
|
7331
7349
|
case "runtime.warmup":
|
|
7332
7350
|
return e.reason === "panel_open" || e.reason === "extension_install" || e.reason === "composer_input";
|
|
7333
7351
|
case "runtime.report_operation_timing":
|
|
7334
|
-
return
|
|
7352
|
+
return He(e.timing);
|
|
7335
7353
|
case "runtime.report_displayed_error":
|
|
7336
|
-
return (e.errorDiagnostic === void 0 ||
|
|
7354
|
+
return (e.errorDiagnostic === void 0 || lr(e.errorDiagnostic)) && (e.httpRequest === void 0 || le(e.httpRequest)) && (e.historyRefreshFailure === void 0 || Es(e.historyRefreshFailure)) && (e.renderedError === void 0 || qs(e.renderedError)) && (e.reason === "conversation_error" || e.reason === "attachment_error" || e.reason === "history_error" || e.reason === "action_error") && typeof e.errorFingerprint == "string" && /^fnv1a-[0-9a-f]{8}$/.test(e.errorFingerprint) && (e.displayedMessage === void 0 || typeof e.displayedMessage == "string" && e.displayedMessage.length <= 500);
|
|
7337
7355
|
case "runtime.report_invalid_state_transition":
|
|
7338
|
-
return (e.uiInvariant === void 0 || Cs(e.uiInvariant)) && (e.reason === "submitted_turn_returned_to_welcome_without_new_chat" || e.reason === "new_messages_button_without_user_scroll" ||
|
|
7356
|
+
return (e.uiInvariant === void 0 || Cs(e.uiInvariant)) && (e.reason === "submitted_turn_returned_to_welcome_without_new_chat" || e.reason === "new_messages_button_without_user_scroll" || Ba(e.reason)) && (e.clientMessageId === void 0 || typeof e.clientMessageId == "string");
|
|
7339
7357
|
case "runtime.widget_lifecycle":
|
|
7340
7358
|
return (e.action === "opened" || e.action === "closed" || e.action === "minimized") && typeof e.trigger == "string";
|
|
7341
7359
|
case "session.load":
|
|
@@ -7363,7 +7381,7 @@ function Jd(s) {
|
|
|
7363
7381
|
return !1;
|
|
7364
7382
|
}
|
|
7365
7383
|
}
|
|
7366
|
-
class
|
|
7384
|
+
class Xd {
|
|
7367
7385
|
constructor(e, t, i) {
|
|
7368
7386
|
this.adapter = t, this.state = Kt(e), this.model = i;
|
|
7369
7387
|
}
|
|
@@ -7417,7 +7435,7 @@ class Qd {
|
|
|
7417
7435
|
for (const o of this.state.messages) {
|
|
7418
7436
|
if (o.role !== "user" || !o.attachments?.length) continue;
|
|
7419
7437
|
const c = a.messages.find((d) => d.role === "user" && d.id === o.id);
|
|
7420
|
-
a.sessionId !== e.sessionId && !(a.sessionId === null && c) || (o.attachments =
|
|
7438
|
+
a.sessionId !== e.sessionId && !(a.sessionId === null && c) || (o.attachments = ja(c?.attachments, o.attachments));
|
|
7421
7439
|
}
|
|
7422
7440
|
if (t !== void 0 && (this.model = t), i && JSON.stringify(i) !== JSON.stringify(this.sessionHistoryState)) {
|
|
7423
7441
|
this.sessionHistoryState = Ti(i);
|
|
@@ -7452,7 +7470,7 @@ class Qd {
|
|
|
7452
7470
|
this.dispatch({ type: "runtime.widget_lifecycle", action: e, trigger: t });
|
|
7453
7471
|
}
|
|
7454
7472
|
reportOperationTiming(e) {
|
|
7455
|
-
!this.destroyed &&
|
|
7473
|
+
!this.destroyed && He(e) && this.adapter.dispatch({ type: "runtime.report_operation_timing", timing: e }).catch(() => {
|
|
7456
7474
|
});
|
|
7457
7475
|
}
|
|
7458
7476
|
reportResponseVisibility(e) {
|
|
@@ -7480,7 +7498,7 @@ class Qd {
|
|
|
7480
7498
|
errorFingerprint: t,
|
|
7481
7499
|
...n ? { renderedError: n } : {},
|
|
7482
7500
|
...r ? { historyRefreshFailure: r } : {},
|
|
7483
|
-
...
|
|
7501
|
+
...le(a) ? { httpRequest: a } : {},
|
|
7484
7502
|
...i ? { displayedMessage: _e(i) } : {}
|
|
7485
7503
|
}).catch(() => {
|
|
7486
7504
|
});
|
|
@@ -7563,14 +7581,14 @@ class Qd {
|
|
|
7563
7581
|
return r === this.stagedProactiveSuggestionClientMessageId && (this.stagedProactiveSuggestionClientMessageId = null), r;
|
|
7564
7582
|
} catch (d) {
|
|
7565
7583
|
if (i !== this.submissionGeneration) return null;
|
|
7566
|
-
if (
|
|
7584
|
+
if (Mr(d))
|
|
7567
7585
|
for (const u of t.attachments ?? [])
|
|
7568
7586
|
u.id && this.attachmentFiles.delete(u.id);
|
|
7569
7587
|
const l = this.submissionPreviews.get(r);
|
|
7570
|
-
throw l && (l.pending = !1, l.error =
|
|
7588
|
+
throw l && (l.pending = !1, l.error = J(d).message, l.retry = !c && J(d).code === "command_not_received" ? () => this.sendMessageNow(e, t, i) : void 0, this.emit("state", this.getState())), c && await this.adapter.dispatch({
|
|
7571
7589
|
type: "conversation.fail_staged",
|
|
7572
7590
|
clientMessageId: r,
|
|
7573
|
-
message:
|
|
7591
|
+
message: J(d).message
|
|
7574
7592
|
}), d;
|
|
7575
7593
|
}
|
|
7576
7594
|
}
|
|
@@ -7591,7 +7609,7 @@ class Qd {
|
|
|
7591
7609
|
return i && n ? (i.pending = !0, i.error = void 0, i.retry = void 0, this.pendingTransfers.set(t, (i.message.attachments ?? []).flatMap((a) => a.id ? [a.id] : [])), this.emit("state", this.getState()), await n()) : await this.dispatch({ type: "run.retry", clientMessageId: t }), !0;
|
|
7592
7610
|
} catch (a) {
|
|
7593
7611
|
if (!i) throw a;
|
|
7594
|
-
return r === this.submissionGeneration && this.submissionPreviews.get(t) === i && (i.error =
|
|
7612
|
+
return r === this.submissionGeneration && this.submissionPreviews.get(t) === i && (i.error = J(a).message, this.emit("state", this.getState())), !1;
|
|
7595
7613
|
} finally {
|
|
7596
7614
|
n && this.pendingTransfers.delete(t), i && r === this.submissionGeneration && this.submissionPreviews.get(t) === i && (i.pending = !1, this.emit("state", this.getState()));
|
|
7597
7615
|
}
|
|
@@ -7629,7 +7647,7 @@ class Qd {
|
|
|
7629
7647
|
}, (d) => {
|
|
7630
7648
|
if (!(o !== this.submissionGeneration || i.every((l) => !this.stopPreviews.has(l)))) {
|
|
7631
7649
|
for (const l of i) this.stopPreviews.delete(l);
|
|
7632
|
-
this.stopError =
|
|
7650
|
+
this.stopError = J(d).message;
|
|
7633
7651
|
}
|
|
7634
7652
|
}).finally(() => {
|
|
7635
7653
|
this.destroyed || o !== this.submissionGeneration || (this.pendingStop === r && (this.pendingStop = null), this.emit("state", this.getState()));
|
|
@@ -7748,7 +7766,7 @@ class Qd {
|
|
|
7748
7766
|
for (const n of i ?? []) n(t);
|
|
7749
7767
|
}
|
|
7750
7768
|
}
|
|
7751
|
-
function
|
|
7769
|
+
function ja(s, e) {
|
|
7752
7770
|
if (!e || !s) return e;
|
|
7753
7771
|
const t = /* @__PURE__ */ new Map();
|
|
7754
7772
|
for (const i of s) {
|
|
@@ -7788,13 +7806,13 @@ function Ti(s) {
|
|
|
7788
7806
|
return {
|
|
7789
7807
|
...s,
|
|
7790
7808
|
data: s.data ? it({
|
|
7791
|
-
entities:
|
|
7809
|
+
entities: kr(s.data).map((e) => ({ ...e })),
|
|
7792
7810
|
nextCursor: s.data.nextCursor
|
|
7793
7811
|
}) : null
|
|
7794
7812
|
};
|
|
7795
7813
|
}
|
|
7796
|
-
const
|
|
7797
|
-
class
|
|
7814
|
+
const La = globalThis.fetch.bind(globalThis), Ei = '.pluno-pa-widget-host[data-pluno-product-agent-ui="widget"]', $a = '.pluno-pa-widget[data-pluno-product-agent-ui-root="widget"]', Fa = ".pluno-pa-widget__panel", za = ".pluno-pa-widget__timeline", Ha = "__plunoExtensionWidgetOwner";
|
|
7815
|
+
class oe extends Error {
|
|
7798
7816
|
constructor(e, t, i, n) {
|
|
7799
7817
|
super(e), this.retryable = t, this.status = i, this.retryAfterMs = n, this.name = "ProductAgentTokenProviderError";
|
|
7800
7818
|
}
|
|
@@ -7802,10 +7820,10 @@ class re extends Error {
|
|
|
7802
7820
|
status;
|
|
7803
7821
|
retryAfterMs;
|
|
7804
7822
|
}
|
|
7805
|
-
function
|
|
7823
|
+
function Ka(s) {
|
|
7806
7824
|
return s === "dismiss" || s === "later" || s === "snooze" || s === "never" || s === "dont_show_again";
|
|
7807
7825
|
}
|
|
7808
|
-
let
|
|
7826
|
+
let Wa = 0;
|
|
7809
7827
|
function Wt(s) {
|
|
7810
7828
|
const e = {};
|
|
7811
7829
|
for (const c of [
|
|
@@ -7885,26 +7903,26 @@ function Se(s, e, t) {
|
|
|
7885
7903
|
source: "web_sdk",
|
|
7886
7904
|
category: s,
|
|
7887
7905
|
name: e,
|
|
7888
|
-
sequence: ++
|
|
7906
|
+
sequence: ++Wa,
|
|
7889
7907
|
wallTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7890
7908
|
monotonicMs: performance.now(),
|
|
7891
7909
|
data: t
|
|
7892
7910
|
};
|
|
7893
7911
|
window.dispatchEvent(new CustomEvent("product-agent:trace", { detail: n }));
|
|
7894
7912
|
}
|
|
7895
|
-
const
|
|
7913
|
+
const Va = "https://app.pluno.ai", Ga = 2e4, Ja = 1e4, Qa = 6e4, Xa = 6e4, Ya = 1e4, Za = 1e4, ec = 1e3, _s = 3e4, ki = 0.2, Vt = 6e4, Gt = 3, qi = "Still connecting to Pluno. Retrying automatically.", tc = 1e3, sc = 100, Ci = 3, ic = [300, 1e3], Rn = 50 * 1024 * 1024, nc = /* @__PURE__ */ new Set([
|
|
7896
7914
|
".jpeg:image/jpeg",
|
|
7897
7915
|
".jpg:image/jpeg",
|
|
7898
7916
|
".pdf:application/pdf",
|
|
7899
7917
|
".png:image/png",
|
|
7900
7918
|
".webp:image/webp"
|
|
7901
|
-
]),
|
|
7919
|
+
]), Yd = ".pdf,.png,.jpg,.jpeg,.webp", Ls = 64e3, Jt = 4e3, $s = 30, rc = 2e3, oc = 1e3, An = "Image is too large for model vision input.", ac = "pluno.productAgent.state.", Ss = "pluno.productAgent.pendingEvents.", wt = "pluno.productAgent.activeToolCalls.", cc = 100, ht = /* @__PURE__ */ new Set();
|
|
7902
7920
|
let Ze = null;
|
|
7903
|
-
function
|
|
7904
|
-
const t = Math.min(_s,
|
|
7921
|
+
function dc(s, e = Math.random) {
|
|
7922
|
+
const t = Math.min(_s, ec * 2 ** s), i = 1 - ki + e() * ki * 2;
|
|
7905
7923
|
return Math.min(_s, Math.round(t * i));
|
|
7906
7924
|
}
|
|
7907
|
-
function
|
|
7925
|
+
function lc(s) {
|
|
7908
7926
|
const e = s.split(".")[1];
|
|
7909
7927
|
if (!e)
|
|
7910
7928
|
return null;
|
|
@@ -7916,7 +7934,7 @@ function dc(s) {
|
|
|
7916
7934
|
}
|
|
7917
7935
|
}
|
|
7918
7936
|
function Qt(s) {
|
|
7919
|
-
if (s instanceof
|
|
7937
|
+
if (s instanceof oe)
|
|
7920
7938
|
return s.retryable;
|
|
7921
7939
|
if (s && typeof s == "object") {
|
|
7922
7940
|
const e = s instanceof w ? s.code : "", t = /^[45][0-9]{2}$/.test(e) ? Number(e) : s.status;
|
|
@@ -7926,16 +7944,14 @@ function Qt(s) {
|
|
|
7926
7944
|
return !0;
|
|
7927
7945
|
}
|
|
7928
7946
|
function xe(s) {
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
if (s && typeof s == "object") {
|
|
7932
|
-
const
|
|
7933
|
-
if (typeof
|
|
7934
|
-
return new Error(
|
|
7935
|
-
if (typeof e.error == "string")
|
|
7936
|
-
return new Error(e.error);
|
|
7947
|
+
const e = J(s, "connection_failed", "web_transport");
|
|
7948
|
+
if (s instanceof Error && s.message === e.message) return s;
|
|
7949
|
+
if (s && typeof s == "object" && !("message" in s)) {
|
|
7950
|
+
const t = s, i = t.data && typeof t.data == "object" ? t.data.detail : null, n = typeof i == "string" ? i : t.error;
|
|
7951
|
+
if (typeof n == "string")
|
|
7952
|
+
return Object.assign(new Error(J(n).message), { code: e.code });
|
|
7937
7953
|
}
|
|
7938
|
-
return new Error(
|
|
7954
|
+
return Object.assign(new Error(e.message), e);
|
|
7939
7955
|
}
|
|
7940
7956
|
function Xt(s) {
|
|
7941
7957
|
return s === "main_web_chat" ? ["pinned", "recent"] : ["all"];
|
|
@@ -7966,7 +7982,7 @@ class _t {
|
|
|
7966
7982
|
}
|
|
7967
7983
|
});
|
|
7968
7984
|
const i = this;
|
|
7969
|
-
this.clientRuntime = new
|
|
7985
|
+
this.clientRuntime = new sa(Oo({
|
|
7970
7986
|
http: this.directoryHttp,
|
|
7971
7987
|
get authority() {
|
|
7972
7988
|
return i.directoryAuthority;
|
|
@@ -7978,7 +7994,7 @@ class _t {
|
|
|
7978
7994
|
}), void 0, pr(async () => {
|
|
7979
7995
|
if (!this.token || !this.state.user || this.state.status === "closed") throw new Error("Product Agent is not authenticated");
|
|
7980
7996
|
return this.options.activeUsersLoader ? (await this.options.activeUsersLoader()).count : fr(this.options.backendUrl);
|
|
7981
|
-
})), this.modelClientScopeId =
|
|
7997
|
+
})), this.modelClientScopeId = Ea(e.clientId, () => crypto.randomUUID()), this.directoryConversationScopeId = `conversation:${this.modelClientScopeId}`, this.createDirectoryAdapters(), this.clientRuntime.engine.dispatch({
|
|
7982
7998
|
type: "model.scope_open",
|
|
7983
7999
|
clientScopeId: this.modelClientScopeId,
|
|
7984
8000
|
sessionId: null,
|
|
@@ -7986,10 +8002,10 @@ class _t {
|
|
|
7986
8002
|
defaultModel: e.productVariant === "personal" ? void 0 : "gpt-5.6-terra",
|
|
7987
8003
|
selectedModel: e.model
|
|
7988
8004
|
}), this.state = {
|
|
7989
|
-
starterPrompts:
|
|
7990
|
-
}, this.account = e.initialAccount ? { ...e.initialAccount } : null, this.queuedClientEvents =
|
|
7991
|
-
|
|
7992
|
-
|
|
8005
|
+
starterPrompts: Lc(e.initialStarterPrompts)
|
|
8006
|
+
}, this.account = e.initialAccount ? { ...e.initialAccount } : null, this.queuedClientEvents = hd(
|
|
8007
|
+
cd(e.clientId),
|
|
8008
|
+
dd(e.clientId)
|
|
7993
8009
|
);
|
|
7994
8010
|
}
|
|
7995
8011
|
options;
|
|
@@ -8046,7 +8062,7 @@ class _t {
|
|
|
8046
8062
|
accountRefresh = null;
|
|
8047
8063
|
runtimeInteractions = [];
|
|
8048
8064
|
interactionListeners = /* @__PURE__ */ new Set();
|
|
8049
|
-
interactionManager = new
|
|
8065
|
+
interactionManager = new Ma(
|
|
8050
8066
|
{ load: async () => [], save: async () => {
|
|
8051
8067
|
} },
|
|
8052
8068
|
[]
|
|
@@ -8121,17 +8137,17 @@ class _t {
|
|
|
8121
8137
|
t in e && Object.assign(this.platformState, { [t]: e[t] });
|
|
8122
8138
|
}
|
|
8123
8139
|
static async init(e) {
|
|
8124
|
-
const t = e, i = await
|
|
8140
|
+
const t = e, i = await Ia(
|
|
8125
8141
|
t.skipStoredTransportIdentityCollisionCheck === !0
|
|
8126
8142
|
), n = new _t({
|
|
8127
8143
|
...e,
|
|
8128
|
-
backendUrl:
|
|
8129
|
-
clientId: e.clientId ??
|
|
8144
|
+
backendUrl: Ec(e.backendUrl ?? Va),
|
|
8145
|
+
clientId: e.clientId ?? Kc(),
|
|
8130
8146
|
productVariant: e.productVariant ?? "customer_embedded",
|
|
8131
8147
|
entrySurface: mr(e.entrySurface)
|
|
8132
8148
|
}, i);
|
|
8133
8149
|
try {
|
|
8134
|
-
await n.initializeDirectory(), await n.initializeConversation(),
|
|
8150
|
+
await n.initializeDirectory(), await n.initializeConversation(), aa().catch((r) => {
|
|
8135
8151
|
$("web-sdk.attachments", "Failed to delete stale Product Agent attachments", {
|
|
8136
8152
|
message: r instanceof Error ? r.message : String(r)
|
|
8137
8153
|
});
|
|
@@ -8142,15 +8158,15 @@ class _t {
|
|
|
8142
8158
|
return n;
|
|
8143
8159
|
}
|
|
8144
8160
|
createDirectoryAdapters() {
|
|
8145
|
-
this.directoryScope = new
|
|
8161
|
+
this.directoryScope = new Do({
|
|
8146
8162
|
runtime: this.clientRuntime,
|
|
8147
8163
|
authority: this.directoryAuthority,
|
|
8148
8164
|
random: Math.random,
|
|
8149
|
-
persistence:
|
|
8165
|
+
persistence: No(
|
|
8150
8166
|
this.modelClientScopeId,
|
|
8151
8167
|
this.directoryAuthority.authorityId
|
|
8152
8168
|
)
|
|
8153
|
-
}), this.directoryObservation = new
|
|
8169
|
+
}), this.directoryObservation = new Po({
|
|
8154
8170
|
runtime: this.clientRuntime,
|
|
8155
8171
|
authority: this.directoryAuthority,
|
|
8156
8172
|
http: this.directoryHttp,
|
|
@@ -8173,18 +8189,18 @@ class _t {
|
|
|
8173
8189
|
operationTimingReporter = () => {
|
|
8174
8190
|
};
|
|
8175
8191
|
reportOperationTiming(e) {
|
|
8176
|
-
|
|
8192
|
+
He(e) && this.operationTimingReporter(e);
|
|
8177
8193
|
}
|
|
8178
8194
|
async initializeConversation() {
|
|
8179
8195
|
const e = ++this.conversationAdapterGeneration;
|
|
8180
8196
|
this.conversationObservation?.dispose(), this.conversationUnsubscribe?.();
|
|
8181
8197
|
const t = this.directoryAuthority, i = () => e === this.conversationAdapterGeneration;
|
|
8182
|
-
this.operationTimingReporter =
|
|
8198
|
+
this.operationTimingReporter = ir((h) => {
|
|
8183
8199
|
i() && !this.clientRuntime.isDisposed && this.reportHealthSignal("operation_timing", { timings: h.map((y) => ({ ...y, entrySurface: this.options.entrySurface })) });
|
|
8184
8200
|
});
|
|
8185
8201
|
const n = `pa.conversation.delivery:${this.modelClientScopeId}:${t.authorityId}`, r = `${n}:cancellations`;
|
|
8186
8202
|
this.authenticatedUserId && this.options.restorePersistedState === !1 && sessionStorage.removeItem(r);
|
|
8187
|
-
const a = this.authenticatedUserId ? Mt(r) : null, o =
|
|
8203
|
+
const a = this.authenticatedUserId ? Mt(r) : null, o = nr({
|
|
8188
8204
|
authorityId: t.authorityId,
|
|
8189
8205
|
isCurrent: i,
|
|
8190
8206
|
read: async () => a ? JSON.parse(a) : null,
|
|
@@ -8223,7 +8239,7 @@ class _t {
|
|
|
8223
8239
|
document.addEventListener("visibilitychange", A);
|
|
8224
8240
|
}));
|
|
8225
8241
|
const v = h.context.page;
|
|
8226
|
-
if (
|
|
8242
|
+
if (te().url !== v.url) throw Object.assign(new Error("The page changed before preparation completed. Send this message again."), { code: "context_preparation_interrupted", retryable: !1 });
|
|
8227
8243
|
b = { pageContent: await g.measure("page_capture", async () => Fs()), sessionTabs: [] };
|
|
8228
8244
|
}
|
|
8229
8245
|
if (await g.measure("authentication", () => this.waitForAuthentication()), !i() || t !== this.directoryAuthority || this.clientRuntime.isDisposed) throw new Error("Submission authority was retired.");
|
|
@@ -8325,13 +8341,17 @@ class _t {
|
|
|
8325
8341
|
for (const g of h)
|
|
8326
8342
|
(g.dataType === "run_status" || g.dataType === "run_error") && this.clearFirstResponseTimer(g.respondsToUserMessageId ?? null);
|
|
8327
8343
|
for (const g of h)
|
|
8328
|
-
g.content.trim() && (g.role === "assistant" || g.dataType === "commentary_history" || g.dataType === "tool_summary")
|
|
8344
|
+
if (g.content.trim() && (g.role === "assistant" || g.dataType === "commentary_history" || g.dataType === "tool_summary")) {
|
|
8345
|
+
const b = y ? this.clientRuntime.engine.getState().slices.conversation.sessions[y] : void 0;
|
|
8346
|
+
for (const v of g.respondsToUserMessageId ? br(b, g.respondsToUserMessageId) : [])
|
|
8347
|
+
this.clearFirstResponseTimer(v, !0, y);
|
|
8348
|
+
}
|
|
8329
8349
|
}
|
|
8330
8350
|
};
|
|
8331
8351
|
let u = new Map(this.getState().messages.map((h) => [h.id, h])), p = this.clientRuntime.engine.getState().slices.conversation, f = this.clientRuntime.engine.getState().slices.directory.selections, m = this.clientRuntime.engine.getState().slices.directory.clients[this.modelClientScopeId];
|
|
8332
8352
|
this.conversationUnsubscribe = this.clientRuntime.engine.subscribe(() => {
|
|
8333
8353
|
const h = this.clientRuntime.engine.getState().slices, y = p;
|
|
8334
|
-
p = h.conversation,
|
|
8354
|
+
p = h.conversation, rr(y, h.conversation, this.operationTimingReporter, "sdk");
|
|
8335
8355
|
const g = m !== h.directory.clients[this.modelClientScopeId];
|
|
8336
8356
|
m = h.directory.clients[this.modelClientScopeId], f !== h.directory.selections && (f = h.directory.selections, this.directoryScope.persist());
|
|
8337
8357
|
for (const v of Object.values(h.conversation.submissions)) {
|
|
@@ -8351,8 +8371,8 @@ class _t {
|
|
|
8351
8371
|
if (!v.startsWith(`background:${this.modelClientScopeId}:`)) continue;
|
|
8352
8372
|
const S = Ie(h.conversation, h.directory, _), A = S.sessionId ? h.conversation.sessions[S.sessionId] : void 0;
|
|
8353
8373
|
if (this.firstResponseTimersByClientMessageId.size && (l(Ot(S, A?.queries.current, this.options.backendUrl).messages, S.sessionId), ["failed", "stopped"].includes(S.activity.phase)))
|
|
8354
|
-
for (const H of
|
|
8355
|
-
const C = S.activity.phase === "completed" &&
|
|
8374
|
+
for (const H of ie(A?.execution)) this.clearFirstResponseTimer(H);
|
|
8375
|
+
const C = S.activity.phase === "completed" && ie(A?.execution).some((H) => this.firstResponseTimersByClientMessageId.has(H));
|
|
8356
8376
|
(g && S.sessionId === this.getState().sessionId || !C && ["completed", "failed", "stopped"].includes(S.activity.phase)) && this.directoryScope.detach(v);
|
|
8357
8377
|
}
|
|
8358
8378
|
const b = this.getState();
|
|
@@ -8370,7 +8390,7 @@ class _t {
|
|
|
8370
8390
|
type: "directory.authority_replace",
|
|
8371
8391
|
expectedGeneration: 0
|
|
8372
8392
|
}), !(this.options.restorePersistedState !== !1 && await this.directoryScope.restore(this.options.expectedPersistedSessionId))) {
|
|
8373
|
-
const t = this.options.restorePersistedState === !1 ? null :
|
|
8393
|
+
const t = this.options.restorePersistedState === !1 ? null : ad(this.options.clientId, this.options.expectedPersistedSessionId)?.sessionId;
|
|
8374
8394
|
t ? await this.directoryScope.bind(
|
|
8375
8395
|
this.modelClientScopeId,
|
|
8376
8396
|
this.directoryConversationScopeId,
|
|
@@ -8456,7 +8476,7 @@ class _t {
|
|
|
8456
8476
|
if (!this.options.tokenProvider)
|
|
8457
8477
|
return this.token;
|
|
8458
8478
|
if (this.tokenRequest) return await this.tokenRequest;
|
|
8459
|
-
const i = Date.now(), n = this.token !== null && this.tokenExpiresAtMs !== null && this.tokenExpiresAtMs -
|
|
8479
|
+
const i = Date.now(), n = this.token !== null && this.tokenExpiresAtMs !== null && this.tokenExpiresAtMs - Xa > i;
|
|
8460
8480
|
if (!t.forceRefresh && (n || t.preferCached && this.token !== null))
|
|
8461
8481
|
return this.token;
|
|
8462
8482
|
t.forceRefresh && this.invalidateProviderToken();
|
|
@@ -8466,8 +8486,8 @@ class _t {
|
|
|
8466
8486
|
let o = null;
|
|
8467
8487
|
const c = new Promise((d, l) => {
|
|
8468
8488
|
o = window.setTimeout(() => {
|
|
8469
|
-
r.abort(), l(new
|
|
8470
|
-
},
|
|
8489
|
+
r.abort(), l(new oe("Pluno token provider timed out", !0));
|
|
8490
|
+
}, Qa);
|
|
8471
8491
|
});
|
|
8472
8492
|
try {
|
|
8473
8493
|
const d = await Promise.race([
|
|
@@ -8475,10 +8495,10 @@ class _t {
|
|
|
8475
8495
|
c
|
|
8476
8496
|
]);
|
|
8477
8497
|
if (r.signal.aborted || this.tokenAbortController !== r)
|
|
8478
|
-
throw new
|
|
8498
|
+
throw new oe("Pluno token request was cancelled", !0);
|
|
8479
8499
|
if (typeof d != "string" || !d.trim())
|
|
8480
|
-
throw new
|
|
8481
|
-
return this.token = d, this.tokenExpiresAtMs =
|
|
8500
|
+
throw new oe("Chat setup did not return a session. Contact your app administrator, then try again.", !1);
|
|
8501
|
+
return this.token = d, this.tokenExpiresAtMs = lc(d), d;
|
|
8482
8502
|
} finally {
|
|
8483
8503
|
o !== null && window.clearTimeout(o);
|
|
8484
8504
|
}
|
|
@@ -8512,7 +8532,7 @@ class _t {
|
|
|
8512
8532
|
if (this.lastRecoveryStage = "token_provider", this.token = await this.acquireToken("connect", { forceRefresh: e }), this.token && (this.directoryHttp.auth.token = this.token), i !== this.connectionAttemptId || this.state.status === "closed")
|
|
8513
8533
|
return;
|
|
8514
8534
|
if (this.lastRecoveryStage = "socket_admission", !this.token && !this.options.webSocketFactory)
|
|
8515
|
-
throw new
|
|
8535
|
+
throw new oe("Pluno requires a token or tokenProvider", !1);
|
|
8516
8536
|
if (!this.options.webSocketFactory && this.rejectedTransportToken !== null && this.rejectedTransportToken === this.token) {
|
|
8517
8537
|
this.clearEmbeddedRecoveryBudget(), this.setState({ status: "error", lastError: n });
|
|
8518
8538
|
return;
|
|
@@ -8521,7 +8541,7 @@ class _t {
|
|
|
8521
8541
|
await this.replaceDefaultTransportCredentials(this.socket);
|
|
8522
8542
|
return;
|
|
8523
8543
|
}
|
|
8524
|
-
const r =
|
|
8544
|
+
const r = qc(this.options.backendUrl), a = this.options.webSocketFactory?.(r) ?? new D({
|
|
8525
8545
|
displaySchema: "canonical",
|
|
8526
8546
|
backendUrl: this.options.backendUrl,
|
|
8527
8547
|
entrySurface: this.options.entrySurface,
|
|
@@ -8542,7 +8562,7 @@ class _t {
|
|
|
8542
8562
|
});
|
|
8543
8563
|
this.socket = a, this.options.webSocketFactory && (this.socketConnectTimer = window.setTimeout(() => {
|
|
8544
8564
|
this.socket === a && a.readyState === WebSocket.CONNECTING && ($("web-sdk.agent", "Pluno socket opening timed out; reconnecting"), this.reportTransportDiagnostic("connect_timeout"), this.replaceTimedOutSocket(a));
|
|
8545
|
-
},
|
|
8565
|
+
}, Ya)), a.addEventListener("reconnecting", (o) => {
|
|
8546
8566
|
this.socket === a && this.state.status !== "closed" && (this.refreshingDefaultCredentials || this.reportTransportDiagnostic("socket_closed", { disconnectReason: o.detail.reason }), this.setReconnectingState());
|
|
8547
8567
|
}), a.addEventListener("open", () => {
|
|
8548
8568
|
this.socket !== a || (this.clearSocketConnectTimer(), this.directoryObservation.reconnect().catch(() => {
|
|
@@ -8557,12 +8577,12 @@ class _t {
|
|
|
8557
8577
|
pageUrl: location.href
|
|
8558
8578
|
}) : !0)) || this.options.webSocketFactory && (this.socketAuthTimer = window.setTimeout(() => {
|
|
8559
8579
|
this.socket === a && ($("web-sdk.agent", "Pluno socket authentication timed out; reconnecting"), this.reportTransportDiagnostic("auth_timeout"), this.replaceTimedOutSocket(a));
|
|
8560
|
-
},
|
|
8580
|
+
}, Za));
|
|
8561
8581
|
}), a.addEventListener("message", (o) => {
|
|
8562
8582
|
if (this.socket !== a)
|
|
8563
8583
|
return;
|
|
8564
8584
|
const c = Cn(o.data);
|
|
8565
|
-
if (a instanceof D && c.type === "tool.call" && !
|
|
8585
|
+
if (a instanceof D && c.type === "tool.call" && !jc(c)) {
|
|
8566
8586
|
this.setState({ status: "error", lastError: "Invalid tool-call envelope", lastErrorCode: "invalid_tool_call" });
|
|
8567
8587
|
return;
|
|
8568
8588
|
}
|
|
@@ -8608,7 +8628,7 @@ class _t {
|
|
|
8608
8628
|
lastError: qi,
|
|
8609
8629
|
lastErrorCode: "connection_failed"
|
|
8610
8630
|
}), this.emit("error", a), this.scheduleReconnect(
|
|
8611
|
-
r instanceof
|
|
8631
|
+
r instanceof oe ? r.retryAfterMs : void 0
|
|
8612
8632
|
);
|
|
8613
8633
|
return;
|
|
8614
8634
|
}
|
|
@@ -8629,7 +8649,7 @@ class _t {
|
|
|
8629
8649
|
}
|
|
8630
8650
|
destroy() {
|
|
8631
8651
|
if (!this.clientRuntime.isDisposed) {
|
|
8632
|
-
this.disconnect(), this.clearAllFirstResponseTimers(), this.locationChangeCleanup?.(), this.locationChangeCleanup = null, this.cleanupSessionBrowserApis(), this.pageLifecycleCleanup?.(), this.pageLifecycleCleanup = null, this.activeBrowserToolCalls.clear(),
|
|
8652
|
+
this.disconnect(), this.clearAllFirstResponseTimers(), this.locationChangeCleanup?.(), this.locationChangeCleanup = null, this.cleanupSessionBrowserApis(), this.pageLifecycleCleanup?.(), this.pageLifecycleCleanup = null, this.activeBrowserToolCalls.clear(), pd(this.options.clientId), this.transportIdentity.release(), this.networkCaptureCleanup?.(), this.networkCaptureCleanup = null, this.networkBatchTimer !== null && (window.clearTimeout(this.networkBatchTimer), this.networkBatchTimer = null), this.queuedNetworkEvents = [];
|
|
8633
8653
|
for (const e of Object.values(this.listeners))
|
|
8634
8654
|
e?.clear();
|
|
8635
8655
|
this.accountListeners.clear(), this.interactionListeners.clear(), this.conversationAdapterGeneration++, this.conversationObservation?.dispose(), this.conversationUnsubscribe?.(), this.directoryObservation.dispose(), this.directoryHttp.dispose(), this.clientRuntime.dispose();
|
|
@@ -8664,7 +8684,7 @@ class _t {
|
|
|
8664
8684
|
reason: e,
|
|
8665
8685
|
...n ? { warmupId: n } : {},
|
|
8666
8686
|
sessionId: t,
|
|
8667
|
-
page:
|
|
8687
|
+
page: te(),
|
|
8668
8688
|
entrySurface: this.options.entrySurface,
|
|
8669
8689
|
model: this.getModel() ?? null
|
|
8670
8690
|
}
|
|
@@ -8681,7 +8701,7 @@ class _t {
|
|
|
8681
8701
|
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
8682
8702
|
entrySurface: this.options.entrySurface,
|
|
8683
8703
|
...this.state.sessionId ? { sessionId: this.state.sessionId } : {},
|
|
8684
|
-
pageOrigin:
|
|
8704
|
+
pageOrigin: te().origin
|
|
8685
8705
|
}
|
|
8686
8706
|
};
|
|
8687
8707
|
this.authenticatedSocket === this.socket && this.sendNow(i) || (this.pendingWidgetLifecycleEvents.push(i), this.pendingWidgetLifecycleEvents.length > 20 && this.pendingWidgetLifecycleEvents.splice(0, this.pendingWidgetLifecycleEvents.length - 20));
|
|
@@ -8705,7 +8725,7 @@ class _t {
|
|
|
8705
8725
|
Ft(this.clientRuntime, this.modelClientScopeId, r, o ?? null);
|
|
8706
8726
|
const l = this.clientRuntime.engine.getState().slices.conversation.submissions[r];
|
|
8707
8727
|
if (l && (l.content !== i || JSON.stringify(l.attachments.map((y) => y.sourceId)) !== JSON.stringify(n.map((y) => y.id ?? y.storageKey ?? y.sandboxPath)))) throw new Error("User-message identity cannot be reused with different input.");
|
|
8708
|
-
const u =
|
|
8728
|
+
const u = te(), p = !l && !t.initiatedBy && this.options.capturePageContent !== !1 && this.lastUserMessagePageUrl !== u.url, m = this.clientRuntime.engine.getState().slices.directory.clients[this.modelClientScopeId];
|
|
8709
8729
|
if (!m) throw new Error("Conversation selection is not initialized.");
|
|
8710
8730
|
l || await this.clientRuntime.engine.dispatch({
|
|
8711
8731
|
...this.directoryAuthority,
|
|
@@ -8738,7 +8758,7 @@ class _t {
|
|
|
8738
8758
|
...t.proactiveSuggestionQuestion ? { proactiveSuggestionQuestion: t.proactiveSuggestionQuestion } : {},
|
|
8739
8759
|
metadata: { ...Mi(this.options.metadata), ...t.automationOnboarding ? { automationOnboarding: !0 } : {} }
|
|
8740
8760
|
})),
|
|
8741
|
-
invocation:
|
|
8761
|
+
invocation: kc(t.invocation ?? t.initiatedBy),
|
|
8742
8762
|
entrySurface: this.options.entrySurface,
|
|
8743
8763
|
submittedAt: t.submittedAt ?? Date.now()
|
|
8744
8764
|
});
|
|
@@ -8760,7 +8780,7 @@ class _t {
|
|
|
8760
8780
|
});
|
|
8761
8781
|
}
|
|
8762
8782
|
reportResponseVisibility(e) {
|
|
8763
|
-
|
|
8783
|
+
Bo(this, this.options.entrySurface, e);
|
|
8764
8784
|
}
|
|
8765
8785
|
reportInvalidStateTransition(e, t, i) {
|
|
8766
8786
|
i !== void 0 && !Cs(i) || this.reportHealthSignal("invalid_state_transition", {
|
|
@@ -8780,13 +8800,13 @@ class _t {
|
|
|
8780
8800
|
errorFingerprint: t,
|
|
8781
8801
|
...n ? { renderedError: n } : {},
|
|
8782
8802
|
...r ? { historyRefreshFailure: r } : {},
|
|
8783
|
-
...
|
|
8803
|
+
...le(a) ? { httpRequest: a } : {},
|
|
8784
8804
|
...i ? { displayedMessage: _e(i) } : {}
|
|
8785
8805
|
});
|
|
8786
8806
|
}
|
|
8787
8807
|
getModel() {
|
|
8788
8808
|
return this.clientRuntime.project("modelSelection", {
|
|
8789
|
-
core: () =>
|
|
8809
|
+
core: () => qa(this.clientRuntime, this.modelClientScopeId)
|
|
8790
8810
|
});
|
|
8791
8811
|
}
|
|
8792
8812
|
setModel(e) {
|
|
@@ -8798,7 +8818,7 @@ class _t {
|
|
|
8798
8818
|
const t = this.clientRuntime.engine.getState().slices, i = t.directory.clients[this.modelClientScopeId], n = Ie(t.conversation, t.directory, i), r = Yi(n, e);
|
|
8799
8819
|
if (!r) return !1;
|
|
8800
8820
|
if (r.type === "preparation") {
|
|
8801
|
-
const a = j(), o =
|
|
8821
|
+
const a = j(), o = Ar(r.submission);
|
|
8802
8822
|
return Ft(this.clientRuntime, this.modelClientScopeId, a, r.submission.requestedModel), this.sendMessage(o.content, { clientMessageId: a, attachments: o.attachments, proactiveSuggestionQuestion: o.proactiveSuggestionQuestion }).catch((c) => this.emit("error", xe(c))), !0;
|
|
8803
8823
|
}
|
|
8804
8824
|
return r.type === "delivery" ? (this.clientRuntime.engine.dispatch({ ...this.directoryAuthority, type: "conversation.submit", userMessageId: r.userMessageId, now: Date.now(), manualRetry: !0 }), !0) : (this.clientRuntime.engine.dispatch({ ...this.directoryAuthority, type: "conversation.operation", command: {
|
|
@@ -8812,19 +8832,19 @@ class _t {
|
|
|
8812
8832
|
} }), !0);
|
|
8813
8833
|
}
|
|
8814
8834
|
createLocalAttachment(e) {
|
|
8815
|
-
this.options.productVariant === "customer_embedded" &&
|
|
8835
|
+
this.options.productVariant === "customer_embedded" && fd(e);
|
|
8816
8836
|
const t = j(), i = {
|
|
8817
8837
|
id: t,
|
|
8818
8838
|
name: e.name || "attachment",
|
|
8819
8839
|
mimeType: Dn(e),
|
|
8820
8840
|
sizeBytes: e.size
|
|
8821
|
-
}, n = Date.now(), r =
|
|
8841
|
+
}, n = Date.now(), r = oa({
|
|
8822
8842
|
attachmentId: t,
|
|
8823
8843
|
name: i.name,
|
|
8824
8844
|
mimeType: i.mimeType,
|
|
8825
8845
|
sizeBytes: i.sizeBytes,
|
|
8826
8846
|
blob: e,
|
|
8827
|
-
origin:
|
|
8847
|
+
origin: te().origin,
|
|
8828
8848
|
sessionId: this.state.sessionId ?? void 0,
|
|
8829
8849
|
createdAt: n,
|
|
8830
8850
|
lastUsedAt: n
|
|
@@ -8847,7 +8867,7 @@ class _t {
|
|
|
8847
8867
|
conversationScopeId: o,
|
|
8848
8868
|
command: { request_id: c, type: "attachment.prepare", payload: {
|
|
8849
8869
|
source: { sourceId: r.id, name: r.name, mimeType: r.mimeType, sizeBytes: r.sizeBytes },
|
|
8850
|
-
context: JSON.parse(JSON.stringify({ page:
|
|
8870
|
+
context: JSON.parse(JSON.stringify({ page: te(), metadata: Mi(this.options.metadata) })),
|
|
8851
8871
|
requestedModel: i ?? null,
|
|
8852
8872
|
entrySurface: this.options.entrySurface,
|
|
8853
8873
|
sessionId: this.getState().sessionId
|
|
@@ -8892,9 +8912,9 @@ class _t {
|
|
|
8892
8912
|
});
|
|
8893
8913
|
};
|
|
8894
8914
|
let a = !1;
|
|
8895
|
-
return
|
|
8915
|
+
return kd(async () => {
|
|
8896
8916
|
let o = await r(!1);
|
|
8897
|
-
if (n(), !o.ok &&
|
|
8917
|
+
if (n(), !o.ok && Od(o.status) && this.options.tokenProvider && !a && (a = !0, o = await r(!0), n()), !o.ok) throw new jn("Failed to prepare attachment upload", o.status);
|
|
8898
8918
|
return await o.json();
|
|
8899
8919
|
}, "Failed to prepare attachment upload");
|
|
8900
8920
|
}
|
|
@@ -8935,7 +8955,7 @@ class _t {
|
|
|
8935
8955
|
payload: {
|
|
8936
8956
|
sessionId: t.sessionId,
|
|
8937
8957
|
warmupId: this.activeComposerWarmupId,
|
|
8938
|
-
page:
|
|
8958
|
+
page: te()
|
|
8939
8959
|
}
|
|
8940
8960
|
} }), this.activeComposerWarmupId = null, this.lastUserMessagePageUrl = null, this.clientRuntime.engine.dispatch({ type: "model.scope_navigate", clientScopeId: this.modelClientScopeId, sessionId: null }), this.beginDirectoryProvisional();
|
|
8941
8961
|
}
|
|
@@ -8955,7 +8975,7 @@ class _t {
|
|
|
8955
8975
|
}
|
|
8956
8976
|
getSessionHistoryState() {
|
|
8957
8977
|
return this.clientRuntime.project("directory", { core: () => {
|
|
8958
|
-
const e = this.clientRuntime.engine.getProjection().directory, t = e.queries[x(this.getDirectoryQuery())], i = Xt(this.options.entrySurface).map((l) => this.getDirectoryQuery(l)).map((l) => e.queries[x(l)]).filter((l) => l !== void 0), n = Object.values(e.optimisticEntries).reverse(), r =
|
|
8978
|
+
const e = this.clientRuntime.engine.getProjection().directory, t = e.queries[x(this.getDirectoryQuery())], i = Xt(this.options.entrySurface).map((l) => this.getDirectoryQuery(l)).map((l) => e.queries[x(l)]).filter((l) => l !== void 0), n = Object.values(e.optimisticEntries).reverse(), r = Mo(i), a = new Set(n.flatMap((l) => l.sessionId ? [l.sessionId] : [])), o = [...n.map((l) => l.id), ...r.filter((l) => !a.has(l))], c = Object.fromEntries([
|
|
8959
8979
|
...n.map((l) => [l.id, {
|
|
8960
8980
|
id: l.id,
|
|
8961
8981
|
title: null,
|
|
@@ -8969,7 +8989,7 @@ class _t {
|
|
|
8969
8989
|
isPinned: !1
|
|
8970
8990
|
}]),
|
|
8971
8991
|
...r.filter((l) => !a.has(l)).map((l) => [l, this.toSessionHistoryEntry(e.entities[l])])
|
|
8972
|
-
]), d =
|
|
8992
|
+
]), d = Co(i);
|
|
8973
8993
|
return {
|
|
8974
8994
|
key: `${this.options.clientId}:recent`,
|
|
8975
8995
|
status: d?.status ?? "not_requested",
|
|
@@ -9071,7 +9091,7 @@ class _t {
|
|
|
9071
9091
|
throw new Error("This interaction is no longer available.");
|
|
9072
9092
|
if (!r.allowedActions.includes(t))
|
|
9073
9093
|
throw new Error("This action is not available for the interaction.");
|
|
9074
|
-
if (
|
|
9094
|
+
if (Ka(t) && await this.interactionManager.act(
|
|
9075
9095
|
{
|
|
9076
9096
|
key: r.id,
|
|
9077
9097
|
category: r.category,
|
|
@@ -9106,7 +9126,7 @@ class _t {
|
|
|
9106
9126
|
} });
|
|
9107
9127
|
}
|
|
9108
9128
|
createConversationInteractionPort() {
|
|
9109
|
-
return
|
|
9129
|
+
return Tr({
|
|
9110
9130
|
authority: this.directoryAuthority,
|
|
9111
9131
|
runtime: () => this.clientRuntime,
|
|
9112
9132
|
manager: this.interactionManager,
|
|
@@ -9139,7 +9159,7 @@ class _t {
|
|
|
9139
9159
|
this.rebuildRuntimeInteractions();
|
|
9140
9160
|
}
|
|
9141
9161
|
rebuildRuntimeInteractions(e = !0) {
|
|
9142
|
-
const t = [], i = this.interactionManager.getConversationInputs(this.state.sessionId), n = this.options.productVariant === "personal" && (this.options.entrySurface === "main_web_chat" || this.options.entrySurface === "automation") ? i === void 0 ?
|
|
9162
|
+
const t = [], i = this.interactionManager.getConversationInputs(this.state.sessionId), n = this.options.productVariant === "personal" && (this.options.entrySurface === "main_web_chat" || this.options.entrySurface === "automation") ? i === void 0 ? da(this.state.messages) : i.share?.candidate ?? null : null;
|
|
9143
9163
|
if (n) {
|
|
9144
9164
|
const a = {
|
|
9145
9165
|
key: n.id,
|
|
@@ -9276,11 +9296,11 @@ class _t {
|
|
|
9276
9296
|
!this.options.keepRunsActiveOnSessionNavigation && this.state.sessionId !== e && this.stopConversation("session_switch"), this.retainNavigatedConversation();
|
|
9277
9297
|
const i = "conversation:" + this.modelClientScopeId + ":" + j();
|
|
9278
9298
|
this.directoryConversationScopeId = i, this.lastUserMessagePageUrl = null, this.clientRuntime.engine.dispatch({ type: "model.scope_navigate", clientScopeId: this.modelClientScopeId, sessionId: e }), this.directoryScope.bind(this.modelClientScopeId, this.directoryConversationScopeId, e).then(async () => {
|
|
9279
|
-
await this.directoryScope.persist(), this.state.sessionId === e && (t.intents[e]?.observe && this.conversationObservation?.refresh(e).catch((n) => this.handleDirectoryTransportError(n)), this.send({ type: "page.upsert", sessionId: e, page:
|
|
9299
|
+
await this.directoryScope.persist(), this.state.sessionId === e && (t.intents[e]?.observe && this.conversationObservation?.refresh(e).catch((n) => this.handleDirectoryTransportError(n)), this.send({ type: "page.upsert", sessionId: e, page: te(), model: this.getModel() }));
|
|
9280
9300
|
});
|
|
9281
9301
|
}
|
|
9282
9302
|
send(e) {
|
|
9283
|
-
const t = this.sendNow(
|
|
9303
|
+
const t = this.sendNow(Y(e));
|
|
9284
9304
|
return t || (this.queuedClientEvents.push(e), ge(this.options.clientId, this.queuedClientEvents), this.setState({ status: "reconnecting" }), this.scheduleReconnect()), t;
|
|
9285
9305
|
}
|
|
9286
9306
|
sendNow(e) {
|
|
@@ -9289,7 +9309,7 @@ class _t {
|
|
|
9289
9309
|
const t = this.socket;
|
|
9290
9310
|
if ((e.type === "tool.result" || e.type === "run.stop") && t instanceof D) {
|
|
9291
9311
|
const i = this.queuedClientEvents.find((n) => "sessionId" in n && n.sessionId === e.sessionId && (e.type === "tool.result" && n.type === "tool.result" && n.callId === e.callId || e.type === "run.stop" && n.type === "run.stop" && n.expectedUserMessageId === e.expectedUserMessageId)) ?? e;
|
|
9292
|
-
return this.queuedClientEvents.includes(i) || this.queuedClientEvents.push(i), ge(this.options.clientId, this.queuedClientEvents), this.pendingRetainedCommandDeliveries.has(i) || (this.pendingRetainedCommandDeliveries.add(i), t.sendRetainedCommand(
|
|
9312
|
+
return this.queuedClientEvents.includes(i) || this.queuedClientEvents.push(i), ge(this.options.clientId, this.queuedClientEvents), this.pendingRetainedCommandDeliveries.has(i) || (this.pendingRetainedCommandDeliveries.add(i), t.sendRetainedCommand(Y(i)).then((n) => {
|
|
9293
9313
|
this.pendingRetainedCommandDeliveries.delete(i), n && (this.queuedClientEvents = this.queuedClientEvents.filter((r) => r !== i), ge(this.options.clientId, this.queuedClientEvents));
|
|
9294
9314
|
})), !0;
|
|
9295
9315
|
}
|
|
@@ -9313,7 +9333,7 @@ class _t {
|
|
|
9313
9333
|
this.options.backendUrl
|
|
9314
9334
|
) });
|
|
9315
9335
|
}
|
|
9316
|
-
if (t.httpRequest && (!
|
|
9336
|
+
if (t.httpRequest && (!le(t.httpRequest) || t.httpRequest.sessionId !== null && t.httpRequest.sessionId !== i.sessionId) || t.historyRefreshFailure && (t.historyRefreshFailure.consecutiveFailures < 3 || t.historyRefreshFailure.sessionId !== i.sessionId) || t.renderedError && t.renderedError.sessionId !== i.sessionId || t.uiInvariant && t.uiInvariant.current.sessionId !== i.sessionId) return;
|
|
9317
9337
|
const n = t.historyRefreshFailure?.episodeId ?? (t.renderedError ? `${t.errorFingerprint}:${t.renderedError.itemId}` : void 0) ?? t.errorFingerprint ?? t.clientMessageId ?? (t.previousPhase && t.nextPhase ? `${t.previousPhase}:${t.nextPhase}:${t.reason ?? "unknown"}` : null);
|
|
9318
9338
|
if (n) {
|
|
9319
9339
|
const m = `${e}:${n}:${e === "invalid_state_transition" ? t.reason ?? "unknown" : ""}`;
|
|
@@ -9327,7 +9347,7 @@ class _t {
|
|
|
9327
9347
|
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
9328
9348
|
source: "web_sdk",
|
|
9329
9349
|
entrySurface: this.options.entrySurface,
|
|
9330
|
-
...e === "first_response_slow" ? { responseDiagnostics:
|
|
9350
|
+
...e === "first_response_slow" ? { responseDiagnostics: Lo(
|
|
9331
9351
|
this,
|
|
9332
9352
|
this.options.entrySurface,
|
|
9333
9353
|
i.sessionId,
|
|
@@ -9522,9 +9542,9 @@ class _t {
|
|
|
9522
9542
|
if (this.state.starterPromptsLoading || this.transientStarterPromptsRequestInFlight || this.transientStarterPromptsRequestAttempted)
|
|
9523
9543
|
return;
|
|
9524
9544
|
this.transientStarterPromptsRequestInFlight = !0, this.transientStarterPromptsRequestAttempted = !0, this.setState({ starterPromptsLoading: !0 });
|
|
9525
|
-
const e =
|
|
9545
|
+
const e = Cc();
|
|
9526
9546
|
this.sendNow(
|
|
9527
|
-
|
|
9547
|
+
Y({
|
|
9528
9548
|
type: "starter_prompts.page_context",
|
|
9529
9549
|
pageUrl: e.pageUrl,
|
|
9530
9550
|
pageTitle: e.pageTitle,
|
|
@@ -9533,13 +9553,13 @@ class _t {
|
|
|
9533
9553
|
) || (this.transientStarterPromptsRequestInFlight = !1, this.transientStarterPromptsRequestAttempted = !1, this.setState({ starterPromptsLoading: !1 }));
|
|
9534
9554
|
}
|
|
9535
9555
|
startStarterPromptUrlWatcher() {
|
|
9536
|
-
this.locationChangeCleanup || (this.locationChangeCleanup =
|
|
9556
|
+
this.locationChangeCleanup || (this.locationChangeCleanup = Mc(() => this.handleStarterPromptUrlChange()));
|
|
9537
9557
|
}
|
|
9538
9558
|
handleStarterPromptUrlChange() {
|
|
9539
9559
|
const e = location.href;
|
|
9540
9560
|
e !== this.lastStarterPromptPageUrl && (this.lastStarterPromptPageUrl = e, this.clearStarterPromptUrlRefreshTimer(), this.starterPromptUrlRefreshTimer = window.setTimeout(() => {
|
|
9541
9561
|
this.starterPromptUrlRefreshTimer = null, this.refreshStarterPromptsForCurrentUrl();
|
|
9542
|
-
},
|
|
9562
|
+
}, cc));
|
|
9543
9563
|
}
|
|
9544
9564
|
refreshStarterPromptsForCurrentUrl() {
|
|
9545
9565
|
this.socket?.readyState !== WebSocket.OPEN || this.state.status === "closed" || (this.setState({ starterPromptsLoading: this.state.messages.length === 0 }), this.sendNow({
|
|
@@ -9554,7 +9574,7 @@ class _t {
|
|
|
9554
9574
|
const e = [...this.queuedClientEvents];
|
|
9555
9575
|
this.queuedClientEvents = this.queuedClientEvents.filter((t) => (t.type === "tool.result" || t.type === "run.stop") && this.socket instanceof D), ge(this.options.clientId, this.queuedClientEvents);
|
|
9556
9576
|
for (let t = 0; t < e.length; t++)
|
|
9557
|
-
if (!this.sendNow(
|
|
9577
|
+
if (!this.sendNow(Y(e[t]))) {
|
|
9558
9578
|
this.queuedClientEvents.unshift(...e.slice(t).filter((i) => !this.queuedClientEvents.includes(i)));
|
|
9559
9579
|
break;
|
|
9560
9580
|
}
|
|
@@ -9632,12 +9652,12 @@ class _t {
|
|
|
9632
9652
|
const t = Di(e.user);
|
|
9633
9653
|
this.applyAuthenticatedDirectoryIdentity(e.user), this.authenticatedSocket = this.socket, this.directoryObservation.reconnect().catch(() => {
|
|
9634
9654
|
}), this.conversationObservation?.wake(), this.flushPendingWidgetLifecycleEvents(), this.flushQueuedClientEvents(), this.startHeartbeat();
|
|
9635
|
-
const i =
|
|
9655
|
+
const i = $c(e), n = Object.prototype.hasOwnProperty.call(e, "appearance");
|
|
9636
9656
|
$("web-sdk.agent", "Received auth.ok appearance", {
|
|
9637
9657
|
hasAppearance: n,
|
|
9638
9658
|
rawAppearance: e.appearance,
|
|
9639
9659
|
normalizedAppearance: i
|
|
9640
|
-
}), this.runtimeHelperJavascript =
|
|
9660
|
+
}), this.runtimeHelperJavascript = Fc(e.runtimeHelpers)?.javascript ?? null;
|
|
9641
9661
|
const r = xi(e, "starterPrompts"), a = Object.prototype.hasOwnProperty.call(e, "starterPrompts"), o = e.starterPromptsLoading === !0, c = {
|
|
9642
9662
|
user: t,
|
|
9643
9663
|
status: "connected",
|
|
@@ -9647,10 +9667,10 @@ class _t {
|
|
|
9647
9667
|
type: "runtime.auth_ack",
|
|
9648
9668
|
connectionAttempt: this.connectionAttemptId,
|
|
9649
9669
|
entrySurface: this.options.entrySurface
|
|
9650
|
-
}), a && r.length === 0 && !o && !
|
|
9670
|
+
}), a && r.length === 0 && !o && !Pc() && this.requestTransientStarterPrompts(), this.state.sessionId && this.send({
|
|
9651
9671
|
type: "page.upsert",
|
|
9652
9672
|
sessionId: this.state.sessionId,
|
|
9653
|
-
page:
|
|
9673
|
+
page: te(),
|
|
9654
9674
|
model: js(this.clientRuntime, this.modelClientScopeId).selectedModel
|
|
9655
9675
|
});
|
|
9656
9676
|
return;
|
|
@@ -9677,7 +9697,7 @@ class _t {
|
|
|
9677
9697
|
if (e.type === "tool.call")
|
|
9678
9698
|
return e.sessionId !== this.state.sessionId && this.clientRuntime.engine.getState().slices.conversation.sessions[String(e.sessionId)] && !this.options.keepRunsActiveOnSessionNavigation ? void 0 : (this.executeToolCall(e), !0);
|
|
9679
9699
|
if (e.type === "error") {
|
|
9680
|
-
if (e.code === "connection_failed") {
|
|
9700
|
+
if (e = { ...e, message: J(e, "connection_failed", "web_transport").message }, e.code === "connection_failed") {
|
|
9681
9701
|
this.setState({ status: "reconnecting", lastError: String(e.message), lastErrorCode: e.code });
|
|
9682
9702
|
return;
|
|
9683
9703
|
}
|
|
@@ -9749,7 +9769,7 @@ class _t {
|
|
|
9749
9769
|
});
|
|
9750
9770
|
}
|
|
9751
9771
|
updateAccountFallbackFromSession(e) {
|
|
9752
|
-
const t = e && typeof e == "object" ? e.metadata : null, i =
|
|
9772
|
+
const t = e && typeof e == "object" ? e.metadata : null, i = qr(t);
|
|
9753
9773
|
if (this.usingPaidCreditFallback !== i && (this.usingPaidCreditFallback = i, !!this.account)) {
|
|
9754
9774
|
this.account = { ...this.account, usingPaidCreditFallback: i };
|
|
9755
9775
|
for (const n of this.accountListeners) n(this.getAccount());
|
|
@@ -9768,15 +9788,15 @@ class _t {
|
|
|
9768
9788
|
}
|
|
9769
9789
|
if (this.activeBrowserToolCalls.has(i)) return;
|
|
9770
9790
|
const c = n === "execute_code", d = n === "execute_code_in_browser_tab" && a !== null && typeof a == "object" && a.tabId === "local:current";
|
|
9771
|
-
if (!c && !d || !
|
|
9791
|
+
if (!c && !d || !Id(a)) {
|
|
9772
9792
|
this.send({
|
|
9773
9793
|
type: "tool.result",
|
|
9774
9794
|
sessionId: t,
|
|
9775
9795
|
callId: i,
|
|
9776
9796
|
toolName: n,
|
|
9777
9797
|
summary: r,
|
|
9778
|
-
rawInput:
|
|
9779
|
-
rawOutput:
|
|
9798
|
+
rawInput: Y(a),
|
|
9799
|
+
rawOutput: Y({
|
|
9780
9800
|
ok: !1,
|
|
9781
9801
|
toolName: n,
|
|
9782
9802
|
error: `Unsupported browser tool: ${n}`
|
|
@@ -9791,7 +9811,7 @@ class _t {
|
|
|
9791
9811
|
callId: i,
|
|
9792
9812
|
toolName: n,
|
|
9793
9813
|
summary: r,
|
|
9794
|
-
rawInput:
|
|
9814
|
+
rawInput: Y(a),
|
|
9795
9815
|
rawOutput: {
|
|
9796
9816
|
ok: !1,
|
|
9797
9817
|
toolName: n,
|
|
@@ -9807,7 +9827,7 @@ class _t {
|
|
|
9807
9827
|
callId: i,
|
|
9808
9828
|
toolName: n,
|
|
9809
9829
|
summary: r,
|
|
9810
|
-
rawInput:
|
|
9830
|
+
rawInput: Y(a),
|
|
9811
9831
|
rawOutput: null
|
|
9812
9832
|
},
|
|
9813
9833
|
startedAtMs: Date.now(),
|
|
@@ -9817,7 +9837,7 @@ class _t {
|
|
|
9817
9837
|
let l = null, u;
|
|
9818
9838
|
l = await this.executeRuntimeHelper(), u = await Oi(
|
|
9819
9839
|
a,
|
|
9820
|
-
|
|
9840
|
+
Ac(e.runtimeContext, this.options.backendUrl)
|
|
9821
9841
|
).catch((p) => ({
|
|
9822
9842
|
ok: !1,
|
|
9823
9843
|
exception: {
|
|
@@ -9829,8 +9849,8 @@ class _t {
|
|
|
9829
9849
|
callId: i,
|
|
9830
9850
|
toolName: n,
|
|
9831
9851
|
summary: a.summary,
|
|
9832
|
-
rawInput:
|
|
9833
|
-
rawOutput:
|
|
9852
|
+
rawInput: Y(a),
|
|
9853
|
+
rawOutput: Y(zc(u, l))
|
|
9834
9854
|
}), Ni(this.options.clientId, this.activeBrowserToolCalls.values()));
|
|
9835
9855
|
}
|
|
9836
9856
|
startPageLifecycleRecovery() {
|
|
@@ -9844,10 +9864,10 @@ class _t {
|
|
|
9844
9864
|
};
|
|
9845
9865
|
}
|
|
9846
9866
|
installSessionBrowserApis() {
|
|
9847
|
-
this.cleanupSessionBrowserApis(), this.sessionBrowserApisCleanup =
|
|
9867
|
+
this.cleanupSessionBrowserApis(), this.sessionBrowserApisCleanup = mc();
|
|
9848
9868
|
}
|
|
9849
9869
|
cleanupSessionBrowserApis() {
|
|
9850
|
-
this.sessionBrowserApisCleanup && (
|
|
9870
|
+
this.sessionBrowserApisCleanup && (Sc(this.sessionBrowserApisCleanup), this.sessionBrowserApisCleanup = null);
|
|
9851
9871
|
}
|
|
9852
9872
|
async executeRuntimeHelper() {
|
|
9853
9873
|
if (!this.runtimeHelperJavascript?.trim())
|
|
@@ -9855,24 +9875,24 @@ class _t {
|
|
|
9855
9875
|
const e = await Oi({
|
|
9856
9876
|
javascript: this.runtimeHelperJavascript
|
|
9857
9877
|
});
|
|
9858
|
-
return e.ok === !1 ?
|
|
9878
|
+
return e.ok === !1 ? Hc(e) : null;
|
|
9859
9879
|
}
|
|
9860
9880
|
enableNetworkCapture() {
|
|
9861
|
-
this.networkCaptureCleanup || (this.networkCaptureCleanup =
|
|
9862
|
-
|
|
9881
|
+
this.networkCaptureCleanup || (this.networkCaptureCleanup = uc((e) => {
|
|
9882
|
+
Ad(e.url, this.options.backendUrl) || this.enqueueNetworkEvent(e);
|
|
9863
9883
|
}));
|
|
9864
9884
|
}
|
|
9865
9885
|
enqueueNetworkEvent(e) {
|
|
9866
|
-
this.queuedNetworkEvents.length >=
|
|
9886
|
+
this.queuedNetworkEvents.length >= sc || (this.queuedNetworkEvents.push(Rd(e)), this.networkBatchTimer === null && (this.networkBatchTimer = window.setTimeout(() => {
|
|
9867
9887
|
this.networkBatchTimer = null;
|
|
9868
9888
|
const t = this.queuedNetworkEvents.splice(0, this.queuedNetworkEvents.length);
|
|
9869
9889
|
t.length === 0 || this.socket?.readyState !== WebSocket.OPEN || this.sendNow({
|
|
9870
9890
|
type: "network.batch",
|
|
9871
9891
|
sessionId: this.state.sessionId ?? void 0,
|
|
9872
|
-
page:
|
|
9892
|
+
page: te(),
|
|
9873
9893
|
events: t
|
|
9874
9894
|
});
|
|
9875
|
-
},
|
|
9895
|
+
}, tc)));
|
|
9876
9896
|
}
|
|
9877
9897
|
startEmbeddedRecoveryBudget() {
|
|
9878
9898
|
if (this.options.productVariant !== "customer_embedded" || this.embeddedRecoveryTimer !== null || this.authenticationFailure) return;
|
|
@@ -9894,7 +9914,7 @@ class _t {
|
|
|
9894
9914
|
this.embeddedRecoveryTimer !== null && window.clearTimeout(this.embeddedRecoveryTimer), this.embeddedRecoveryTimer = null;
|
|
9895
9915
|
}
|
|
9896
9916
|
connectionFailureDiagnostic(e, t) {
|
|
9897
|
-
const i = e instanceof
|
|
9917
|
+
const i = e instanceof oe ? e.status : e instanceof w && e.code === "unauthorized" ? 401 : e instanceof w && /^[45][0-9]{2}$/.test(e.code) ? Number(e.code) : void 0, n = i !== void 0 && Number.isInteger(i) && i >= 400 && i <= 599 ? i : void 0, a = !(e instanceof w && ["unauthorized", "403", "update_required", "executor_replaced"].includes(e.code)) && Qt(e) && n !== 401 && n !== 403;
|
|
9898
9918
|
return {
|
|
9899
9919
|
stage: t,
|
|
9900
9920
|
...n !== void 0 ? { httpStatus: n } : {},
|
|
@@ -9907,7 +9927,7 @@ class _t {
|
|
|
9907
9927
|
return;
|
|
9908
9928
|
const t = Math.min(
|
|
9909
9929
|
_s,
|
|
9910
|
-
Math.max(
|
|
9930
|
+
Math.max(dc(this.reconnectAttempts), e)
|
|
9911
9931
|
);
|
|
9912
9932
|
this.reconnectAttempts += 1, this.reconnectTimer = window.setTimeout(() => {
|
|
9913
9933
|
this.reconnectTimer = null, (this.refreshingDefaultCredentials && this.socket instanceof D ? this.refreshDefaultTransportCredentials(this.socket) : this.connect()).catch((n) => {
|
|
@@ -10000,13 +10020,13 @@ class _t {
|
|
|
10000
10020
|
const c = await this.acquireToken("connect", { forceRefresh: !0 });
|
|
10001
10021
|
if (this.socket !== e || this.state.status === "closed" || this.clientRuntime.isDisposed)
|
|
10002
10022
|
throw new w("Conversation authority was retired.", "authority_retired", !0);
|
|
10003
|
-
if (!c) throw new
|
|
10023
|
+
if (!c) throw new oe("Pluno token provider did not return a token", !1);
|
|
10004
10024
|
if (t && c === n) throw new w("Credential did not change.", "unauthorized", !1);
|
|
10005
10025
|
this.directoryHttp.auth.token = c, a = "bootstrap", this.lastRecoveryStage = a, await this.replaceDefaultTransportCredentials(e), this.reportTransportDiagnostic("auth_refresh_validated", r);
|
|
10006
10026
|
})().catch((c) => {
|
|
10007
10027
|
if (this.socket !== e || this.state.status === "closed") throw c;
|
|
10008
10028
|
if (this.reportTransportDiagnostic("auth_refresh_failed", { ...r, ...this.connectionFailureDiagnostic(c, a) }), this.credentialRecoveryFailure = xe(c), c instanceof w && ["unauthorized", "403", "update_required"].includes(c.code) || !Qt(c)) {
|
|
10009
|
-
const d = c instanceof w ? c : new w(c instanceof
|
|
10029
|
+
const d = c instanceof w ? c : new w(c instanceof oe ? c.message : "Your session could not be refreshed. Try again.", this.options.productVariant === "customer_embedded" ? "connection_failed" : "unauthorized", !1);
|
|
10010
10030
|
throw this.stopAuthentication(d), d;
|
|
10011
10031
|
}
|
|
10012
10032
|
throw this.options.productVariant === "customer_embedded" && this.setState({ status: "reconnecting", lastError: qi, lastErrorCode: "connection_failed" }), this.scheduleReconnect(), c;
|
|
@@ -10027,8 +10047,8 @@ class _t {
|
|
|
10027
10047
|
const e = this.socket;
|
|
10028
10048
|
!e || !this.sendNow({ type: "runtime.ping" }) || (this.clearHeartbeatAckTimer(), this.heartbeatAckTimer = window.setTimeout(() => {
|
|
10029
10049
|
this.socket === e && ($("web-sdk.agent", "Pluno heartbeat acknowledgement timed out; reconnecting"), this.replaceTimedOutSocket(e));
|
|
10030
|
-
},
|
|
10031
|
-
},
|
|
10050
|
+
}, Ja));
|
|
10051
|
+
}, Ga));
|
|
10032
10052
|
}
|
|
10033
10053
|
stopHeartbeat() {
|
|
10034
10054
|
this.heartbeatTimer !== null && (window.clearInterval(this.heartbeatTimer), this.heartbeatTimer = null), this.clearHeartbeatAckTimer();
|
|
@@ -10064,13 +10084,13 @@ class _t {
|
|
|
10064
10084
|
}
|
|
10065
10085
|
}
|
|
10066
10086
|
const Yt = /* @__PURE__ */ new WeakMap();
|
|
10067
|
-
function
|
|
10068
|
-
const e = window.__plunoProductAgentNetworkCapture ??
|
|
10087
|
+
function uc(s) {
|
|
10088
|
+
const e = window.__plunoProductAgentNetworkCapture ?? hc();
|
|
10069
10089
|
return e.subscribers.add(s), () => {
|
|
10070
10090
|
e.subscribers.delete(s), !(e.subscribers.size > 0) && (e.destroy(), window.__plunoProductAgentNetworkCapture === e && delete window.__plunoProductAgentNetworkCapture);
|
|
10071
10091
|
};
|
|
10072
10092
|
}
|
|
10073
|
-
function
|
|
10093
|
+
function hc() {
|
|
10074
10094
|
const s = /* @__PURE__ */ new Set(), e = (p) => {
|
|
10075
10095
|
s.forEach((f) => {
|
|
10076
10096
|
try {
|
|
@@ -10087,11 +10107,11 @@ function uc() {
|
|
|
10087
10107
|
throw g;
|
|
10088
10108
|
}
|
|
10089
10109
|
try {
|
|
10090
|
-
const g = f instanceof Request ? f : null, b =
|
|
10110
|
+
const g = f instanceof Request ? f : null, b = bd(f, g), v = Nn(m?.headers ?? g?.headers);
|
|
10091
10111
|
if (!Re(b, v, m?.body)) {
|
|
10092
10112
|
const S = {
|
|
10093
10113
|
requestId: ts("fetch"),
|
|
10094
|
-
url:
|
|
10114
|
+
url: ce(b, Jt),
|
|
10095
10115
|
method: (m?.method ?? g?.method ?? "GET").toUpperCase(),
|
|
10096
10116
|
requestHeaders: v,
|
|
10097
10117
|
requestBody: ji(m?.body),
|
|
@@ -10100,7 +10120,7 @@ function uc() {
|
|
|
10100
10120
|
};
|
|
10101
10121
|
y.then(
|
|
10102
10122
|
(A) => {
|
|
10103
|
-
|
|
10123
|
+
wd(A, S, h, e).catch(() => {
|
|
10104
10124
|
e({
|
|
10105
10125
|
...S,
|
|
10106
10126
|
responseStatus: A.status,
|
|
@@ -10111,7 +10131,7 @@ function uc() {
|
|
|
10111
10131
|
(A) => {
|
|
10112
10132
|
e({
|
|
10113
10133
|
...S,
|
|
10114
|
-
errorText:
|
|
10134
|
+
errorText: ce(A instanceof Error ? A.message : String(A)),
|
|
10115
10135
|
durationMs: Date.now() - h
|
|
10116
10136
|
});
|
|
10117
10137
|
}
|
|
@@ -10125,7 +10145,7 @@ function uc() {
|
|
|
10125
10145
|
return Yt.set(this, {
|
|
10126
10146
|
requestId: ts("xhr"),
|
|
10127
10147
|
method: String(f ?? "GET").toUpperCase(),
|
|
10128
|
-
url:
|
|
10148
|
+
url: ce(v, Jt),
|
|
10129
10149
|
requestHeaders: {},
|
|
10130
10150
|
startedAtMs: Date.now(),
|
|
10131
10151
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -10142,7 +10162,7 @@ function uc() {
|
|
|
10142
10162
|
() => {
|
|
10143
10163
|
queueMicrotask(() => {
|
|
10144
10164
|
try {
|
|
10145
|
-
const h =
|
|
10165
|
+
const h = Ed(this.getAllResponseHeaders());
|
|
10146
10166
|
e({
|
|
10147
10167
|
requestId: m.requestId,
|
|
10148
10168
|
url: m.url,
|
|
@@ -10152,7 +10172,7 @@ function uc() {
|
|
|
10152
10172
|
resourceType: "xhr",
|
|
10153
10173
|
responseStatus: this.status,
|
|
10154
10174
|
responseHeaders: h,
|
|
10155
|
-
responseBody:
|
|
10175
|
+
responseBody: Sd(this, h),
|
|
10156
10176
|
errorText: this.status === 0 ? "XHR request failed or was aborted" : void 0,
|
|
10157
10177
|
startedAt: m.startedAt,
|
|
10158
10178
|
durationMs: Date.now() - m.startedAtMs
|
|
@@ -10194,7 +10214,7 @@ function uc() {
|
|
|
10194
10214
|
const h = performance.timeOrigin + m.startTime;
|
|
10195
10215
|
e({
|
|
10196
10216
|
requestId: ts("resource"),
|
|
10197
|
-
url:
|
|
10217
|
+
url: ce(m.name, Jt),
|
|
10198
10218
|
method: "GET",
|
|
10199
10219
|
resourceType: "resource",
|
|
10200
10220
|
responseStatus: m.responseStatus,
|
|
@@ -10248,27 +10268,27 @@ function Mi(s) {
|
|
|
10248
10268
|
const e = typeof s == "function" ? s() : s;
|
|
10249
10269
|
return e && Object.keys(e).length > 0 ? e : void 0;
|
|
10250
10270
|
}
|
|
10251
|
-
const
|
|
10252
|
-
function
|
|
10271
|
+
const pc = 5e3, fc = 12e4;
|
|
10272
|
+
function mc() {
|
|
10253
10273
|
const s = [
|
|
10254
|
-
|
|
10255
|
-
|
|
10274
|
+
yc(),
|
|
10275
|
+
gc()
|
|
10256
10276
|
].filter((e) => typeof e == "function");
|
|
10257
10277
|
return () => {
|
|
10258
10278
|
for (const e of s.reverse())
|
|
10259
10279
|
e();
|
|
10260
10280
|
};
|
|
10261
10281
|
}
|
|
10262
|
-
function
|
|
10282
|
+
function gc() {
|
|
10263
10283
|
return bn(globalThis, "getPageSnapshot", async () => Fs());
|
|
10264
10284
|
}
|
|
10265
|
-
function
|
|
10285
|
+
function yc() {
|
|
10266
10286
|
return bn(globalThis, "pageImages", {
|
|
10267
|
-
inspectImage: async (e, t) => await
|
|
10287
|
+
inspectImage: async (e, t) => await vc(e, t)
|
|
10268
10288
|
});
|
|
10269
10289
|
}
|
|
10270
|
-
async function
|
|
10271
|
-
const t =
|
|
10290
|
+
async function vc(s, e = {}) {
|
|
10291
|
+
const t = _c(e.name), i = await Ic(s);
|
|
10272
10292
|
return i.ok ? i.sizeBytes > 8 * 1024 * 1024 ? {
|
|
10273
10293
|
type: "pluno.pageImages.inspectImage",
|
|
10274
10294
|
imageAttached: !1,
|
|
@@ -10286,15 +10306,15 @@ async function yc(s, e = {}) {
|
|
|
10286
10306
|
imageAttachmentError: i.error
|
|
10287
10307
|
};
|
|
10288
10308
|
}
|
|
10289
|
-
async function
|
|
10309
|
+
async function Ic(s) {
|
|
10290
10310
|
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: An } : {
|
|
10291
10311
|
ok: !0,
|
|
10292
10312
|
mimeType: s.type,
|
|
10293
10313
|
sizeBytes: s.size,
|
|
10294
|
-
dataUrl: await
|
|
10295
|
-
} : { 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." } :
|
|
10314
|
+
dataUrl: await Rc(s)
|
|
10315
|
+
} : { 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." } : bc(s);
|
|
10296
10316
|
}
|
|
10297
|
-
function
|
|
10317
|
+
function bc(s) {
|
|
10298
10318
|
if (!s.startsWith("data:") || !s.includes(","))
|
|
10299
10319
|
return { ok: !1, error: "Page image must be a complete data:image/* URL, not bare base64." };
|
|
10300
10320
|
const [e, t] = s.slice(5).split(",", 2), i = e.split(";").map((o) => o.trim()).filter(Boolean), n = i[0] ?? "";
|
|
@@ -10305,7 +10325,7 @@ function Ic(s) {
|
|
|
10305
10325
|
const r = t.replace(/[ \t\r\n\f]+/g, "");
|
|
10306
10326
|
if (!/^[A-Za-z0-9+/]*={0,2}$/.test(r))
|
|
10307
10327
|
return { ok: !1, error: "Page image data URL has invalid base64." };
|
|
10308
|
-
const a =
|
|
10328
|
+
const a = wc(r);
|
|
10309
10329
|
return a === null ? { ok: !1, error: "Page image data URL has invalid base64." } : a === 0 ? { ok: !1, error: "Page image is empty." } : {
|
|
10310
10330
|
ok: !0,
|
|
10311
10331
|
mimeType: n,
|
|
@@ -10313,22 +10333,22 @@ function Ic(s) {
|
|
|
10313
10333
|
dataUrl: `data:${n};base64,${r}`
|
|
10314
10334
|
};
|
|
10315
10335
|
}
|
|
10316
|
-
function
|
|
10336
|
+
function wc(s) {
|
|
10317
10337
|
if (s.length === 0 || s.length % 4 !== 0)
|
|
10318
10338
|
return null;
|
|
10319
10339
|
const e = s.length - s.replace(/=+$/, "").length;
|
|
10320
10340
|
return e > 2 ? null : s.length / 4 * 3 - e;
|
|
10321
10341
|
}
|
|
10322
|
-
function
|
|
10342
|
+
function _c(s) {
|
|
10323
10343
|
return (typeof s == "string" ? s.trim() : "") || "Page image";
|
|
10324
10344
|
}
|
|
10325
|
-
function
|
|
10345
|
+
function Sc(s) {
|
|
10326
10346
|
try {
|
|
10327
10347
|
s();
|
|
10328
10348
|
} catch {
|
|
10329
10349
|
}
|
|
10330
10350
|
}
|
|
10331
|
-
function
|
|
10351
|
+
function Rc(s) {
|
|
10332
10352
|
return new Promise((e, t) => {
|
|
10333
10353
|
const i = new FileReader();
|
|
10334
10354
|
i.onload = () => {
|
|
@@ -10342,7 +10362,7 @@ function Sc(s) {
|
|
|
10342
10362
|
}
|
|
10343
10363
|
async function Oi(s, e) {
|
|
10344
10364
|
const t = Object.getPrototypeOf(async function() {
|
|
10345
|
-
}).constructor, i = s.timeoutMs ??
|
|
10365
|
+
}).constructor, i = s.timeoutMs ?? pc, n = Date.now(), r = [];
|
|
10346
10366
|
let a;
|
|
10347
10367
|
const o = {
|
|
10348
10368
|
log: console.log,
|
|
@@ -10360,7 +10380,7 @@ async function Oi(s, e) {
|
|
|
10360
10380
|
a = window.setTimeout(() => u(d), i);
|
|
10361
10381
|
})
|
|
10362
10382
|
]);
|
|
10363
|
-
return l === d ?
|
|
10383
|
+
return l === d ? Tc(i) : {
|
|
10364
10384
|
ok: !0,
|
|
10365
10385
|
result: l,
|
|
10366
10386
|
console: r,
|
|
@@ -10389,7 +10409,7 @@ async function Oi(s, e) {
|
|
|
10389
10409
|
e?.deactivate(), a !== void 0 && window.clearTimeout(a), console.log = o.log, console.info = o.info, console.warn = o.warn, console.error = o.error;
|
|
10390
10410
|
}
|
|
10391
10411
|
}
|
|
10392
|
-
function
|
|
10412
|
+
function Ac(s, e) {
|
|
10393
10413
|
if (!s || typeof s != "object")
|
|
10394
10414
|
return;
|
|
10395
10415
|
const t = s.sandboxFilesToken;
|
|
@@ -10399,7 +10419,7 @@ function Rc(s, e) {
|
|
|
10399
10419
|
const n = () => {
|
|
10400
10420
|
if (!i)
|
|
10401
10421
|
throw new Error("sandboxFiles is only available during browser-code execution");
|
|
10402
|
-
}, r = async (o, c) => await
|
|
10422
|
+
}, r = async (o, c) => await La(`${e.replace(/\/$/, "")}${o}`, c);
|
|
10403
10423
|
return {
|
|
10404
10424
|
value: Object.freeze({
|
|
10405
10425
|
upload: async (o) => {
|
|
@@ -10433,7 +10453,7 @@ function Rc(s, e) {
|
|
|
10433
10453
|
}
|
|
10434
10454
|
};
|
|
10435
10455
|
}
|
|
10436
|
-
function
|
|
10456
|
+
function Tc(s) {
|
|
10437
10457
|
return {
|
|
10438
10458
|
ok: !1,
|
|
10439
10459
|
exception: {
|
|
@@ -10447,20 +10467,20 @@ function Ac(s) {
|
|
|
10447
10467
|
}
|
|
10448
10468
|
};
|
|
10449
10469
|
}
|
|
10450
|
-
function
|
|
10470
|
+
function Ec(s) {
|
|
10451
10471
|
return s.replace(/\/+$/, "");
|
|
10452
10472
|
}
|
|
10453
|
-
function
|
|
10473
|
+
function kc(s) {
|
|
10454
10474
|
return s === "pluno" ? "scheduled_continuation" : s ?? "user";
|
|
10455
10475
|
}
|
|
10456
|
-
function
|
|
10476
|
+
function Zd(s, e = location.origin) {
|
|
10457
10477
|
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;
|
|
10458
10478
|
}
|
|
10459
|
-
function
|
|
10479
|
+
function qc(s) {
|
|
10460
10480
|
const e = new URL("/api/product-agent/embed/ws", s);
|
|
10461
10481
|
return e.protocol = e.protocol === "https:" ? "wss:" : "ws:", e.toString();
|
|
10462
10482
|
}
|
|
10463
|
-
function
|
|
10483
|
+
function te() {
|
|
10464
10484
|
const s = qn();
|
|
10465
10485
|
return {
|
|
10466
10486
|
url: location.href,
|
|
@@ -10469,19 +10489,19 @@ function ee() {
|
|
|
10469
10489
|
...s ? { plunoProductAgentUi: s } : {}
|
|
10470
10490
|
};
|
|
10471
10491
|
}
|
|
10472
|
-
function
|
|
10492
|
+
function Cc() {
|
|
10473
10493
|
return {
|
|
10474
10494
|
pageUrl: location.href,
|
|
10475
10495
|
pageTitle: document.title,
|
|
10476
10496
|
htmlContent: Fs()
|
|
10477
10497
|
};
|
|
10478
10498
|
}
|
|
10479
|
-
function
|
|
10480
|
-
return ht.add(s), Ze || (Ze =
|
|
10499
|
+
function Mc(s) {
|
|
10500
|
+
return ht.add(s), Ze || (Ze = Oc()), () => {
|
|
10481
10501
|
ht.delete(s), ht.size === 0 && (Ze?.(), Ze = null);
|
|
10482
10502
|
};
|
|
10483
10503
|
}
|
|
10484
|
-
function
|
|
10504
|
+
function Oc() {
|
|
10485
10505
|
const s = () => {
|
|
10486
10506
|
for (const r of Array.from(ht))
|
|
10487
10507
|
r();
|
|
@@ -10496,7 +10516,7 @@ function Mc() {
|
|
|
10496
10516
|
window.history.pushState === i && (window.history.pushState = e), window.history.replaceState === n && (window.history.replaceState = t), window.removeEventListener("popstate", s), window.removeEventListener("hashchange", s);
|
|
10497
10517
|
};
|
|
10498
10518
|
}
|
|
10499
|
-
function
|
|
10519
|
+
function Pc() {
|
|
10500
10520
|
return qn()?.surface === "browser_extension_sdk_preview";
|
|
10501
10521
|
}
|
|
10502
10522
|
function Fs() {
|
|
@@ -10512,12 +10532,12 @@ function Fs() {
|
|
|
10512
10532
|
);
|
|
10513
10533
|
for (const h of n.slice(0, 3))
|
|
10514
10534
|
t("Active overlay", Zt(je(h), e));
|
|
10515
|
-
const r =
|
|
10535
|
+
const r = xc(), a = r ? Zt(je(r), e) : "";
|
|
10516
10536
|
t("Main page content", a), t("Additional visible page text", Zt(je(document.body), e));
|
|
10517
10537
|
const o = s.map(([h, y]) => `${h}:
|
|
10518
10538
|
${y}`).join(`
|
|
10519
10539
|
|
|
10520
|
-
`).trim().slice(0, 12e3), c =
|
|
10540
|
+
`).trim().slice(0, 12e3), c = Dc(n, r).trim(), d = `Simplified DOM outline:
|
|
10521
10541
|
`, l = `
|
|
10522
10542
|
|
|
10523
10543
|
Visible page text:
|
|
@@ -10545,10 +10565,10 @@ function Tn(s) {
|
|
|
10545
10565
|
const e = window.getComputedStyle(s);
|
|
10546
10566
|
return e.display !== "none" && e.visibility !== "hidden" && s.getClientRects().length > 0;
|
|
10547
10567
|
}
|
|
10548
|
-
function
|
|
10568
|
+
function xc() {
|
|
10549
10569
|
return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(Tn).sort((s, e) => je(e).length - je(s).length)[0] ?? null;
|
|
10550
10570
|
}
|
|
10551
|
-
function
|
|
10571
|
+
function Dc(s, e) {
|
|
10552
10572
|
const t = /* @__PURE__ */ new Set([
|
|
10553
10573
|
"main",
|
|
10554
10574
|
"nav",
|
|
@@ -10628,7 +10648,7 @@ function xc(s, e) {
|
|
|
10628
10648
|
"data-test",
|
|
10629
10649
|
"data-qa",
|
|
10630
10650
|
"data-cy"
|
|
10631
|
-
], d = ["aria-label", "placeholder", "data-testid", "data-test", "data-qa", "data-cy"], { priorityElements: l, priorityTargets: u } =
|
|
10651
|
+
], d = ["aria-label", "placeholder", "data-testid", "data-test", "data-qa", "data-cy"], { priorityElements: l, priorityTargets: u } = Uc(), p = new Set(s);
|
|
10632
10652
|
e && p.add(e);
|
|
10633
10653
|
let f = 0;
|
|
10634
10654
|
const m = (v) => {
|
|
@@ -10639,8 +10659,8 @@ function xc(s, e) {
|
|
|
10639
10659
|
return `${v.tagName.toLowerCase()}|${m(v)}|${_}`;
|
|
10640
10660
|
}, y = (v, _, S) => {
|
|
10641
10661
|
const A = (C, H) => {
|
|
10642
|
-
const B = C.tagName.toLowerCase(),
|
|
10643
|
-
if (f >= 1e3 && !R || S.has(C) || r.has(B) || C.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") ||
|
|
10662
|
+
const B = C.tagName.toLowerCase(), Q = window.getComputedStyle(C), R = l.has(C);
|
|
10663
|
+
if (f >= 1e3 && !R || S.has(C) || r.has(B) || C.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") || Q.display === "none" || Q.visibility === "hidden")
|
|
10644
10664
|
return { lines: [], hasUsefulContent: !1, textPreview: "", containsTextElement: !1 };
|
|
10645
10665
|
f += 1;
|
|
10646
10666
|
const M = m(C), E = kn(C), I = o.has(M) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(B) || B === "a" && C.hasAttribute("href"), k = Array.from(C.children).filter((q) => q instanceof HTMLElement), P = /* @__PURE__ */ new Map();
|
|
@@ -10650,13 +10670,13 @@ function xc(s, e) {
|
|
|
10650
10670
|
}
|
|
10651
10671
|
const L = /* @__PURE__ */ new Map(), qe = /* @__PURE__ */ new Map();
|
|
10652
10672
|
for (const q of k) {
|
|
10653
|
-
const N = h(q),
|
|
10654
|
-
qe.set(N,
|
|
10673
|
+
const N = h(q), ue = qe.get(N) ?? 0;
|
|
10674
|
+
qe.set(N, ue + 1), (P.get(N) ?? 0) > 8 && ue >= 6 && !l.has(q) && L.set(N, (L.get(N) ?? 0) + 1);
|
|
10655
10675
|
}
|
|
10656
10676
|
const We = /* @__PURE__ */ new Map(), Ws = /* @__PURE__ */ new Set(), Rt = [], Vs = [];
|
|
10657
10677
|
for (const q of k) {
|
|
10658
|
-
const N = h(q),
|
|
10659
|
-
if (We.set(N, Qs + 1),
|
|
10678
|
+
const N = h(q), ue = P.get(N) ?? 0, Qs = We.get(N) ?? 0;
|
|
10679
|
+
if (We.set(N, Qs + 1), ue > 8 && Qs >= 6 && !l.has(q)) {
|
|
10660
10680
|
Ws.has(N) || (Rt.push([`… ${L.get(N) ?? 0} similar siblings omitted`]), Ws.add(N));
|
|
10661
10681
|
continue;
|
|
10662
10682
|
}
|
|
@@ -10669,9 +10689,9 @@ function xc(s, e) {
|
|
|
10669
10689
|
q instanceof HTMLElement && At.push(A(q, H + 1));
|
|
10670
10690
|
const Ve = [...Vs, ...At], Tt = E.length > 0 || I || Ve.some((q) => q.hasUsefulContent), Gs = Ee(
|
|
10671
10691
|
[E, ...Ve.map((q) => q.textPreview)].filter(Boolean).join(" ")
|
|
10672
|
-
).slice(0, 180), Wn = C.hasAttribute("contenteditable") && (E.length > 0 || !C.querySelector("[contenteditable]")), Js = d.some((q) => C.hasAttribute(q)) || !!M || Wn, Et = (C.getClientRects().length > 0 ||
|
|
10692
|
+
).slice(0, 180), Wn = C.hasAttribute("contenteditable") && (E.length > 0 || !C.querySelector("[contenteditable]")), Js = d.some((q) => C.hasAttribute(q)) || !!M || Wn, Et = (C.getClientRects().length > 0 || Q.display === "contents") && (t.has(B) || Js || R) && (Tt || R) && (!n.has(B) || Tt || Js || R), kt = Et ? 1 : 0, Ce = [];
|
|
10673
10693
|
if (Et) {
|
|
10674
|
-
const q = Ve.some((
|
|
10694
|
+
const q = Ve.some((ue) => ue.containsTextElement), N = i.has(B) && !q ? Gs : E;
|
|
10675
10695
|
Ce.push(En(C, c, a, N.slice(0, 180)));
|
|
10676
10696
|
}
|
|
10677
10697
|
for (const q of Rt)
|
|
@@ -10682,8 +10702,8 @@ function xc(s, e) {
|
|
|
10682
10702
|
qt.length > q.length && q.push("… shadow DOM omitted");
|
|
10683
10703
|
const N = B.includes("tooltip") || B.includes("popper") || B.includes("loader");
|
|
10684
10704
|
if (H < 2 && !N) {
|
|
10685
|
-
const
|
|
10686
|
-
Ce.push(...et([
|
|
10705
|
+
const ue = Et ? "#shadow-root" : `${B} #shadow-root`;
|
|
10706
|
+
Ce.push(...et([ue, ...et(q, 1)], kt));
|
|
10687
10707
|
} else
|
|
10688
10708
|
Ce.push(...et(q, kt));
|
|
10689
10709
|
}
|
|
@@ -10698,7 +10718,7 @@ function xc(s, e) {
|
|
|
10698
10718
|
`);
|
|
10699
10719
|
}, g = [], b = Ee(window.getSelection()?.toString() ?? "");
|
|
10700
10720
|
b && g.push(`--- selected text ---
|
|
10701
|
-
${JSON.stringify(b)}`), u.length > 0 && g.push(
|
|
10721
|
+
${JSON.stringify(b)}`), u.length > 0 && g.push(Nc(u, t, c, a));
|
|
10702
10722
|
for (const v of s.slice(0, 3))
|
|
10703
10723
|
g.push(y(v, "active overlay DOM", /* @__PURE__ */ new Set()));
|
|
10704
10724
|
if (e && g.push(y(e, "main DOM", /* @__PURE__ */ new Set())), document.body) {
|
|
@@ -10713,7 +10733,7 @@ function En(s, e, t, i) {
|
|
|
10713
10733
|
const n = s.tagName.toLowerCase();
|
|
10714
10734
|
let r = n;
|
|
10715
10735
|
const a = s.getAttribute("id");
|
|
10716
|
-
a &&
|
|
10736
|
+
a && Bc(a) && (r += `#${a}`);
|
|
10717
10737
|
for (const o of e) {
|
|
10718
10738
|
const c = s.getAttribute(o);
|
|
10719
10739
|
c && c.length <= 160 && (o !== "role" || !t.has(c)) && (r += `[${o}=${JSON.stringify(c)}]`);
|
|
@@ -10726,7 +10746,7 @@ function En(s, e, t, i) {
|
|
|
10726
10746
|
s.hasAttribute(o) && (r += `[${o}]`);
|
|
10727
10747
|
return `${r}${i ? ` ${JSON.stringify(i)}` : ""}`;
|
|
10728
10748
|
}
|
|
10729
|
-
function
|
|
10749
|
+
function Uc() {
|
|
10730
10750
|
const s = /* @__PURE__ */ new Set(), e = /* @__PURE__ */ new Map(), t = (o, c) => {
|
|
10731
10751
|
if (!o)
|
|
10732
10752
|
return;
|
|
@@ -10769,7 +10789,7 @@ function Dc() {
|
|
|
10769
10789
|
priorityTargets: Array.from(e, ([o, c]) => ({ element: o, labels: Array.from(c) }))
|
|
10770
10790
|
};
|
|
10771
10791
|
}
|
|
10772
|
-
function
|
|
10792
|
+
function Nc(s, e, t, i) {
|
|
10773
10793
|
const n = ["--- active/current elements ---"];
|
|
10774
10794
|
for (const r of s) {
|
|
10775
10795
|
const a = [];
|
|
@@ -10805,12 +10825,12 @@ function kn(s) {
|
|
|
10805
10825
|
Array.from(s.childNodes).filter((e) => e.nodeType === Node.TEXT_NODE).map((e) => e.textContent ?? "").join(" ")
|
|
10806
10826
|
);
|
|
10807
10827
|
}
|
|
10808
|
-
function
|
|
10828
|
+
function Bc(s) {
|
|
10809
10829
|
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);
|
|
10810
10830
|
}
|
|
10811
10831
|
function qn() {
|
|
10812
10832
|
const s = Array.from(document.querySelectorAll(Ei)), e = s.find(
|
|
10813
|
-
(r) => typeof r[
|
|
10833
|
+
(r) => typeof r[Ha] == "string"
|
|
10814
10834
|
);
|
|
10815
10835
|
if (!(e ?? s[0]))
|
|
10816
10836
|
return;
|
|
@@ -10826,23 +10846,23 @@ function qn() {
|
|
|
10826
10846
|
},
|
|
10827
10847
|
{
|
|
10828
10848
|
name: "widget_root",
|
|
10829
|
-
selector:
|
|
10849
|
+
selector: $a,
|
|
10830
10850
|
description: "Finds Pluno's widget root inside the widget host shadow root."
|
|
10831
10851
|
},
|
|
10832
10852
|
{
|
|
10833
10853
|
name: "widget_panel",
|
|
10834
|
-
selector:
|
|
10854
|
+
selector: Fa,
|
|
10835
10855
|
description: "Finds Pluno's open chat panel inside the widget host shadow root."
|
|
10836
10856
|
},
|
|
10837
10857
|
{
|
|
10838
10858
|
name: "widget_timeline",
|
|
10839
|
-
selector:
|
|
10859
|
+
selector: za,
|
|
10840
10860
|
description: "Finds Pluno's chat timeline inside the widget host shadow root."
|
|
10841
10861
|
}
|
|
10842
10862
|
]
|
|
10843
10863
|
};
|
|
10844
10864
|
}
|
|
10845
|
-
function
|
|
10865
|
+
function jc(s) {
|
|
10846
10866
|
if (s.runtimeContext !== void 0) {
|
|
10847
10867
|
if (!s.runtimeContext || typeof s.runtimeContext != "object" || Array.isArray(s.runtimeContext)) return !1;
|
|
10848
10868
|
const e = s.runtimeContext;
|
|
@@ -10870,10 +10890,10 @@ function xi(s, e) {
|
|
|
10870
10890
|
const t = s[e];
|
|
10871
10891
|
return Array.isArray(t) ? t.filter((i) => typeof i == "string" && i.trim().length > 0) : [];
|
|
10872
10892
|
}
|
|
10873
|
-
function
|
|
10893
|
+
function Lc(s) {
|
|
10874
10894
|
return Array.isArray(s) ? s.filter((e) => typeof e == "string" && e.trim().length > 0) : [];
|
|
10875
10895
|
}
|
|
10876
|
-
function
|
|
10896
|
+
function $c(s) {
|
|
10877
10897
|
if (!s || typeof s != "object")
|
|
10878
10898
|
return null;
|
|
10879
10899
|
const e = s, t = e.appearance, i = t && typeof t == "object" ? t : e, n = typeof i.accentColor == "string" ? i.accentColor : null, r = i.colorScheme === "dark" ? "dark" : i.colorScheme === "light" ? "light" : null, a = typeof i.fontFamily == "string" && i.fontFamily.trim() ? i.fontFamily : null, o = typeof i.scribbleStyle == "boolean" ? i.scribbleStyle : null;
|
|
@@ -10884,13 +10904,13 @@ function Lc(s) {
|
|
|
10884
10904
|
...o !== null ? { scribbleStyle: o } : {}
|
|
10885
10905
|
};
|
|
10886
10906
|
}
|
|
10887
|
-
function
|
|
10907
|
+
function Fc(s) {
|
|
10888
10908
|
if (!s || typeof s != "object")
|
|
10889
10909
|
return null;
|
|
10890
10910
|
const e = s.javascript;
|
|
10891
10911
|
return typeof e != "string" || !e.trim() ? null : { javascript: e };
|
|
10892
10912
|
}
|
|
10893
|
-
function
|
|
10913
|
+
function zc(s, e) {
|
|
10894
10914
|
return e ? s && typeof s == "object" ? {
|
|
10895
10915
|
...s,
|
|
10896
10916
|
helperError: e
|
|
@@ -10900,13 +10920,13 @@ function Fc(s, e) {
|
|
|
10900
10920
|
helperError: e
|
|
10901
10921
|
} : s;
|
|
10902
10922
|
}
|
|
10903
|
-
function
|
|
10923
|
+
function Hc(s) {
|
|
10904
10924
|
if (!s || typeof s != "object")
|
|
10905
10925
|
return s;
|
|
10906
10926
|
const e = s;
|
|
10907
10927
|
return typeof e.exception?.message == "string" ? e.exception.message : typeof e.error == "string" ? e.error : s;
|
|
10908
10928
|
}
|
|
10909
|
-
function
|
|
10929
|
+
function Kc() {
|
|
10910
10930
|
const s = "pluno.productAgent.clientId", e = window.localStorage.getItem(s);
|
|
10911
10931
|
if (e)
|
|
10912
10932
|
return e;
|
|
@@ -10927,8 +10947,8 @@ function Di(s) {
|
|
|
10927
10947
|
avatarUrl: typeof e.avatarUrl == "string" ? e.avatarUrl : null
|
|
10928
10948
|
} : null;
|
|
10929
10949
|
}
|
|
10930
|
-
function
|
|
10931
|
-
return Array.isArray(s) ?
|
|
10950
|
+
function el(s, e) {
|
|
10951
|
+
return Array.isArray(s) ? Yc(
|
|
10932
10952
|
s.map((t) => Mn(t, e)).filter((t) => t !== null)
|
|
10933
10953
|
) : [];
|
|
10934
10954
|
}
|
|
@@ -10939,7 +10959,7 @@ function Mn(s, e) {
|
|
|
10939
10959
|
if (!i || typeof i != "object")
|
|
10940
10960
|
return null;
|
|
10941
10961
|
const n = i;
|
|
10942
|
-
if (n.hiddenFromTranscript === !0 ||
|
|
10962
|
+
if (n.hiddenFromTranscript === !0 || fa(n) || n.type === "tab_lifecycle_decision" && n.decision === "keep")
|
|
10943
10963
|
return null;
|
|
10944
10964
|
if (n.type === "assistant_draft")
|
|
10945
10965
|
return {
|
|
@@ -10952,8 +10972,8 @@ function Mn(s, e) {
|
|
|
10952
10972
|
),
|
|
10953
10973
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
10954
10974
|
...F(n) !== null ? { displaySequence: F(n) } : {},
|
|
10955
|
-
...
|
|
10956
|
-
respondsToUserMessageId:
|
|
10975
|
+
...X(n) !== null ? { causalSequence: X(n) } : {},
|
|
10976
|
+
respondsToUserMessageId: he(n) ?? void 0,
|
|
10957
10977
|
...z(n) ? { runId: z(n) } : {},
|
|
10958
10978
|
dataType: "assistant_draft",
|
|
10959
10979
|
...n.steered === !0 ? { steered: !0 } : {}
|
|
@@ -10969,8 +10989,8 @@ function Mn(s, e) {
|
|
|
10969
10989
|
),
|
|
10970
10990
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
10971
10991
|
...F(n) !== null ? { displaySequence: F(n) } : {},
|
|
10972
|
-
...
|
|
10973
|
-
respondsToUserMessageId:
|
|
10992
|
+
...X(n) !== null ? { causalSequence: X(n) } : {},
|
|
10993
|
+
respondsToUserMessageId: he(n) ?? void 0,
|
|
10974
10994
|
...z(n) ? { runId: z(n) } : {},
|
|
10975
10995
|
attachments: Pn(n.attachments, e),
|
|
10976
10996
|
...n.steered === !0 ? { steered: !0 } : {}
|
|
@@ -10987,7 +11007,7 @@ function Mn(s, e) {
|
|
|
10987
11007
|
}), a;
|
|
10988
11008
|
}
|
|
10989
11009
|
if (n.type === "function_call_output") {
|
|
10990
|
-
const r =
|
|
11010
|
+
const r = la(n.output);
|
|
10991
11011
|
if (r !== null)
|
|
10992
11012
|
return {
|
|
10993
11013
|
id: String(t.id ?? crypto.randomUUID()),
|
|
@@ -10995,14 +11015,14 @@ function Mn(s, e) {
|
|
|
10995
11015
|
content: "",
|
|
10996
11016
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
10997
11017
|
...F(n) !== null ? { displaySequence: F(n) } : {},
|
|
10998
|
-
respondsToUserMessageId:
|
|
11018
|
+
respondsToUserMessageId: he(n) ?? void 0,
|
|
10999
11019
|
...z(n) ? { runId: z(n) } : {},
|
|
11000
11020
|
dataType: "function_call_output",
|
|
11001
11021
|
toolName: Bs,
|
|
11002
11022
|
callId: De(n) ?? void 0,
|
|
11003
11023
|
sharePromptAllowed: r
|
|
11004
11024
|
};
|
|
11005
|
-
const a =
|
|
11025
|
+
const a = Ra(n.output);
|
|
11006
11026
|
if (a)
|
|
11007
11027
|
return {
|
|
11008
11028
|
id: String(t.id ?? crypto.randomUUID()),
|
|
@@ -11010,7 +11030,7 @@ function Mn(s, e) {
|
|
|
11010
11030
|
content: "",
|
|
11011
11031
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
11012
11032
|
...F(n) !== null ? { displaySequence: F(n) } : {},
|
|
11013
|
-
respondsToUserMessageId:
|
|
11033
|
+
respondsToUserMessageId: he(n) ?? void 0,
|
|
11014
11034
|
...z(n) ? { runId: z(n) } : {},
|
|
11015
11035
|
dataType: "scheduled_check_in",
|
|
11016
11036
|
toolName: _n,
|
|
@@ -11018,15 +11038,15 @@ function Mn(s, e) {
|
|
|
11018
11038
|
scheduledCheckInId: a.id ?? void 0,
|
|
11019
11039
|
scheduledCheckInAt: a.dueAt
|
|
11020
11040
|
};
|
|
11021
|
-
const o =
|
|
11041
|
+
const o = Vc(n.output), c = Gc(n.output);
|
|
11022
11042
|
return o ? {
|
|
11023
11043
|
id: String(t.id ?? crypto.randomUUID()),
|
|
11024
11044
|
role: "tool",
|
|
11025
11045
|
content: `Connect ${o.appName} to continue`,
|
|
11026
11046
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
11027
11047
|
...F(n) !== null ? { displaySequence: F(n) } : {},
|
|
11028
|
-
...
|
|
11029
|
-
respondsToUserMessageId:
|
|
11048
|
+
...X(n) !== null ? { causalSequence: X(n) } : {},
|
|
11049
|
+
respondsToUserMessageId: he(n) ?? void 0,
|
|
11030
11050
|
...z(n) ? { runId: z(n) } : {},
|
|
11031
11051
|
dataType: "function_call_output",
|
|
11032
11052
|
toolName: "authenticate_pipedream_app",
|
|
@@ -11038,8 +11058,8 @@ function Mn(s, e) {
|
|
|
11038
11058
|
content: "Connect WhatsApp to continue",
|
|
11039
11059
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
11040
11060
|
...F(n) !== null ? { displaySequence: F(n) } : {},
|
|
11041
|
-
...
|
|
11042
|
-
respondsToUserMessageId:
|
|
11061
|
+
...X(n) !== null ? { causalSequence: X(n) } : {},
|
|
11062
|
+
respondsToUserMessageId: he(n) ?? void 0,
|
|
11043
11063
|
...z(n) ? { runId: z(n) } : {},
|
|
11044
11064
|
dataType: "function_call_output",
|
|
11045
11065
|
toolName: "request_personal_channel_connection",
|
|
@@ -11050,11 +11070,11 @@ function Mn(s, e) {
|
|
|
11050
11070
|
return n.type === "function_call" || n.type === "tool_call" || n.type === "web_search_call" || n.type === "mcp_call" || n.type === "tab_lifecycle_decision" ? {
|
|
11051
11071
|
id: String(t.id ?? crypto.randomUUID()),
|
|
11052
11072
|
role: "tool",
|
|
11053
|
-
content: n.type === "mcp_call" ?
|
|
11073
|
+
content: n.type === "mcp_call" ? Wc(n) : Qc(n),
|
|
11054
11074
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
11055
11075
|
...F(n) !== null ? { displaySequence: F(n) } : {},
|
|
11056
|
-
...
|
|
11057
|
-
respondsToUserMessageId:
|
|
11076
|
+
...X(n) !== null ? { causalSequence: X(n) } : {},
|
|
11077
|
+
respondsToUserMessageId: he(n) ?? void 0,
|
|
11058
11078
|
...z(n) ? { runId: z(n) } : {},
|
|
11059
11079
|
dataType: String(n.type),
|
|
11060
11080
|
toolName: n.type === "tab_lifecycle_decision" ? "tab_lifecycle_decision" : typeof n.name == "string" ? n.name : void 0,
|
|
@@ -11064,11 +11084,11 @@ function Mn(s, e) {
|
|
|
11064
11084
|
} : n.type === "run_status" || n.type === "run_error" ? n.type === "run_error" && n.stage === "tool_execution" ? null : {
|
|
11065
11085
|
id: String(t.id ?? crypto.randomUUID()),
|
|
11066
11086
|
role: "system",
|
|
11067
|
-
content:
|
|
11087
|
+
content: Jc(n),
|
|
11068
11088
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
11069
11089
|
...F(n) !== null ? { displaySequence: F(n) } : {},
|
|
11070
|
-
...
|
|
11071
|
-
respondsToUserMessageId:
|
|
11090
|
+
...X(n) !== null ? { causalSequence: X(n) } : {},
|
|
11091
|
+
respondsToUserMessageId: he(n) ?? void 0,
|
|
11072
11092
|
...z(n) ? { runId: z(n) } : {},
|
|
11073
11093
|
dataType: String(n.type),
|
|
11074
11094
|
loading: n.steered !== !0 && n.type === "run_status" && (n.status === "running" || n.status === "retrying"),
|
|
@@ -11077,11 +11097,11 @@ function Mn(s, e) {
|
|
|
11077
11097
|
...typeof n.securitySettingsUrl == "string" ? { securitySettingsUrl: n.securitySettingsUrl } : {}
|
|
11078
11098
|
} : null;
|
|
11079
11099
|
}
|
|
11080
|
-
function
|
|
11100
|
+
function Wc(s) {
|
|
11081
11101
|
const t = (typeof s.server_label == "string" ? s.server_label : "").replace(/^pipedream_/, "").split(/[_-]+/).filter(Boolean).map((i) => `${i.charAt(0).toUpperCase()}${i.slice(1)}`).join(" ");
|
|
11082
11102
|
return t ? `🔌 Using ${t}` : "🔌 Using connected integration";
|
|
11083
11103
|
}
|
|
11084
|
-
function
|
|
11104
|
+
function Vc(s) {
|
|
11085
11105
|
if (typeof s != "string")
|
|
11086
11106
|
return null;
|
|
11087
11107
|
try {
|
|
@@ -11098,7 +11118,7 @@ function Wc(s) {
|
|
|
11098
11118
|
return null;
|
|
11099
11119
|
}
|
|
11100
11120
|
}
|
|
11101
|
-
function
|
|
11121
|
+
function Gc(s) {
|
|
11102
11122
|
if (typeof s != "string")
|
|
11103
11123
|
return null;
|
|
11104
11124
|
try {
|
|
@@ -11113,10 +11133,10 @@ function Vc(s) {
|
|
|
11113
11133
|
return null;
|
|
11114
11134
|
}
|
|
11115
11135
|
}
|
|
11116
|
-
function
|
|
11136
|
+
function Jc(s) {
|
|
11117
11137
|
return s.type === "run_status" && s.status === "steered" ? "Steered" : typeof s.message == "string" && s.message.trim().length > 0 ? s.message : "";
|
|
11118
11138
|
}
|
|
11119
|
-
function
|
|
11139
|
+
function Qc(s) {
|
|
11120
11140
|
if (s.type === "web_search_call") {
|
|
11121
11141
|
const e = s.action;
|
|
11122
11142
|
if (e && typeof e == "object") {
|
|
@@ -11128,9 +11148,9 @@ function Jc(s) {
|
|
|
11128
11148
|
}
|
|
11129
11149
|
return "🔎 Searching the web";
|
|
11130
11150
|
}
|
|
11131
|
-
return
|
|
11151
|
+
return Xc(s);
|
|
11132
11152
|
}
|
|
11133
|
-
function
|
|
11153
|
+
function Xc(s) {
|
|
11134
11154
|
if (typeof s.summary == "string" && s.summary.trim().length > 0)
|
|
11135
11155
|
return Be(s.summary);
|
|
11136
11156
|
if (typeof s.arguments == "string")
|
|
@@ -11151,7 +11171,7 @@ function De(s) {
|
|
|
11151
11171
|
const e = s.callId ?? s.call_id;
|
|
11152
11172
|
return typeof e == "string" && e ? e : null;
|
|
11153
11173
|
}
|
|
11154
|
-
function
|
|
11174
|
+
function X(s) {
|
|
11155
11175
|
return typeof s.causalSequence == "number" && Number.isSafeInteger(s.causalSequence) ? s.causalSequence : null;
|
|
11156
11176
|
}
|
|
11157
11177
|
function F(s) {
|
|
@@ -11165,25 +11185,25 @@ function Ui(s) {
|
|
|
11165
11185
|
return typeof t.text == "string" ? t.text : typeof t.content == "string" ? t.content : "";
|
|
11166
11186
|
}).filter(Boolean).join("") : "";
|
|
11167
11187
|
}
|
|
11168
|
-
function Xc(s) {
|
|
11169
|
-
return s.filter((e, t) => zs(e) ? !rd(s, t) && !Zc(s, t) && !id(s, t) && !nd(s, t) : Yc(e) ? e.retryable === !0 && sd(s, t) ? !1 : !td(s, t) : !0);
|
|
11170
|
-
}
|
|
11171
11188
|
function Yc(s) {
|
|
11189
|
+
return s.filter((e, t) => zs(e) ? !od(s, t) && !ed(s, t) && !nd(s, t) && !rd(s, t) : Zc(e) ? e.retryable === !0 && id(s, t) ? !1 : !sd(s, t) : !0);
|
|
11190
|
+
}
|
|
11191
|
+
function Zc(s) {
|
|
11172
11192
|
return s.role === "system" && (s.dataType === "run_error" || s.dataType === "run_status" && s.steered !== !0);
|
|
11173
11193
|
}
|
|
11174
11194
|
function zs(s) {
|
|
11175
11195
|
return s.role === "system" && s.dataType === "run_status" && s.loading === !0;
|
|
11176
11196
|
}
|
|
11177
|
-
function
|
|
11197
|
+
function ed(s, e) {
|
|
11178
11198
|
return s.some(
|
|
11179
|
-
(t, i) => i !== e && t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.loading !== !0 && t.steered !== !0) &&
|
|
11199
|
+
(t, i) => i !== e && t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.loading !== !0 && t.steered !== !0) && td(
|
|
11180
11200
|
s,
|
|
11181
11201
|
e,
|
|
11182
11202
|
i
|
|
11183
11203
|
)
|
|
11184
11204
|
);
|
|
11185
11205
|
}
|
|
11186
|
-
function
|
|
11206
|
+
function td(s, e, t) {
|
|
11187
11207
|
const i = s[e], n = s[t];
|
|
11188
11208
|
if (Ke(i, n))
|
|
11189
11209
|
return !0;
|
|
@@ -11194,7 +11214,7 @@ function ed(s, e, t) {
|
|
|
11194
11214
|
return s[r].id === i.respondsToUserMessageId;
|
|
11195
11215
|
return !1;
|
|
11196
11216
|
}
|
|
11197
|
-
function
|
|
11217
|
+
function sd(s, e) {
|
|
11198
11218
|
const t = s[e];
|
|
11199
11219
|
for (let i = e + 1; i < s.length; i += 1) {
|
|
11200
11220
|
const n = s[i];
|
|
@@ -11203,7 +11223,7 @@ function td(s, e) {
|
|
|
11203
11223
|
}
|
|
11204
11224
|
return !1;
|
|
11205
11225
|
}
|
|
11206
|
-
function
|
|
11226
|
+
function id(s, e) {
|
|
11207
11227
|
const t = s[e];
|
|
11208
11228
|
if (!t.respondsToUserMessageId)
|
|
11209
11229
|
return !1;
|
|
@@ -11216,19 +11236,19 @@ function sd(s, e) {
|
|
|
11216
11236
|
}
|
|
11217
11237
|
return !1;
|
|
11218
11238
|
}
|
|
11219
|
-
function
|
|
11239
|
+
function nd(s, e) {
|
|
11220
11240
|
const t = s[e];
|
|
11221
11241
|
return s.some(
|
|
11222
11242
|
(i, n) => n !== e && i.role === "assistant" && Ke(t, i)
|
|
11223
11243
|
);
|
|
11224
11244
|
}
|
|
11225
|
-
function
|
|
11245
|
+
function rd(s, e) {
|
|
11226
11246
|
const t = s[e];
|
|
11227
11247
|
return s.some(
|
|
11228
11248
|
(i, n) => n !== e && i.role === "tool" && Ke(t, i)
|
|
11229
11249
|
);
|
|
11230
11250
|
}
|
|
11231
|
-
function
|
|
11251
|
+
function od(s, e) {
|
|
11232
11252
|
const t = s[e];
|
|
11233
11253
|
for (let i = e + 1; i < s.length; i += 1)
|
|
11234
11254
|
if (zs(s[i]) && Ke(t, s[i]))
|
|
@@ -11241,15 +11261,15 @@ function Ke(s, e) {
|
|
|
11241
11261
|
function es(s, e) {
|
|
11242
11262
|
return s && typeof s == "object" && typeof s[e] == "string" ? s[e] : null;
|
|
11243
11263
|
}
|
|
11244
|
-
function
|
|
11264
|
+
function ad(s, e) {
|
|
11245
11265
|
try {
|
|
11246
|
-
const t = window.localStorage.getItem(`${
|
|
11266
|
+
const t = window.localStorage.getItem(`${ac}${s}`);
|
|
11247
11267
|
if (!t)
|
|
11248
11268
|
return null;
|
|
11249
11269
|
const i = JSON.parse(t), n = typeof i.sessionId == "string" ? i.sessionId : null;
|
|
11250
11270
|
if (e !== void 0 && n !== e)
|
|
11251
11271
|
return null;
|
|
11252
|
-
const r = Array.isArray(i.messages) ? i.messages.map(
|
|
11272
|
+
const r = Array.isArray(i.messages) ? i.messages.map(yd).filter((a) => !!a) : [];
|
|
11253
11273
|
return {
|
|
11254
11274
|
sessionId: n,
|
|
11255
11275
|
messages: r
|
|
@@ -11258,7 +11278,7 @@ function od(s, e) {
|
|
|
11258
11278
|
return null;
|
|
11259
11279
|
}
|
|
11260
11280
|
}
|
|
11261
|
-
function
|
|
11281
|
+
function cd(s) {
|
|
11262
11282
|
try {
|
|
11263
11283
|
const e = window.localStorage.getItem(`${Ss}${s}`);
|
|
11264
11284
|
if (!e)
|
|
@@ -11309,19 +11329,19 @@ function Ni(s, e) {
|
|
|
11309
11329
|
}
|
|
11310
11330
|
On(s, e);
|
|
11311
11331
|
}
|
|
11312
|
-
function
|
|
11332
|
+
function dd(s) {
|
|
11313
11333
|
try {
|
|
11314
11334
|
const e = `${wt}${s}`, t = window.sessionStorage.getItem(e);
|
|
11315
11335
|
if (window.sessionStorage.removeItem(e), !t)
|
|
11316
11336
|
return [];
|
|
11317
11337
|
const i = JSON.parse(t);
|
|
11318
|
-
return Array.isArray(i) ? i.flatMap((n) =>
|
|
11338
|
+
return Array.isArray(i) ? i.flatMap((n) => ud(n) ? [{
|
|
11319
11339
|
...n.event,
|
|
11320
|
-
page:
|
|
11340
|
+
page: te(),
|
|
11321
11341
|
rawOutput: {
|
|
11322
11342
|
pageContextRestarted: !0,
|
|
11323
11343
|
outcome: "unknown",
|
|
11324
|
-
message:
|
|
11344
|
+
message: ld(location.href),
|
|
11325
11345
|
currentUrl: location.href,
|
|
11326
11346
|
console: [],
|
|
11327
11347
|
metadata: {
|
|
@@ -11338,17 +11358,17 @@ function cd(s) {
|
|
|
11338
11358
|
return [];
|
|
11339
11359
|
}
|
|
11340
11360
|
}
|
|
11341
|
-
function
|
|
11361
|
+
function ld(s) {
|
|
11342
11362
|
return `The page context restarted. This is expected when the action included page navigation. Otherwise, it's unknown whether the action completed.
|
|
11343
11363
|
Current URL: ${s}`;
|
|
11344
11364
|
}
|
|
11345
|
-
function
|
|
11365
|
+
function ud(s) {
|
|
11346
11366
|
if (!s || typeof s != "object")
|
|
11347
11367
|
return !1;
|
|
11348
11368
|
const e = s, t = e.event;
|
|
11349
11369
|
return typeof e.startedAtMs == "number" && typeof e.startedAtUrl == "string" && e.startedAtOrigin === location.origin && e.unloadOrigin === location.origin && typeof e.unloadUrl == "string" && Hs(t) && t.type === "tool.result";
|
|
11350
11370
|
}
|
|
11351
|
-
function
|
|
11371
|
+
function hd(s, e) {
|
|
11352
11372
|
const t = new Set(
|
|
11353
11373
|
s.flatMap((i) => i.type === "tool.result" ? [i.callId] : [])
|
|
11354
11374
|
);
|
|
@@ -11357,7 +11377,7 @@ function ud(s, e) {
|
|
|
11357
11377
|
...e.filter((i) => !t.has(i.callId))
|
|
11358
11378
|
];
|
|
11359
11379
|
}
|
|
11360
|
-
function
|
|
11380
|
+
function pd(s) {
|
|
11361
11381
|
try {
|
|
11362
11382
|
window.sessionStorage.removeItem(`${wt}${s}`);
|
|
11363
11383
|
} catch {
|
|
@@ -11394,9 +11414,9 @@ function xn(s, e) {
|
|
|
11394
11414
|
} : s;
|
|
11395
11415
|
}
|
|
11396
11416
|
function Dn(s) {
|
|
11397
|
-
return s.type ||
|
|
11417
|
+
return s.type || gd(s.name) || "application/octet-stream";
|
|
11398
11418
|
}
|
|
11399
|
-
function
|
|
11419
|
+
function fd(s) {
|
|
11400
11420
|
Un({
|
|
11401
11421
|
name: s.name,
|
|
11402
11422
|
mimeType: Dn(s),
|
|
@@ -11404,21 +11424,21 @@ function pd(s) {
|
|
|
11404
11424
|
});
|
|
11405
11425
|
}
|
|
11406
11426
|
function Un(s) {
|
|
11407
|
-
const e =
|
|
11408
|
-
if (!
|
|
11427
|
+
const e = md(s.name), t = s.mimeType.trim().toLowerCase();
|
|
11428
|
+
if (!nc.has(`${e}:${t}`))
|
|
11409
11429
|
throw new Error("This attachment type is not supported by the embedded model provider");
|
|
11410
11430
|
if (s.sizeBytes <= 0 || s.sizeBytes >= Rn)
|
|
11411
11431
|
throw new Error("Embedded attachments must be between 1 byte and less than 50 MB");
|
|
11412
11432
|
}
|
|
11413
|
-
function
|
|
11433
|
+
function md(s) {
|
|
11414
11434
|
const e = s.trim().toLowerCase(), t = e.lastIndexOf(".");
|
|
11415
11435
|
return t >= 0 ? e.slice(t) : "";
|
|
11416
11436
|
}
|
|
11417
|
-
function
|
|
11437
|
+
function gd(s) {
|
|
11418
11438
|
const e = s.toLowerCase();
|
|
11419
11439
|
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;
|
|
11420
11440
|
}
|
|
11421
|
-
function
|
|
11441
|
+
function yd(s) {
|
|
11422
11442
|
if (!s || typeof s != "object")
|
|
11423
11443
|
return null;
|
|
11424
11444
|
const e = s;
|
|
@@ -11436,11 +11456,11 @@ function gd(s) {
|
|
|
11436
11456
|
scheduledCheckInId: typeof e.scheduledCheckInId == "string" ? e.scheduledCheckInId : void 0,
|
|
11437
11457
|
scheduledCheckInAt: typeof e.scheduledCheckInAt == "string" ? e.scheduledCheckInAt : void 0,
|
|
11438
11458
|
securitySettingsUrl: typeof e.securitySettingsUrl == "string" ? e.securitySettingsUrl : void 0,
|
|
11439
|
-
attachments: Pn(e.attachments)?.map(
|
|
11459
|
+
attachments: Pn(e.attachments)?.map(vd),
|
|
11440
11460
|
loading: typeof e.loading == "boolean" ? e.loading : void 0
|
|
11441
11461
|
};
|
|
11442
11462
|
}
|
|
11443
|
-
function
|
|
11463
|
+
function vd(s) {
|
|
11444
11464
|
const {
|
|
11445
11465
|
dataUrl: e,
|
|
11446
11466
|
objectUrl: t,
|
|
@@ -11450,7 +11470,7 @@ function yd(s) {
|
|
|
11450
11470
|
} = s;
|
|
11451
11471
|
return r;
|
|
11452
11472
|
}
|
|
11453
|
-
function
|
|
11473
|
+
function he(s) {
|
|
11454
11474
|
const e = s.respondsToUserMessageId;
|
|
11455
11475
|
return typeof e == "string" && e ? e : null;
|
|
11456
11476
|
}
|
|
@@ -11458,9 +11478,9 @@ function z(s) {
|
|
|
11458
11478
|
const e = s.runId;
|
|
11459
11479
|
return typeof e == "string" && e ? e : null;
|
|
11460
11480
|
}
|
|
11461
|
-
function
|
|
11481
|
+
function Id(s) {
|
|
11462
11482
|
const e = s?.timeoutMs;
|
|
11463
|
-
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 <=
|
|
11483
|
+
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 <= fc);
|
|
11464
11484
|
}
|
|
11465
11485
|
function Nn(s) {
|
|
11466
11486
|
const e = {};
|
|
@@ -11474,22 +11494,22 @@ function Nn(s) {
|
|
|
11474
11494
|
return e;
|
|
11475
11495
|
}
|
|
11476
11496
|
function Ks(s, e) {
|
|
11477
|
-
return Hn(s) ? St :
|
|
11497
|
+
return Hn(s) ? St : ce(gt(e), rc);
|
|
11478
11498
|
}
|
|
11479
|
-
function
|
|
11499
|
+
function bd(s, e) {
|
|
11480
11500
|
return typeof s == "string" ? s : s instanceof URL ? s.toString() : e?.url ?? "";
|
|
11481
11501
|
}
|
|
11482
|
-
async function
|
|
11502
|
+
async function wd(s, e, t, i) {
|
|
11483
11503
|
const n = Nn(s.headers);
|
|
11484
11504
|
i({
|
|
11485
11505
|
...e,
|
|
11486
11506
|
responseStatus: s.status,
|
|
11487
11507
|
responseHeaders: n,
|
|
11488
|
-
responseBody: await
|
|
11508
|
+
responseBody: await _d(s),
|
|
11489
11509
|
durationMs: Date.now() - t
|
|
11490
11510
|
});
|
|
11491
11511
|
}
|
|
11492
|
-
async function
|
|
11512
|
+
async function _d(s) {
|
|
11493
11513
|
if (!Bn(s.headers))
|
|
11494
11514
|
return;
|
|
11495
11515
|
let e = null, t = null;
|
|
@@ -11499,7 +11519,7 @@ async function wd(s) {
|
|
|
11499
11519
|
const i = new Promise((o) => {
|
|
11500
11520
|
t = window.setTimeout(() => {
|
|
11501
11521
|
e?.cancel(), o("timeout");
|
|
11502
|
-
},
|
|
11522
|
+
}, oc);
|
|
11503
11523
|
}), n = new TextDecoder();
|
|
11504
11524
|
let r = "", a = 0;
|
|
11505
11525
|
for (; ; ) {
|
|
@@ -11508,10 +11528,10 @@ async function wd(s) {
|
|
|
11508
11528
|
return;
|
|
11509
11529
|
const { done: c, value: d } = o;
|
|
11510
11530
|
if (c)
|
|
11511
|
-
return
|
|
11531
|
+
return ce(r + n.decode());
|
|
11512
11532
|
const l = Ls - a;
|
|
11513
11533
|
if (d.byteLength > l)
|
|
11514
|
-
return r += n.decode(d.subarray(0, Math.max(l, 0)), { stream: !0 }), e.cancel(), `${
|
|
11534
|
+
return r += n.decode(d.subarray(0, Math.max(l, 0)), { stream: !0 }), e.cancel(), `${ce(r)}... [truncated]`;
|
|
11515
11535
|
a += d.byteLength, r += n.decode(d, { stream: !0 });
|
|
11516
11536
|
}
|
|
11517
11537
|
} catch {
|
|
@@ -11521,20 +11541,20 @@ async function wd(s) {
|
|
|
11521
11541
|
t !== null && window.clearTimeout(t);
|
|
11522
11542
|
}
|
|
11523
11543
|
}
|
|
11524
|
-
function
|
|
11544
|
+
function Sd(s, e) {
|
|
11525
11545
|
if (Bn(new Headers(e)))
|
|
11526
11546
|
try {
|
|
11527
|
-
return s.responseType === "" || s.responseType === "text" ?
|
|
11547
|
+
return s.responseType === "" || s.responseType === "text" ? ce(s.responseText ?? "") : void 0;
|
|
11528
11548
|
} catch {
|
|
11529
11549
|
return;
|
|
11530
11550
|
}
|
|
11531
11551
|
}
|
|
11532
11552
|
function ji(s) {
|
|
11533
11553
|
if (typeof s == "string")
|
|
11534
|
-
return
|
|
11554
|
+
return ce(s);
|
|
11535
11555
|
}
|
|
11536
|
-
function
|
|
11537
|
-
return
|
|
11556
|
+
function Rd(s) {
|
|
11557
|
+
return Y({
|
|
11538
11558
|
...s,
|
|
11539
11559
|
requestBody: Li(s.requestBody),
|
|
11540
11560
|
responseBody: Li(s.responseBody)
|
|
@@ -11547,7 +11567,7 @@ function Li(s) {
|
|
|
11547
11567
|
if (!e.startsWith("{") && !e.startsWith("["))
|
|
11548
11568
|
return gt(s);
|
|
11549
11569
|
try {
|
|
11550
|
-
return JSON.stringify(
|
|
11570
|
+
return JSON.stringify(Y(JSON.parse(s)));
|
|
11551
11571
|
} catch {
|
|
11552
11572
|
return gt(s);
|
|
11553
11573
|
}
|
|
@@ -11559,7 +11579,7 @@ function Bn(s) {
|
|
|
11559
11579
|
return t !== null && Number.isInteger(i) && i >= 0 && i <= Ls && (e.startsWith("text/") || e.includes("json") || e.includes("javascript"));
|
|
11560
11580
|
}
|
|
11561
11581
|
function Re(s, e = {}, t) {
|
|
11562
|
-
if (
|
|
11582
|
+
if (Td(t))
|
|
11563
11583
|
return !0;
|
|
11564
11584
|
const i = Object.entries(e).find(([n]) => n.toLowerCase() === "content-type")?.[1]?.toLowerCase();
|
|
11565
11585
|
if (i?.includes("multipart/form-data") || i?.includes("application/octet-stream"))
|
|
@@ -11574,7 +11594,7 @@ function Re(s, e = {}, t) {
|
|
|
11574
11594
|
return !0;
|
|
11575
11595
|
}
|
|
11576
11596
|
}
|
|
11577
|
-
function
|
|
11597
|
+
function Ad(s, e) {
|
|
11578
11598
|
if (Re(s))
|
|
11579
11599
|
return !0;
|
|
11580
11600
|
try {
|
|
@@ -11584,10 +11604,10 @@ function Rd(s, e) {
|
|
|
11584
11604
|
return !0;
|
|
11585
11605
|
}
|
|
11586
11606
|
}
|
|
11587
|
-
function
|
|
11607
|
+
function Td(s) {
|
|
11588
11608
|
return s instanceof FormData || s instanceof Blob || s instanceof ArrayBuffer || ArrayBuffer.isView(s) || typeof ReadableStream < "u" && s instanceof ReadableStream;
|
|
11589
11609
|
}
|
|
11590
|
-
function
|
|
11610
|
+
function Ed(s) {
|
|
11591
11611
|
const e = {};
|
|
11592
11612
|
for (const t of s.trim().split(/[\r\n]+/)) {
|
|
11593
11613
|
const i = t.indexOf(":");
|
|
@@ -11600,7 +11620,7 @@ function Td(s) {
|
|
|
11600
11620
|
}
|
|
11601
11621
|
return e;
|
|
11602
11622
|
}
|
|
11603
|
-
function
|
|
11623
|
+
function ce(s, e = Ls) {
|
|
11604
11624
|
return s.length <= e ? s : `${s.slice(0, e)}... [truncated ${s.length - e} chars]`;
|
|
11605
11625
|
}
|
|
11606
11626
|
function ts(s) {
|
|
@@ -11613,34 +11633,34 @@ class jn extends Error {
|
|
|
11613
11633
|
status;
|
|
11614
11634
|
code;
|
|
11615
11635
|
}
|
|
11616
|
-
async function
|
|
11636
|
+
async function kd(s, e) {
|
|
11617
11637
|
let t = null;
|
|
11618
11638
|
for (let i = 0; i < Ci; i += 1)
|
|
11619
11639
|
try {
|
|
11620
11640
|
return await s();
|
|
11621
11641
|
} catch (n) {
|
|
11622
|
-
if (t = n, i >= Ci - 1 || !
|
|
11642
|
+
if (t = n, i >= Ci - 1 || !Cd(n))
|
|
11623
11643
|
throw n;
|
|
11624
|
-
await
|
|
11644
|
+
await qd(i);
|
|
11625
11645
|
}
|
|
11626
11646
|
throw t instanceof Error ? t : new Error(e);
|
|
11627
11647
|
}
|
|
11628
|
-
function
|
|
11648
|
+
function qd(s) {
|
|
11629
11649
|
return new Promise((e) => {
|
|
11630
|
-
window.setTimeout(e,
|
|
11650
|
+
window.setTimeout(e, ic[s] ?? 0);
|
|
11631
11651
|
});
|
|
11632
11652
|
}
|
|
11633
|
-
function qd(s) {
|
|
11634
|
-
return s instanceof jn ? Cd(s.status) : s instanceof TypeError;
|
|
11635
|
-
}
|
|
11636
11653
|
function Cd(s) {
|
|
11637
|
-
return s
|
|
11654
|
+
return s instanceof jn ? Md(s.status) : s instanceof TypeError;
|
|
11638
11655
|
}
|
|
11639
11656
|
function Md(s) {
|
|
11657
|
+
return s === 408 || s === 409 || s === 429 || s >= 500;
|
|
11658
|
+
}
|
|
11659
|
+
function Od(s) {
|
|
11640
11660
|
return s === 401 || s === 403;
|
|
11641
11661
|
}
|
|
11642
|
-
const St = "[REDACTED_SECRET]",
|
|
11643
|
-
function
|
|
11662
|
+
const St = "[REDACTED_SECRET]", de = "[REDACTED_TOKEN]", Pd = "[REDACTED_SIGNED_URL]", xd = 20, Dd = /^(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, Ln = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, $n = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, Fn = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, zn = /\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, Ud = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, Nd = /\bhttps?:\/\/[^\s"'<>]+/gi, Bd = /[),.;\]]+$/;
|
|
11663
|
+
function Y(s) {
|
|
11644
11664
|
return mt(s, 0, /* @__PURE__ */ new WeakSet());
|
|
11645
11665
|
}
|
|
11646
11666
|
function mt(s, e, t) {
|
|
@@ -11648,7 +11668,7 @@ function mt(s, e, t) {
|
|
|
11648
11668
|
return s.startsWith("data:image/") || s.startsWith("data:application/pdf;") ? s : gt(s);
|
|
11649
11669
|
if (s === null || typeof s != "object")
|
|
11650
11670
|
return s;
|
|
11651
|
-
if (e >=
|
|
11671
|
+
if (e >= xd)
|
|
11652
11672
|
return "[REDACTED_MAX_DEPTH]";
|
|
11653
11673
|
if (t.has(s))
|
|
11654
11674
|
return "[REDACTED_CIRCULAR]";
|
|
@@ -11656,40 +11676,40 @@ function mt(s, e, t) {
|
|
|
11656
11676
|
return s.map((n) => mt(n, e + 1, t));
|
|
11657
11677
|
const i = {};
|
|
11658
11678
|
for (const [n, r] of Object.entries(s))
|
|
11659
|
-
n === "pageContent" ? i[n] = r : Hn(n) ? i[n] = St : i[n] = n.toLowerCase() === "url" ?
|
|
11679
|
+
n === "pageContent" ? i[n] = r : Hn(n) ? i[n] = St : i[n] = n.toLowerCase() === "url" ? jd(r) : mt(r, e + 1, t);
|
|
11660
11680
|
return i;
|
|
11661
11681
|
}
|
|
11662
11682
|
function Hn(s) {
|
|
11663
11683
|
const e = s.replace(/[^a-z0-9]/gi, "").toLowerCase();
|
|
11664
11684
|
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");
|
|
11665
11685
|
}
|
|
11666
|
-
function
|
|
11686
|
+
function jd(s) {
|
|
11667
11687
|
return typeof s == "string" ? Kn(s) : mt(s, 0, /* @__PURE__ */ new WeakSet());
|
|
11668
11688
|
}
|
|
11669
11689
|
function Kn(s) {
|
|
11670
11690
|
try {
|
|
11671
11691
|
const e = new URL(s, location.href);
|
|
11672
11692
|
for (const t of Array.from(e.searchParams.keys()))
|
|
11673
|
-
|
|
11674
|
-
return e.username && (e.username =
|
|
11693
|
+
Dd.test(t) && e.searchParams.set(t, de);
|
|
11694
|
+
return e.username && (e.username = de), e.password && (e.password = de), e.toString();
|
|
11675
11695
|
} catch {
|
|
11676
|
-
return
|
|
11696
|
+
return Ld(s);
|
|
11677
11697
|
}
|
|
11678
11698
|
}
|
|
11679
11699
|
function gt(s) {
|
|
11680
|
-
return s.replace(
|
|
11681
|
-
}
|
|
11682
|
-
function jd(s) {
|
|
11683
|
-
return s.replace(Ln, `Bearer ${ce}`).replace($n, `Basic ${ce}`).replace(Fn, ce).replace(zn, (e, t) => `${t}: ${St}`);
|
|
11700
|
+
return s.replace(Ud, Pd).replace(Nd, $d).replace(Ln, `Bearer ${de}`).replace($n, `Basic ${de}`).replace(Fn, de).replace(zn, (e, t) => `${t}: ${St}`);
|
|
11684
11701
|
}
|
|
11685
11702
|
function Ld(s) {
|
|
11686
|
-
|
|
11703
|
+
return s.replace(Ln, `Bearer ${de}`).replace($n, `Basic ${de}`).replace(Fn, de).replace(zn, (e, t) => `${t}: ${St}`);
|
|
11704
|
+
}
|
|
11705
|
+
function $d(s) {
|
|
11706
|
+
const e = s.match(Bd)?.[0] ?? "", t = e ? s.slice(0, -e.length) : s;
|
|
11687
11707
|
return `${Kn(t)}${e}`;
|
|
11688
11708
|
}
|
|
11689
|
-
const
|
|
11709
|
+
const tl = Object.freeze({
|
|
11690
11710
|
init: (s) => _t.init(s)
|
|
11691
11711
|
});
|
|
11692
|
-
function
|
|
11712
|
+
function sl(s) {
|
|
11693
11713
|
return _t.init(s);
|
|
11694
11714
|
}
|
|
11695
11715
|
function $i(s) {
|
|
@@ -11713,36 +11733,36 @@ function Fi(s) {
|
|
|
11713
11733
|
}
|
|
11714
11734
|
export {
|
|
11715
11735
|
Ei as PLUNO_PRODUCT_AGENT_WIDGET_HOST_SELECTOR,
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11736
|
+
Fa as PLUNO_PRODUCT_AGENT_WIDGET_PANEL_SELECTOR,
|
|
11737
|
+
$a as PLUNO_PRODUCT_AGENT_WIDGET_ROOT_SELECTOR,
|
|
11738
|
+
za as PLUNO_PRODUCT_AGENT_WIDGET_TIMELINE_SELECTOR,
|
|
11739
|
+
Cr as PRODUCT_AGENT_AUTH_RECONNECTING_ERROR_MESSAGE,
|
|
11740
|
+
Yd as PRODUCT_AGENT_PROVIDER_INPUT_ATTACHMENT_ACCEPT,
|
|
11741
|
+
tl as PlunoProductAgent,
|
|
11742
|
+
Ma as ProductAgentInteractionManager,
|
|
11723
11743
|
ri as ProductAgentQueryController,
|
|
11724
|
-
|
|
11744
|
+
Xd as ProductAgentRemoteRuntimeClient,
|
|
11725
11745
|
_t as ProductAgentSessionEngine,
|
|
11726
|
-
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
|
|
11730
|
-
|
|
11731
|
-
|
|
11746
|
+
Vd as ProductAgentSessionHistoryManager,
|
|
11747
|
+
Gd as ProductAgentTaskPageTitleController,
|
|
11748
|
+
oe as ProductAgentTokenProviderError,
|
|
11749
|
+
dc as calculateReconnectDelay,
|
|
11750
|
+
zd as canSubmitPersonalProductAgentMessage,
|
|
11751
|
+
Wd as createLocalStorageInteractionDecisionStorage,
|
|
11732
11752
|
st as createProductAgentQueryState,
|
|
11733
|
-
|
|
11734
|
-
|
|
11735
|
-
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11753
|
+
sl as createProductAgentRuntime,
|
|
11754
|
+
Jd as createProductAgentTaskPageTitleDocument,
|
|
11755
|
+
tl as default,
|
|
11756
|
+
Ua as formatProductAgentTaskPageTitle,
|
|
11757
|
+
Zd as getProductAgentOriginAccessErrorMessage,
|
|
11758
|
+
Mr as isProductAgentAuthReconnectError,
|
|
11759
|
+
Qd as isProductAgentRuntimeCommand,
|
|
11760
|
+
Er as mergeProductAgentEntityPages,
|
|
11741
11761
|
it as normalizeProductAgentEntityPage,
|
|
11742
|
-
|
|
11743
|
-
|
|
11744
|
-
|
|
11745
|
-
|
|
11746
|
-
|
|
11747
|
-
|
|
11762
|
+
el as normalizeProductAgentSessionItems,
|
|
11763
|
+
Oa as readLocalStorageInteractionDecisions,
|
|
11764
|
+
Hd as resolveProductAgentComposerAction,
|
|
11765
|
+
Fd as resolveProductAgentWidgetPresentation,
|
|
11766
|
+
kr as selectProductAgentQueryEntities,
|
|
11767
|
+
fd as validateProductAgentProviderInputFile
|
|
11748
11768
|
};
|