@gengage/assistant-fe 0.6.21 → 0.6.22
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/README.md +4 -2
- package/dist/agentic/adaptor/create-adaptor.d.ts +6 -3
- package/dist/agentic/adaptor/mount.d.ts +8 -2
- package/dist/agentic/{similarity.d.ts → algos/similarity.d.ts} +11 -2
- package/dist/agentic/algos/similarity.js +261 -0
- package/dist/agentic/context/chat-context.d.ts +4 -2
- package/dist/agentic/context/context-store.d.ts +11 -1
- package/dist/agentic/context/persistence.d.ts +1 -0
- package/dist/agentic/contracts/agentic-contracts.d.ts +133 -0
- package/dist/agentic/debug/activity-collector.d.ts +14 -0
- package/dist/agentic/debug/activity-instrumentation.d.ts +22 -0
- package/dist/agentic/debug/activity-overlay.d.ts +3 -0
- package/dist/agentic/debug/activity-state.d.ts +37 -0
- package/dist/agentic/debug/local-dev.d.ts +18 -0
- package/dist/agentic/events/product-normalize.d.ts +4 -1
- package/dist/agentic/events/ui-specs.d.ts +8 -4
- package/dist/agentic/index.d.ts +25 -2
- package/dist/agentic/index.js +2792 -441
- package/dist/agentic/types.d.ts +77 -4
- package/dist/agentic/util/common/declarative-cache.d.ts +21 -0
- package/dist/agentic/util/common/fallback-status.d.ts +10 -0
- package/dist/agentic/util/common/flow-steps.d.ts +8 -0
- package/dist/agentic/util/common/gss-tool-aliases.d.ts +66 -0
- package/dist/agentic/util/common/iframe-scraper.d.ts +22 -0
- package/dist/agentic/util/common/llm-routing.d.ts +50 -0
- package/dist/agentic/util/common/object.d.ts +1 -0
- package/dist/agentic/util/common/open-product-page.d.ts +30 -0
- package/dist/agentic/util/common/panel-context.d.ts +3 -0
- package/dist/agentic/util/common/privacy.d.ts +14 -0
- package/dist/agentic/util/common/product-resolver.d.ts +20 -0
- package/dist/agentic/util/common/product-surface.d.ts +24 -0
- package/dist/agentic/util/common/ref-store.d.ts +15 -0
- package/dist/agentic/util/common/retail-privacy.d.ts +4 -0
- package/dist/agentic/util/common/route-params.d.ts +3 -0
- package/dist/agentic/util/common/similarity-ranking.d.ts +2 -0
- package/dist/agentic/util/common/site-awareness.d.ts +130 -0
- package/dist/agentic/util/lazy-runtime-loader.d.ts +2 -1
- package/dist/agentic/worker/rpc.d.ts +26 -6
- package/dist/agentic/worker.d.ts +15 -2
- package/dist/agentic/worker.js +316 -119
- package/dist/agentic.iife.js +352 -6
- package/dist/{api-paths-DcKsQqb6.js → api-paths-DE3_TyTw.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-MpBmMLVk.js → common-BWnFHbvv.js} +1 -1
- package/dist/common.js +5 -5
- package/dist/{connection-warning-ClrMLgmZ.js → connection-warning-Tk4ZjgMi.js} +1 -1
- package/dist/{fastIntent-Bl4xN0qL.js → fastIntent-DIhMlxVd.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/route-params-5KSvTyeb.js +2454 -0
- package/dist/{runtime-CS4mg3ra.js → runtime-CjJy8KKu.js} +3 -3
- package/dist/{runtime-_koZbJK_.js → runtime-H5hNQQKm.js} +3 -3
- package/dist/{runtime-BlU1rKqc.js → runtime-wEP7N2Hr.js} +3 -3
- package/dist/{simbut-BtL7zYIJ.js → simbut-BlBLtgVy.js} +1 -1
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/{simrel-ekf3kUb_.js → simrel-S6-OsWJ9.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-p1EKDuiI.js → widget-base-e4JwEf2I.js} +1 -1
- package/package.json +5 -1
- package/dist/account-config-D_EMuR0g.js +0 -1479
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import type { AgentBeaconPayload, RpcFn, ToolMap } from '../types.js';
|
|
2
|
-
interface
|
|
1
|
+
import type { AgentBeaconPayload, ConfirmationCallback, AgentMemoryProvider, BrowserMemory, RpcFn, ToolMap } from '../types.js';
|
|
2
|
+
interface StorageMemoryLike {
|
|
3
3
|
getItem: (key: string) => string | null;
|
|
4
4
|
setItem: (key: string, value: string) => void;
|
|
5
|
+
removeItem?: (key: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export type MainRpcMemory = StorageMemoryLike | BrowserMemory | AgentMemoryProvider;
|
|
8
|
+
interface MainRpcRefStore {
|
|
9
|
+
put: (value: unknown, options?: {
|
|
10
|
+
kind?: string;
|
|
11
|
+
ttlMs?: number;
|
|
12
|
+
}) => Promise<{
|
|
13
|
+
kind: string;
|
|
14
|
+
id: string;
|
|
15
|
+
}>;
|
|
16
|
+
get: (refOrId: unknown) => Promise<unknown>;
|
|
17
|
+
delete: (refOrId: unknown) => Promise<void>;
|
|
18
|
+
materialize: (value: unknown) => Promise<unknown>;
|
|
19
|
+
cleanup?: () => void;
|
|
5
20
|
}
|
|
6
21
|
interface MainRpcDeps {
|
|
7
22
|
tools: ToolMap;
|
|
8
23
|
beacon?: ((payload: AgentBeaconPayload) => void) | undefined;
|
|
9
|
-
|
|
24
|
+
confirmation?: ConfirmationCallback | undefined;
|
|
25
|
+
memory: MainRpcMemory;
|
|
26
|
+
refStore?: MainRpcRefStore | undefined;
|
|
10
27
|
}
|
|
11
28
|
interface RpcScope {
|
|
12
29
|
addEventListener: (type: 'message', listener: (event: MessageEvent) => void) => void;
|
|
@@ -17,8 +34,11 @@ interface HandleMainRpcArgs {
|
|
|
17
34
|
worker: Worker;
|
|
18
35
|
tools?: ToolMap;
|
|
19
36
|
beacon?: (payload: AgentBeaconPayload) => void;
|
|
20
|
-
|
|
37
|
+
confirmation?: ConfirmationCallback;
|
|
38
|
+
memory?: MainRpcMemory;
|
|
39
|
+
refStore?: MainRpcRefStore;
|
|
21
40
|
}
|
|
22
|
-
export declare function handleMainRpc({ worker, tools, beacon, memory }: HandleMainRpcArgs): void;
|
|
23
|
-
export declare function
|
|
41
|
+
export declare function handleMainRpc({ worker, tools, beacon, confirmation, memory, refStore, }: HandleMainRpcArgs): void;
|
|
42
|
+
export declare function defaultMainRpcMemory(): StorageMemoryLike;
|
|
43
|
+
export declare function runMainRpc(method: string, payload: unknown, { tools, beacon, confirmation, memory, refStore }: MainRpcDeps): Promise<unknown>;
|
|
24
44
|
export {};
|
package/dist/agentic/worker.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { ContextStore } from './context/context-store.js';
|
|
2
|
+
export { stickyContextKey } from './context/persistence.js';
|
|
2
3
|
export { action, done, error, metadata, textChunk, uiSpec } from './events/builders.js';
|
|
3
4
|
export { AgentError, beErrorToAgentError, caughtToStreamError, httpErrorToAgentError, } from './events/error-taxonomy.js';
|
|
4
5
|
export { normalizeProduct, trimProductFactsCore, trimProductFactsListCore } from './events/product-normalize.js';
|
|
@@ -7,7 +8,7 @@ export { alignProductsToTable, comparisonResultForUi, normalizeComparisonTable }
|
|
|
7
8
|
export { actionButtonsUiSpec, comparisonUiSpec, productDetailsUiSpec, productsUiSpec } from './events/ui-specs.js';
|
|
8
9
|
export { createFlow } from './flow/create-flow.js';
|
|
9
10
|
export { resolveFlow } from './flow/dispatch.js';
|
|
10
|
-
export { buildPhotoSimilarityProfile, buildProductSimilarityProfile, buildSimilarityQueries, normalizeSimilarityText, rankSimilarProducts, scoreSimilarityCandidate, tokenizeSimilarityText, type PhotoSimilaritySignals, type ProductSimilarityProfile, type SimilarityProductLike, type SimilarityRankedProduct, type SimilarityRankingOptions, type SimilarityScore, type SimilarityWeights, } from './similarity.js';
|
|
11
|
+
export { buildPhotoSimilarityProfile, buildProductSimilarityProfile, buildSimilarityQueries, normalizeSimilarityText, rankSimilarProducts, rankSimilarProductsAsync, scoreSimilarityCandidate, tokenizeSimilarityText, type PhotoSimilaritySignals, type ProductSimilarityProfile, type SimilarityProductLike, type SimilarityAsyncRankingOptions, type SimilarityRankedProduct, type SimilarityRankingOptions, type SimilarityScore, type SimilarityWeights, } from './algos/similarity.js';
|
|
11
12
|
export { requestText } from './util/request-text.js';
|
|
12
13
|
export { anonymousRequestText, defaultPiiPatternPack, defaultPiiPatterns, redactPii } from './util/privacy.js';
|
|
13
14
|
export { compactAccountConfig, withAccountConfig } from './util/account-config.js';
|
|
@@ -21,5 +22,17 @@ export { startWorker } from './worker/entry.js';
|
|
|
21
22
|
export { runTurn } from './worker/flow-runner.js';
|
|
22
23
|
export { createJwtProvider, mintDevJwt } from './worker/jwt-mint.js';
|
|
23
24
|
export { createWorkerRpc, handleMainRpc, runMainRpc } from './worker/rpc.js';
|
|
25
|
+
export type { MainRpcMemory } from './worker/rpc.js';
|
|
24
26
|
export { createToolBridge } from './worker/tool-bridge.js';
|
|
25
|
-
export
|
|
27
|
+
export { declarativeBeOpCache, inputHashCachePolicy, withDeclarativeBeOpCache, } from './util/common/declarative-cache.js';
|
|
28
|
+
export { FALLBACK_STATUS, fallbackStatus, isFallbackStatus } from './util/common/fallback-status.js';
|
|
29
|
+
export { createReadPageStep } from './util/common/flow-steps.js';
|
|
30
|
+
export { explicitRoute, flowParamsFromRoute, llmIntentStep, routeKind, routeText, searchInputFromRoute, searchQueryFromRoute, } from './util/common/llm-routing.js';
|
|
31
|
+
export { compactObject } from './util/common/object.js';
|
|
32
|
+
export { homePanelReset } from './util/common/panel-context.js';
|
|
33
|
+
export { createPrivacyHelpers, plainMessageContent } from './util/common/privacy.js';
|
|
34
|
+
export { compactProductSurfaceForLlm, mergeProductSurfaceEvidence, productSurfaceReviewText, } from './util/common/product-surface.js';
|
|
35
|
+
export { anonymousRequestText as retailAnonymousRequestText, anonymizeMessages as retailAnonymizeMessages, redactPii as retailRedactPii, } from './util/common/retail-privacy.js';
|
|
36
|
+
export { firstArrayValue, routeFlowParams, routeSkuList } from './util/common/route-params.js';
|
|
37
|
+
export type { AccountModule, AgentConfirmationRequest, AgentConfirmationResult, AgentMemoryProvider, AgentTraceCallback, AgentTraceEvent, AdapterStep, AgentBeaconPayload, Awaitable, BeClient, BeOpStep, BranchStep, BrowserCachePolicy, ChatContext, CommitStep, EmitStep, Flow, FlowAdapterFn, FlowAdapterMap, FlowConfirmationGate, FlowConfirmationRequest, FlowConfirmationValue, FlowPatch, FlowStep, FlowStepCtx, FlowValue, MemoryTier, ParallelStep, RefusalStep, ToolFn, ToolMap, ToolStep, } from './types.js';
|
|
38
|
+
export type { BeOpInputBase, CompareInput, CompareOutput, GssInstallmentOption, GssProductDetails, GssProductFeature, GssProductQuestionAnswer, GssProductReview, GssProductSeller, GssShippingOption, IntentOpInput, IntentOpOutput, LocaleCode, MoneyValue, ProductAnswerInput, ProductAnswerOutput, RefPayload, UiSpec, UiSpecElement, UiSpecElementType, UiSpecEvent, } from './contracts/agentic-contracts.js';
|
package/dist/agentic/worker.js
CHANGED
|
@@ -1,145 +1,342 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { buildPhotoSimilarityProfile as X, buildProductSimilarityProfile as Y, buildSimilarityQueries as Z, normalizeSimilarityText as tt, rankSimilarProducts as et, rankSimilarProductsAsync as rt, scoreSimilarityCandidate as at, tokenizeSimilarityText as ot } from "./algos/similarity.js";
|
|
2
|
+
import { $ as ct, A as st, B as b, C as it, D as I, E as ut, F as lt, G as U, H as dt, I as pt, J as yt, K as mt, L as ft, M as _t, N as Pt, O as C, P as gt, Q as kt, R as ht, S as St, T as R, U as xt, V as B, W as vt, X as wt, Y as At, Z as K, _ as Tt, a as bt, at as F, b as It, ct as Ut, d as Ct, dt as Rt, et as Bt, f as Kt, ft as Ft, g as Lt, gt as jt, h as zt, ht as Et, i as Ot, it as Mt, j as Jt, k as L, lt as j, m as Nt, n as qt, nt as z, o as Dt, ot as $t, p as Ht, pt as E, q as Qt, r as Vt, rt as Wt, s as Gt, st as O, t as Xt, tt as Yt, u as Zt, ut as te, v as ee, w as M, x as J, y as re, z as N } from "../route-params-5KSvTyeb.js";
|
|
3
|
+
function ae(t) {
|
|
4
|
+
const e = self, r = /* @__PURE__ */ new Map(), a = E(e), d = N(a);
|
|
5
|
+
let i = null, f = null, m = null, _ = "";
|
|
6
|
+
e.addEventListener("message", (o) => {
|
|
7
|
+
const u = o.data;
|
|
8
|
+
if (u) {
|
|
9
|
+
if (u.type === "abort") {
|
|
10
|
+
typeof u.id == "number" && (r.get(u.id)?.abort(), r.delete(u.id));
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
+
u.type === "invoke" && k(u);
|
|
13
14
|
}
|
|
14
15
|
});
|
|
15
|
-
async function
|
|
16
|
-
|
|
17
|
-
accountId: String(
|
|
18
|
-
beUrl:
|
|
19
|
-
...
|
|
20
|
-
...
|
|
21
|
-
...
|
|
22
|
-
locale:
|
|
23
|
-
parentUrl:
|
|
16
|
+
async function k(o) {
|
|
17
|
+
i = {
|
|
18
|
+
accountId: String(o.accountId || t.accountId || ""),
|
|
19
|
+
beUrl: o.beUrl || "",
|
|
20
|
+
...o.devJwtSecret ? { devJwtSecret: o.devJwtSecret } : {},
|
|
21
|
+
...o.tokenBrokerUrl ? { tokenBrokerUrl: o.tokenBrokerUrl } : {},
|
|
22
|
+
...o.tokenBrokerAudience ? { tokenBrokerAudience: o.tokenBrokerAudience } : {},
|
|
23
|
+
locale: o.defaultLocale || t.defaultLocale || "en-GB",
|
|
24
|
+
parentUrl: o.parentUrl || ""
|
|
24
25
|
};
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const u = [
|
|
27
|
+
i.accountId,
|
|
28
|
+
i.devJwtSecret || "",
|
|
29
|
+
i.tokenBrokerUrl || "",
|
|
30
|
+
i.tokenBrokerAudience || ""
|
|
30
31
|
].join(`
|
|
31
32
|
`);
|
|
32
|
-
(!
|
|
33
|
-
accountId:
|
|
34
|
-
locale:
|
|
35
|
-
parentUrl:
|
|
36
|
-
rpc:
|
|
37
|
-
persistentPanelKeys:
|
|
38
|
-
panelKeyLimits:
|
|
33
|
+
(!m || _ !== u) && (m = O(i), _ = u), f ||= new j({
|
|
34
|
+
accountId: i.accountId,
|
|
35
|
+
locale: i.locale,
|
|
36
|
+
parentUrl: i.parentUrl,
|
|
37
|
+
rpc: a,
|
|
38
|
+
persistentPanelKeys: t.contextPersistence?.panelKeys,
|
|
39
|
+
panelKeyLimits: t.contextPersistence?.panelKeyLimits,
|
|
40
|
+
messageLimit: t.contextPersistence?.messageLimit,
|
|
41
|
+
maxThreads: t.contextPersistence?.maxThreads,
|
|
42
|
+
threadTtlMs: t.contextPersistence?.threadTtlMs
|
|
39
43
|
});
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
id:
|
|
44
|
+
const c = new AbortController();
|
|
45
|
+
r.set(o.id, c);
|
|
46
|
+
const s = (n) => {
|
|
47
|
+
e.postMessage({
|
|
48
|
+
id: o.id,
|
|
45
49
|
type: "event",
|
|
46
|
-
event:
|
|
50
|
+
event: n
|
|
47
51
|
});
|
|
48
52
|
};
|
|
49
53
|
try {
|
|
50
|
-
const
|
|
51
|
-
await
|
|
52
|
-
request:
|
|
54
|
+
const n = i, l = m;
|
|
55
|
+
await b({
|
|
56
|
+
request: o.request || {},
|
|
53
57
|
accountModule: {
|
|
54
|
-
...
|
|
55
|
-
accountId:
|
|
58
|
+
...t,
|
|
59
|
+
accountId: n.accountId
|
|
56
60
|
},
|
|
57
|
-
contextStore:
|
|
58
|
-
beClient: { invoke({ op:
|
|
59
|
-
return
|
|
60
|
-
beUrl:
|
|
61
|
-
accountId:
|
|
62
|
-
jwtProvider:
|
|
63
|
-
parentUrl:
|
|
64
|
-
op:
|
|
65
|
-
input:
|
|
66
|
-
cacheTtlS:
|
|
67
|
-
cacheKey:
|
|
68
|
-
browserCache:
|
|
69
|
-
...
|
|
61
|
+
contextStore: f,
|
|
62
|
+
beClient: { invoke({ op: P, input: v, signal: S, cacheTtlS: w, cacheKey: A, browserCache: T }) {
|
|
63
|
+
return z({
|
|
64
|
+
beUrl: n.beUrl,
|
|
65
|
+
accountId: n.accountId,
|
|
66
|
+
jwtProvider: l,
|
|
67
|
+
parentUrl: n.parentUrl,
|
|
68
|
+
op: P,
|
|
69
|
+
input: v,
|
|
70
|
+
cacheTtlS: w,
|
|
71
|
+
cacheKey: A,
|
|
72
|
+
browserCache: T,
|
|
73
|
+
...S ? { signal: S } : {}
|
|
70
74
|
});
|
|
71
75
|
} },
|
|
72
|
-
toolBridge:
|
|
73
|
-
emit:
|
|
74
|
-
rpc:
|
|
75
|
-
signal:
|
|
76
|
-
}),
|
|
77
|
-
id:
|
|
76
|
+
toolBridge: d,
|
|
77
|
+
emit: s,
|
|
78
|
+
rpc: a,
|
|
79
|
+
signal: c.signal
|
|
80
|
+
}), e.postMessage({
|
|
81
|
+
id: o.id,
|
|
78
82
|
type: "end"
|
|
79
83
|
});
|
|
80
|
-
} catch (
|
|
81
|
-
|
|
82
|
-
id:
|
|
84
|
+
} catch (n) {
|
|
85
|
+
c.signal.aborted || (s(F(n)), s(K()), e.postMessage({
|
|
86
|
+
id: o.id,
|
|
83
87
|
type: "end"
|
|
84
88
|
}));
|
|
85
89
|
} finally {
|
|
86
|
-
|
|
90
|
+
r.delete(o.id);
|
|
87
91
|
}
|
|
88
92
|
}
|
|
89
93
|
}
|
|
94
|
+
var h = { patterns: [
|
|
95
|
+
...I,
|
|
96
|
+
{
|
|
97
|
+
pattern: /(?:adresim|adres|address)\s*[:=]?\s*[^.;\n]{0,160}/giu,
|
|
98
|
+
replacement: "[address]"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
pattern: /[^\s,.;]{2,}\s+(?:mahallesi|mah\.|sokak|sk\.|cadde|cad\.)\s+[^.;\n]{0,120}/giu,
|
|
102
|
+
replacement: "[address]"
|
|
103
|
+
}
|
|
104
|
+
] }, q = "llm-flow-routing-v1";
|
|
105
|
+
function D(t) {
|
|
106
|
+
return String(t?.payload?.text || t?.payload?.query || t?.action?.payload?.text || "");
|
|
107
|
+
}
|
|
108
|
+
function oe(t, e = {}) {
|
|
109
|
+
return e[t?.type || t?.action?.type] || "";
|
|
110
|
+
}
|
|
111
|
+
function ne({ accountId: t, cacheTtlS: e = 3600, browserCacheTtlMs: r, promptVersion: a = q, cacheable: d = !0, piiPatternPack: i = h, utterance: f, compactPageContext: m = H, compactStructuredContext: _ = Q, extraInput: k, cacheKeyParts: o, onError: u = [] } = {}) {
|
|
112
|
+
return {
|
|
113
|
+
kind: "be_op",
|
|
114
|
+
op: "intent",
|
|
115
|
+
input: (c) => {
|
|
116
|
+
const { request: s, context: n, bag: l, accountConfig: P } = c;
|
|
117
|
+
return M(y({
|
|
118
|
+
utterance: x(s, {
|
|
119
|
+
request: s,
|
|
120
|
+
context: n,
|
|
121
|
+
bag: l,
|
|
122
|
+
accountConfig: P
|
|
123
|
+
}, f, i),
|
|
124
|
+
page_context: p(m, l.page, c),
|
|
125
|
+
structured_context: p(_, n, c),
|
|
126
|
+
locale: n.meta.locale,
|
|
127
|
+
...y(p(k, c))
|
|
128
|
+
}), P, "intent");
|
|
129
|
+
},
|
|
130
|
+
out: "route",
|
|
131
|
+
cache: (c) => p(d, c) ? J({
|
|
132
|
+
ttlS: e,
|
|
133
|
+
promptVersion: a
|
|
134
|
+
}) : void 0,
|
|
135
|
+
...r ? { browserCache: { ttlMs: r } } : {},
|
|
136
|
+
cacheKey: ({ request: c, context: s, bag: n, accountConfig: l }) => {
|
|
137
|
+
if (p(d, {
|
|
138
|
+
request: c,
|
|
139
|
+
context: s,
|
|
140
|
+
bag: n,
|
|
141
|
+
accountConfig: l
|
|
142
|
+
}))
|
|
143
|
+
return B("intent", {
|
|
144
|
+
account: t,
|
|
145
|
+
prompt: a,
|
|
146
|
+
locale: s.meta.locale,
|
|
147
|
+
utterance: U(x(c, {
|
|
148
|
+
request: c,
|
|
149
|
+
context: s,
|
|
150
|
+
bag: n,
|
|
151
|
+
accountConfig: l
|
|
152
|
+
}, f, i), s.meta.locale),
|
|
153
|
+
page: p(m, n.page, {
|
|
154
|
+
request: c,
|
|
155
|
+
context: s,
|
|
156
|
+
bag: n,
|
|
157
|
+
accountConfig: l
|
|
158
|
+
}),
|
|
159
|
+
panel: p(_, s, {
|
|
160
|
+
request: c,
|
|
161
|
+
context: s,
|
|
162
|
+
bag: n,
|
|
163
|
+
accountConfig: l
|
|
164
|
+
}),
|
|
165
|
+
...y(p(o, {
|
|
166
|
+
request: c,
|
|
167
|
+
context: s,
|
|
168
|
+
bag: n,
|
|
169
|
+
accountConfig: l
|
|
170
|
+
}))
|
|
171
|
+
});
|
|
172
|
+
},
|
|
173
|
+
onError: u
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function ce(t, e = "product") {
|
|
177
|
+
const r = String(t?.intent?.kind || t?.kind || "").trim();
|
|
178
|
+
return {
|
|
179
|
+
product_search: "search",
|
|
180
|
+
add_to_cart: "cart",
|
|
181
|
+
question: "product",
|
|
182
|
+
open_product: "open_product",
|
|
183
|
+
beauty_consulting: "consulting",
|
|
184
|
+
fashion_consulting: "consulting",
|
|
185
|
+
style_consulting: "consulting",
|
|
186
|
+
account_expert: "consulting",
|
|
187
|
+
consulting: "consulting",
|
|
188
|
+
consulting_redirect: "consulting",
|
|
189
|
+
handoff_shopping: "consulting",
|
|
190
|
+
handOffShopping: "consulting"
|
|
191
|
+
}[r] || r || e;
|
|
192
|
+
}
|
|
193
|
+
function se(t, e) {
|
|
194
|
+
return $(t, e).query || "";
|
|
195
|
+
}
|
|
196
|
+
function $(t, e) {
|
|
197
|
+
const r = e.route?.search_params || e.route?.searchParams || {}, a = t?.payload || {}, d = r.query || a.query;
|
|
198
|
+
return y({
|
|
199
|
+
...r,
|
|
200
|
+
query: d,
|
|
201
|
+
text: r.text || a.text,
|
|
202
|
+
facetParams: r.facetParams || r.facet_params || a.facetParams || a.facet_params,
|
|
203
|
+
facets: r.facets || a.facets,
|
|
204
|
+
categoryName: r.categoryName || r.category_name || a.categoryName || a.category_name,
|
|
205
|
+
categoryId: r.categoryId || r.category_id || a.categoryId || a.category_id,
|
|
206
|
+
size: r.size || a.size || a.beden || a.shoeSize || a.clothingSize,
|
|
207
|
+
budgetMax: r.budgetMax || r.budget_max || r.maxPrice || a.budgetMax || a.budget_max || a.maxPrice,
|
|
208
|
+
maxPrice: r.maxPrice || a.maxPrice
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function ie(t) {
|
|
212
|
+
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) || {};
|
|
213
|
+
}
|
|
214
|
+
function H(t = {}) {
|
|
215
|
+
const e = t?.product && typeof t.product == "object" ? t.product : null;
|
|
216
|
+
return y({
|
|
217
|
+
pageType: t?.pageType || t?.type || "other",
|
|
218
|
+
sku: t?.sku || e?.sku,
|
|
219
|
+
product_name: e?.name || e?.title,
|
|
220
|
+
category_names: Array.isArray(e?.category_names) ? e.category_names.slice(0, 5) : void 0
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
function Q(t = {}) {
|
|
224
|
+
const e = t.panel || {};
|
|
225
|
+
return y({
|
|
226
|
+
screen_type: e.screen_type,
|
|
227
|
+
screen_sku_list: Array.isArray(e.screen_sku_list) ? e.screen_sku_list.slice(0, 24) : void 0,
|
|
228
|
+
chat_mentioned_skus: Array.isArray(e.chat_mentioned_skus) ? e.chat_mentioned_skus.slice(0, 12) : void 0,
|
|
229
|
+
last_search: V(e.last_search),
|
|
230
|
+
current_panel_product_count: Array.isArray(e.last_search_products) ? e.last_search_products.length : 0
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
function V(t) {
|
|
234
|
+
return !t || typeof t != "object" ? null : y({
|
|
235
|
+
query: g(t.query),
|
|
236
|
+
source: t.source,
|
|
237
|
+
count: t.count,
|
|
238
|
+
category: g(t.category),
|
|
239
|
+
goal: g(t.goal)
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
function W(t, e = h) {
|
|
243
|
+
return R(t, e) || g(L(t) || D(t), e);
|
|
244
|
+
}
|
|
245
|
+
function x(t, e, r, a) {
|
|
246
|
+
const d = p(r, t, e);
|
|
247
|
+
return d ? String(d) : W(t, a);
|
|
248
|
+
}
|
|
249
|
+
function g(t, e = h) {
|
|
250
|
+
return C(String(t || ""), e);
|
|
251
|
+
}
|
|
252
|
+
function p(t, e, r) {
|
|
253
|
+
return typeof t == "function" ? t(e, r) : t;
|
|
254
|
+
}
|
|
255
|
+
function y(t) {
|
|
256
|
+
return Object.fromEntries(Object.entries(t || {}).filter(([, e]) => e != null && e !== "" && (!Array.isArray(e) || e.length)));
|
|
257
|
+
}
|
|
90
258
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
259
|
+
Wt as AgentError,
|
|
260
|
+
j as ContextStore,
|
|
261
|
+
Tt as FALLBACK_STATUS,
|
|
262
|
+
wt as action,
|
|
263
|
+
Jt as actionButtonsUiSpec,
|
|
264
|
+
lt as alignProductsToTable,
|
|
265
|
+
R as anonymousRequestText,
|
|
266
|
+
Mt as beErrorToAgentError,
|
|
267
|
+
X as buildPhotoSimilarityProfile,
|
|
268
|
+
Y as buildProductSimilarityProfile,
|
|
269
|
+
Z as buildSimilarityQueries,
|
|
270
|
+
F as caughtToStreamError,
|
|
271
|
+
it as compactAccountConfig,
|
|
272
|
+
ht as compactContextProducts,
|
|
273
|
+
zt as compactObject,
|
|
274
|
+
Gt as compactProductSurfaceForLlm,
|
|
275
|
+
pt as comparisonResultForUi,
|
|
276
|
+
_t as comparisonUiSpec,
|
|
277
|
+
st as createFlow,
|
|
278
|
+
O as createJwtProvider,
|
|
279
|
+
Kt as createPrivacyHelpers,
|
|
280
|
+
Lt as createReadPageStep,
|
|
281
|
+
N as createToolBridge,
|
|
282
|
+
E as createWorkerRpc,
|
|
283
|
+
It as declarativeBeOpCache,
|
|
284
|
+
ut as defaultPiiPatternPack,
|
|
285
|
+
I as defaultPiiPatterns,
|
|
286
|
+
K as done,
|
|
287
|
+
Rt as elapsedMs,
|
|
288
|
+
kt as error,
|
|
289
|
+
oe as explicitRoute,
|
|
290
|
+
ee as fallbackStatus,
|
|
291
|
+
Xt as firstArrayValue,
|
|
292
|
+
ie as flowParamsFromRoute,
|
|
293
|
+
Et as handleMainRpc,
|
|
294
|
+
Nt as homePanelReset,
|
|
295
|
+
$t as httpErrorToAgentError,
|
|
296
|
+
J as inputHashCachePolicy,
|
|
297
|
+
z as invokeBeOp,
|
|
298
|
+
re as isFallbackStatus,
|
|
299
|
+
B as llmCacheKey,
|
|
300
|
+
ne as llmIntentStep,
|
|
301
|
+
Zt as mergeProductSurfaceEvidence,
|
|
302
|
+
ct as metadata,
|
|
303
|
+
Ut as mintDevJwt,
|
|
304
|
+
ft as normalizeComparisonTable,
|
|
305
|
+
mt as normalizeProduct,
|
|
306
|
+
tt as normalizeSimilarityText,
|
|
307
|
+
Ft as nowIso,
|
|
308
|
+
Ht as plainMessageContent,
|
|
309
|
+
Pt as productDetailsUiSpec,
|
|
310
|
+
dt as productFactsKey,
|
|
311
|
+
xt as productSkuKey,
|
|
312
|
+
Ct as productSurfaceReviewText,
|
|
313
|
+
gt as productsUiSpec,
|
|
314
|
+
et as rankSimilarProducts,
|
|
315
|
+
rt as rankSimilarProductsAsync,
|
|
316
|
+
C as redactPii,
|
|
317
|
+
L as requestText,
|
|
318
|
+
At as resolveFlow,
|
|
319
|
+
Ot as retailAnonymizeMessages,
|
|
320
|
+
bt as retailAnonymousRequestText,
|
|
321
|
+
Dt as retailRedactPii,
|
|
322
|
+
qt as routeFlowParams,
|
|
323
|
+
ce as routeKind,
|
|
324
|
+
Vt as routeSkuList,
|
|
325
|
+
D as routeText,
|
|
326
|
+
jt as runMainRpc,
|
|
327
|
+
b as runTurn,
|
|
328
|
+
at as scoreSimilarityCandidate,
|
|
329
|
+
$ as searchInputFromRoute,
|
|
330
|
+
se as searchQueryFromRoute,
|
|
331
|
+
vt as stableKey,
|
|
332
|
+
ae as startWorker,
|
|
333
|
+
te as stickyContextKey,
|
|
334
|
+
Bt as textChunk,
|
|
335
|
+
U as textKey,
|
|
336
|
+
ot as tokenizeSimilarityText,
|
|
337
|
+
Qt as trimProductFactsCore,
|
|
338
|
+
yt as trimProductFactsListCore,
|
|
339
|
+
Yt as uiSpec,
|
|
340
|
+
M as withAccountConfig,
|
|
341
|
+
St as withDeclarativeBeOpCache
|
|
145
342
|
};
|