@gengage/assistant-fe 0.4.19 → 0.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-paths-Bg6iwO5w.js +1250 -0
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +17 -17
- package/dist/chat.js +1 -1
- package/dist/{common-Bpp43wr0.js → common-DDJSeQhg.js} +2 -2
- package/dist/common.js +79 -77
- package/dist/{connection-warning-C7ehvQxx.js → connection-warning-BeD-B0Ec.js} +1 -1
- package/dist/{fastIntent-CINRmM8r.js → fastIntent-BeeDIwd2.js} +1 -1
- package/dist/index.js +75 -73
- package/dist/native.iife.js +18 -18
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +22 -22
- package/dist/qna.js +1 -1
- package/dist/{runtime-B0hDHRlN.js → runtime-C8ZBidd2.js} +13 -13
- package/dist/{runtime-CLcYqzoA.js → runtime-CRSFPLku.js} +17 -17
- package/dist/{runtime-DhdfOJEN.js → runtime-Ct1qOl8V.js} +855 -848
- package/dist/{simbut-3kqLW3SM.js → simbut-BrAeZ6SH.js} +19 -22
- package/dist/simbut.iife.js +9 -9
- package/dist/simbut.js +1 -1
- package/dist/{simrel-fQg2EIB8.js → simrel-Cha5de6P.js} +1 -1
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +7 -7
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-bdJaGJYi.js → widget-base-BtBl_PCR.js} +91 -83
- package/package.json +9 -5
- package/dist/api-paths-BX3Lea3A.js +0 -1213
- package/dist/chat/api.d.ts +0 -88
- package/dist/chat/assistant-mode.d.ts +0 -19
- package/dist/chat/attachment-utils.d.ts +0 -9
- package/dist/chat/catalog.d.ts +0 -826
- package/dist/chat/chat-presentation-state.d.ts +0 -53
- package/dist/chat/components/AIGroupingCards.d.ts +0 -3
- package/dist/chat/components/AISuggestedSearchCards.d.ts +0 -3
- package/dist/chat/components/AITopPicks.d.ts +0 -3
- package/dist/chat/components/BeautyPhotoStep.d.ts +0 -16
- package/dist/chat/components/CategoriesContainer.d.ts +0 -3
- package/dist/chat/components/ChatDrawer.d.ts +0 -360
- package/dist/chat/components/ChoicePrompter.d.ts +0 -21
- package/dist/chat/components/ComparisonTable.d.ts +0 -57
- package/dist/chat/components/ConsultingStylePicker.d.ts +0 -34
- package/dist/chat/components/FloatingComparisonButton.d.ts +0 -2
- package/dist/chat/components/FloatingLauncher.d.ts +0 -79
- package/dist/chat/components/GroundingReviewCard.d.ts +0 -3
- package/dist/chat/components/HandoffNotice.d.ts +0 -4
- package/dist/chat/components/KvkkBanner.d.ts +0 -6
- package/dist/chat/components/Launcher.d.ts +0 -28
- package/dist/chat/components/PanelRestoreCard.d.ts +0 -4
- package/dist/chat/components/PanelTopBar.d.ts +0 -32
- package/dist/chat/components/PhotoAnalysisCard.d.ts +0 -20
- package/dist/chat/components/ProductSummaryCard.d.ts +0 -3
- package/dist/chat/components/ProsAndCons.d.ts +0 -8
- package/dist/chat/components/ReviewHighlights.d.ts +0 -9
- package/dist/chat/components/actionClassifier.d.ts +0 -12
- package/dist/chat/components/product-price-layout.d.ts +0 -18
- package/dist/chat/components/productMentionLinker.d.ts +0 -25
- package/dist/chat/components/renderUISpec.d.ts +0 -11
- package/dist/chat/components/typewriter.d.ts +0 -24
- package/dist/chat/extendedModeManager.d.ts +0 -32
- package/dist/chat/features/beauty-consulting/consulting-grid.d.ts +0 -31
- package/dist/chat/features/beauty-consulting/drawer-extensions.d.ts +0 -20
- package/dist/chat/features/beauty-consulting/mode-controller.d.ts +0 -53
- package/dist/chat/features/beauty-consulting/registry.d.ts +0 -3
- package/dist/chat/features/beauty-consulting/stream-handler.d.ts +0 -38
- package/dist/chat/history-storage.d.ts +0 -85
- package/dist/chat/index.d.ts +0 -5
- package/dist/chat/kvkk.d.ts +0 -20
- package/dist/chat/locales/en.d.ts +0 -2
- package/dist/chat/locales/index.d.ts +0 -5
- package/dist/chat/locales/tr.d.ts +0 -2
- package/dist/chat/panel-manager.d.ts +0 -126
- package/dist/chat/runtime.d.ts +0 -399
- package/dist/chat/session-persistence.d.ts +0 -65
- package/dist/chat/stream-error-display.d.ts +0 -6
- package/dist/chat/types.d.ts +0 -543
- package/dist/chat/utils/chat-presentation-debug.d.ts +0 -19
- package/dist/chat/utils/get-chat-scroll-element.d.ts +0 -10
- package/dist/chat/utils/ui.d.ts +0 -10
- package/dist/common/action-router.d.ts +0 -26
- package/dist/common/activity-tracker.d.ts +0 -37
- package/dist/common/analytics-events.d.ts +0 -91
- package/dist/common/analytics.d.ts +0 -61
- package/dist/common/api-paths.d.ts +0 -15
- package/dist/common/client.d.ts +0 -27
- package/dist/common/communication-bridge.d.ts +0 -51
- package/dist/common/config-constants.d.ts +0 -1
- package/dist/common/config-schema.d.ts +0 -81
- package/dist/common/connection-warning.d.ts +0 -8
- package/dist/common/consulting-sources.d.ts +0 -9
- package/dist/common/context.d.ts +0 -27
- package/dist/common/css-escape.d.ts +0 -1
- package/dist/common/customization-factories.d.ts +0 -62
- package/dist/common/debug.d.ts +0 -13
- package/dist/common/events.d.ts +0 -46
- package/dist/common/fastIntent.d.ts +0 -1
- package/dist/common/ga-datalayer.d.ts +0 -89
- package/dist/common/global-error-toast.d.ts +0 -6
- package/dist/common/index.d.ts +0 -49
- package/dist/common/indexed-db.d.ts +0 -79
- package/dist/common/locale.d.ts +0 -1
- package/dist/common/native-webview.d.ts +0 -60
- package/dist/common/navigation.d.ts +0 -5
- package/dist/common/overlay.d.ts +0 -168
- package/dist/common/page-detect.d.ts +0 -30
- package/dist/common/pill-launcher.d.ts +0 -51
- package/dist/common/preflight.d.ts +0 -13
- package/dist/common/price-formatter.d.ts +0 -35
- package/dist/common/product-utils.d.ts +0 -35
- package/dist/common/protocol-adapter.d.ts +0 -105
- package/dist/common/renderer/dom.d.ts +0 -3
- package/dist/common/renderer/index.d.ts +0 -4
- package/dist/common/renderer/overrides.d.ts +0 -23
- package/dist/common/renderer/registry.d.ts +0 -2
- package/dist/common/renderer/types.d.ts +0 -19
- package/dist/common/safe-html.d.ts +0 -22
- package/dist/common/skeleton.d.ts +0 -8
- package/dist/common/streaming.d.ts +0 -37
- package/dist/common/suggested-search-keywords.d.ts +0 -18
- package/dist/common/theme-utils.d.ts +0 -15
- package/dist/common/tts-player.d.ts +0 -13
- package/dist/common/types.d.ts +0 -381
- package/dist/common/ui-theme.d.ts +0 -9
- package/dist/common/uuidv7.d.ts +0 -7
- package/dist/common/voice-input.d.ts +0 -74
- package/dist/common/widget-base.d.ts +0 -97
- package/dist/index.d.ts +0 -25
- package/dist/native/index.d.ts +0 -2
- package/dist/overlay.d.ts +0 -4
- package/dist/qna/api.d.ts +0 -23
- package/dist/qna/catalog.d.ts +0 -73
- package/dist/qna/components/ButtonRow.d.ts +0 -15
- package/dist/qna/components/TextInput.d.ts +0 -11
- package/dist/qna/components/renderUISpec.d.ts +0 -7
- package/dist/qna/index.d.ts +0 -3
- package/dist/qna/locales/en.d.ts +0 -2
- package/dist/qna/locales/index.d.ts +0 -5
- package/dist/qna/locales/tr.d.ts +0 -2
- package/dist/qna/normalize-ui-specs.d.ts +0 -15
- package/dist/qna/runtime.d.ts +0 -62
- package/dist/qna/types.d.ts +0 -98
- package/dist/simbut/index.d.ts +0 -22
- package/dist/simbut/locales.d.ts +0 -3
- package/dist/simbut/types.d.ts +0 -43
- package/dist/simrel/api.d.ts +0 -25
- package/dist/simrel/catalog.d.ts +0 -110
- package/dist/simrel/components/GroupTabs.d.ts +0 -24
- package/dist/simrel/components/ProductCard.d.ts +0 -19
- package/dist/simrel/components/ProductGrid.d.ts +0 -17
- package/dist/simrel/components/renderUISpec.d.ts +0 -7
- package/dist/simrel/index.d.ts +0 -5
- package/dist/simrel/locales/en.d.ts +0 -2
- package/dist/simrel/locales/index.d.ts +0 -5
- package/dist/simrel/locales/tr.d.ts +0 -2
- package/dist/simrel/renderers/default.d.ts +0 -40
- package/dist/simrel/runtime.d.ts +0 -59
- package/dist/simrel/types.d.ts +0 -141
package/dist/chat/api.d.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { StreamEvent, UISpec, PageContext } from '../common/types.js';
|
|
2
|
-
import { ChatTransportConfig } from '../common/api-paths.js';
|
|
3
|
-
export interface BackendRequestMeta {
|
|
4
|
-
outputLanguage: string;
|
|
5
|
-
parentUrl: string;
|
|
6
|
-
windowWidth: string;
|
|
7
|
-
windowHeight: string;
|
|
8
|
-
selfUrl: string;
|
|
9
|
-
id: string;
|
|
10
|
-
userId: string;
|
|
11
|
-
appId: string;
|
|
12
|
-
threads: unknown[];
|
|
13
|
-
createdAt: string;
|
|
14
|
-
kvkkApproved: boolean;
|
|
15
|
-
voiceEnabled: boolean;
|
|
16
|
-
threadId: string;
|
|
17
|
-
isControlGroup: boolean;
|
|
18
|
-
isMobile: boolean;
|
|
19
|
-
viewId?: string;
|
|
20
|
-
assistantMode?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface ProcessActionRequest {
|
|
23
|
-
account_id: string;
|
|
24
|
-
session_id: string;
|
|
25
|
-
correlation_id: string;
|
|
26
|
-
user_id?: string;
|
|
27
|
-
view_id?: string;
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated Use top-level `type` and `payload` instead.
|
|
30
|
-
* Kept for one release cycle of backward compatibility.
|
|
31
|
-
*/
|
|
32
|
-
action?: {
|
|
33
|
-
title: string;
|
|
34
|
-
type: string;
|
|
35
|
-
payload?: unknown;
|
|
36
|
-
};
|
|
37
|
-
/** Backend action type identifier (preferred over `action.type`). */
|
|
38
|
-
type?: string;
|
|
39
|
-
/** Arbitrary action data passed to the backend (preferred over `action.payload`). */
|
|
40
|
-
payload?: unknown;
|
|
41
|
-
sku?: string;
|
|
42
|
-
page_type?: string;
|
|
43
|
-
locale?: string;
|
|
44
|
-
meta?: BackendRequestMeta;
|
|
45
|
-
context?: {
|
|
46
|
-
messages?: Array<{
|
|
47
|
-
role: string;
|
|
48
|
-
content: string;
|
|
49
|
-
}>;
|
|
50
|
-
[key: string]: unknown;
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
export interface ActionEnrichmentContext {
|
|
54
|
-
pageContext?: PageContext | undefined;
|
|
55
|
-
backendContext?: import('../common/types.js').BackendContext | null | undefined;
|
|
56
|
-
isMobile?: boolean | undefined;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Enriches action payloads with fields the backend expects.
|
|
60
|
-
* Only adds fields that are not already present in the payload.
|
|
61
|
-
*/
|
|
62
|
-
export declare function enrichActionPayload(action: {
|
|
63
|
-
title: string;
|
|
64
|
-
type: string;
|
|
65
|
-
payload?: unknown;
|
|
66
|
-
}, ctx: ActionEnrichmentContext): {
|
|
67
|
-
title: string;
|
|
68
|
-
type: string;
|
|
69
|
-
payload?: unknown;
|
|
70
|
-
};
|
|
71
|
-
export interface StreamCallbacks {
|
|
72
|
-
onTextChunk: (content: string, isFinal: boolean, extra?: {
|
|
73
|
-
productMentions?: Array<{
|
|
74
|
-
sku: string;
|
|
75
|
-
short_name: string;
|
|
76
|
-
}> | undefined;
|
|
77
|
-
skuToProductItem?: Record<string, Record<string, unknown>> | undefined;
|
|
78
|
-
conversationMode?: string | undefined;
|
|
79
|
-
renderHint?: string | undefined;
|
|
80
|
-
kvkk?: boolean | undefined;
|
|
81
|
-
}) => void;
|
|
82
|
-
onUISpec: (spec: UISpec, widget: string, panelHint?: 'panel', clearPanel?: boolean) => void;
|
|
83
|
-
onAction: (event: StreamEvent) => void;
|
|
84
|
-
onMetadata: (event: StreamEvent) => void;
|
|
85
|
-
onError: (err: Error) => void;
|
|
86
|
-
onDone: () => void;
|
|
87
|
-
}
|
|
88
|
-
export declare function sendChatMessage(request: ProcessActionRequest, callbacks: StreamCallbacks, transport: ChatTransportConfig): AbortController;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Assistant-mode utilities for the chat widget.
|
|
3
|
-
*
|
|
4
|
-
* The chat widget can operate in multiple modes (shopping, beauty consulting,
|
|
5
|
-
* watch expert, booking). This module contains the type, parsing helpers, and
|
|
6
|
-
* recognised mode list so the main index.ts stays focused on orchestration.
|
|
7
|
-
*/
|
|
8
|
-
export type AssistantMode = 'shopping' | 'booking' | 'beauty_consulting' | 'watch_expert';
|
|
9
|
-
/** Return the value as an AssistantMode if it is a known mode string, otherwise null. */
|
|
10
|
-
export declare function toAssistantMode(value: unknown): AssistantMode | null;
|
|
11
|
-
/** Safely cast an unknown value to a plain Record, or null. */
|
|
12
|
-
export declare function asRecord(value: unknown): Record<string, unknown> | null;
|
|
13
|
-
/** Return the first non-empty string among the given values. */
|
|
14
|
-
export declare function firstString(...values: unknown[]): string | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Parse a redirect metadata payload and return the target assistant mode,
|
|
17
|
-
* or `null` if the payload is not a valid mode-switch redirect.
|
|
18
|
-
*/
|
|
19
|
-
export declare function parseRedirectMode(redirectPayload: unknown): AssistantMode | null;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const ALLOWED_MIME_TYPES: readonly ["image/jpeg", "image/png", "image/webp"];
|
|
2
|
-
export declare const MAX_FILE_SIZE: number;
|
|
3
|
-
export type ValidationResult = {
|
|
4
|
-
ok: true;
|
|
5
|
-
} | {
|
|
6
|
-
ok: false;
|
|
7
|
-
reason: 'invalid_type' | 'too_large';
|
|
8
|
-
};
|
|
9
|
-
export declare function validateImageFile(file: File): ValidationResult;
|