@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,20 +0,0 @@
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[];
@@ -1,24 +0,0 @@
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;
@@ -1,15 +0,0 @@
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;
@@ -1,4 +0,0 @@
1
- export declare const redactPii: (value: any) => string, anonymousRequestText: (request: any) => string, anonymizeMessages: (messages?: never[]) => {
2
- role: any;
3
- content: string;
4
- }[];
@@ -1,3 +0,0 @@
1
- export declare function routeFlowParams(bag: any): any;
2
- export declare function firstArrayValue(value: any): any;
3
- export declare function routeSkuList(bag: any): string[];
@@ -1,2 +0,0 @@
1
- export declare function rankSimilarityCandidates(source?: {}, products?: never[], options?: {}): never[];
2
- export declare function withoutSourceProduct(products?: never[], source?: {}): never[];
@@ -1,130 +0,0 @@
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
- };
@@ -1,10 +0,0 @@
1
- interface LazyRuntimeLoaderOptions {
2
- accountId: string;
3
- runtimeFile?: string;
4
- startExport?: string;
5
- globalBaseUrlKey?: string;
6
- errorLabel?: string;
7
- trustedRuntimeOrigins?: readonly string[] | true;
8
- }
9
- export declare function startLazyRuntimeLoader({ accountId, runtimeFile, startExport, globalBaseUrlKey, errorLabel, trustedRuntimeOrigins, }?: LazyRuntimeLoaderOptions): Promise<unknown>;
10
- export {};
@@ -1,12 +0,0 @@
1
- import type { ProcessActionRequest } from '../../common/transport.js';
2
- export interface RedactionPattern {
3
- pattern: RegExp;
4
- replacement: string | ((value: string) => string);
5
- }
6
- export interface RedactionPatternPack {
7
- patterns?: readonly RedactionPattern[];
8
- }
9
- export declare const defaultPiiPatterns: readonly RedactionPattern[];
10
- export declare const defaultPiiPatternPack: RedactionPatternPack;
11
- export declare function redactPii(value: unknown, patternPack?: RedactionPatternPack): string;
12
- export declare function anonymousRequestText(request: ProcessActionRequest | null | undefined, patternPack?: RedactionPatternPack): string;
@@ -1,3 +0,0 @@
1
- import type { ProcessActionRequest } from '../../common/transport.js';
2
- /** Account-agnostic helper to extract the shopper's text from a ProcessActionRequest. */
3
- export declare function requestText(request: ProcessActionRequest | null | undefined): string;
@@ -1,2 +0,0 @@
1
- export declare function nowIso(): string;
2
- export declare function elapsedMs(startedAt: number): number;
@@ -1,12 +0,0 @@
1
- import type { InjectorBridgeEndpoint, InjectorEndpointHandler } from '../../common/transport.js';
2
- import type { EndpointCachePolicyResolver } from '../adaptor/fetch-bridge.js';
3
- export interface EndpointCachePolicyOptions {
4
- partitionPrefix: string;
5
- version?: string;
6
- ttlMs?: number;
7
- }
8
- export declare function endpointStableKey(endpoint: InjectorBridgeEndpoint, request: unknown, version?: string): string;
9
- export declare function createEndpointCachePolicies(options: EndpointCachePolicyOptions): Partial<Record<InjectorBridgeEndpoint, EndpointCachePolicyResolver>>;
10
- export declare function createEndpointHandlers(handlers: Partial<Record<InjectorBridgeEndpoint, InjectorEndpointHandler>>): Partial<Record<InjectorBridgeEndpoint, InjectorEndpointHandler>>;
11
- export declare function ndjsonResponse(lines: unknown[], init?: ResponseInit): Response;
12
- export declare function jsonResponse(value: unknown, init?: ResponseInit): Response;
@@ -1,43 +0,0 @@
1
- import type { ChatContext, FlowStep, UiSpecEnvelope } from '../types.js';
2
- import type { StreamEvent } from '../../common/types.js';
3
- import { type RoundObservation, type SearchFollowUpPill } from './agent-ui.js';
4
- export interface ToolObservationEnvelope extends RoundObservation {
5
- name?: string;
6
- arguments?: Record<string, unknown>;
7
- observation?: {
8
- status?: string;
9
- products?: unknown[];
10
- query?: unknown;
11
- source?: unknown;
12
- count?: unknown;
13
- comparison_table?: unknown;
14
- key_differences?: unknown;
15
- recommendation?: {
16
- sku?: unknown;
17
- reason?: unknown;
18
- };
19
- surface?: {
20
- product?: unknown;
21
- };
22
- [key: string]: unknown;
23
- };
24
- }
25
- export interface ToolUiStepsDeps {
26
- obsKey?: string;
27
- uiSpec: (envelope: UiSpecEnvelope) => StreamEvent;
28
- productsUiSpec: (products: unknown[]) => UiSpecEnvelope;
29
- actionButtonsUiSpec: (pills: SearchFollowUpPill[]) => UiSpecEnvelope;
30
- comparisonUiSpec: (input: {
31
- products: unknown[];
32
- comparison_table?: unknown;
33
- key_differences?: unknown;
34
- recommended_choice_sku?: unknown;
35
- recommended_choice?: unknown;
36
- }) => UiSpecEnvelope;
37
- productDetailsUiSpec: (product: unknown) => UiSpecEnvelope;
38
- similarsFollowupSteps?: () => readonly FlowStep[];
39
- pdpFollowupProduct?: (bag: Record<string, unknown>, context: ChatContext) => unknown;
40
- gridLimit?: number;
41
- }
42
- export declare function buildToolUiSteps(deps: ToolUiStepsDeps): FlowStep[];
43
- export declare function buildPdpFollowupSteps(deps: ToolUiStepsDeps): FlowStep[];
@@ -1,44 +0,0 @@
1
- interface UiSpecLike {
2
- spec?: {
3
- root?: string;
4
- elements?: Record<string, {
5
- type?: string;
6
- props?: Record<string, unknown>;
7
- } | undefined>;
8
- };
9
- [key: string]: unknown;
10
- }
11
- export interface SearchFollowUpProduct {
12
- sku?: unknown;
13
- url?: unknown;
14
- [key: string]: unknown;
15
- }
16
- export interface SearchFollowUpContext {
17
- meta?: {
18
- locale?: unknown;
19
- };
20
- }
21
- export interface SearchFollowUpAccountConfig {
22
- locale?: unknown;
23
- defaultLocale?: unknown;
24
- }
25
- export interface SearchFollowUpPill {
26
- label: string;
27
- action: {
28
- type: string;
29
- payload: Record<string, unknown>;
30
- };
31
- }
32
- export declare function searchFollowUpPills(products: readonly SearchFollowUpProduct[] | null | undefined, options?: {
33
- context?: SearchFollowUpContext;
34
- accountConfig?: SearchFollowUpAccountConfig;
35
- }): SearchFollowUpPill[];
36
- export interface RoundObservation {
37
- observation?: {
38
- products?: readonly unknown[];
39
- };
40
- [key: string]: unknown;
41
- }
42
- export declare function mergeRoundProducts(observations: readonly (RoundObservation | null | undefined)[] | null | undefined, limit?: number): Record<string, unknown>[];
43
- export declare function withSimilarsAppend<T extends UiSpecLike>(envelope: T): T;
44
- export {};
@@ -1,32 +0,0 @@
1
- import { type JwtProvider } from './jwt-mint.js';
2
- import type { Awaitable, BrowserCachePolicy } from '../types.js';
3
- export interface BeClientInterceptors {
4
- beforeRequest?(args: InvokeBeOpArgs, request: {
5
- url: string;
6
- init: RequestInit;
7
- }): Awaitable<{
8
- init?: RequestInit;
9
- cached?: Record<string, unknown>;
10
- } | void | undefined>;
11
- afterResponse?(args: InvokeBeOpArgs, result: Record<string, unknown>): Awaitable<{
12
- result?: Record<string, unknown>;
13
- } | void | undefined>;
14
- }
15
- export interface InvokeBeOpArgs {
16
- beUrl: string;
17
- accountId: string;
18
- devJwtSecret?: string | undefined;
19
- tokenBrokerUrl?: string | undefined;
20
- tokenBrokerAudience?: string | undefined;
21
- jwtProvider?: JwtProvider | undefined;
22
- parentUrl?: string | undefined;
23
- op: string;
24
- input?: unknown;
25
- cacheTtlS?: number | undefined;
26
- cacheKey?: string | undefined;
27
- cacheFreshness?: string | undefined;
28
- browserCache?: BrowserCachePolicy | undefined;
29
- signal?: AbortSignal | undefined;
30
- interceptors?: BeClientInterceptors | undefined;
31
- }
32
- export declare function invokeBeOp(args: InvokeBeOpArgs): Promise<Record<string, unknown>>;
@@ -1,25 +0,0 @@
1
- export interface SingleFlightOptions {
2
- ttlMs?: number;
3
- clock?: () => number;
4
- }
5
- export type SingleFlightExecutor<TInput, TResult> = (input: TInput) => Promise<TResult>;
6
- export type SingleFlightKeyFn<TInput> = (input: TInput) => string | null | undefined;
7
- export declare function singleFlight<TInput, TResult>(executor: SingleFlightExecutor<TInput, TResult>, keyFn: SingleFlightKeyFn<TInput>, options?: SingleFlightOptions): SingleFlightExecutor<TInput, TResult>;
8
- interface CartInput {
9
- cartCode?: unknown;
10
- sku?: unknown;
11
- productCode?: unknown;
12
- quantity?: unknown;
13
- qty?: unknown;
14
- variantId?: unknown;
15
- variantCode?: unknown;
16
- product?: {
17
- sku?: unknown;
18
- cart_code?: unknown;
19
- variantId?: unknown;
20
- };
21
- }
22
- type CartImpl<TResult> = (input: CartInput) => Promise<TResult>;
23
- export declare function coalesceAddToCart<TResult>(impl: CartImpl<TResult>): (input?: CartInput) => Promise<TResult>;
24
- export declare function __resetAllCartCoalescersForTesting(): void;
25
- export {};
@@ -1,12 +0,0 @@
1
- import type { ChatContext, ChatMessage } from '../types.js';
2
- export interface CompactionOptions {
3
- threshold?: number;
4
- retainTail?: number;
5
- }
6
- export interface CompactionRequest {
7
- messagesToSummarize: readonly ChatMessage[];
8
- retainedTail: readonly ChatMessage[];
9
- }
10
- export declare function shouldCompact(messages: readonly ChatMessage[] | null | undefined, options?: CompactionOptions): boolean;
11
- export declare function buildCompactionRequest(messages: readonly ChatMessage[], options?: CompactionOptions): CompactionRequest | null;
12
- export declare function applyCompactionResult(context: ChatContext, summary: string, options?: CompactionOptions): ChatContext;
@@ -1,2 +0,0 @@
1
- import type { AccountModule } from '../types.js';
2
- export declare function startWorker(accountModule: AccountModule): void;
@@ -1,24 +0,0 @@
1
- import type { ProcessActionRequest } from '../../common/transport.js';
2
- import type { StreamEvent } from '../../common/types.js';
3
- import type { AccountModule, BeClient, ChatContext, RpcFn, ToolBridge } from '../types.js';
4
- interface RunTurnArgs {
5
- request: ProcessActionRequest;
6
- accountModule: AccountModule;
7
- contextStore: {
8
- load: (request: ProcessActionRequest) => Promise<ChatContext>;
9
- patch: (threadId: string, patch: Partial<ChatContext> | null | undefined) => ChatContext | null;
10
- appendUserMessage: (threadId: string, text: string) => ChatContext | null;
11
- commit: (threadId: string) => Promise<ChatContext | null>;
12
- };
13
- beClient: BeClient;
14
- toolBridge: ToolBridge;
15
- emit: (event: StreamEvent) => void;
16
- rpc: RpcFn;
17
- signal?: AbortSignal;
18
- }
19
- interface RunTurnResult {
20
- steps: number;
21
- productSkusEmitted: string[];
22
- }
23
- export declare function runTurn({ request, accountModule, contextStore, beClient, toolBridge, emit, rpc, signal, }: RunTurnArgs): Promise<RunTurnResult>;
24
- export {};
@@ -1,21 +0,0 @@
1
- interface MintDevJwtArgs {
2
- accountId: string;
3
- devJwtSecret?: string;
4
- ttlS?: number;
5
- }
6
- export declare function mintDevJwt({ accountId, devJwtSecret, ttlS }: MintDevJwtArgs): Promise<string>;
7
- interface JwtProviderOptions {
8
- accountId: string;
9
- devJwtSecret?: string | undefined;
10
- tokenBrokerUrl?: string | undefined;
11
- tokenBrokerAudience?: string | undefined;
12
- refreshSkewS?: number | undefined;
13
- fetchImpl?: typeof fetch | undefined;
14
- }
15
- interface JwtProviderArgs {
16
- signal?: AbortSignal;
17
- parentUrl?: string;
18
- }
19
- export type JwtProvider = (args?: JwtProviderArgs) => Promise<string>;
20
- export declare function createJwtProvider({ accountId, devJwtSecret, tokenBrokerUrl, tokenBrokerAudience, refreshSkewS, fetchImpl, }: JwtProviderOptions): JwtProvider;
21
- export {};
@@ -1,30 +0,0 @@
1
- type ResolveProductsResult<TProduct> = {
2
- products?: TProduct[];
3
- } & Record<string, unknown>;
4
- type ResolveProductsInput = {
5
- hydrateFromPdp?: boolean;
6
- [key: string]: unknown;
7
- };
8
- export interface PdpHydrationOptions<TProduct extends {
9
- sku?: unknown;
10
- url?: unknown;
11
- }> {
12
- accountId: string;
13
- allowedHostnames: readonly string[];
14
- productFromPage: (doc: Document, url: string) => TProduct | null;
15
- mergeProduct?: (base: TProduct, parsed: TProduct) => TProduct;
16
- needsHydration?: (product: TProduct) => boolean;
17
- fetchOptions?: RequestInit;
18
- maxConcurrency?: number;
19
- }
20
- export interface WrappedResolveProducts<TProduct, TResult extends ResolveProductsResult<TProduct>> {
21
- (input?: ResolveProductsInput): Promise<TResult>;
22
- __resetCacheForTesting(): void;
23
- __cacheSizeForTesting(): number;
24
- }
25
- export declare function wrapResolveProductsWithPdpHydration<TProduct extends {
26
- sku?: unknown;
27
- url?: unknown;
28
- }, TResult extends ResolveProductsResult<TProduct>>(baseResolveProducts: (input: ResolveProductsInput) => Promise<TResult>, options: PdpHydrationOptions<TProduct>): WrappedResolveProducts<TProduct, TResult>;
29
- export declare function __resetAllPdpHydratorsForTesting(): void;
30
- export {};
@@ -1,47 +0,0 @@
1
- import type { AgentBeaconPayload, ConfirmationCallback, AgentMemoryProvider, BrowserMemory, RpcFn, ToolMap } from '../types.js';
2
- interface StorageMemoryLike {
3
- getItem: (key: string) => string | null;
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;
20
- }
21
- interface MainRpcDeps {
22
- tools: ToolMap;
23
- beacon?: ((payload: AgentBeaconPayload) => void) | undefined;
24
- confirmation?: ConfirmationCallback | undefined;
25
- memory: MainRpcMemory;
26
- refStore?: MainRpcRefStore | undefined;
27
- }
28
- interface RpcScope {
29
- addEventListener: (type: 'message', listener: (event: MessageEvent) => void) => void;
30
- postMessage: (message: unknown, transfer?: Transferable[]) => void;
31
- }
32
- export interface WorkerRpcOptions {
33
- timeoutMs?: number;
34
- }
35
- export declare function createWorkerRpc(scope?: RpcScope, options?: WorkerRpcOptions): RpcFn;
36
- interface HandleMainRpcArgs {
37
- worker: Worker;
38
- tools?: ToolMap;
39
- beacon?: (payload: AgentBeaconPayload) => void;
40
- confirmation?: ConfirmationCallback;
41
- memory?: MainRpcMemory;
42
- refStore?: MainRpcRefStore;
43
- }
44
- export declare function handleMainRpc({ worker, tools, beacon, confirmation, memory, refStore, }: HandleMainRpcArgs): void;
45
- export declare function defaultMainRpcMemory(): StorageMemoryLike;
46
- export declare function runMainRpc(method: string, payload: unknown, { tools, beacon, confirmation, memory, refStore }: MainRpcDeps): Promise<unknown>;
47
- export {};
@@ -1,2 +0,0 @@
1
- import type { RpcFn, ToolBridge } from '../types.js';
2
- export declare function createToolBridge(rpc: RpcFn): ToolBridge;
@@ -1,19 +0,0 @@
1
- export interface ToolArgSchema {
2
- type?: 'string' | 'number' | 'boolean' | 'array' | 'object';
3
- required?: readonly string[];
4
- properties?: Readonly<Record<string, ToolArgSchema>>;
5
- items?: ToolArgSchema;
6
- enum?: readonly unknown[];
7
- minItems?: number;
8
- maxItems?: number;
9
- minLength?: number;
10
- minimum?: number;
11
- maximum?: number;
12
- }
13
- export type ToolArgValidationResult = {
14
- ok: true;
15
- } | {
16
- ok: false;
17
- error: string;
18
- };
19
- export declare function validateToolArgs(schema: ToolArgSchema | undefined, args: unknown): ToolArgValidationResult;
@@ -1,52 +0,0 @@
1
- export { ContextStore } from './context/context-store.js';
2
- export { stickyContextKey } from './context/persistence.js';
3
- export { action, done, error, metadata, textChunk, uiSpec } from './events/builders.js';
4
- export { AgentError, beErrorToAgentError, caughtToStreamError, httpErrorToAgentError, } from './events/error-taxonomy.js';
5
- export { normalizeProduct, trimProductFactsCore, trimProductFactsListCore } from './events/product-normalize.js';
6
- export { compactContextProducts } from './events/context-products.js';
7
- export { alignProductsToTable, comparisonResultForUi, normalizeComparisonTable } from './events/comparison.js';
8
- export { actionButtonsUiSpec, comparisonUiSpec, productDetailsUiSpec, productsUiSpec } from './events/ui-specs.js';
9
- export { createFlow } from './flow/create-flow.js';
10
- export { resolveFlow } from './flow/dispatch.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';
12
- export { requestText } from './util/request-text.js';
13
- export { anonymousRequestText, defaultPiiPatternPack, defaultPiiPatterns, redactPii } from './util/privacy.js';
14
- export { compactAccountConfig, withAccountConfig } from './util/account-config.js';
15
- export { llmCacheKey, productFactsKey, productSkuKey, stableKey, textKey } from './util/cache-key.js';
16
- export type { LlmCacheKeyOptions, ProductFactsKeyOptions, ProductKeyOptions } from './util/cache-key.js';
17
- export type { RedactionPattern, RedactionPatternPack } from './util/privacy.js';
18
- export type { AccountConfigPayloadOptions } from './util/account-config.js';
19
- export { elapsedMs, nowIso } from './util/time.js';
20
- export { invokeBeOp } from './worker/be-client.js';
21
- export { startWorker } from './worker/entry.js';
22
- export { runTurn } from './worker/flow-runner.js';
23
- export { createJwtProvider, mintDevJwt } from './worker/jwt-mint.js';
24
- export { createWorkerRpc, handleMainRpc, runMainRpc } from './worker/rpc.js';
25
- export type { MainRpcMemory } from './worker/rpc.js';
26
- export { createToolBridge } from './worker/tool-bridge.js';
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, AfterBeOpResult, AfterToolCallResult, AgentHooks, AgentLoopPatch, AgentLoopPredicate, AgentLoopStep, AgentConfirmationRequest, AgentConfirmationResult, AgentMemoryProvider, AgentTraceCallback, AgentTraceEvent, AdapterStep, AgentBeaconPayload, BeforeBeOpResult, BeforeToolCallResult, 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';
39
- export { validateToolArgs } from './worker/tool-schema.js';
40
- export type { ToolArgSchema, ToolArgValidationResult } from './worker/tool-schema.js';
41
- export { __resetAllCartCoalescersForTesting, coalesceAddToCart, singleFlight } from './worker/coalesce.js';
42
- export type { SingleFlightExecutor, SingleFlightKeyFn, SingleFlightOptions } from './worker/coalesce.js';
43
- export { __resetAllPdpHydratorsForTesting, wrapResolveProductsWithPdpHydration } from './worker/pdp-hydrate.js';
44
- export type { PdpHydrationOptions, WrappedResolveProducts } from './worker/pdp-hydrate.js';
45
- export type { BeClientInterceptors, InvokeBeOpArgs } from './worker/be-client.js';
46
- export type { PendingMessage, PendingMessageKind, QueueMode, SavePointEntry } from './context/context-store.js';
47
- export { mergeRoundProducts, searchFollowUpPills, withSimilarsAppend } from './worker/agent-ui.js';
48
- export type { RoundObservation, SearchFollowUpAccountConfig, SearchFollowUpContext, SearchFollowUpPill, SearchFollowUpProduct, } from './worker/agent-ui.js';
49
- export { applyCompactionResult, buildCompactionRequest, shouldCompact } from './worker/compaction.js';
50
- export type { CompactionOptions, CompactionRequest } from './worker/compaction.js';
51
- export { buildPdpFollowupSteps, buildToolUiSteps } from './worker/agent-ui-steps.js';
52
- export type { ToolObservationEnvelope, ToolUiStepsDeps } from './worker/agent-ui-steps.js';