@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.
Files changed (97) hide show
  1. package/dist/chat-runtime.js +1 -1
  2. package/dist/chat.iife.js +1 -1
  3. package/dist/chat.js +1 -1
  4. package/dist/common/index.d.ts +2 -1
  5. package/dist/{common-Bhl-diYQ.js → common-C-lXfS-s.js} +1 -1
  6. package/dist/common.js +68 -67
  7. package/dist/{connection-warning-CuJ66qqt.js → connection-warning-DrXU9qN9.js} +1 -1
  8. package/dist/{fastIntent-CjgT7XpX.js → fastIntent-Diz6Vo0W.js} +1 -1
  9. package/dist/index.js +21 -21
  10. package/dist/native.iife.js +1 -1
  11. package/dist/qna-runtime.js +1 -1
  12. package/dist/qna.iife.js +1 -1
  13. package/dist/qna.js +1 -1
  14. package/dist/request-response-cache-DmnzO4Hu.js +1426 -0
  15. package/dist/{runtime-8WgpotSV.js → runtime-CiO-HX8B.js} +198 -199
  16. package/dist/{runtime-4QEfxNRC.js → runtime-D0v-KyzN.js} +36 -37
  17. package/dist/{runtime-bXec5UVj.js → runtime-hci1VRsa.js} +8 -9
  18. package/dist/{simbut-3z-Ed-TM.js → simbut-D-IPkTT8.js} +1 -1
  19. package/dist/simbut.iife.js +1 -1
  20. package/dist/simbut.js +1 -1
  21. package/dist/{simrel-Bz7xAdSc.js → simrel-BjMCvCdo.js} +1 -1
  22. package/dist/simrel-runtime.js +1 -1
  23. package/dist/simrel.iife.js +1 -1
  24. package/dist/simrel.js +2 -2
  25. package/dist/{widget-base-DhkuNWft.js → widget-base-_HBDf5VH.js} +1 -1
  26. package/package.json +3 -19
  27. package/dist/agent-ui-steps-DIWmTMuV.js +0 -3199
  28. package/dist/agentic/adaptor/create-adaptor.d.ts +0 -22
  29. package/dist/agentic/adaptor/fetch-bridge.d.ts +0 -31
  30. package/dist/agentic/adaptor/mount.d.ts +0 -45
  31. package/dist/agentic/algos/similarity.d.ts +0 -86
  32. package/dist/agentic/algos/similarity.js +0 -261
  33. package/dist/agentic/context/chat-context.d.ts +0 -17
  34. package/dist/agentic/context/context-store.d.ts +0 -57
  35. package/dist/agentic/context/persistence.d.ts +0 -14
  36. package/dist/agentic/contracts/agentic-contracts.d.ts +0 -133
  37. package/dist/agentic/debug/activity-collector.d.ts +0 -15
  38. package/dist/agentic/debug/activity-instrumentation.d.ts +0 -22
  39. package/dist/agentic/debug/activity-overlay.d.ts +0 -3
  40. package/dist/agentic/debug/activity-state.d.ts +0 -37
  41. package/dist/agentic/debug/local-dev.d.ts +0 -18
  42. package/dist/agentic/events/builders.d.ts +0 -10
  43. package/dist/agentic/events/comparison.d.ts +0 -6
  44. package/dist/agentic/events/context-products.d.ts +0 -6
  45. package/dist/agentic/events/error-taxonomy.d.ts +0 -27
  46. package/dist/agentic/events/product-normalize.d.ts +0 -50
  47. package/dist/agentic/events/ui-specs.d.ts +0 -41
  48. package/dist/agentic/flow/create-flow.d.ts +0 -2
  49. package/dist/agentic/flow/dispatch.d.ts +0 -3
  50. package/dist/agentic/index.d.ts +0 -65
  51. package/dist/agentic/index.js +0 -3493
  52. package/dist/agentic/types.d.ts +0 -360
  53. package/dist/agentic/util/account-config.d.ts +0 -8
  54. package/dist/agentic/util/assistant-host.d.ts +0 -11
  55. package/dist/agentic/util/be-url.d.ts +0 -4
  56. package/dist/agentic/util/browser-memory.d.ts +0 -13
  57. package/dist/agentic/util/browser-tools.d.ts +0 -31
  58. package/dist/agentic/util/cache-key.d.ts +0 -15
  59. package/dist/agentic/util/common/declarative-cache.d.ts +0 -21
  60. package/dist/agentic/util/common/fallback-status.d.ts +0 -10
  61. package/dist/agentic/util/common/flow-steps.d.ts +0 -8
  62. package/dist/agentic/util/common/gss-tool-aliases.d.ts +0 -66
  63. package/dist/agentic/util/common/iframe-scraper.d.ts +0 -22
  64. package/dist/agentic/util/common/llm-routing.d.ts +0 -50
  65. package/dist/agentic/util/common/object.d.ts +0 -1
  66. package/dist/agentic/util/common/open-product-page.d.ts +0 -30
  67. package/dist/agentic/util/common/panel-context.d.ts +0 -3
  68. package/dist/agentic/util/common/privacy.d.ts +0 -14
  69. package/dist/agentic/util/common/product-resolver.d.ts +0 -20
  70. package/dist/agentic/util/common/product-surface.d.ts +0 -24
  71. package/dist/agentic/util/common/ref-store.d.ts +0 -15
  72. package/dist/agentic/util/common/retail-privacy.d.ts +0 -4
  73. package/dist/agentic/util/common/route-params.d.ts +0 -3
  74. package/dist/agentic/util/common/similarity-ranking.d.ts +0 -2
  75. package/dist/agentic/util/common/site-awareness.d.ts +0 -130
  76. package/dist/agentic/util/lazy-runtime-loader.d.ts +0 -10
  77. package/dist/agentic/util/privacy.d.ts +0 -12
  78. package/dist/agentic/util/request-text.d.ts +0 -3
  79. package/dist/agentic/util/time.d.ts +0 -2
  80. package/dist/agentic/widgets/endpoints.d.ts +0 -12
  81. package/dist/agentic/worker/agent-ui-steps.d.ts +0 -43
  82. package/dist/agentic/worker/agent-ui.d.ts +0 -44
  83. package/dist/agentic/worker/be-client.d.ts +0 -32
  84. package/dist/agentic/worker/coalesce.d.ts +0 -25
  85. package/dist/agentic/worker/compaction.d.ts +0 -12
  86. package/dist/agentic/worker/entry.d.ts +0 -2
  87. package/dist/agentic/worker/flow-runner.d.ts +0 -24
  88. package/dist/agentic/worker/jwt-mint.d.ts +0 -21
  89. package/dist/agentic/worker/pdp-hydrate.d.ts +0 -30
  90. package/dist/agentic/worker/rpc.d.ts +0 -47
  91. package/dist/agentic/worker/tool-bridge.d.ts +0 -2
  92. package/dist/agentic/worker/tool-schema.d.ts +0 -19
  93. package/dist/agentic/worker.d.ts +0 -52
  94. package/dist/agentic/worker.js +0 -429
  95. package/dist/agentic.iife.js +0 -445
  96. package/dist/api-paths-BTHgM_Tz.js +0 -1274
  97. package/dist/request-response-cache-BxRsKGJ0.js +0 -154
@@ -1,360 +0,0 @@
1
- import type { ProcessActionRequest } from '../common/transport.js';
2
- import type { StreamEvent, UISpec } from '../common/types.js';
3
- import type { NormalizedProduct } from './events/product-normalize.js';
4
- import type { ProductSimilarityProfile } from './algos/similarity.js';
5
- import type { ToolArgSchema } from './worker/tool-schema.js';
6
- export interface ChatThread {
7
- id: string;
8
- started_at: string;
9
- extensions: Record<string, unknown>;
10
- }
11
- export type ChatPanel = Record<string, unknown>;
12
- export interface ChatMessage {
13
- role: 'user' | 'assistant' | 'tool_result';
14
- content: string;
15
- name?: string;
16
- details?: unknown;
17
- }
18
- export interface ChatMeta {
19
- locale: string;
20
- parentUrl: string;
21
- accountId: string;
22
- }
23
- export interface ChatContext {
24
- panel: ChatPanel;
25
- messages: ChatMessage[];
26
- thread: ChatThread;
27
- meta: ChatMeta;
28
- }
29
- export type RpcMethod = 'tool.invoke' | 'beacon.send' | 'confirmation.request' | 'memory.get' | 'memory.set' | 'memory.remove' | (string & {});
30
- export type RpcFn = <T = unknown>(method: RpcMethod, payload?: unknown, transfer?: Transferable[]) => Promise<T>;
31
- export interface ToolBridge {
32
- invoke<T = unknown>(name: string, input?: unknown): Promise<T>;
33
- }
34
- export interface BeClient {
35
- invoke(args: {
36
- op: string;
37
- input?: unknown;
38
- signal?: AbortSignal;
39
- cacheTtlS?: number;
40
- cacheKey?: string;
41
- cacheFreshness?: string;
42
- browserCache?: BrowserCachePolicy;
43
- }): Promise<unknown>;
44
- }
45
- export type Awaitable<T> = T | Promise<T>;
46
- export interface FlowStepCtx {
47
- request: ProcessActionRequest;
48
- context: ChatContext;
49
- bag: Record<string, unknown>;
50
- accountConfig: Record<string, unknown>;
51
- catalogMapper?: CatalogMapper | undefined;
52
- similarityMapper?: SimilarityMapper | undefined;
53
- beClient?: BeClient;
54
- toolBridge?: ToolBridge;
55
- signal?: AbortSignal;
56
- }
57
- export type FlowValue<T> = T | ((ctx: FlowStepCtx) => Awaitable<T>);
58
- export type FlowPatch = (ctx: ChatContext, result: unknown, snapshot: FlowStepCtx) => Awaitable<Partial<ChatContext> | null | undefined>;
59
- export type BrowserCachePolicy = boolean | {
60
- ttlMs?: number;
61
- };
62
- export interface BeOpCachePolicy {
63
- strategy: 'input-hash';
64
- ttlS: number;
65
- promptVersion?: string | undefined;
66
- }
67
- export type FlowAdapterFn = (input: unknown, ctx: FlowStepCtx) => unknown | Promise<unknown>;
68
- export type FlowAdapterMap = Record<string, FlowAdapterFn>;
69
- export interface FlowConfirmationRequest {
70
- title?: string;
71
- message?: string;
72
- action?: string;
73
- payload?: unknown;
74
- }
75
- export type FlowConfirmationValue = boolean | string | FlowConfirmationRequest;
76
- export type FlowConfirmationGate = FlowValue<FlowConfirmationValue | null | undefined>;
77
- export interface BeOpStep {
78
- kind: 'be_op';
79
- op: string;
80
- input: FlowValue<unknown>;
81
- cache?: FlowValue<BeOpCachePolicy | false | null | undefined>;
82
- cacheTtlS?: FlowValue<number | undefined>;
83
- cacheKey?: FlowValue<string | undefined>;
84
- cacheFreshness?: FlowValue<string | undefined>;
85
- browserCache?: FlowValue<BrowserCachePolicy | undefined>;
86
- timeoutMs?: FlowValue<number | undefined>;
87
- confirm?: FlowConfirmationGate;
88
- out?: string;
89
- errorOut?: string;
90
- onError?: readonly FlowStep[];
91
- patch?: FlowPatch;
92
- }
93
- export interface ToolStep {
94
- kind: 'tool';
95
- name: string;
96
- input: FlowValue<unknown>;
97
- parameters?: ToolArgSchema;
98
- timeoutMs?: FlowValue<number | undefined>;
99
- confirm?: FlowConfirmationGate;
100
- out?: string;
101
- errorOut?: string;
102
- onError?: readonly FlowStep[];
103
- patch?: FlowPatch;
104
- }
105
- export interface AdapterStep {
106
- kind: 'adapter';
107
- name: string;
108
- input: FlowValue<unknown>;
109
- timeoutMs?: FlowValue<number | undefined>;
110
- confirm?: FlowConfirmationGate;
111
- out?: string;
112
- patch?: FlowPatch;
113
- }
114
- export interface EmitStep {
115
- kind: 'emit';
116
- build: (ctx: FlowStepCtx) => Awaitable<StreamEvent>;
117
- }
118
- export interface PatchStep {
119
- kind: 'patch';
120
- patch: FlowPatch;
121
- }
122
- export interface BranchStep {
123
- kind: 'branch';
124
- on: FlowValue<string | undefined>;
125
- cases: Record<string, readonly FlowStep[]>;
126
- }
127
- export type AgentLoopPredicate = (bag: Record<string, unknown>, ctx: FlowStepCtx) => Awaitable<boolean>;
128
- export type AgentLoopPatch = (bag: Record<string, unknown>, ctx: FlowStepCtx) => Awaitable<Partial<Record<string, unknown>> | null | undefined>;
129
- export interface AgentLoopStep {
130
- kind: 'agent_loop';
131
- body: readonly FlowStep[];
132
- shouldContinue: AgentLoopPredicate;
133
- maxIterations: number;
134
- onIterate?: AgentLoopPatch;
135
- }
136
- export interface ParallelStep {
137
- kind: 'parallel';
138
- steps: readonly (readonly FlowStep[])[];
139
- timeoutMs?: FlowValue<number | undefined>;
140
- merge?: {
141
- bag?: readonly string[];
142
- panel?: readonly string[];
143
- threadExtensions?: readonly string[];
144
- };
145
- }
146
- export interface RefusalStep {
147
- kind: 'refusal';
148
- message: FlowValue<string>;
149
- }
150
- export interface CommitStep {
151
- kind: 'commit';
152
- }
153
- export type FlowStep = BeOpStep | ToolStep | AdapterStep | EmitStep | PatchStep | BranchStep | AgentLoopStep | ParallelStep | RefusalStep | CommitStep;
154
- export type Flow = readonly FlowStep[];
155
- export type ToolFn = (input: unknown) => unknown | Promise<unknown>;
156
- export type ToolMap = Record<string, ToolFn>;
157
- export type CatalogMapper = (raw: Record<string, unknown>) => NormalizedProduct | null;
158
- export type SimilarityMapper = (raw: Record<string, unknown>) => ProductSimilarityProfile | null;
159
- export interface BeforeToolCallResult {
160
- block?: boolean;
161
- reason?: string;
162
- args?: unknown;
163
- }
164
- export interface AfterToolCallResult {
165
- result?: unknown;
166
- terminate?: boolean;
167
- }
168
- export interface BeforeBeOpResult {
169
- input?: unknown;
170
- cached?: unknown;
171
- }
172
- export interface AfterBeOpResult {
173
- result?: unknown;
174
- }
175
- export interface AgentHooks {
176
- beforeToolCall?(name: string, args: unknown, ctx: FlowStepCtx): Awaitable<BeforeToolCallResult | void | undefined>;
177
- afterToolCall?(name: string, result: unknown, ctx: FlowStepCtx): Awaitable<AfterToolCallResult | void | undefined>;
178
- transformContext?(ctx: ChatContext): Awaitable<ChatContext | void | undefined>;
179
- beforeBeOp?(op: string, input: unknown, ctx: FlowStepCtx): Awaitable<BeforeBeOpResult | void | undefined>;
180
- afterBeOp?(op: string, result: unknown, ctx: FlowStepCtx): Awaitable<AfterBeOpResult | void | undefined>;
181
- }
182
- export interface AccountModule<TAccountConfig extends Record<string, unknown> = Record<string, unknown>> {
183
- accountId?: string;
184
- defaultLocale?: string;
185
- flows: Record<string, Flow>;
186
- tools?: ToolMap;
187
- adapters?: FlowAdapterMap;
188
- catalogMapper?: CatalogMapper;
189
- similarityMapper?: SimilarityMapper;
190
- accountConfig?: TAccountConfig;
191
- trace?: AgentTraceCallback;
192
- hooks?: AgentHooks;
193
- contextPersistence?: {
194
- panelKeys?: readonly string[];
195
- panelKeyLimits?: Record<string, number>;
196
- messageLimit?: number;
197
- maxThreads?: number;
198
- threadTtlMs?: number;
199
- };
200
- }
201
- export interface AgentOpBeacon {
202
- type: 'agentOp';
203
- threadId: string;
204
- sessionId: string;
205
- accountId: string;
206
- op: string;
207
- status: 'ok' | 'error';
208
- latencyMs: number;
209
- errorCode?: string | undefined;
210
- }
211
- export interface AgentToolBeacon {
212
- type: 'agentTool';
213
- threadId: string;
214
- sessionId: string;
215
- accountId: string;
216
- tool: string;
217
- status: 'ok' | 'error';
218
- latencyMs: number;
219
- errorCode?: string | undefined;
220
- }
221
- export interface TurnSummaryBeacon {
222
- type: 'turnSummary';
223
- threadId: string;
224
- sessionId: string;
225
- accountId: string;
226
- steps: number;
227
- totalLatencyMs: number;
228
- productSkusEmitted: string[];
229
- }
230
- export interface GenericBeacon {
231
- type: string;
232
- accountId?: string;
233
- [key: string]: unknown;
234
- }
235
- export type AgentBeaconPayload = AgentOpBeacon | AgentToolBeacon | TurnSummaryBeacon | GenericBeacon;
236
- export type BeaconCallback = (payload: AgentBeaconPayload) => void;
237
- export interface AgentTraceEvent {
238
- type: 'turn:start' | 'turn:end' | 'turn:error' | 'step:start' | 'step:end' | 'step:error' | 'confirmation:start' | 'confirmation:end' | 'confirmation:error';
239
- accountId: string;
240
- threadId: string;
241
- sessionId: string;
242
- stepIndex?: number;
243
- stepKind?: FlowStep['kind'];
244
- stepName?: string;
245
- latencyMs?: number;
246
- errorCode?: string;
247
- }
248
- export type AgentTraceCallback = (event: AgentTraceEvent) => Awaitable<void>;
249
- export interface AgentConfirmationRequest extends FlowConfirmationRequest {
250
- accountId: string;
251
- threadId: string;
252
- sessionId: string;
253
- stepKind: FlowStep['kind'];
254
- stepName?: string;
255
- }
256
- export interface AgentConfirmationResult {
257
- confirmed: boolean;
258
- reason?: string;
259
- payload?: unknown;
260
- }
261
- export type ConfirmationCallback = (request: AgentConfirmationRequest) => Awaitable<boolean | AgentConfirmationResult>;
262
- export interface UiSpecEnvelope {
263
- widget: 'chat' | 'qna' | 'simrel';
264
- spec: UISpec;
265
- panelHint?: 'panel' | 'inline';
266
- clearPanel?: true;
267
- }
268
- export interface MemoryBucketSync {
269
- get: (key: string) => unknown;
270
- set: (key: string, value: unknown, options?: {
271
- ttlMs?: number;
272
- }) => boolean;
273
- remove: (key: string) => void;
274
- clear?: () => void;
275
- }
276
- export interface MemoryBucketAsync {
277
- get: (key: string) => Promise<unknown>;
278
- set: (key: string, value: unknown, options?: {
279
- ttlMs?: number;
280
- }) => Promise<boolean>;
281
- remove: (key: string) => Promise<void>;
282
- }
283
- export type MemoryTier = 'volatile' | 'session' | 'local' | 'indexedDb';
284
- export interface AgentMemoryProvider {
285
- get: (tier: MemoryTier, key: string) => unknown | Promise<unknown>;
286
- set: (tier: MemoryTier, key: string, value: unknown, options?: {
287
- ttlMs?: number;
288
- }) => boolean | void | Promise<boolean | void>;
289
- remove?: (tier: MemoryTier, key: string) => void | Promise<void>;
290
- }
291
- export interface BrowserMemory {
292
- accountId: string;
293
- volatile: MemoryBucketSync & {
294
- clear: () => void;
295
- };
296
- session: MemoryBucketSync;
297
- local: MemoryBucketSync;
298
- indexedDb: MemoryBucketAsync;
299
- gc: () => Promise<{
300
- volatile: number;
301
- session: number;
302
- local: number;
303
- indexedDb: number;
304
- }>;
305
- stableKey: (value: unknown) => string;
306
- policy: Record<string, string>;
307
- }
308
- export interface WorkerInvokeMessage {
309
- id: number;
310
- type: 'invoke';
311
- accountId?: string;
312
- beUrl?: string;
313
- devJwtSecret?: string;
314
- tokenBrokerUrl?: string;
315
- tokenBrokerAudience?: string;
316
- defaultLocale?: string;
317
- request: ProcessActionRequest;
318
- parentUrl?: string;
319
- debugActivity?: boolean;
320
- }
321
- export interface WorkerAbortMessage {
322
- id: number;
323
- type: 'abort';
324
- }
325
- export type WorkerInboundMessage = WorkerInvokeMessage | WorkerAbortMessage;
326
- export interface WorkerEventOutbound {
327
- id: number;
328
- type: 'event';
329
- event: StreamEvent;
330
- }
331
- export interface WorkerEndOutbound {
332
- id: number;
333
- type: 'end';
334
- }
335
- export interface WorkerErrorOutbound {
336
- id: number;
337
- type: 'error';
338
- message?: string;
339
- }
340
- export interface WorkerActivityOutbound {
341
- id?: number;
342
- type: 'activity';
343
- entry: Record<string, unknown>;
344
- }
345
- export type WorkerOutboundMessage = WorkerEventOutbound | WorkerEndOutbound | WorkerErrorOutbound | WorkerActivityOutbound;
346
- export interface RpcRequestMessage {
347
- type: 'rpc.req';
348
- rpcId: number;
349
- method: string;
350
- payload?: unknown;
351
- }
352
- export interface RpcResultMessage {
353
- type: 'rpc.result';
354
- rpcId: number;
355
- ok: boolean;
356
- value?: unknown;
357
- error?: {
358
- message?: string;
359
- } | string;
360
- }
@@ -1,8 +0,0 @@
1
- export interface AccountConfigPayloadOptions {
2
- baseKeys?: readonly string[];
3
- opAllowlist?: Readonly<Record<string, readonly string[]>>;
4
- }
5
- export declare function withAccountConfig<T extends Record<string, unknown>>(payload: T, accountConfig: Record<string, unknown> | null | undefined, opName: string, options?: AccountConfigPayloadOptions): T & {
6
- account_config?: Record<string, unknown>;
7
- };
8
- export declare function compactAccountConfig(accountConfig: Record<string, unknown> | null | undefined, opName: string, options?: AccountConfigPayloadOptions): Record<string, unknown>;
@@ -1,11 +0,0 @@
1
- interface ChatLike {
2
- root?: Element | null;
3
- close?: () => void;
4
- }
5
- interface AssistantController {
6
- chat?: ChatLike;
7
- _chat?: ChatLike;
8
- }
9
- export declare function getAssistantHost(controller: AssistantController | null | undefined): HTMLElement | undefined;
10
- export declare function setAssistantHostVisible(controller: AssistantController | null | undefined, visible: boolean): void;
11
- export {};
@@ -1,4 +0,0 @@
1
- export interface BeUrlOverrides {
2
- beUrl?: string;
3
- }
4
- export declare function resolveBeUrl(overrides: BeUrlOverrides, fallbackUrl: string): string;
@@ -1,13 +0,0 @@
1
- import type { BrowserMemory } from '../types.js';
2
- import { stableKey } from './cache-key.js';
3
- export { stableKey };
4
- interface BrowserMemoryOptions {
5
- dbName?: string;
6
- dbStore?: string;
7
- dbVersion?: number;
8
- sessionPrefix?: string;
9
- localPrefix?: string;
10
- policy?: Record<string, string>;
11
- aliases?: string[];
12
- }
13
- export declare function createBrowserMemory(accountId: string, options?: BrowserMemoryOptions): BrowserMemory;
@@ -1,31 +0,0 @@
1
- import type { BrowserMemory, ToolMap } from '../types.js';
2
- interface InstallToolsOptions {
3
- accountAliases?: string[];
4
- exposeStandardAliases?: boolean;
5
- standardAliases?: string[];
6
- }
7
- export declare function installBrowserTools(accountId: string, tools: ToolMap, options?: InstallToolsOptions): ToolMap;
8
- interface PageProductLike {
9
- sku?: string;
10
- [key: string]: unknown;
11
- }
12
- interface ReadPageToolDeps {
13
- getPageType: () => string;
14
- getProduct: () => PageProductLike | null | undefined;
15
- }
16
- export declare function createReadPageTool({ getPageType, getProduct }: ReadPageToolDeps): () => {
17
- url: string;
18
- title: string;
19
- pageType: string;
20
- product: PageProductLike | null | undefined;
21
- };
22
- interface DiagnosticsToolDeps {
23
- accountId: string;
24
- getPageType: () => string;
25
- getProduct: () => PageProductLike | null | undefined;
26
- getToolNames: () => string[];
27
- getSearchCapabilities?: () => unknown;
28
- getMemory?: () => BrowserMemory;
29
- }
30
- export declare function createDiagnosticsTool({ accountId, getPageType, getProduct, getToolNames, getSearchCapabilities, getMemory, }: DiagnosticsToolDeps): () => Promise<Record<string, unknown>>;
31
- export {};
@@ -1,15 +0,0 @@
1
- export interface LlmCacheKeyOptions {
2
- version?: string;
3
- }
4
- export interface ProductKeyOptions {
5
- limit?: number;
6
- locale?: string;
7
- }
8
- export interface ProductFactsKeyOptions extends ProductKeyOptions {
9
- mapProduct?: (product: Record<string, unknown>) => Record<string, unknown> | null | undefined;
10
- }
11
- export declare function llmCacheKey(op: string, parts: unknown, options?: LlmCacheKeyOptions): string;
12
- export declare function productSkuKey(products: unknown, options?: ProductKeyOptions): string;
13
- export declare function productFactsKey(products: unknown, options?: ProductFactsKeyOptions): string;
14
- export declare function textKey(value: unknown, locale?: string): string;
15
- export declare function stableKey(value: unknown): string;
@@ -1,21 +0,0 @@
1
- export declare const INPUT_HASH_CACHE_STRATEGY = "input-hash";
2
- export declare function inputHashCachePolicy({ ttlS, promptVersion }?: {
3
- promptVersion?: string | undefined;
4
- }): {
5
- strategy: string;
6
- ttlS: any;
7
- promptVersion: string;
8
- };
9
- export declare function declarativeBeOpCache({ accountId, op, ttlS, promptVersion, input, keyParts, locale, }?: {
10
- accountId?: string | undefined;
11
- promptVersion?: string | undefined;
12
- }): {
13
- cache: {
14
- strategy: string;
15
- ttlS: any;
16
- promptVersion: string;
17
- };
18
- cacheTtlS: any;
19
- cacheKey: (args?: {}) => string;
20
- };
21
- export declare function withDeclarativeBeOpCache(step: any, policy?: {}): any;
@@ -1,10 +0,0 @@
1
- export declare const FALLBACK_STATUS: Readonly<{
2
- FALLBACK_RESULTS: "fallback_results";
3
- FALLBACK_NO_RESULTS: "fallback_no_results";
4
- FALLBACK_PARTIAL: "fallback_partial";
5
- OP_UNAVAILABLE: "op_unavailable";
6
- }>;
7
- export declare function fallbackStatus(status: any, details?: {}): {
8
- status: any;
9
- };
10
- export declare function isFallbackStatus(value: any): boolean;
@@ -1,8 +0,0 @@
1
- export declare function createReadPageStep(productDetailsPanelPatch: any): () => {
2
- kind: string;
3
- name: string;
4
- input: () => {};
5
- out: string;
6
- patch: (ctx: any, result: any) => any;
7
- onError: never[];
8
- }[];
@@ -1,66 +0,0 @@
1
- export declare function createGssToolAliases({ accountId, search, facetedSearch, similaritySearch, searchGiftOptions, filters, resultContract, limitations, extraTools, }?: {
2
- filters?: {} | undefined;
3
- resultContract?: {} | undefined;
4
- limitations?: never[] | undefined;
5
- extraTools?: never[] | undefined;
6
- }): {
7
- searchKeyword: (queryOrOptions?: {}, options?: {}) => Promise<any>;
8
- facetedSearch: (input?: {}, options?: {}) => any;
9
- getSearchCapabilities: () => {
10
- accountId: any;
11
- tools: any;
12
- filters: {
13
- query: string;
14
- categoryId: string;
15
- categoryName: string;
16
- categoryHints: string;
17
- brandHints: string;
18
- featureHints: string;
19
- facets: string;
20
- facetParams: string;
21
- priceMin: string;
22
- priceMax: string;
23
- };
24
- resultContract: {
25
- productItemFields: string[];
26
- productDetailFields: string[];
27
- searchResultFields: string[];
28
- similarityResultFields: string[];
29
- siteContentFields: string[];
30
- };
31
- privacy: string[];
32
- limitations: never[];
33
- };
34
- };
35
- export declare function gssSearchCapabilities({ accountId, hasSimilarity, hasGiftSearch, filters, resultContract, limitations, extraTools, }?: {
36
- hasSimilarity?: boolean | undefined;
37
- hasGiftSearch?: boolean | undefined;
38
- filters?: {} | undefined;
39
- resultContract?: {} | undefined;
40
- limitations?: never[] | undefined;
41
- extraTools?: never[] | undefined;
42
- }): {
43
- accountId: any;
44
- tools: any;
45
- filters: {
46
- query: string;
47
- categoryId: string;
48
- categoryName: string;
49
- categoryHints: string;
50
- brandHints: string;
51
- featureHints: string;
52
- facets: string;
53
- facetParams: string;
54
- priceMin: string;
55
- priceMax: string;
56
- };
57
- resultContract: {
58
- productItemFields: string[];
59
- productDetailFields: string[];
60
- searchResultFields: string[];
61
- similarityResultFields: string[];
62
- siteContentFields: string[];
63
- };
64
- privacy: string[];
65
- limitations: never[];
66
- };
@@ -1,22 +0,0 @@
1
- export declare function createIframeScraper({ markerParam, markerValue, frameName, sandbox, timeoutMs, hiddenStyle, messageType, parser, isBlockedDocument, }?: {
2
- markerParam?: string | undefined;
3
- markerValue?: string | undefined;
4
- frameName?: any;
5
- sandbox?: string | undefined;
6
- timeoutMs?: number | undefined;
7
- hiddenStyle?: string | undefined;
8
- }): {
9
- markerParam: string;
10
- markerValue: any;
11
- frameName: any;
12
- messageType: any;
13
- decorateUrl: (url: any, params?: {}) => string;
14
- isScraperFrame: (locationLike?: Location, name?: string) => boolean;
15
- load: (url: any, input?: {}, options?: {}) => Promise<unknown>;
16
- postCurrentDocument: (payloadFactory?: any, { targetOrigin }?: {
17
- targetOrigin?: string | undefined;
18
- }) => boolean;
19
- };
20
- export declare function installIframeScraperBypass(scraper: any, { accountId, type }?: {
21
- type?: string | undefined;
22
- }): boolean;
@@ -1,50 +0,0 @@
1
- export declare function routeText(request: any): string;
2
- export declare function explicitRoute(request: any, routeMap?: {}): any;
3
- export declare function llmIntentStep({ accountId, cacheTtlS, browserCacheTtlMs, promptVersion, cacheable, piiPatternPack, utterance, compactPageContext: pageContextMapper, compactStructuredContext: structuredContextMapper, extraInput, cacheKeyParts, onError, }?: {
4
- cacheTtlS?: number | undefined;
5
- promptVersion?: string | undefined;
6
- cacheable?: boolean | undefined;
7
- piiPatternPack?: {
8
- patterns: import("../privacy.js").RedactionPattern[];
9
- } | undefined;
10
- compactPageContext?: typeof compactPageContext | undefined;
11
- compactStructuredContext?: typeof compactStructuredContext | undefined;
12
- onError?: never[] | undefined;
13
- }): {
14
- cacheKey: ({ request, context, bag, accountConfig }: {
15
- request: any;
16
- context: any;
17
- bag: any;
18
- accountConfig: any;
19
- }) => string | undefined;
20
- onError: never[];
21
- browserCache?: {
22
- ttlMs: any;
23
- };
24
- kind: string;
25
- op: string;
26
- input: (ctx: any) => {
27
- [k: string]: unknown;
28
- } & {
29
- account_config?: Record<string, unknown>;
30
- };
31
- out: string;
32
- cache: (ctx: any) => {
33
- strategy: string;
34
- ttlS: any;
35
- promptVersion: string;
36
- } | undefined;
37
- };
38
- export declare function routeKind(route: any, fallback?: string): string;
39
- export declare function searchQueryFromRoute(request: any, bag: any): {};
40
- export declare function searchInputFromRoute(request: any, bag: any): {
41
- [k: string]: unknown;
42
- };
43
- export declare function flowParamsFromRoute(bag: any): any;
44
- declare function compactPageContext(page?: {}): {
45
- [k: string]: unknown;
46
- };
47
- declare function compactStructuredContext(context?: {}): {
48
- [k: string]: unknown;
49
- };
50
- export {};
@@ -1 +0,0 @@
1
- export declare function compactObject(value: unknown): Record<string, unknown>;
@@ -1,30 +0,0 @@
1
- export declare function createOpenProductPageTool({ rootUrl, successMessage, alreadyCurrentPageMessage, missingUrlMessage, }?: {
2
- alreadyCurrentPageMessage?: any;
3
- missingUrlMessage?: string | undefined;
4
- }): (input?: {}) => Promise<{
5
- ok: boolean;
6
- sku: any;
7
- reason: string;
8
- message: string;
9
- url?: never;
10
- method?: never;
11
- alreadyCurrentPage?: never;
12
- } | {
13
- ok: boolean;
14
- sku: any;
15
- url: string;
16
- method: string;
17
- alreadyCurrentPage: boolean;
18
- message: any;
19
- reason?: never;
20
- } | {
21
- ok: boolean;
22
- sku: any;
23
- url: string;
24
- method: string;
25
- message: any;
26
- reason?: never;
27
- alreadyCurrentPage?: never;
28
- }>;
29
- export declare function normalizeSameOriginUrl(value: any, rootUrl: any, rootOrigin?: string): string;
30
- export declare function navigateSameTab(url: any): void;
@@ -1,3 +0,0 @@
1
- export declare function homePanelReset(ctx: any, { screenSummary }?: {}): {
2
- panel: any;
3
- };
@@ -1,14 +0,0 @@
1
- import { defaultPiiPatterns } from '../privacy.js';
2
- export { defaultPiiPatterns };
3
- export declare function createPrivacyHelpers({ patterns, messageFilter, messageNormalizer, messageLimit, }?: {
4
- messageNormalizer?: ((value: any) => any) | undefined;
5
- messageLimit?: number | undefined;
6
- }): {
7
- redactPii: (value: any) => string;
8
- anonymousRequestText: (request: any) => string;
9
- anonymizeMessages: (messages?: never[]) => {
10
- role: any;
11
- content: string;
12
- }[];
13
- };
14
- export declare function plainMessageContent(value: any): string;