@gengage/assistant-fe 0.6.19 → 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-lIioK7-S.js → api-paths-DE3_TyTw.js} +1 -1
- package/dist/chat/history-storage.d.ts +1 -0
- package/dist/chat/runtime.d.ts +1 -1
- package/dist/chat/types.d.ts +1 -0
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +10 -10
- package/dist/chat.js +1 -1
- package/dist/{common-8WOyaL9-.js → common-BWnFHbvv.js} +2 -2
- package/dist/common.js +8 -8
- package/dist/{connection-warning-CBR0CWsY.js → connection-warning-Tk4ZjgMi.js} +1 -1
- package/dist/{context-heG8hv5l.js → context-UTzCGyR9.js} +19 -8
- package/dist/{fastIntent-Dw79pmRK.js → fastIntent-DIhMlxVd.js} +2 -2
- package/dist/index.js +13 -13
- package/dist/{native-webview-NWc9LrJh.js → native-webview-BcwGKkDe.js} +1 -1
- package/dist/native.iife.js +6 -6
- package/dist/native.js +1 -1
- package/dist/{overlay-COzFFq0-.js → overlay-cF2SjxYU.js} +1 -1
- package/dist/overlay.js +2 -2
- 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-BsnZ6gt2.js → runtime-CjJy8KKu.js} +4 -4
- package/dist/{runtime-w0f2VkzL.js → runtime-H5hNQQKm.js} +51 -48
- package/dist/{runtime-D5Sj-_tA.js → runtime-wEP7N2Hr.js} +4 -4
- package/dist/{simbut-BvdJtzCu.js → simbut-BlBLtgVy.js} +2 -2
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/{simrel-DU6a27g9.js → simrel-S6-OsWJ9.js} +2 -2
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +2 -2
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-BeWuIxD6.js → widget-base-e4JwEf2I.js} +2 -2
- package/package.json +5 -1
- package/dist/account-config-D_EMuR0g.js +0 -1479
package/dist/agentic/types.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ProcessActionRequest } from '../common/transport.js';
|
|
2
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';
|
|
3
5
|
export interface ChatThread {
|
|
4
6
|
id: string;
|
|
5
7
|
started_at: string;
|
|
@@ -21,7 +23,7 @@ export interface ChatContext {
|
|
|
21
23
|
thread: ChatThread;
|
|
22
24
|
meta: ChatMeta;
|
|
23
25
|
}
|
|
24
|
-
export type RpcMethod = 'tool.invoke' | 'beacon.send' | 'memory.get' | 'memory.set' | (string & {});
|
|
26
|
+
export type RpcMethod = 'tool.invoke' | 'beacon.send' | 'confirmation.request' | 'memory.get' | 'memory.set' | 'memory.remove' | (string & {});
|
|
25
27
|
export type RpcFn = <T = unknown>(method: RpcMethod, payload?: unknown, transfer?: Transferable[]) => Promise<T>;
|
|
26
28
|
export interface ToolBridge {
|
|
27
29
|
invoke<T = unknown>(name: string, input?: unknown): Promise<T>;
|
|
@@ -36,26 +38,45 @@ export interface BeClient {
|
|
|
36
38
|
browserCache?: BrowserCachePolicy;
|
|
37
39
|
}): Promise<unknown>;
|
|
38
40
|
}
|
|
41
|
+
export type Awaitable<T> = T | Promise<T>;
|
|
39
42
|
export interface FlowStepCtx {
|
|
40
43
|
request: ProcessActionRequest;
|
|
41
44
|
context: ChatContext;
|
|
42
45
|
bag: Record<string, unknown>;
|
|
43
46
|
accountConfig: Record<string, unknown>;
|
|
47
|
+
catalogMapper?: CatalogMapper | undefined;
|
|
48
|
+
similarityMapper?: SimilarityMapper | undefined;
|
|
44
49
|
}
|
|
45
|
-
export type FlowValue<T> = T | ((ctx: FlowStepCtx) => T);
|
|
46
|
-
export type FlowPatch = (ctx: ChatContext, result: unknown, snapshot: FlowStepCtx) => Partial<ChatContext> | null | undefined
|
|
50
|
+
export type FlowValue<T> = T | ((ctx: FlowStepCtx) => Awaitable<T>);
|
|
51
|
+
export type FlowPatch = (ctx: ChatContext, result: unknown, snapshot: FlowStepCtx) => Awaitable<Partial<ChatContext> | null | undefined>;
|
|
47
52
|
export type BrowserCachePolicy = boolean | {
|
|
48
53
|
ttlMs?: number;
|
|
49
54
|
};
|
|
55
|
+
export interface BeOpCachePolicy {
|
|
56
|
+
strategy: 'input-hash';
|
|
57
|
+
ttlS: number;
|
|
58
|
+
promptVersion?: string | undefined;
|
|
59
|
+
}
|
|
50
60
|
export type FlowAdapterFn = (input: unknown, ctx: FlowStepCtx) => unknown | Promise<unknown>;
|
|
51
61
|
export type FlowAdapterMap = Record<string, FlowAdapterFn>;
|
|
62
|
+
export interface FlowConfirmationRequest {
|
|
63
|
+
title?: string;
|
|
64
|
+
message?: string;
|
|
65
|
+
action?: string;
|
|
66
|
+
payload?: unknown;
|
|
67
|
+
}
|
|
68
|
+
export type FlowConfirmationValue = boolean | string | FlowConfirmationRequest;
|
|
69
|
+
export type FlowConfirmationGate = FlowValue<FlowConfirmationValue | null | undefined>;
|
|
52
70
|
export interface BeOpStep {
|
|
53
71
|
kind: 'be_op';
|
|
54
72
|
op: string;
|
|
55
73
|
input: FlowValue<unknown>;
|
|
74
|
+
cache?: FlowValue<BeOpCachePolicy | false | null | undefined>;
|
|
56
75
|
cacheTtlS?: FlowValue<number | undefined>;
|
|
57
76
|
cacheKey?: FlowValue<string | undefined>;
|
|
58
77
|
browserCache?: FlowValue<BrowserCachePolicy | undefined>;
|
|
78
|
+
timeoutMs?: FlowValue<number | undefined>;
|
|
79
|
+
confirm?: FlowConfirmationGate;
|
|
59
80
|
out?: string;
|
|
60
81
|
errorOut?: string;
|
|
61
82
|
onError?: readonly FlowStep[];
|
|
@@ -65,6 +86,8 @@ export interface ToolStep {
|
|
|
65
86
|
kind: 'tool';
|
|
66
87
|
name: string;
|
|
67
88
|
input: FlowValue<unknown>;
|
|
89
|
+
timeoutMs?: FlowValue<number | undefined>;
|
|
90
|
+
confirm?: FlowConfirmationGate;
|
|
68
91
|
out?: string;
|
|
69
92
|
errorOut?: string;
|
|
70
93
|
onError?: readonly FlowStep[];
|
|
@@ -74,12 +97,14 @@ export interface AdapterStep {
|
|
|
74
97
|
kind: 'adapter';
|
|
75
98
|
name: string;
|
|
76
99
|
input: FlowValue<unknown>;
|
|
100
|
+
timeoutMs?: FlowValue<number | undefined>;
|
|
101
|
+
confirm?: FlowConfirmationGate;
|
|
77
102
|
out?: string;
|
|
78
103
|
patch?: FlowPatch;
|
|
79
104
|
}
|
|
80
105
|
export interface EmitStep {
|
|
81
106
|
kind: 'emit';
|
|
82
|
-
build: (ctx: FlowStepCtx) => StreamEvent
|
|
107
|
+
build: (ctx: FlowStepCtx) => Awaitable<StreamEvent>;
|
|
83
108
|
}
|
|
84
109
|
export interface PatchStep {
|
|
85
110
|
kind: 'patch';
|
|
@@ -93,6 +118,7 @@ export interface BranchStep {
|
|
|
93
118
|
export interface ParallelStep {
|
|
94
119
|
kind: 'parallel';
|
|
95
120
|
steps: readonly (readonly FlowStep[])[];
|
|
121
|
+
timeoutMs?: FlowValue<number | undefined>;
|
|
96
122
|
merge?: {
|
|
97
123
|
bag?: readonly string[];
|
|
98
124
|
panel?: readonly string[];
|
|
@@ -110,16 +136,24 @@ export type FlowStep = BeOpStep | ToolStep | AdapterStep | EmitStep | PatchStep
|
|
|
110
136
|
export type Flow = readonly FlowStep[];
|
|
111
137
|
export type ToolFn = (input: unknown) => unknown | Promise<unknown>;
|
|
112
138
|
export type ToolMap = Record<string, ToolFn>;
|
|
139
|
+
export type CatalogMapper = (raw: Record<string, unknown>) => NormalizedProduct | null;
|
|
140
|
+
export type SimilarityMapper = (raw: Record<string, unknown>) => ProductSimilarityProfile | null;
|
|
113
141
|
export interface AccountModule {
|
|
114
142
|
accountId?: string;
|
|
115
143
|
defaultLocale?: string;
|
|
116
144
|
flows: Record<string, Flow>;
|
|
117
145
|
tools?: ToolMap;
|
|
118
146
|
adapters?: FlowAdapterMap;
|
|
147
|
+
catalogMapper?: CatalogMapper;
|
|
148
|
+
similarityMapper?: SimilarityMapper;
|
|
119
149
|
accountConfig?: Record<string, unknown>;
|
|
150
|
+
trace?: AgentTraceCallback;
|
|
120
151
|
contextPersistence?: {
|
|
121
152
|
panelKeys?: readonly string[];
|
|
122
153
|
panelKeyLimits?: Record<string, number>;
|
|
154
|
+
messageLimit?: number;
|
|
155
|
+
maxThreads?: number;
|
|
156
|
+
threadTtlMs?: number;
|
|
123
157
|
};
|
|
124
158
|
}
|
|
125
159
|
export interface AgentOpBeacon {
|
|
@@ -158,6 +192,31 @@ export interface GenericBeacon {
|
|
|
158
192
|
}
|
|
159
193
|
export type AgentBeaconPayload = AgentOpBeacon | AgentToolBeacon | TurnSummaryBeacon | GenericBeacon;
|
|
160
194
|
export type BeaconCallback = (payload: AgentBeaconPayload) => void;
|
|
195
|
+
export interface AgentTraceEvent {
|
|
196
|
+
type: 'turn:start' | 'turn:end' | 'turn:error' | 'step:start' | 'step:end' | 'step:error' | 'confirmation:start' | 'confirmation:end' | 'confirmation:error';
|
|
197
|
+
accountId: string;
|
|
198
|
+
threadId: string;
|
|
199
|
+
sessionId: string;
|
|
200
|
+
stepIndex?: number;
|
|
201
|
+
stepKind?: FlowStep['kind'];
|
|
202
|
+
stepName?: string;
|
|
203
|
+
latencyMs?: number;
|
|
204
|
+
errorCode?: string;
|
|
205
|
+
}
|
|
206
|
+
export type AgentTraceCallback = (event: AgentTraceEvent) => Awaitable<void>;
|
|
207
|
+
export interface AgentConfirmationRequest extends FlowConfirmationRequest {
|
|
208
|
+
accountId: string;
|
|
209
|
+
threadId: string;
|
|
210
|
+
sessionId: string;
|
|
211
|
+
stepKind: FlowStep['kind'];
|
|
212
|
+
stepName?: string;
|
|
213
|
+
}
|
|
214
|
+
export interface AgentConfirmationResult {
|
|
215
|
+
confirmed: boolean;
|
|
216
|
+
reason?: string;
|
|
217
|
+
payload?: unknown;
|
|
218
|
+
}
|
|
219
|
+
export type ConfirmationCallback = (request: AgentConfirmationRequest) => Awaitable<boolean | AgentConfirmationResult>;
|
|
161
220
|
export interface UiSpecEnvelope {
|
|
162
221
|
widget: 'chat' | 'qna' | 'simrel';
|
|
163
222
|
spec: UISpec;
|
|
@@ -179,6 +238,14 @@ export interface MemoryBucketAsync {
|
|
|
179
238
|
}) => Promise<boolean>;
|
|
180
239
|
remove: (key: string) => Promise<void>;
|
|
181
240
|
}
|
|
241
|
+
export type MemoryTier = 'volatile' | 'session' | 'local' | 'indexedDb';
|
|
242
|
+
export interface AgentMemoryProvider {
|
|
243
|
+
get: (tier: MemoryTier, key: string) => unknown | Promise<unknown>;
|
|
244
|
+
set: (tier: MemoryTier, key: string, value: unknown, options?: {
|
|
245
|
+
ttlMs?: number;
|
|
246
|
+
}) => boolean | void | Promise<boolean | void>;
|
|
247
|
+
remove?: (tier: MemoryTier, key: string) => void | Promise<void>;
|
|
248
|
+
}
|
|
182
249
|
export interface BrowserMemory {
|
|
183
250
|
accountId: string;
|
|
184
251
|
volatile: MemoryBucketSync & {
|
|
@@ -187,6 +254,12 @@ export interface BrowserMemory {
|
|
|
187
254
|
session: MemoryBucketSync;
|
|
188
255
|
local: MemoryBucketSync;
|
|
189
256
|
indexedDb: MemoryBucketAsync;
|
|
257
|
+
gc: () => Promise<{
|
|
258
|
+
volatile: number;
|
|
259
|
+
session: number;
|
|
260
|
+
local: number;
|
|
261
|
+
indexedDb: number;
|
|
262
|
+
}>;
|
|
190
263
|
stableKey: (value: unknown) => string;
|
|
191
264
|
policy: Record<string, string>;
|
|
192
265
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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;
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
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;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function compactObject(value: unknown): Record<string, unknown>;
|
|
@@ -0,0 +1,30 @@
|
|
|
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;
|
|
@@ -0,0 +1,14 @@
|
|
|
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;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare function resolveProductCandidates({ accountId, supplied, pageProduct, listingProducts, skus, limit, storedProducts, getStoredPanelProducts, }?: {
|
|
2
|
+
supplied?: never[] | undefined;
|
|
3
|
+
pageProduct?: null | undefined;
|
|
4
|
+
listingProducts?: never[] | undefined;
|
|
5
|
+
skus?: never[] | undefined;
|
|
6
|
+
limit?: number | undefined;
|
|
7
|
+
storedProducts?: never[] | undefined;
|
|
8
|
+
}): any[];
|
|
9
|
+
export declare function createResolveProductsTool({ accountId, rootUrl, getProduct, getProducts, getStoredPanelProducts, limit, }?: {
|
|
10
|
+
limit?: number | undefined;
|
|
11
|
+
}): (input?: {}) => Promise<{
|
|
12
|
+
accountId: any;
|
|
13
|
+
products: any[];
|
|
14
|
+
rootUrl: any;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function uniqueProductsBySku(products: any, { skus, limit }?: {
|
|
17
|
+
skus?: never[] | undefined;
|
|
18
|
+
limit?: number | undefined;
|
|
19
|
+
}): any[];
|
|
20
|
+
export declare function readStoredPanelProducts(accountId: any, visibleProducts?: never[]): never[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare function createProductSurfaceInspector({ accountId, getPageType, getProduct, getProducts, normalizeProduct, }: {
|
|
2
|
+
accountId: any;
|
|
3
|
+
getPageType: any;
|
|
4
|
+
getProduct: any;
|
|
5
|
+
getProducts: any;
|
|
6
|
+
normalizeProduct?: ((product: any) => any) | undefined;
|
|
7
|
+
}): (input?: {}) => {
|
|
8
|
+
[k: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
export declare function inspectProductSurface({ accountId, getPageType, getProduct, getProducts, normalizeProduct, input, }: {
|
|
11
|
+
accountId: any;
|
|
12
|
+
getPageType: any;
|
|
13
|
+
getProduct: any;
|
|
14
|
+
getProducts: any;
|
|
15
|
+
normalizeProduct?: ((product: any) => any) | undefined;
|
|
16
|
+
input?: {} | undefined;
|
|
17
|
+
}): {
|
|
18
|
+
[k: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
export declare function mergeProductSurfaceEvidence(products: any, surface: any): any[];
|
|
21
|
+
export declare function compactProductSurfaceForLlm(surface: any): {
|
|
22
|
+
[k: string]: unknown;
|
|
23
|
+
} | null;
|
|
24
|
+
export declare function productSurfaceReviewText(surface: any, fallback: any, options?: {}): any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function createLocalRefStore({ namespace, ttlMs, maxEntries }?: {
|
|
2
|
+
namespace?: string | undefined;
|
|
3
|
+
ttlMs?: number | undefined;
|
|
4
|
+
maxEntries?: number | undefined;
|
|
5
|
+
}): {
|
|
6
|
+
put: (value: any, options?: {}) => Promise<{
|
|
7
|
+
kind: any;
|
|
8
|
+
id: string;
|
|
9
|
+
}>;
|
|
10
|
+
get: (refOrId: any) => Promise<any>;
|
|
11
|
+
delete: (refOrId: any) => Promise<void>;
|
|
12
|
+
materialize: (value: any) => any;
|
|
13
|
+
cleanup: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function isRef(value: any): boolean;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
export declare function createSiteAwarenessTools({ accountId, getPageType, getProduct, getProducts, normalizeProduct, }: {
|
|
2
|
+
accountId: any;
|
|
3
|
+
getPageType: any;
|
|
4
|
+
getProduct: any;
|
|
5
|
+
getProducts: any;
|
|
6
|
+
normalizeProduct?: ((product: any) => any) | undefined;
|
|
7
|
+
}): {
|
|
8
|
+
scanSite: (input?: {}) => {
|
|
9
|
+
[k: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
siteGrep: (input?: {}) => {
|
|
12
|
+
ok: boolean;
|
|
13
|
+
matches: never[];
|
|
14
|
+
message: string;
|
|
15
|
+
privacy: {
|
|
16
|
+
rawHtml: boolean;
|
|
17
|
+
formValues: boolean;
|
|
18
|
+
redacted: boolean;
|
|
19
|
+
browserLocal: boolean;
|
|
20
|
+
};
|
|
21
|
+
query?: never;
|
|
22
|
+
count?: never;
|
|
23
|
+
} | {
|
|
24
|
+
ok: boolean;
|
|
25
|
+
query: string;
|
|
26
|
+
matches: {
|
|
27
|
+
snippet: string;
|
|
28
|
+
tag: string;
|
|
29
|
+
heading: string;
|
|
30
|
+
}[];
|
|
31
|
+
count: number;
|
|
32
|
+
privacy: {
|
|
33
|
+
rawHtml: boolean;
|
|
34
|
+
formValues: boolean;
|
|
35
|
+
redacted: boolean;
|
|
36
|
+
browserLocal: boolean;
|
|
37
|
+
};
|
|
38
|
+
message?: never;
|
|
39
|
+
};
|
|
40
|
+
discoverSiteContent: (input?: {}) => {
|
|
41
|
+
accountId: string;
|
|
42
|
+
items: ({
|
|
43
|
+
[k: string]: unknown;
|
|
44
|
+
} | null)[];
|
|
45
|
+
count: number;
|
|
46
|
+
privacy: {
|
|
47
|
+
rawHtml: boolean;
|
|
48
|
+
formValues: boolean;
|
|
49
|
+
redacted: boolean;
|
|
50
|
+
browserLocal: boolean;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
runSiteCommand: (input?: {}) => {
|
|
54
|
+
ok: boolean;
|
|
55
|
+
command: string;
|
|
56
|
+
message: string;
|
|
57
|
+
label?: never;
|
|
58
|
+
privacy?: never;
|
|
59
|
+
} | {
|
|
60
|
+
ok: boolean;
|
|
61
|
+
command: string;
|
|
62
|
+
label: string;
|
|
63
|
+
message: string;
|
|
64
|
+
privacy: {
|
|
65
|
+
rawHtml: boolean;
|
|
66
|
+
formValues: boolean;
|
|
67
|
+
redacted: boolean;
|
|
68
|
+
browserLocal: boolean;
|
|
69
|
+
};
|
|
70
|
+
} | {
|
|
71
|
+
ok: boolean;
|
|
72
|
+
blocked: boolean;
|
|
73
|
+
command: string;
|
|
74
|
+
message: string;
|
|
75
|
+
privacy: {
|
|
76
|
+
rawHtml: boolean;
|
|
77
|
+
formValues: boolean;
|
|
78
|
+
redacted: boolean;
|
|
79
|
+
browserLocal: boolean;
|
|
80
|
+
};
|
|
81
|
+
label?: never;
|
|
82
|
+
} | {
|
|
83
|
+
ok: boolean;
|
|
84
|
+
command: string;
|
|
85
|
+
message: string;
|
|
86
|
+
privacy: {
|
|
87
|
+
rawHtml: boolean;
|
|
88
|
+
formValues: boolean;
|
|
89
|
+
redacted: boolean;
|
|
90
|
+
browserLocal: boolean;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
describeVisualContext: (input?: {}) => {
|
|
94
|
+
accountId: any;
|
|
95
|
+
ok: boolean;
|
|
96
|
+
consentedObservations: string[];
|
|
97
|
+
visibleImages: {
|
|
98
|
+
alt: string;
|
|
99
|
+
title: string;
|
|
100
|
+
src: string;
|
|
101
|
+
width: number;
|
|
102
|
+
height: number;
|
|
103
|
+
}[];
|
|
104
|
+
message: string;
|
|
105
|
+
privacy: {
|
|
106
|
+
rawHtml: boolean;
|
|
107
|
+
formValues: boolean;
|
|
108
|
+
screenshotPixels: boolean;
|
|
109
|
+
redacted: boolean;
|
|
110
|
+
browserLocal: boolean;
|
|
111
|
+
requiresConsentForExternalVisualFacts: boolean;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
inspectProductSurface: (input?: {}) => {
|
|
115
|
+
[k: string]: unknown;
|
|
116
|
+
};
|
|
117
|
+
getSiteCapabilities: () => {
|
|
118
|
+
accountId: any;
|
|
119
|
+
tools: string[];
|
|
120
|
+
commands: {
|
|
121
|
+
scanSite: string;
|
|
122
|
+
siteGrep: string;
|
|
123
|
+
discoverSiteContent: string;
|
|
124
|
+
runSiteCommand: string;
|
|
125
|
+
describeVisualContext: string;
|
|
126
|
+
inspectProductSurface: string;
|
|
127
|
+
};
|
|
128
|
+
privacy: string[];
|
|
129
|
+
};
|
|
130
|
+
};
|
|
@@ -4,6 +4,7 @@ interface LazyRuntimeLoaderOptions {
|
|
|
4
4
|
startExport?: string;
|
|
5
5
|
globalBaseUrlKey?: string;
|
|
6
6
|
errorLabel?: string;
|
|
7
|
+
trustedRuntimeOrigins?: readonly string[] | true;
|
|
7
8
|
}
|
|
8
|
-
export declare function startLazyRuntimeLoader({ accountId, runtimeFile, startExport, globalBaseUrlKey, errorLabel, }?: LazyRuntimeLoaderOptions): Promise<unknown>;
|
|
9
|
+
export declare function startLazyRuntimeLoader({ accountId, runtimeFile, startExport, globalBaseUrlKey, errorLabel, trustedRuntimeOrigins, }?: LazyRuntimeLoaderOptions): Promise<unknown>;
|
|
9
10
|
export {};
|