@gengage/assistant-fe 0.6.33 → 0.6.35
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/chat-runtime.js +1 -1
- package/dist/chat.iife.js +1 -1
- package/dist/chat.js +1 -1
- package/dist/common/index.d.ts +2 -1
- package/dist/{common-Bhl-diYQ.js → common-C-lXfS-s.js} +1 -1
- package/dist/common.js +68 -67
- package/dist/{connection-warning-CuJ66qqt.js → connection-warning-DrXU9qN9.js} +1 -1
- package/dist/{fastIntent-CjgT7XpX.js → fastIntent-Diz6Vo0W.js} +1 -1
- package/dist/index.js +21 -21
- package/dist/native.iife.js +1 -1
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +1 -1
- package/dist/qna.js +1 -1
- package/dist/request-response-cache-DmnzO4Hu.js +1426 -0
- package/dist/{runtime-8WgpotSV.js → runtime-CiO-HX8B.js} +198 -199
- package/dist/{runtime-4QEfxNRC.js → runtime-D0v-KyzN.js} +36 -37
- package/dist/{runtime-bXec5UVj.js → runtime-hci1VRsa.js} +8 -9
- package/dist/{simbut-3z-Ed-TM.js → simbut-D-IPkTT8.js} +1 -1
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/{simrel-Bz7xAdSc.js → simrel-BjMCvCdo.js} +1 -1
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +1 -1
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-DhkuNWft.js → widget-base-_HBDf5VH.js} +1 -1
- package/package.json +3 -19
- package/dist/agent-ui-steps-DIWmTMuV.js +0 -3199
- package/dist/agentic/adaptor/create-adaptor.d.ts +0 -22
- package/dist/agentic/adaptor/fetch-bridge.d.ts +0 -31
- package/dist/agentic/adaptor/mount.d.ts +0 -45
- package/dist/agentic/algos/similarity.d.ts +0 -86
- package/dist/agentic/algos/similarity.js +0 -261
- package/dist/agentic/context/chat-context.d.ts +0 -17
- package/dist/agentic/context/context-store.d.ts +0 -57
- package/dist/agentic/context/persistence.d.ts +0 -14
- package/dist/agentic/contracts/agentic-contracts.d.ts +0 -133
- package/dist/agentic/debug/activity-collector.d.ts +0 -15
- package/dist/agentic/debug/activity-instrumentation.d.ts +0 -22
- package/dist/agentic/debug/activity-overlay.d.ts +0 -3
- package/dist/agentic/debug/activity-state.d.ts +0 -37
- package/dist/agentic/debug/local-dev.d.ts +0 -18
- package/dist/agentic/events/builders.d.ts +0 -10
- package/dist/agentic/events/comparison.d.ts +0 -6
- package/dist/agentic/events/context-products.d.ts +0 -6
- package/dist/agentic/events/error-taxonomy.d.ts +0 -27
- package/dist/agentic/events/product-normalize.d.ts +0 -50
- package/dist/agentic/events/ui-specs.d.ts +0 -41
- package/dist/agentic/flow/create-flow.d.ts +0 -2
- package/dist/agentic/flow/dispatch.d.ts +0 -3
- package/dist/agentic/index.d.ts +0 -65
- package/dist/agentic/index.js +0 -3493
- package/dist/agentic/types.d.ts +0 -360
- package/dist/agentic/util/account-config.d.ts +0 -8
- package/dist/agentic/util/assistant-host.d.ts +0 -11
- package/dist/agentic/util/be-url.d.ts +0 -4
- package/dist/agentic/util/browser-memory.d.ts +0 -13
- package/dist/agentic/util/browser-tools.d.ts +0 -31
- package/dist/agentic/util/cache-key.d.ts +0 -15
- package/dist/agentic/util/common/declarative-cache.d.ts +0 -21
- package/dist/agentic/util/common/fallback-status.d.ts +0 -10
- package/dist/agentic/util/common/flow-steps.d.ts +0 -8
- package/dist/agentic/util/common/gss-tool-aliases.d.ts +0 -66
- package/dist/agentic/util/common/iframe-scraper.d.ts +0 -22
- package/dist/agentic/util/common/llm-routing.d.ts +0 -50
- package/dist/agentic/util/common/object.d.ts +0 -1
- package/dist/agentic/util/common/open-product-page.d.ts +0 -30
- package/dist/agentic/util/common/panel-context.d.ts +0 -3
- package/dist/agentic/util/common/privacy.d.ts +0 -14
- package/dist/agentic/util/common/product-resolver.d.ts +0 -20
- package/dist/agentic/util/common/product-surface.d.ts +0 -24
- package/dist/agentic/util/common/ref-store.d.ts +0 -15
- package/dist/agentic/util/common/retail-privacy.d.ts +0 -4
- package/dist/agentic/util/common/route-params.d.ts +0 -3
- package/dist/agentic/util/common/similarity-ranking.d.ts +0 -2
- package/dist/agentic/util/common/site-awareness.d.ts +0 -130
- package/dist/agentic/util/lazy-runtime-loader.d.ts +0 -10
- package/dist/agentic/util/privacy.d.ts +0 -12
- package/dist/agentic/util/request-text.d.ts +0 -3
- package/dist/agentic/util/time.d.ts +0 -2
- package/dist/agentic/widgets/endpoints.d.ts +0 -12
- package/dist/agentic/worker/agent-ui-steps.d.ts +0 -43
- package/dist/agentic/worker/agent-ui.d.ts +0 -44
- package/dist/agentic/worker/be-client.d.ts +0 -32
- package/dist/agentic/worker/coalesce.d.ts +0 -25
- package/dist/agentic/worker/compaction.d.ts +0 -12
- package/dist/agentic/worker/entry.d.ts +0 -2
- package/dist/agentic/worker/flow-runner.d.ts +0 -24
- package/dist/agentic/worker/jwt-mint.d.ts +0 -21
- package/dist/agentic/worker/pdp-hydrate.d.ts +0 -30
- package/dist/agentic/worker/rpc.d.ts +0 -47
- package/dist/agentic/worker/tool-bridge.d.ts +0 -2
- package/dist/agentic/worker/tool-schema.d.ts +0 -19
- package/dist/agentic/worker.d.ts +0 -52
- package/dist/agentic/worker.js +0 -429
- package/dist/agentic.iife.js +0 -445
- package/dist/api-paths-BTHgM_Tz.js +0 -1274
- package/dist/request-response-cache-BxRsKGJ0.js +0 -154
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
var w = 72e5, b = 200, S = 5 * 1024 * 1024, g = "gengage_request_response_cache", T = 1, c = "responses", _ = /* @__PURE__ */ new Set(["addToCart", "like"]), a = /* @__PURE__ */ new Map(), A = null;
|
|
2
|
-
async function H(e, t = {}, r = {}) {
|
|
3
|
-
const n = B(e, t);
|
|
4
|
-
if (!n) return fetch(e, t);
|
|
5
|
-
const s = Date.now(), o = await C(n, s);
|
|
6
|
-
if (o) return j(o);
|
|
7
|
-
const u = await fetch(e, t);
|
|
8
|
-
return u.ok && I(n, u.clone(), s, {
|
|
9
|
-
ttlMs: r.ttlMs ?? w,
|
|
10
|
-
maxEntries: r.maxEntries ?? b,
|
|
11
|
-
maxBodyBytes: r.maxBodyBytes ?? S
|
|
12
|
-
}), u;
|
|
13
|
-
}
|
|
14
|
-
function B(e, t = {}) {
|
|
15
|
-
if (typeof Request < "u" && e instanceof Request) return null;
|
|
16
|
-
const r = String(t.method || "GET").toUpperCase();
|
|
17
|
-
return r !== "POST" || typeof t.body != "string" || D(t.body) ? null : `rr:${F(q({
|
|
18
|
-
url: String(e),
|
|
19
|
-
method: r,
|
|
20
|
-
headers: M(t.headers),
|
|
21
|
-
body: t.body
|
|
22
|
-
}))}`;
|
|
23
|
-
}
|
|
24
|
-
function D(e) {
|
|
25
|
-
try {
|
|
26
|
-
const t = JSON.parse(e);
|
|
27
|
-
if (!t || typeof t != "object" || Array.isArray(t)) return !1;
|
|
28
|
-
const r = t.type;
|
|
29
|
-
return typeof r == "string" && _.has(r);
|
|
30
|
-
} catch {
|
|
31
|
-
return !1;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
async function C(e, t) {
|
|
35
|
-
const r = a.get(e);
|
|
36
|
-
if (r) if (r.expiresAt <= t) a.delete(e);
|
|
37
|
-
else
|
|
38
|
-
return r.lastAccessedAt = t, a.delete(e), a.set(e, r), y(r), r;
|
|
39
|
-
const n = await R(e);
|
|
40
|
-
return n ? n.expiresAt <= t ? (a.delete(e), L(e), null) : (n.lastAccessedAt = t, a.set(e, n), y(n), m(b), n) : null;
|
|
41
|
-
}
|
|
42
|
-
async function I(e, t, r, n) {
|
|
43
|
-
try {
|
|
44
|
-
const s = await t.text();
|
|
45
|
-
if (U(s) > n.maxBodyBytes || O(s)) return;
|
|
46
|
-
const o = {
|
|
47
|
-
key: e,
|
|
48
|
-
status: t.status,
|
|
49
|
-
statusText: t.statusText,
|
|
50
|
-
headers: P(t.headers),
|
|
51
|
-
body: s,
|
|
52
|
-
createdAt: r,
|
|
53
|
-
expiresAt: r + n.ttlMs,
|
|
54
|
-
lastAccessedAt: r
|
|
55
|
-
};
|
|
56
|
-
a.set(e, o), m(n.maxEntries), await y(o), await N(n.maxEntries, r);
|
|
57
|
-
} catch {
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function O(e) {
|
|
61
|
-
return /"_error"\s*:/u.test(e) || /"type"\s*:\s*"error"/u.test(e);
|
|
62
|
-
}
|
|
63
|
-
function j(e) {
|
|
64
|
-
return new Response(e.body, {
|
|
65
|
-
status: e.status,
|
|
66
|
-
statusText: e.statusText,
|
|
67
|
-
headers: new Headers(e.headers)
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
function M(e) {
|
|
71
|
-
const t = new Headers(e), r = [];
|
|
72
|
-
return t.forEach((n, s) => {
|
|
73
|
-
const o = s.toLowerCase();
|
|
74
|
-
o !== "authorization" && o !== "cookie" && r.push([o, n]);
|
|
75
|
-
}), r.sort(([n], [s]) => n.localeCompare(s));
|
|
76
|
-
}
|
|
77
|
-
function P(e) {
|
|
78
|
-
const t = [];
|
|
79
|
-
return e.forEach((r, n) => {
|
|
80
|
-
const s = n.toLowerCase();
|
|
81
|
-
s !== "set-cookie" && t.push([s, r]);
|
|
82
|
-
}), t.sort(([r], [n]) => r.localeCompare(n));
|
|
83
|
-
}
|
|
84
|
-
function m(e) {
|
|
85
|
-
for (; a.size > e; ) {
|
|
86
|
-
const t = [...a.values()].sort((r, n) => r.lastAccessedAt - n.lastAccessedAt)[0];
|
|
87
|
-
if (!t) break;
|
|
88
|
-
a.delete(t.key);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
async function d() {
|
|
92
|
-
return typeof indexedDB > "u" ? null : (A ??= new Promise((e) => {
|
|
93
|
-
const t = indexedDB.open(g, T);
|
|
94
|
-
t.onupgradeneeded = () => {
|
|
95
|
-
const r = t.result;
|
|
96
|
-
r.objectStoreNames.contains(c) || r.createObjectStore(c, { keyPath: "key" }).createIndex("lastAccessedAt", "lastAccessedAt", { unique: !1 });
|
|
97
|
-
}, t.onsuccess = () => e(t.result), t.onerror = () => e(null), t.onblocked = () => e(null);
|
|
98
|
-
}), A);
|
|
99
|
-
}
|
|
100
|
-
async function R(e) {
|
|
101
|
-
const t = await d();
|
|
102
|
-
return t ? new Promise((r) => {
|
|
103
|
-
const n = t.transaction(c, "readonly"), s = n.objectStore(c).get(e);
|
|
104
|
-
s.onsuccess = () => r(s.result ?? null), s.onerror = () => r(null), n.onerror = () => r(null);
|
|
105
|
-
}) : null;
|
|
106
|
-
}
|
|
107
|
-
async function y(e) {
|
|
108
|
-
const t = await d();
|
|
109
|
-
t && await new Promise((r) => {
|
|
110
|
-
const n = t.transaction(c, "readwrite");
|
|
111
|
-
n.objectStore(c).put(e), n.oncomplete = () => r(), n.onerror = () => r(), n.onabort = () => r();
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
async function L(e) {
|
|
115
|
-
const t = await d();
|
|
116
|
-
t && await new Promise((r) => {
|
|
117
|
-
const n = t.transaction(c, "readwrite");
|
|
118
|
-
n.objectStore(c).delete(e), n.oncomplete = () => r(), n.onerror = () => r(), n.onabort = () => r();
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
async function N(e, t) {
|
|
122
|
-
const r = await d();
|
|
123
|
-
r && await new Promise((n) => {
|
|
124
|
-
const s = r.transaction(c, "readwrite"), o = s.objectStore(c), u = [], f = o.openCursor();
|
|
125
|
-
f.onsuccess = () => {
|
|
126
|
-
const l = f.result;
|
|
127
|
-
if (!l) {
|
|
128
|
-
const p = u.filter((i) => i.expiresAt <= t), x = u.filter((i) => i.expiresAt > t).sort((i, E) => i.lastAccessedAt - E.lastAccessedAt).slice(0, Math.max(0, u.length - p.length - e));
|
|
129
|
-
for (const i of [...p, ...x]) o.delete(i.key);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
u.push(l.value), l.continue();
|
|
133
|
-
}, f.onerror = () => n(), s.oncomplete = () => n(), s.onerror = () => n(), s.onabort = () => n();
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
function q(e) {
|
|
137
|
-
return JSON.stringify(h(e));
|
|
138
|
-
}
|
|
139
|
-
function h(e) {
|
|
140
|
-
return Array.isArray(e) ? e.map(h) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).sort(([t], [r]) => t.localeCompare(r)).map(([t, r]) => [t, h(r)]));
|
|
141
|
-
}
|
|
142
|
-
function F(e) {
|
|
143
|
-
let t = 14695981039346656037n;
|
|
144
|
-
const r = 1099511628211n;
|
|
145
|
-
for (let n = 0; n < e.length; n += 1)
|
|
146
|
-
t ^= BigInt(e.charCodeAt(n)), t = BigInt.asUintN(64, t * r);
|
|
147
|
-
return t.toString(16).padStart(16, "0");
|
|
148
|
-
}
|
|
149
|
-
function U(e) {
|
|
150
|
-
return typeof TextEncoder < "u" ? new TextEncoder().encode(e).byteLength : e.length;
|
|
151
|
-
}
|
|
152
|
-
export {
|
|
153
|
-
H as t
|
|
154
|
-
};
|