@gengage/assistant-fe 0.6.27 → 0.6.29
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/agent-ui-steps-WKbTVOS4.js +3197 -0
- package/dist/agentic/context/context-store.d.ts +25 -0
- package/dist/agentic/index.d.ts +15 -1
- package/dist/agentic/index.js +164 -150
- package/dist/agentic/types.d.ts +31 -3
- package/dist/agentic/worker/agent-ui-steps.d.ts +43 -0
- package/dist/agentic/worker/agent-ui.d.ts +44 -0
- package/dist/agentic/worker/be-client.d.ts +16 -4
- package/dist/agentic/worker/coalesce.d.ts +25 -0
- package/dist/agentic/worker/compaction.d.ts +12 -0
- package/dist/agentic/worker/pdp-hydrate.d.ts +30 -0
- package/dist/agentic/worker/rpc.d.ts +4 -1
- package/dist/agentic/worker/tool-schema.d.ts +19 -0
- package/dist/agentic/worker.d.ts +15 -1
- package/dist/agentic/worker.js +292 -264
- package/dist/agentic.iife.js +9 -9
- package/dist/{api-paths-C9NwnH29.js → api-paths-DdJr0XJ-.js} +1 -1
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +1 -1
- package/dist/chat.js +1 -1
- package/dist/{common-Bhl1mzk2.js → common-DlxPSm8-.js} +1 -1
- package/dist/common.js +5 -5
- package/dist/{connection-warning-D-0Mxk-A.js → connection-warning-B5i-GYl3.js} +1 -1
- package/dist/{fastIntent-bAlwVoje.js → fastIntent-BXTc79jM.js} +1 -1
- package/dist/index.js +10 -10
- 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/{runtime-BAFZ7iOP.js → runtime-2RYLgot8.js} +3 -3
- package/dist/{runtime-oEtmgT4U.js → runtime-BMBmZgp7.js} +3 -3
- package/dist/{runtime-CUNLK1KR.js → runtime-DzSiJPPm.js} +3 -3
- package/dist/{simbut-Dt8e5uSk.js → simbut-Bwpt8E03.js} +1 -1
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/{simrel-txr23_xG.js → simrel-D0G7CUSn.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-56tkaZZB.js → widget-base-XYJ0Ou6y.js} +1 -1
- package/package.json +1 -1
- package/dist/route-params-5K4Du1Xa.js +0 -2476
package/dist/agentic/worker.js
CHANGED
|
@@ -1,155 +1,169 @@
|
|
|
1
|
-
import { buildPhotoSimilarityProfile as
|
|
2
|
-
import { $ as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
let s = null, y = null, p = null, f = "";
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
if (
|
|
10
|
-
typeof
|
|
1
|
+
import { buildPhotoSimilarityProfile as G, buildProductSimilarityProfile as X, buildSimilarityQueries as Y, normalizeSimilarityText as Z, rankSimilarProducts as tt, rankSimilarProductsAsync as et, scoreSimilarityCandidate as rt, tokenizeSimilarityText as at } from "./algos/similarity.js";
|
|
2
|
+
import { $ as A, A as nt, At as st, B as b, C as ct, Ct as T, D as it, Dt as C, E as lt, Et as ut, F as dt, G as pt, H as U, I as yt, J as mt, K as ft, L as I, M as _t, N as gt, O as ht, P as R, Q as B, R as F, St as Pt, T as kt, Tt as wt, U as vt, V as M, W as St, X as xt, Y as At, Z as bt, _ as Tt, _t as Ct, a as Ut, at as K, b as It, bt as Rt, c as Bt, ct as Ft, d as Mt, dt as S, et as Kt, f as Lt, ft as L, g as jt, gt as j, h as Et, ht as zt, i as Ot, it as qt, j as Jt, k as Nt, kt as $t, l as Dt, lt as Ht, m as Wt, mt as Qt, n as Vt, nt as Gt, o as Xt, ot as Yt, p as Zt, pt as te, q as ee, r as re, rt as ae, s as oe, st as ne, t as se, tt as E, u as ce, ut as ie, v as le, vt as ue, w as de, wt as pe, xt as z, y as ye, yt as O, z as me } from "../agent-ui-steps-WKbTVOS4.js";
|
|
3
|
+
function fe(t) {
|
|
4
|
+
const e = self, r = /* @__PURE__ */ new Map(), a = C(e), u = B(a);
|
|
5
|
+
let s = null, y = null, p = null, g = "", f = "idle";
|
|
6
|
+
e.addEventListener("message", (n) => {
|
|
7
|
+
const o = n.data;
|
|
8
|
+
if (o) {
|
|
9
|
+
if (o.type === "abort") {
|
|
10
|
+
typeof o.id == "number" && (r.get(o.id)?.abort(), r.delete(o.id));
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
o.type === "invoke" && _(o);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
async function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
async function _(n) {
|
|
17
|
+
if (f !== "idle") {
|
|
18
|
+
const l = (k) => {
|
|
19
|
+
e.postMessage({
|
|
20
|
+
id: n.id,
|
|
21
|
+
type: "event",
|
|
22
|
+
event: k
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
l(L("agent_busy", "Another shopper turn is already in flight; please try again in a moment.")), l(S()), e.postMessage({
|
|
26
|
+
id: n.id,
|
|
27
|
+
type: "end"
|
|
28
|
+
});
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
f = "in_turn", s = {
|
|
32
|
+
accountId: String(n.accountId || t.accountId || ""),
|
|
33
|
+
beUrl: n.beUrl || "",
|
|
34
|
+
...n.devJwtSecret ? { devJwtSecret: n.devJwtSecret } : {},
|
|
35
|
+
...n.tokenBrokerUrl ? { tokenBrokerUrl: n.tokenBrokerUrl } : {},
|
|
36
|
+
...n.tokenBrokerAudience ? { tokenBrokerAudience: n.tokenBrokerAudience } : {},
|
|
37
|
+
locale: n.defaultLocale || t.defaultLocale || "en-GB",
|
|
38
|
+
parentUrl: n.parentUrl || ""
|
|
25
39
|
};
|
|
26
|
-
const
|
|
40
|
+
const o = [
|
|
27
41
|
s.accountId,
|
|
28
42
|
s.devJwtSecret || "",
|
|
29
43
|
s.tokenBrokerUrl || "",
|
|
30
44
|
s.tokenBrokerAudience || ""
|
|
31
45
|
].join(`
|
|
32
46
|
`);
|
|
33
|
-
(!p ||
|
|
47
|
+
(!p || g !== o) && (p = z(s), g = o), y ||= new T({
|
|
34
48
|
accountId: s.accountId,
|
|
35
49
|
locale: s.locale,
|
|
36
50
|
parentUrl: s.parentUrl,
|
|
37
51
|
rpc: a,
|
|
38
|
-
persistentPanelKeys:
|
|
39
|
-
panelKeyLimits:
|
|
40
|
-
messageLimit:
|
|
41
|
-
maxThreads:
|
|
42
|
-
threadTtlMs:
|
|
52
|
+
persistentPanelKeys: t.contextPersistence?.panelKeys,
|
|
53
|
+
panelKeyLimits: t.contextPersistence?.panelKeyLimits,
|
|
54
|
+
messageLimit: t.contextPersistence?.messageLimit,
|
|
55
|
+
maxThreads: t.contextPersistence?.maxThreads,
|
|
56
|
+
threadTtlMs: t.contextPersistence?.threadTtlMs
|
|
43
57
|
});
|
|
44
|
-
const
|
|
45
|
-
r.set(
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
id:
|
|
58
|
+
const c = new AbortController();
|
|
59
|
+
r.set(n.id, c);
|
|
60
|
+
const i = (l) => {
|
|
61
|
+
e.postMessage({
|
|
62
|
+
id: n.id,
|
|
49
63
|
type: "event",
|
|
50
|
-
event:
|
|
64
|
+
event: l
|
|
51
65
|
});
|
|
52
|
-
}, d = (
|
|
53
|
-
|
|
54
|
-
id:
|
|
66
|
+
}, d = (l) => {
|
|
67
|
+
n.debugActivity === !0 && e.postMessage({
|
|
68
|
+
id: n.id,
|
|
55
69
|
type: "activity",
|
|
56
|
-
entry:
|
|
70
|
+
entry: l
|
|
57
71
|
});
|
|
58
72
|
};
|
|
59
73
|
try {
|
|
60
|
-
const
|
|
61
|
-
await
|
|
62
|
-
request:
|
|
74
|
+
const l = s, k = p;
|
|
75
|
+
await A({
|
|
76
|
+
request: n.request || {},
|
|
63
77
|
accountModule: {
|
|
64
|
-
...
|
|
65
|
-
accountId:
|
|
66
|
-
trace: async (
|
|
78
|
+
...t,
|
|
79
|
+
accountId: l.accountId,
|
|
80
|
+
trace: async (v) => {
|
|
67
81
|
d({
|
|
68
82
|
kind: "flow/trace",
|
|
69
|
-
event:
|
|
70
|
-
}), await
|
|
83
|
+
event: v
|
|
84
|
+
}), await t.trace?.(v);
|
|
71
85
|
}
|
|
72
86
|
},
|
|
73
87
|
contextStore: y,
|
|
74
|
-
beClient:
|
|
75
|
-
config:
|
|
76
|
-
jwtProvider:
|
|
88
|
+
beClient: q({
|
|
89
|
+
config: l,
|
|
90
|
+
jwtProvider: k,
|
|
77
91
|
postActivity: d
|
|
78
92
|
}),
|
|
79
|
-
toolBridge:
|
|
80
|
-
emit:
|
|
93
|
+
toolBridge: u,
|
|
94
|
+
emit: i,
|
|
81
95
|
rpc: a,
|
|
82
|
-
signal:
|
|
83
|
-
}),
|
|
84
|
-
id:
|
|
96
|
+
signal: c.signal
|
|
97
|
+
}), e.postMessage({
|
|
98
|
+
id: n.id,
|
|
85
99
|
type: "end"
|
|
86
100
|
});
|
|
87
|
-
} catch (
|
|
88
|
-
|
|
89
|
-
id:
|
|
101
|
+
} catch (l) {
|
|
102
|
+
c.signal.aborted || (i(O(l)), i(S()), e.postMessage({
|
|
103
|
+
id: n.id,
|
|
90
104
|
type: "end"
|
|
91
105
|
}));
|
|
92
106
|
} finally {
|
|
93
|
-
r.delete(
|
|
107
|
+
r.delete(n.id), f = "idle";
|
|
94
108
|
}
|
|
95
109
|
}
|
|
96
110
|
}
|
|
97
|
-
function
|
|
98
|
-
return { async invoke({ op: a, input:
|
|
99
|
-
const
|
|
111
|
+
function q({ config: t, jwtProvider: e, postActivity: r }) {
|
|
112
|
+
return { async invoke({ op: a, input: u, signal: s, cacheTtlS: y, cacheKey: p, browserCache: g }) {
|
|
113
|
+
const f = performance.now(), _ = t.accountId.replace(/-agentic$/u, ""), n = `${String(t.beUrl).replace(/\/+$/u, "")}/v1/execute`;
|
|
100
114
|
r({
|
|
101
115
|
kind: "be/request",
|
|
102
116
|
source: "worker-fetch",
|
|
103
|
-
url:
|
|
117
|
+
url: n,
|
|
104
118
|
op: a,
|
|
105
|
-
opDomain:
|
|
106
|
-
params:
|
|
119
|
+
opDomain: _,
|
|
120
|
+
params: u || {},
|
|
107
121
|
rawBody: {
|
|
108
|
-
op_domain:
|
|
122
|
+
op_domain: _,
|
|
109
123
|
op_name: a,
|
|
110
|
-
op_payload:
|
|
124
|
+
op_payload: u,
|
|
111
125
|
...y !== void 0 ? { cache_ttl_s: y } : {},
|
|
112
126
|
...p !== void 0 ? { cache_key: p } : {}
|
|
113
127
|
}
|
|
114
128
|
});
|
|
115
129
|
try {
|
|
116
|
-
const
|
|
117
|
-
beUrl:
|
|
118
|
-
accountId:
|
|
119
|
-
jwtProvider:
|
|
120
|
-
parentUrl:
|
|
130
|
+
const o = await j({
|
|
131
|
+
beUrl: t.beUrl,
|
|
132
|
+
accountId: t.accountId,
|
|
133
|
+
jwtProvider: e,
|
|
134
|
+
parentUrl: t.parentUrl,
|
|
121
135
|
op: a,
|
|
122
|
-
input:
|
|
136
|
+
input: u,
|
|
123
137
|
cacheTtlS: y,
|
|
124
138
|
cacheKey: p,
|
|
125
|
-
browserCache:
|
|
139
|
+
browserCache: g,
|
|
126
140
|
...s ? { signal: s } : {}
|
|
127
141
|
});
|
|
128
142
|
return r({
|
|
129
143
|
kind: "be/response",
|
|
130
144
|
source: "worker-fetch",
|
|
131
|
-
url:
|
|
145
|
+
url: n,
|
|
132
146
|
status: 200,
|
|
133
147
|
op: a,
|
|
134
|
-
opDomain:
|
|
135
|
-
latencyMs: Math.max(0, Math.round(performance.now() -
|
|
136
|
-
result:
|
|
137
|
-
}),
|
|
138
|
-
} catch (
|
|
148
|
+
opDomain: _,
|
|
149
|
+
latencyMs: Math.max(0, Math.round(performance.now() - f)),
|
|
150
|
+
result: o
|
|
151
|
+
}), o;
|
|
152
|
+
} catch (o) {
|
|
139
153
|
throw r({
|
|
140
154
|
kind: "be/response",
|
|
141
155
|
source: "worker-fetch",
|
|
142
|
-
url:
|
|
156
|
+
url: n,
|
|
143
157
|
op: a,
|
|
144
|
-
opDomain:
|
|
145
|
-
latencyMs: Math.max(0, Math.round(performance.now() -
|
|
146
|
-
error:
|
|
147
|
-
}),
|
|
158
|
+
opDomain: _,
|
|
159
|
+
latencyMs: Math.max(0, Math.round(performance.now() - f)),
|
|
160
|
+
error: o instanceof Error ? o.message : String(o)
|
|
161
|
+
}), o;
|
|
148
162
|
}
|
|
149
163
|
} };
|
|
150
164
|
}
|
|
151
|
-
var
|
|
152
|
-
...
|
|
165
|
+
var w = { patterns: [
|
|
166
|
+
...b,
|
|
153
167
|
{
|
|
154
168
|
pattern: /(?:adresim|adres|address)\s*[:=]?\s*[^.;\n]{0,160}/giu,
|
|
155
169
|
replacement: "[address]"
|
|
@@ -158,80 +172,80 @@ var h = { patterns: [
|
|
|
158
172
|
pattern: /[^\s,.;]{2,}\s+(?:mahallesi|mah\.|sokak|sk\.|cadde|cad\.)\s+[^.;\n]{0,120}/giu,
|
|
159
173
|
replacement: "[address]"
|
|
160
174
|
}
|
|
161
|
-
] },
|
|
162
|
-
function
|
|
163
|
-
return String(
|
|
175
|
+
] }, J = "llm-flow-routing-v1";
|
|
176
|
+
function N(t) {
|
|
177
|
+
return String(t?.payload?.text || t?.payload?.query || t?.action?.payload?.text || "");
|
|
164
178
|
}
|
|
165
|
-
function
|
|
166
|
-
return t
|
|
179
|
+
function _e(t, e = {}) {
|
|
180
|
+
return e[t?.type || t?.action?.type] || "";
|
|
167
181
|
}
|
|
168
|
-
function
|
|
182
|
+
function ge({ accountId: t, cacheTtlS: e = 3600, browserCacheTtlMs: r, promptVersion: a = J, cacheable: u = !0, piiPatternPack: s = w, utterance: y, compactPageContext: p = D, compactStructuredContext: g = H, extraInput: f, cacheKeyParts: _, onError: n = [] } = {}) {
|
|
169
183
|
return {
|
|
170
184
|
kind: "be_op",
|
|
171
185
|
op: "intent",
|
|
172
|
-
input: (
|
|
173
|
-
const { request:
|
|
174
|
-
return
|
|
175
|
-
utterance: x(
|
|
176
|
-
request:
|
|
177
|
-
context:
|
|
178
|
-
bag:
|
|
179
|
-
accountConfig:
|
|
186
|
+
input: (o) => {
|
|
187
|
+
const { request: c, context: i, bag: d, accountConfig: l } = o;
|
|
188
|
+
return I(h({
|
|
189
|
+
utterance: x(c, {
|
|
190
|
+
request: c,
|
|
191
|
+
context: i,
|
|
192
|
+
bag: d,
|
|
193
|
+
accountConfig: l
|
|
180
194
|
}, y, s),
|
|
181
|
-
page_context: m(p,
|
|
182
|
-
structured_context: m(
|
|
183
|
-
locale:
|
|
184
|
-
...
|
|
185
|
-
}),
|
|
195
|
+
page_context: m(p, d.page, o),
|
|
196
|
+
structured_context: m(g, i, o),
|
|
197
|
+
locale: i.meta.locale,
|
|
198
|
+
...h(m(f, o))
|
|
199
|
+
}), l, "intent");
|
|
186
200
|
},
|
|
187
201
|
out: "route",
|
|
188
|
-
cache: (
|
|
189
|
-
ttlS:
|
|
202
|
+
cache: (o) => m(u, o) ? R({
|
|
203
|
+
ttlS: e,
|
|
190
204
|
promptVersion: a
|
|
191
205
|
}) : void 0,
|
|
192
206
|
...r ? { browserCache: { ttlMs: r } } : {},
|
|
193
|
-
cacheKey: ({ request:
|
|
194
|
-
if (m(
|
|
195
|
-
request:
|
|
196
|
-
context:
|
|
197
|
-
bag:
|
|
198
|
-
accountConfig:
|
|
207
|
+
cacheKey: ({ request: o, context: c, bag: i, accountConfig: d }) => {
|
|
208
|
+
if (m(u, {
|
|
209
|
+
request: o,
|
|
210
|
+
context: c,
|
|
211
|
+
bag: i,
|
|
212
|
+
accountConfig: d
|
|
199
213
|
}))
|
|
200
|
-
return
|
|
201
|
-
account:
|
|
214
|
+
return E("intent", {
|
|
215
|
+
account: t,
|
|
202
216
|
prompt: a,
|
|
203
|
-
locale:
|
|
204
|
-
utterance:
|
|
205
|
-
request:
|
|
206
|
-
context:
|
|
207
|
-
bag:
|
|
208
|
-
accountConfig:
|
|
209
|
-
}, y, s),
|
|
210
|
-
page: m(p,
|
|
211
|
-
request:
|
|
212
|
-
context:
|
|
213
|
-
bag:
|
|
214
|
-
accountConfig:
|
|
217
|
+
locale: c.meta.locale,
|
|
218
|
+
utterance: K(x(o, {
|
|
219
|
+
request: o,
|
|
220
|
+
context: c,
|
|
221
|
+
bag: i,
|
|
222
|
+
accountConfig: d
|
|
223
|
+
}, y, s), c.meta.locale),
|
|
224
|
+
page: m(p, i.page, {
|
|
225
|
+
request: o,
|
|
226
|
+
context: c,
|
|
227
|
+
bag: i,
|
|
228
|
+
accountConfig: d
|
|
215
229
|
}),
|
|
216
|
-
panel: m(
|
|
217
|
-
request:
|
|
218
|
-
context:
|
|
219
|
-
bag:
|
|
220
|
-
accountConfig:
|
|
230
|
+
panel: m(g, c, {
|
|
231
|
+
request: o,
|
|
232
|
+
context: c,
|
|
233
|
+
bag: i,
|
|
234
|
+
accountConfig: d
|
|
221
235
|
}),
|
|
222
|
-
...
|
|
223
|
-
request:
|
|
224
|
-
context:
|
|
225
|
-
bag:
|
|
226
|
-
accountConfig:
|
|
236
|
+
...h(m(_, {
|
|
237
|
+
request: o,
|
|
238
|
+
context: c,
|
|
239
|
+
bag: i,
|
|
240
|
+
accountConfig: d
|
|
227
241
|
}))
|
|
228
242
|
});
|
|
229
243
|
},
|
|
230
|
-
onError:
|
|
244
|
+
onError: n
|
|
231
245
|
};
|
|
232
246
|
}
|
|
233
|
-
function
|
|
234
|
-
const r = String(
|
|
247
|
+
function he(t, e = "product") {
|
|
248
|
+
const r = String(t?.intent?.kind || t?.kind || "").trim();
|
|
235
249
|
return {
|
|
236
250
|
product_search: "search",
|
|
237
251
|
add_to_cart: "cart",
|
|
@@ -245,16 +259,16 @@ function at(e, t = "product") {
|
|
|
245
259
|
consulting_redirect: "consulting",
|
|
246
260
|
handoff_shopping: "consulting",
|
|
247
261
|
handOffShopping: "consulting"
|
|
248
|
-
}[r] || r ||
|
|
262
|
+
}[r] || r || e;
|
|
249
263
|
}
|
|
250
|
-
function
|
|
251
|
-
return
|
|
264
|
+
function Pe(t, e) {
|
|
265
|
+
return $(t, e).query || "";
|
|
252
266
|
}
|
|
253
|
-
function
|
|
254
|
-
const r =
|
|
255
|
-
return
|
|
267
|
+
function $(t, e) {
|
|
268
|
+
const r = e.route?.search_params || e.route?.searchParams || {}, a = t?.payload || {}, u = r.query || a.query;
|
|
269
|
+
return h({
|
|
256
270
|
...r,
|
|
257
|
-
query:
|
|
271
|
+
query: u,
|
|
258
272
|
text: r.text || a.text,
|
|
259
273
|
facetParams: r.facetParams || r.facet_params || a.facetParams || a.facet_params,
|
|
260
274
|
facets: r.facets || a.facets,
|
|
@@ -265,135 +279,149 @@ function q(e, t) {
|
|
|
265
279
|
maxPrice: r.maxPrice || a.maxPrice
|
|
266
280
|
});
|
|
267
281
|
}
|
|
268
|
-
function
|
|
269
|
-
return (
|
|
282
|
+
function ke(t) {
|
|
283
|
+
return (t.route?.flow_params && typeof t.route.flow_params == "object" ? t.route.flow_params : null) || (t.route?.flowParams && typeof t.route.flowParams == "object" ? t.route.flowParams : null) || {};
|
|
270
284
|
}
|
|
271
|
-
function
|
|
272
|
-
const
|
|
273
|
-
return
|
|
274
|
-
pageType:
|
|
275
|
-
sku:
|
|
276
|
-
product_name:
|
|
277
|
-
category_names: Array.isArray(
|
|
285
|
+
function D(t = {}) {
|
|
286
|
+
const e = t?.product && typeof t.product == "object" ? t.product : null;
|
|
287
|
+
return h({
|
|
288
|
+
pageType: t?.pageType || t?.type || "other",
|
|
289
|
+
sku: t?.sku || e?.sku,
|
|
290
|
+
product_name: e?.name || e?.title,
|
|
291
|
+
category_names: Array.isArray(e?.category_names) ? e.category_names.slice(0, 5) : void 0
|
|
278
292
|
});
|
|
279
293
|
}
|
|
280
|
-
function
|
|
281
|
-
const
|
|
282
|
-
return
|
|
283
|
-
screen_type:
|
|
284
|
-
screen_sku_list: Array.isArray(
|
|
285
|
-
chat_mentioned_skus: Array.isArray(
|
|
286
|
-
last_search:
|
|
287
|
-
current_panel_product_count: Array.isArray(
|
|
294
|
+
function H(t = {}) {
|
|
295
|
+
const e = t.panel || {};
|
|
296
|
+
return h({
|
|
297
|
+
screen_type: e.screen_type,
|
|
298
|
+
screen_sku_list: Array.isArray(e.screen_sku_list) ? e.screen_sku_list.slice(0, 24) : void 0,
|
|
299
|
+
chat_mentioned_skus: Array.isArray(e.chat_mentioned_skus) ? e.chat_mentioned_skus.slice(0, 12) : void 0,
|
|
300
|
+
last_search: W(e.last_search),
|
|
301
|
+
current_panel_product_count: Array.isArray(e.last_search_products) ? e.last_search_products.length : 0
|
|
288
302
|
});
|
|
289
303
|
}
|
|
290
|
-
function
|
|
291
|
-
return !
|
|
292
|
-
query:
|
|
293
|
-
source:
|
|
294
|
-
count:
|
|
295
|
-
category:
|
|
296
|
-
goal:
|
|
304
|
+
function W(t) {
|
|
305
|
+
return !t || typeof t != "object" ? null : h({
|
|
306
|
+
query: P(t.query),
|
|
307
|
+
source: t.source,
|
|
308
|
+
count: t.count,
|
|
309
|
+
category: P(t.category),
|
|
310
|
+
goal: P(t.goal)
|
|
297
311
|
});
|
|
298
312
|
}
|
|
299
|
-
function
|
|
300
|
-
return
|
|
313
|
+
function Q(t, e = w) {
|
|
314
|
+
return F(t, e) || P(U(t) || N(t), e);
|
|
301
315
|
}
|
|
302
|
-
function x(
|
|
303
|
-
const
|
|
304
|
-
return
|
|
316
|
+
function x(t, e, r, a) {
|
|
317
|
+
const u = m(r, t, e);
|
|
318
|
+
return u ? String(u) : Q(t, a);
|
|
305
319
|
}
|
|
306
|
-
function
|
|
307
|
-
return
|
|
320
|
+
function P(t, e = w) {
|
|
321
|
+
return M(String(t || ""), e);
|
|
308
322
|
}
|
|
309
|
-
function m(
|
|
310
|
-
return typeof
|
|
323
|
+
function m(t, e, r) {
|
|
324
|
+
return typeof t == "function" ? t(e, r) : t;
|
|
311
325
|
}
|
|
312
|
-
function
|
|
313
|
-
return Object.fromEntries(Object.entries(
|
|
326
|
+
function h(t) {
|
|
327
|
+
return Object.fromEntries(Object.entries(t || {}).filter(([, e]) => e != null && e !== "" && (!Array.isArray(e) || e.length)));
|
|
314
328
|
}
|
|
315
329
|
export {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
he as
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
330
|
+
Ct as AgentError,
|
|
331
|
+
T as ContextStore,
|
|
332
|
+
nt as FALLBACK_STATUS,
|
|
333
|
+
Mt as __resetAllCartCoalescersForTesting,
|
|
334
|
+
Dt as __resetAllPdpHydratorsForTesting,
|
|
335
|
+
ie as action,
|
|
336
|
+
St as actionButtonsUiSpec,
|
|
337
|
+
mt as alignProductsToTable,
|
|
338
|
+
F as anonymousRequestText,
|
|
339
|
+
re as applyCompactionResult,
|
|
340
|
+
ue as beErrorToAgentError,
|
|
341
|
+
Ot as buildCompactionRequest,
|
|
342
|
+
se as buildPdpFollowupSteps,
|
|
343
|
+
G as buildPhotoSimilarityProfile,
|
|
344
|
+
X as buildProductSimilarityProfile,
|
|
345
|
+
Y as buildSimilarityQueries,
|
|
346
|
+
Vt as buildToolUiSteps,
|
|
347
|
+
O as caughtToStreamError,
|
|
348
|
+
Lt as coalesceAddToCart,
|
|
349
|
+
yt as compactAccountConfig,
|
|
350
|
+
bt as compactContextProducts,
|
|
351
|
+
ht as compactObject,
|
|
352
|
+
It as compactProductSurfaceForLlm,
|
|
353
|
+
At as comparisonResultForUi,
|
|
354
|
+
pt as comparisonUiSpec,
|
|
355
|
+
vt as createFlow,
|
|
356
|
+
z as createJwtProvider,
|
|
357
|
+
kt as createPrivacyHelpers,
|
|
358
|
+
Nt as createReadPageStep,
|
|
359
|
+
B as createToolBridge,
|
|
360
|
+
C as createWorkerRpc,
|
|
361
|
+
gt as declarativeBeOpCache,
|
|
362
|
+
me as defaultPiiPatternPack,
|
|
363
|
+
b as defaultPiiPatterns,
|
|
364
|
+
S as done,
|
|
365
|
+
wt as elapsedMs,
|
|
366
|
+
L as error,
|
|
367
|
+
_e as explicitRoute,
|
|
368
|
+
Jt as fallbackStatus,
|
|
369
|
+
Wt as firstArrayValue,
|
|
370
|
+
ke as flowParamsFromRoute,
|
|
371
|
+
$t as handleMainRpc,
|
|
372
|
+
it as homePanelReset,
|
|
373
|
+
Rt as httpErrorToAgentError,
|
|
374
|
+
R as inputHashCachePolicy,
|
|
375
|
+
j as invokeBeOp,
|
|
376
|
+
_t as isFallbackStatus,
|
|
377
|
+
E as llmCacheKey,
|
|
378
|
+
ge as llmIntentStep,
|
|
379
|
+
ct as mergeProductSurfaceEvidence,
|
|
380
|
+
Xt as mergeRoundProducts,
|
|
381
|
+
te as metadata,
|
|
382
|
+
Pt as mintDevJwt,
|
|
383
|
+
xt as normalizeComparisonTable,
|
|
384
|
+
Yt as normalizeProduct,
|
|
385
|
+
Z as normalizeSimilarityText,
|
|
386
|
+
ut as nowIso,
|
|
387
|
+
lt as plainMessageContent,
|
|
388
|
+
ft as productDetailsUiSpec,
|
|
389
|
+
Gt as productFactsKey,
|
|
390
|
+
ae as productSkuKey,
|
|
391
|
+
de as productSurfaceReviewText,
|
|
392
|
+
ee as productsUiSpec,
|
|
393
|
+
tt as rankSimilarProducts,
|
|
394
|
+
et as rankSimilarProductsAsync,
|
|
395
|
+
M as redactPii,
|
|
396
|
+
U as requestText,
|
|
397
|
+
Ht as resolveFlow,
|
|
398
|
+
Tt as retailAnonymizeMessages,
|
|
399
|
+
le as retailAnonymousRequestText,
|
|
400
|
+
ye as retailRedactPii,
|
|
401
|
+
Et as routeFlowParams,
|
|
402
|
+
he as routeKind,
|
|
403
|
+
jt as routeSkuList,
|
|
404
|
+
N as routeText,
|
|
405
|
+
st as runMainRpc,
|
|
406
|
+
A as runTurn,
|
|
407
|
+
rt as scoreSimilarityCandidate,
|
|
408
|
+
oe as searchFollowUpPills,
|
|
409
|
+
$ as searchInputFromRoute,
|
|
410
|
+
Pe as searchQueryFromRoute,
|
|
411
|
+
Ut as shouldCompact,
|
|
412
|
+
Zt as singleFlight,
|
|
413
|
+
qt as stableKey,
|
|
414
|
+
fe as startWorker,
|
|
415
|
+
pe as stickyContextKey,
|
|
416
|
+
Qt as textChunk,
|
|
417
|
+
K as textKey,
|
|
418
|
+
at as tokenizeSimilarityText,
|
|
419
|
+
ne as trimProductFactsCore,
|
|
420
|
+
Ft as trimProductFactsListCore,
|
|
421
|
+
zt as uiSpec,
|
|
422
|
+
Kt as validateToolArgs,
|
|
423
|
+
I as withAccountConfig,
|
|
424
|
+
dt as withDeclarativeBeOpCache,
|
|
425
|
+
Bt as withSimilarsAppend,
|
|
426
|
+
ce as wrapResolveProductsWithPdpHydration
|
|
399
427
|
};
|