@pluno/product-agent-web 0.1.266 → 0.1.267
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.
|
@@ -218,7 +218,7 @@ function xi(t, e, s = null, n = !0) {
|
|
|
218
218
|
function le(t) {
|
|
219
219
|
return t?.execution_message_ids ?? t?.user_message_ids ?? [];
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function fe(t) {
|
|
222
222
|
const e = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d{1,6}))?(?:Z|\+00:00)$/.exec(t);
|
|
223
223
|
if (!e) throw new Error("Display timestamps must retain the backend UTC precision.");
|
|
224
224
|
return `${e[1]}.${(e[2] ?? "").padEnd(6, "0")}`;
|
|
@@ -226,7 +226,7 @@ function he(t) {
|
|
|
226
226
|
function xt(t) {
|
|
227
227
|
return "revision" in t.data ? t.data.revision : null;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function ye(t) {
|
|
230
230
|
return {
|
|
231
231
|
key: t,
|
|
232
232
|
status: "not_requested",
|
|
@@ -292,7 +292,7 @@ function Ps(t) {
|
|
|
292
292
|
executionByUserMessage: {},
|
|
293
293
|
followUps: [],
|
|
294
294
|
followUpsVersion: -1,
|
|
295
|
-
queries: { current:
|
|
295
|
+
queries: { current: ye(`${t}:current`), history: ye(`${t}:history`) }
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
298
|
function Pi(t) {
|
|
@@ -304,7 +304,7 @@ function $r(t, e) {
|
|
|
304
304
|
}
|
|
305
305
|
function Ie(t, e, s) {
|
|
306
306
|
const n = t.submissionOrder.map((k) => t.submissions[k]).filter((k) => k.conversationScopeId === s), i = e.selections[s]?.sessionId ?? n.find((k) => !k.cancelled && k.sessionId !== null)?.sessionId ?? null, r = i ? t.sessions[i] : void 0, a = t.submissionOrder.map((k) => t.submissions[k]).filter((k) => i ? k.sessionId === i || k.sessionId === null && k.conversationScopeId === s : k.conversationScopeId === s), o = Object.values(r?.items ?? {}).sort((k, x) => {
|
|
307
|
-
const U =
|
|
307
|
+
const U = fe(k.created_at), H = fe(x.created_at);
|
|
308
308
|
return U < H ? -1 : U > H ? 1 : k.id < x.id ? -1 : k.id > x.id ? 1 : 0;
|
|
309
309
|
}), c = a.filter((k) => (!k.cancelled || k.conversationScopeId === s && (k.sessionId === null || k.sessionId === i || i === null && k === a[a.length - 1])) && !r?.items[k.userMessageId] && !r?.removedItems[k.userMessageId]), l = {};
|
|
310
310
|
for (const k of o) {
|
|
@@ -387,7 +387,7 @@ function Ui(t, e) {
|
|
|
387
387
|
if (!e) return !1;
|
|
388
388
|
const s = t.executionByUserMessage[e];
|
|
389
389
|
if (s) return ["completed", "stopped", "failed"].includes(s.phase);
|
|
390
|
-
const n = Object.values(t.items).sort((r, a) =>
|
|
390
|
+
const n = Object.values(t.items).sort((r, a) => fe(r.created_at).localeCompare(fe(a.created_at)) || r.id.localeCompare(a.id));
|
|
391
391
|
let i = !1;
|
|
392
392
|
for (const r of n)
|
|
393
393
|
if (r.type === "user_message" && (i = r.id === e), !!i && (r.type === "stopped" || r.type === "error" || r.type === "final_response" && t.streams[r.id]?.state === "finished" && t.streams[r.id].revision >= r.data.revision))
|
|
@@ -681,7 +681,7 @@ function Kr(t, e, s, n) {
|
|
|
681
681
|
if (m && m.fingerprint !== JSON.stringify(u)) throw new Error("Query request ID changed payload.");
|
|
682
682
|
a({
|
|
683
683
|
appearanceQueries: { ...i.appearanceQueries, [p]: u },
|
|
684
|
-
queries: { ...i.queries, [p]: De(i.queries[p] ??
|
|
684
|
+
queries: { ...i.queries, [p]: De(i.queries[p] ?? ye(p), { key: p, requestId: re(s.requestId), mode: "replace" }) },
|
|
685
685
|
pending: { ...i.pending, [g]: {
|
|
686
686
|
requestId: s.requestId,
|
|
687
687
|
effectId: g,
|
|
@@ -749,7 +749,7 @@ function Kr(t, e, s, n) {
|
|
|
749
749
|
return { state: i, effects: r };
|
|
750
750
|
}
|
|
751
751
|
function Ds(t = null) {
|
|
752
|
-
return { authority: t, refusal: null, paidFallbackBySession: {}, query:
|
|
752
|
+
return { authority: t, refusal: null, paidFallbackBySession: {}, query: ye("account"), preferences: null };
|
|
753
753
|
}
|
|
754
754
|
function Wr(t, e) {
|
|
755
755
|
return t.preferences && e.preferencesVersion <= t.preferences.preferencesVersion ? t : { ...t, preferences: e };
|
|
@@ -932,7 +932,7 @@ function js(t, e, s) {
|
|
|
932
932
|
const T = n.features.pending[R];
|
|
933
933
|
if (T && T.fingerprint !== JSON.stringify(h)) throw new Error("Query request ID changed payload.");
|
|
934
934
|
if (T?.status === "pending" || Object.values(n.features.pending).some((q) => q.mode === "query" && q.key === w && q.status === "pending")) return;
|
|
935
|
-
const C = n.features.queries[w] ??
|
|
935
|
+
const C = n.features.queries[w] ?? ye(w), E = De(C, { key: w, requestId: re(b), mode: "replace" });
|
|
936
936
|
r({ queries: { ...n.features.queries, [w]: E }, pending: { ...n.features.pending, [R]: {
|
|
937
937
|
requestId: b,
|
|
938
938
|
effectId: R,
|
|
@@ -975,7 +975,7 @@ function js(t, e, s) {
|
|
|
975
975
|
return;
|
|
976
976
|
}
|
|
977
977
|
if (h.kind === "generatePrompts") {
|
|
978
|
-
const C = { kind: "starterPrompts", ...h.page, includeUserSuggestions: h.includeUserSuggestions ?? !1 }, E = ae(o, C), q = n.features.queries[E] ??
|
|
978
|
+
const C = { kind: "starterPrompts", ...h.page, includeUserSuggestions: h.includeUserSuggestions ?? !1 }, E = ae(o, C), q = n.features.queries[E] ?? ye(E);
|
|
979
979
|
r({ queries: { ...n.features.queries, [E]: De(q, { key: E, requestId: re(b), mode: "replace" }) } });
|
|
980
980
|
}
|
|
981
981
|
r({ pending: { ...n.features.pending, [w]: { requestId: b, effectId: w, fingerprint: R, key: Ln(h), generation: o.generation, operation: h, mode: "mutation", status: "pending", error: null, result: null } } }), i.push({ kind: "stage7.mutate", id: w, input: { authority: o, requestId: b, mutation: h } });
|
|
@@ -1845,7 +1845,7 @@ function oo(t, e = null) {
|
|
|
1845
1845
|
} : void 0);
|
|
1846
1846
|
return { ...n, ...o ? { auth: o } : {}, submissionGate: a, usingPaidCreditFallback: e ? t.paidFallbackBySession[e] ?? !1 : !1 };
|
|
1847
1847
|
}
|
|
1848
|
-
const ao = "0.1.
|
|
1848
|
+
const ao = "0.1.267", jt = {
|
|
1849
1849
|
version: ao
|
|
1850
1850
|
}, dn = (t) => t.selectedModel ?? t.historyModel ?? t.defaultModel, co = (t, e) => t.scopes[e];
|
|
1851
1851
|
function Bt(t) {
|
|
@@ -1854,19 +1854,19 @@ function Bt(t) {
|
|
|
1854
1854
|
function Ls(t, e) {
|
|
1855
1855
|
if (e.conversation_id !== t.sessionId) throw new Error("Display item belongs to another conversation.");
|
|
1856
1856
|
if (t.removedItems[e.id]) return t;
|
|
1857
|
-
const s =
|
|
1858
|
-
|
|
1857
|
+
const s = fe(e.created_at);
|
|
1858
|
+
fe(e.updated_at);
|
|
1859
1859
|
const n = xt(e);
|
|
1860
1860
|
n !== null && Bt(n);
|
|
1861
1861
|
const i = t.streams[e.id];
|
|
1862
1862
|
if (n !== null && i && (i.state === "stopped" || i.state === "finished") && n > i.revision) return t;
|
|
1863
1863
|
const r = t.items[e.id];
|
|
1864
1864
|
if (r) {
|
|
1865
|
-
if (
|
|
1865
|
+
if (fe(r.created_at) !== s) throw new Error("Display shell timestamp changed.");
|
|
1866
1866
|
const a = xt(r);
|
|
1867
1867
|
if (a !== null && n !== null) {
|
|
1868
1868
|
if (n <= a) return t;
|
|
1869
|
-
} else if (
|
|
1869
|
+
} else if (fe(e.updated_at) <= fe(r.updated_at)) return t;
|
|
1870
1870
|
}
|
|
1871
1871
|
return { ...t, items: { ...t.items, [e.id]: { ...e, created_at: r?.created_at ?? e.created_at } } };
|
|
1872
1872
|
}
|
|
@@ -2136,7 +2136,7 @@ function uo(t, e, s, n) {
|
|
|
2136
2136
|
const p = l[u.lane];
|
|
2137
2137
|
l[u.lane] = { ...p, requestId: null, status: p.data === null ? "not_requested" : "ready" };
|
|
2138
2138
|
}
|
|
2139
|
-
l.history =
|
|
2139
|
+
l.history = ye(l.history.key), i = { ...t, requests: c, sessions: { ...t.sessions, [e.sessionId]: { ...o, queries: l } } };
|
|
2140
2140
|
break;
|
|
2141
2141
|
}
|
|
2142
2142
|
case "conversation.snapshot": {
|
|
@@ -2881,7 +2881,7 @@ frame `)) : void 0;
|
|
|
2881
2881
|
...n ? { stack: n } : {}
|
|
2882
2882
|
};
|
|
2883
2883
|
}
|
|
2884
|
-
function
|
|
2884
|
+
function pe(t) {
|
|
2885
2885
|
if (!t || typeof t != "object") return !1;
|
|
2886
2886
|
const e = t, s = (n) => Number.isSafeInteger(n) && n >= 0;
|
|
2887
2887
|
return Object.keys(e).every((n) => [
|
|
@@ -3066,7 +3066,7 @@ function Z(t, e) {
|
|
|
3066
3066
|
throw Object.assign(new Error("Conversation authority was retired."), { code: "authority_retired", retryable: !0 });
|
|
3067
3067
|
}
|
|
3068
3068
|
function ke(t, e) {
|
|
3069
|
-
const s = Y(t, "connection_interrupted", "web_transport"), { code: n, message: i } = s, r = t instanceof Error && "detail" in t ? t.detail : t instanceof Error && "details" in t ? t.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, l = o.elapsedMs ?? o.durationMs, d = 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 &&
|
|
3069
|
+
const s = Y(t, "connection_interrupted", "web_transport"), { code: n, message: i } = s, r = t instanceof Error && "detail" in t ? t.detail : t instanceof Error && "details" in t ? t.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, l = o.elapsedMs ?? o.durationMs, d = 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 && pe(r.httpRequest) ? r.httpRequest : void 0;
|
|
3070
3070
|
return Object.assign(new Error(i), {
|
|
3071
3071
|
code: n,
|
|
3072
3072
|
// Keep the actionable public URL without copying arbitrary transport internals into durable errors.
|
|
@@ -3590,7 +3590,7 @@ function as(t, e, s, n) {
|
|
|
3590
3590
|
...typeof _?.details?.requestId == "string" ? { errorRequestId: _.details.requestId } : {},
|
|
3591
3591
|
...nt(_?.details?.errorNormalization) ? { errorNormalization: _.details.errorNormalization } : {},
|
|
3592
3592
|
...n ? { owner: n } : {},
|
|
3593
|
-
...
|
|
3593
|
+
...pe(_?.details?.httpRequest) ? { httpRequest: _.details.httpRequest } : {},
|
|
3594
3594
|
queryStatus: e?.status ?? null,
|
|
3595
3595
|
queryRequestId: e?.requestId ?? null,
|
|
3596
3596
|
queryUpdatedAt: e?.updatedAt ?? null
|
|
@@ -3806,19 +3806,19 @@ const Fo = "Pluno is reconnecting. Try again in a moment.";
|
|
|
3806
3806
|
function $o(t) {
|
|
3807
3807
|
return (t instanceof Error ? t.message : t) === Fo;
|
|
3808
3808
|
}
|
|
3809
|
-
const
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3809
|
+
const he = /* @__PURE__ */ Object.create(null);
|
|
3810
|
+
he.open = "0";
|
|
3811
|
+
he.close = "1";
|
|
3812
|
+
he.ping = "2";
|
|
3813
|
+
he.pong = "3";
|
|
3814
|
+
he.message = "4";
|
|
3815
|
+
he.upgrade = "5";
|
|
3816
|
+
he.noop = "6";
|
|
3817
3817
|
const St = /* @__PURE__ */ Object.create(null);
|
|
3818
|
-
Object.keys(
|
|
3819
|
-
St[
|
|
3818
|
+
Object.keys(he).forEach((t) => {
|
|
3819
|
+
St[he[t]] = t;
|
|
3820
3820
|
});
|
|
3821
|
-
const Js = { type: "error", data: "parser error" }, Wi = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", Gi = typeof ArrayBuffer == "function", Ji = (t) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(t) : t && t.buffer instanceof ArrayBuffer, gn = ({ type: t, data: e }, s, n) => Wi && e instanceof Blob ? s ? n(e) : Qn(e, n) : Gi && (e instanceof ArrayBuffer || Ji(e)) ? s ? n(e) : Qn(new Blob([e]), n) : n(
|
|
3821
|
+
const Js = { type: "error", data: "parser error" }, Wi = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", Gi = typeof ArrayBuffer == "function", Ji = (t) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(t) : t && t.buffer instanceof ArrayBuffer, gn = ({ type: t, data: e }, s, n) => Wi && e instanceof Blob ? s ? n(e) : Qn(e, n) : Gi && (e instanceof ArrayBuffer || Ji(e)) ? s ? n(e) : Qn(new Blob([e]), n) : n(he[t] + (e || "")), Qn = (t, e) => {
|
|
3822
3822
|
const s = new FileReader();
|
|
3823
3823
|
return s.onload = function() {
|
|
3824
3824
|
const n = s.result.split(",")[1];
|
|
@@ -6560,9 +6560,9 @@ class or {
|
|
|
6560
6560
|
upstreamRequestId: T,
|
|
6561
6561
|
upstreamTraceId: C
|
|
6562
6562
|
};
|
|
6563
|
-
|
|
6563
|
+
pe(O) && Promise.resolve().then(() => this.options.onRequestFailure ? this.options.onRequestFailure(O) : console.warn("Product Agent HTTP request failed", O)).catch(() => {
|
|
6564
6564
|
});
|
|
6565
|
-
const k =
|
|
6565
|
+
const k = pe(O) ? { httpRequest: O } : void 0;
|
|
6566
6566
|
if (q !== null) {
|
|
6567
6567
|
const x = q !== "deadline" && q !== "unexpected_abort";
|
|
6568
6568
|
throw new A(
|
|
@@ -7189,15 +7189,15 @@ class L extends EventTarget {
|
|
|
7189
7189
|
return;
|
|
7190
7190
|
}
|
|
7191
7191
|
if (s.type === "auth.session") {
|
|
7192
|
-
const o = a instanceof A ? a : new A("Chat setup failed", "request_failed");
|
|
7192
|
+
const o = a instanceof A ? a : new A("Chat setup failed", "request_failed"), c = this.isInvalidResponse(o);
|
|
7193
7193
|
this.queueDiagnostic("auth_rejected", {
|
|
7194
7194
|
stage: "bootstrap",
|
|
7195
7195
|
failureKind: "permanent",
|
|
7196
7196
|
httpStatus: /^[45][0-9]{2}$/.test(o.code) ? Number(o.code) : void 0
|
|
7197
7197
|
}), this.fail(new A(
|
|
7198
7198
|
o.message,
|
|
7199
|
-
o.code,
|
|
7200
|
-
o.outcomeUnknown,
|
|
7199
|
+
c ? "invalid_response" : o.code,
|
|
7200
|
+
c ? !1 : o.outcomeUnknown,
|
|
7201
7201
|
{ ...o.detail && typeof o.detail == "object" ? o.detail : {}, stage: "bootstrap" },
|
|
7202
7202
|
o.backendRefusal
|
|
7203
7203
|
), s), this.pause();
|
|
@@ -7260,8 +7260,12 @@ class L extends EventTarget {
|
|
|
7260
7260
|
http(e, s = {}, n, i) {
|
|
7261
7261
|
return this.httpTransport.request(e, s, n, i);
|
|
7262
7262
|
}
|
|
7263
|
+
isInvalidResponse(e) {
|
|
7264
|
+
const s = e instanceof A ? e.detail : void 0;
|
|
7265
|
+
return !!(s && typeof s == "object" && "httpRequest" in s && pe(s.httpRequest) && s.httpRequest.category === "invalid_response");
|
|
7266
|
+
}
|
|
7263
7267
|
isRetryableRead(e) {
|
|
7264
|
-
return e instanceof TypeError || e instanceof DOMException && e.name === "AbortError" || e instanceof A && ["request_timed_out", "408", "425", "429", "500", "502", "503", "504"].includes(e.code);
|
|
7268
|
+
return this.isInvalidResponse(e) ? !1 : e instanceof TypeError || e instanceof DOMException && e.name === "AbortError" || e instanceof A && ["connection_interrupted", "request_timed_out", "408", "425", "429", "500", "502", "503", "504"].includes(e.code);
|
|
7265
7269
|
}
|
|
7266
7270
|
async dispatch(e, s) {
|
|
7267
7271
|
const { type: n, ...i } = e, r = this.options.auth.client_kind === "embed", a = e.pageUrl ?? e.page?.url ?? this.options.pageUrl(), o = { page_url: a, origin: new URL(a).origin };
|
|
@@ -7417,7 +7421,7 @@ function Qa(t, e, s, n, i, r, a, o, c = null, l = !1) {
|
|
|
7417
7421
|
}
|
|
7418
7422
|
const Xa = 1e4, Ya = 3e3;
|
|
7419
7423
|
function lr() {
|
|
7420
|
-
return { authenticated: !1, generation: 0, sequence: 0, displaySequence: 0, backendCount: null, query:
|
|
7424
|
+
return { authenticated: !1, generation: 0, sequence: 0, displaySequence: 0, backendCount: null, query: ye("activeUsers") };
|
|
7421
7425
|
}
|
|
7422
7426
|
function Za(t, e) {
|
|
7423
7427
|
if (e.type === "activeUsers.authenticate") {
|
|
@@ -7746,7 +7750,7 @@ function qe(t, e, s) {
|
|
|
7746
7750
|
query: d,
|
|
7747
7751
|
cursor: e.cursor !== void 0 ? e.cursor : e.mode === "append" ? l?.cursor ?? null : null
|
|
7748
7752
|
} }, n = { ...t, queries: { ...t.queries, [c]: {
|
|
7749
|
-
...De(l ??
|
|
7753
|
+
...De(l ?? ye(c), { key: c, requestId: e.requestId, mode: e.mode }),
|
|
7750
7754
|
query: d,
|
|
7751
7755
|
requestSequence: t.requestSequence + 1,
|
|
7752
7756
|
mode: e.mode,
|
|
@@ -8198,7 +8202,7 @@ class pc {
|
|
|
8198
8202
|
},
|
|
8199
8203
|
errorAdapter: (r) => {
|
|
8200
8204
|
const a = Y(r), o = r !== null && typeof r == "object" ? "details" in r ? r.details : "detail" in r ? r.detail : void 0 : void 0, c = o && typeof o == "object" && "httpRequest" in o ? o.httpRequest : void 0;
|
|
8201
|
-
return { ...a, ...
|
|
8205
|
+
return { ...a, ...pe(c) ? { details: { ...a.details, httpRequest: c } } : {} };
|
|
8202
8206
|
}
|
|
8203
8207
|
});
|
|
8204
8208
|
}
|
|
@@ -9009,7 +9013,7 @@ function nu(t) {
|
|
|
9009
9013
|
case "runtime.report_operation_timing":
|
|
9010
9014
|
return it(e.timing);
|
|
9011
9015
|
case "runtime.report_displayed_error":
|
|
9012
|
-
return (e.errorDiagnostic === void 0 || Ro(e.errorDiagnostic)) && (e.httpRequest === void 0 ||
|
|
9016
|
+
return (e.errorDiagnostic === void 0 || Ro(e.errorDiagnostic)) && (e.httpRequest === void 0 || pe(e.httpRequest)) && (e.historyRefreshFailure === void 0 || un(e.historyRefreshFailure)) && (e.renderedError === void 0 || hn(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);
|
|
9013
9017
|
case "runtime.report_invalid_state_transition":
|
|
9014
9018
|
return (e.uiInvariant === void 0 || fn(e.uiInvariant)) && (e.reason === "submitted_turn_returned_to_welcome_without_new_chat" || e.reason === "new_messages_button_without_user_scroll" || Vc(e.reason)) && (e.clientMessageId === void 0 || typeof e.clientMessageId == "string");
|
|
9015
9019
|
case "runtime.prompt_presented":
|
|
@@ -9161,7 +9165,7 @@ class iu {
|
|
|
9161
9165
|
errorFingerprint: s,
|
|
9162
9166
|
...i ? { renderedError: i } : {},
|
|
9163
9167
|
...r ? { historyRefreshFailure: r } : {},
|
|
9164
|
-
...
|
|
9168
|
+
...pe(a) ? { httpRequest: a } : {},
|
|
9165
9169
|
...n ? { displayedMessage: Ce(n) } : {}
|
|
9166
9170
|
}).catch(() => {
|
|
9167
9171
|
});
|
|
@@ -10474,7 +10478,7 @@ class Ht {
|
|
|
10474
10478
|
errorFingerprint: s,
|
|
10475
10479
|
...i ? { renderedError: i } : {},
|
|
10476
10480
|
...r ? { historyRefreshFailure: r } : {},
|
|
10477
|
-
...
|
|
10481
|
+
...pe(a) ? { httpRequest: a } : {},
|
|
10478
10482
|
...n ? { displayedMessage: Ce(n) } : {}
|
|
10479
10483
|
});
|
|
10480
10484
|
}
|
|
@@ -10994,7 +10998,7 @@ class Ht {
|
|
|
10994
10998
|
this.options.backendUrl
|
|
10995
10999
|
) });
|
|
10996
11000
|
}
|
|
10997
|
-
if (s.httpRequest && (!
|
|
11001
|
+
if (s.httpRequest && (!pe(s.httpRequest) || s.httpRequest.sessionId !== null && s.httpRequest.sessionId !== n.sessionId) || s.historyRefreshFailure && (s.historyRefreshFailure.consecutiveFailures < 3 || s.historyRefreshFailure.sessionId !== n.sessionId) || s.renderedError && s.renderedError.sessionId !== n.sessionId || s.uiInvariant && s.uiInvariant.current.sessionId !== n.sessionId) return;
|
|
10998
11002
|
const i = s.historyRefreshFailure?.episodeId ?? (s.renderedError ? `${s.errorFingerprint}:${s.renderedError.itemId}` : void 0) ?? s.errorFingerprint ?? s.clientMessageId ?? (s.previousPhase && s.nextPhase ? `${s.previousPhase}:${s.nextPhase}:${s.reason ?? "unknown"}` : null);
|
|
10999
11003
|
if (i) {
|
|
11000
11004
|
const m = `${e}:${i}:${e === "invalid_state_transition" ? s.reason ?? "unknown" : ""}`;
|
|
@@ -11379,6 +11383,10 @@ class Ht {
|
|
|
11379
11383
|
});
|
|
11380
11384
|
return;
|
|
11381
11385
|
}
|
|
11386
|
+
if (e.code === "invalid_response" && e.stage === "bootstrap") {
|
|
11387
|
+
this.stopAuthentication(new A(String(e.message), "connection_failed", !1, { stage: "bootstrap" }));
|
|
11388
|
+
return;
|
|
11389
|
+
}
|
|
11382
11390
|
if (!this.options.webSocketFactory && (e.code === "unauthorized" || e.code === "401") && e.reason === "invalid_token" && (this.canRefreshInvalidCredential() || this.credentialRecovery !== null)) {
|
|
11383
11391
|
const s = this.socket;
|
|
11384
11392
|
if (s instanceof L) {
|
|
@@ -11782,7 +11790,7 @@ function vd() {
|
|
|
11782
11790
|
if (!Me(_, S, m?.body)) {
|
|
11783
11791
|
const b = {
|
|
11784
11792
|
requestId: qs("fetch"),
|
|
11785
|
-
url:
|
|
11793
|
+
url: ge(_, ks),
|
|
11786
11794
|
method: (m?.method ?? I?.method ?? "GET").toUpperCase(),
|
|
11787
11795
|
requestHeaders: S,
|
|
11788
11796
|
requestBody: Ti(m?.body),
|
|
@@ -11802,7 +11810,7 @@ function vd() {
|
|
|
11802
11810
|
(y) => {
|
|
11803
11811
|
e({
|
|
11804
11812
|
...b,
|
|
11805
|
-
errorText:
|
|
11813
|
+
errorText: ge(y instanceof Error ? y.message : String(y)),
|
|
11806
11814
|
durationMs: Date.now() - f
|
|
11807
11815
|
});
|
|
11808
11816
|
}
|
|
@@ -11816,7 +11824,7 @@ function vd() {
|
|
|
11816
11824
|
return Es.set(this, {
|
|
11817
11825
|
requestId: qs("xhr"),
|
|
11818
11826
|
method: String(g ?? "GET").toUpperCase(),
|
|
11819
|
-
url:
|
|
11827
|
+
url: ge(S, ks),
|
|
11820
11828
|
requestHeaders: {},
|
|
11821
11829
|
startedAtMs: Date.now(),
|
|
11822
11830
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -11885,7 +11893,7 @@ function vd() {
|
|
|
11885
11893
|
const f = performance.timeOrigin + m.startTime;
|
|
11886
11894
|
e({
|
|
11887
11895
|
requestId: qs("resource"),
|
|
11888
|
-
url:
|
|
11896
|
+
url: ge(m.name, ks),
|
|
11889
11897
|
method: "GET",
|
|
11890
11898
|
resourceType: "resource",
|
|
11891
11899
|
responseStatus: m.responseStatus,
|
|
@@ -13156,7 +13164,7 @@ function qr(t) {
|
|
|
13156
13164
|
return e;
|
|
13157
13165
|
}
|
|
13158
13166
|
function Tn(t, e) {
|
|
13159
|
-
return Ur(t) ? Vt :
|
|
13167
|
+
return Ur(t) ? Vt : ge(Nt(e), ud);
|
|
13160
13168
|
}
|
|
13161
13169
|
function Al(t, e) {
|
|
13162
13170
|
return typeof t == "string" ? t : t instanceof URL ? t.toString() : e?.url ?? "";
|
|
@@ -13190,10 +13198,10 @@ async function Tl(t) {
|
|
|
13190
13198
|
return;
|
|
13191
13199
|
const { done: c, value: l } = o;
|
|
13192
13200
|
if (c)
|
|
13193
|
-
return
|
|
13201
|
+
return ge(r + i.decode());
|
|
13194
13202
|
const d = Sn - a;
|
|
13195
13203
|
if (l.byteLength > d)
|
|
13196
|
-
return r += i.decode(l.subarray(0, Math.max(d, 0)), { stream: !0 }), e.cancel(), `${
|
|
13204
|
+
return r += i.decode(l.subarray(0, Math.max(d, 0)), { stream: !0 }), e.cancel(), `${ge(r)}... [truncated]`;
|
|
13197
13205
|
a += l.byteLength, r += i.decode(l, { stream: !0 });
|
|
13198
13206
|
}
|
|
13199
13207
|
} catch {
|
|
@@ -13206,14 +13214,14 @@ async function Tl(t) {
|
|
|
13206
13214
|
function ql(t, e) {
|
|
13207
13215
|
if (Cr(new Headers(e)))
|
|
13208
13216
|
try {
|
|
13209
|
-
return t.responseType === "" || t.responseType === "text" ?
|
|
13217
|
+
return t.responseType === "" || t.responseType === "text" ? ge(t.responseText ?? "") : void 0;
|
|
13210
13218
|
} catch {
|
|
13211
13219
|
return;
|
|
13212
13220
|
}
|
|
13213
13221
|
}
|
|
13214
13222
|
function Ti(t) {
|
|
13215
13223
|
if (typeof t == "string")
|
|
13216
|
-
return
|
|
13224
|
+
return ge(t);
|
|
13217
13225
|
}
|
|
13218
13226
|
function Cl(t) {
|
|
13219
13227
|
return ne({
|
|
@@ -13282,7 +13290,7 @@ function Ml(t) {
|
|
|
13282
13290
|
}
|
|
13283
13291
|
return e;
|
|
13284
13292
|
}
|
|
13285
|
-
function
|
|
13293
|
+
function ge(t, e = Sn) {
|
|
13286
13294
|
return t.length <= e ? t : `${t.slice(0, e)}... [truncated ${t.length - e} chars]`;
|
|
13287
13295
|
}
|
|
13288
13296
|
function qs(t) {
|
|
@@ -13321,7 +13329,7 @@ function Nl(t) {
|
|
|
13321
13329
|
function jl(t) {
|
|
13322
13330
|
return t === 401 || t === 403;
|
|
13323
13331
|
}
|
|
13324
|
-
const Vt = "[REDACTED_SECRET]",
|
|
13332
|
+
const Vt = "[REDACTED_SECRET]", me = "[REDACTED_TOKEN]", Bl = "[REDACTED_SIGNED_URL]", Ll = 20, Fl = /^(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, xr = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, Mr = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, Pr = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, Dr = /\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, $l = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, zl = /\bhttps?:\/\/[^\s"'<>]+/gi, Hl = /[),.;\]]+$/;
|
|
13325
13333
|
function ne(t) {
|
|
13326
13334
|
return Ut(t, 0, /* @__PURE__ */ new WeakSet());
|
|
13327
13335
|
}
|
|
@@ -13352,17 +13360,17 @@ function Nr(t) {
|
|
|
13352
13360
|
try {
|
|
13353
13361
|
const e = new URL(t, location.href);
|
|
13354
13362
|
for (const s of Array.from(e.searchParams.keys()))
|
|
13355
|
-
Fl.test(s) && e.searchParams.set(s,
|
|
13356
|
-
return e.username && (e.username =
|
|
13363
|
+
Fl.test(s) && e.searchParams.set(s, me);
|
|
13364
|
+
return e.username && (e.username = me), e.password && (e.password = me), e.toString();
|
|
13357
13365
|
} catch {
|
|
13358
13366
|
return Kl(t);
|
|
13359
13367
|
}
|
|
13360
13368
|
}
|
|
13361
13369
|
function Nt(t) {
|
|
13362
|
-
return t.replace($l, Bl).replace(zl, Wl).replace(xr, `Bearer ${
|
|
13370
|
+
return t.replace($l, Bl).replace(zl, Wl).replace(xr, `Bearer ${me}`).replace(Mr, `Basic ${me}`).replace(Pr, me).replace(Dr, (e, s) => `${s}: ${Vt}`);
|
|
13363
13371
|
}
|
|
13364
13372
|
function Kl(t) {
|
|
13365
|
-
return t.replace(xr, `Bearer ${
|
|
13373
|
+
return t.replace(xr, `Bearer ${me}`).replace(Mr, `Basic ${me}`).replace(Pr, me).replace(Dr, (e, s) => `${s}: ${Vt}`);
|
|
13366
13374
|
}
|
|
13367
13375
|
function Wl(t) {
|
|
13368
13376
|
const e = t.match(Hl)?.[0] ?? "", s = e ? t.slice(0, -e.length) : t;
|