@gengage/assistant-fe 0.5.7 → 0.6.0
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/agentic/adaptor/create-adaptor.d.ts +19 -0
- package/dist/agentic/adaptor/fetch-bridge.d.ts +11 -0
- package/dist/agentic/adaptor/mount.d.ts +38 -0
- package/dist/agentic/context/chat-context.d.ts +15 -0
- package/dist/agentic/context/context-store.d.ts +20 -0
- package/dist/agentic/context/persistence.d.ts +12 -0
- package/dist/agentic/events/builders.d.ts +10 -0
- package/dist/agentic/events/error-taxonomy.d.ts +27 -0
- package/dist/agentic/events/product-normalize.d.ts +47 -0
- package/dist/agentic/events/ui-specs.d.ts +37 -0
- package/dist/agentic/flow/beauty-consulting-turn.d.ts +1 -0
- package/dist/agentic/flow/create-flow.d.ts +2 -0
- package/dist/agentic/flow/dispatch.d.ts +3 -0
- package/dist/agentic/index.d.ts +18 -0
- package/dist/agentic/index.js +620 -0
- package/dist/agentic/types.d.ts +212 -0
- package/dist/agentic/util/assistant-host.d.ts +11 -0
- package/dist/agentic/util/be-url.d.ts +4 -0
- package/dist/agentic/util/browser-memory.d.ts +13 -0
- package/dist/agentic/util/browser-tools.d.ts +31 -0
- package/dist/agentic/util/lazy-runtime-loader.d.ts +9 -0
- package/dist/agentic/util/request-text.d.ts +3 -0
- package/dist/agentic/util/time.d.ts +2 -0
- package/dist/agentic/worker/be-client.d.ts +15 -0
- package/dist/agentic/worker/entry.d.ts +2 -0
- package/dist/agentic/worker/flow-runner.d.ts +24 -0
- package/dist/agentic/worker/jwt-mint.d.ts +21 -0
- package/dist/agentic/worker/rpc.d.ts +24 -0
- package/dist/agentic/worker/tool-bridge.d.ts +2 -0
- package/dist/agentic/worker.d.ts +16 -0
- package/dist/agentic/worker.js +119 -0
- package/dist/agentic.iife.js +5 -0
- package/dist/{api-paths-CwzwbgQZ.js → api-paths-DJFF9RuZ.js} +1 -1
- package/dist/beauty-consulting-turn-BmPXbkQg.js +1019 -0
- package/dist/chat/api.d.ts +17 -0
- package/dist/chat/assistant-mode.d.ts +20 -0
- package/dist/chat/attachment-utils.d.ts +9 -0
- package/dist/chat/catalog.d.ts +455 -0
- package/dist/chat/chat-presentation-state.d.ts +53 -0
- package/dist/chat/components/AIGroupingCards.d.ts +15 -0
- package/dist/chat/components/AISuggestedSearchCards.d.ts +13 -0
- package/dist/chat/components/AITopPicks.d.ts +9 -0
- package/dist/chat/components/BeautyPhotoStep.d.ts +31 -0
- package/dist/chat/components/CategoriesContainer.d.ts +11 -0
- package/dist/chat/components/ChatDrawer.d.ts +362 -0
- package/dist/chat/components/ChoicePrompter.d.ts +21 -0
- package/dist/chat/components/ComparisonTable.d.ts +66 -0
- package/dist/chat/components/ConsultingStylePicker.d.ts +40 -0
- package/dist/chat/components/FloatingComparisonButton.d.ts +7 -0
- package/dist/chat/components/FloatingLauncher.d.ts +79 -0
- package/dist/chat/components/GroundingReviewCard.d.ts +11 -0
- package/dist/chat/components/HandoffNotice.d.ts +9 -0
- package/dist/chat/components/KvkkBanner.d.ts +6 -0
- package/dist/chat/components/Launcher.d.ts +28 -0
- package/dist/chat/components/PanelRestoreCard.d.ts +4 -0
- package/dist/chat/components/PanelTopBar.d.ts +32 -0
- package/dist/chat/components/PhotoAnalysisCard.d.ts +27 -0
- package/dist/chat/components/ProductSummaryCard.d.ts +12 -0
- package/dist/chat/components/ProsAndCons.d.ts +8 -0
- package/dist/chat/components/ReviewHighlights.d.ts +16 -0
- package/dist/chat/components/actionClassifier.d.ts +12 -0
- package/dist/chat/components/product-price-layout.d.ts +17 -0
- package/dist/chat/components/productMentionLinker.d.ts +26 -0
- package/dist/chat/components/renderUISpec.d.ts +15 -0
- package/dist/chat/components/typewriter.d.ts +24 -0
- package/dist/chat/extendedModeManager.d.ts +32 -0
- package/dist/chat/features/beauty-consulting/consulting-grid.d.ts +38 -0
- package/dist/chat/features/beauty-consulting/drawer-extensions.d.ts +22 -0
- package/dist/chat/features/beauty-consulting/mode-controller.d.ts +59 -0
- package/dist/chat/features/beauty-consulting/registry.d.ts +9 -0
- package/dist/chat/features/beauty-consulting/stream-handler.d.ts +45 -0
- package/dist/chat/history-storage.d.ts +85 -0
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/kvkk.d.ts +20 -0
- package/dist/chat/locales/en.d.ts +2 -0
- package/dist/chat/locales/index.d.ts +5 -0
- package/dist/chat/locales/tr.d.ts +2 -0
- package/dist/chat/panel-manager.d.ts +142 -0
- package/dist/chat/runtime.d.ts +416 -0
- package/dist/chat/session-persistence.d.ts +73 -0
- package/dist/chat/stream-error-display.d.ts +6 -0
- package/dist/chat/types.d.ts +547 -0
- package/dist/chat/utils/chat-presentation-debug.d.ts +18 -0
- package/dist/chat/utils/get-chat-scroll-element.d.ts +10 -0
- package/dist/chat/utils/ui.d.ts +10 -0
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +12 -12
- package/dist/chat.js +1 -1
- package/dist/common/action-router.d.ts +26 -0
- package/dist/common/api-paths.d.ts +23 -0
- package/dist/common/client.d.ts +27 -0
- package/dist/common/communication-bridge.d.ts +51 -0
- package/dist/common/config-constants.d.ts +1 -0
- package/dist/common/config-schema.d.ts +54 -0
- package/dist/common/connection-warning.d.ts +8 -0
- package/dist/common/consulting-sources.d.ts +8 -0
- package/dist/common/context.d.ts +64 -0
- package/dist/common/css-escape.d.ts +1 -0
- package/dist/common/customization-factories.d.ts +59 -0
- package/dist/common/debug.d.ts +13 -0
- package/dist/common/events.d.ts +55 -0
- package/dist/common/fastIntent.d.ts +1 -0
- package/dist/common/find-similar-payload.d.ts +3 -0
- package/dist/common/ga-datalayer.d.ts +80 -0
- package/dist/common/global-error-toast.d.ts +6 -0
- package/dist/common/index.d.ts +47 -0
- package/dist/common/indexed-db.d.ts +89 -0
- package/dist/common/locale.d.ts +1 -0
- package/dist/common/native-webview.d.ts +60 -0
- package/dist/common/navigation.d.ts +1 -0
- package/dist/common/overlay.d.ts +172 -0
- package/dist/common/page-detect.d.ts +36 -0
- package/dist/common/pill-launcher.d.ts +51 -0
- package/dist/common/preflight.d.ts +13 -0
- package/dist/common/price-formatter.d.ts +35 -0
- package/dist/common/product-utils.d.ts +35 -0
- package/dist/common/protocol-adapter.d.ts +108 -0
- package/dist/common/renderer/dom.d.ts +3 -0
- package/dist/common/renderer/index.d.ts +4 -0
- package/dist/common/renderer/overrides.d.ts +23 -0
- package/dist/common/renderer/registry.d.ts +2 -0
- package/dist/common/renderer/types.d.ts +19 -0
- package/dist/common/safe-html.d.ts +22 -0
- package/dist/common/sdk-version.d.ts +3 -0
- package/dist/common/streaming.d.ts +52 -0
- package/dist/common/suggested-search-keywords.d.ts +18 -0
- package/dist/common/theme-utils.d.ts +15 -0
- package/dist/common/transport.d.ts +75 -0
- package/dist/common/tts-player.d.ts +13 -0
- package/dist/common/types.d.ts +379 -0
- package/dist/common/ui-theme.d.ts +9 -0
- package/dist/common/uuidv7.d.ts +7 -0
- package/dist/common/voice-input.d.ts +74 -0
- package/dist/common/widget-base.d.ts +82 -0
- package/dist/{common-KpJP1YwP.js → common-BydCGBNn.js} +90 -139
- package/dist/common.js +41 -41
- package/dist/{connection-warning-B5T_1oBn.js → connection-warning-Pbvk3J8k.js} +1 -1
- package/dist/{fastIntent--Ukm2nOh.js → fastIntent-CkYN2UOl.js} +199 -137
- package/dist/index.d.ts +25 -0
- package/dist/index.js +50 -50
- package/dist/native/index.d.ts +2 -0
- package/dist/{native-webview-qfjm4SHx.js → native-webview-JDC1vtde.js} +1 -1
- package/dist/native.iife.js +14 -14
- package/dist/native.js +1 -1
- package/dist/{overlay-CP5A0Hhf.js → overlay-BetAvpVZ.js} +19 -19
- package/dist/overlay.d.ts +4 -0
- package/dist/overlay.js +1 -1
- package/dist/qna/api.d.ts +23 -0
- package/dist/qna/catalog.d.ts +60 -0
- package/dist/qna/components/ButtonRow.d.ts +15 -0
- package/dist/qna/components/TextInput.d.ts +11 -0
- package/dist/qna/components/renderUISpec.d.ts +7 -0
- package/dist/qna/index.d.ts +3 -0
- package/dist/qna/locales/en.d.ts +2 -0
- package/dist/qna/locales/index.d.ts +4 -0
- package/dist/qna/locales/tr.d.ts +2 -0
- package/dist/qna/normalize-ui-specs.d.ts +15 -0
- package/dist/qna/runtime.d.ts +73 -0
- package/dist/qna/types.d.ts +98 -0
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +1 -1
- package/dist/qna.js +1 -1
- package/dist/{runtime-BPyXOyyp.js → runtime-DbZO1qG5.js} +3 -3
- package/dist/{runtime-G3idwfkM.js → runtime-OpNoB3cu.js} +894 -853
- package/dist/{runtime-C3yOvNFK.js → runtime-iCLkUjI3.js} +3 -3
- package/dist/simbut/index.d.ts +31 -0
- package/dist/simbut/locales.d.ts +3 -0
- package/dist/simbut/types.d.ts +43 -0
- package/dist/{simbut-CiknJI6-.js → simbut-FyXolmZY.js} +1 -1
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/simrel/api.d.ts +25 -0
- package/dist/simrel/catalog.d.ts +77 -0
- package/dist/simrel/components/GroupTabs.d.ts +24 -0
- package/dist/simrel/components/ProductCard.d.ts +19 -0
- package/dist/simrel/components/ProductGrid.d.ts +17 -0
- package/dist/simrel/components/renderUISpec.d.ts +7 -0
- package/dist/simrel/index.d.ts +5 -0
- package/dist/simrel/locales/en.d.ts +2 -0
- package/dist/simrel/locales/index.d.ts +4 -0
- package/dist/simrel/locales/tr.d.ts +2 -0
- package/dist/simrel/renderers/default.d.ts +41 -0
- package/dist/simrel/runtime.d.ts +68 -0
- package/dist/simrel/types.d.ts +145 -0
- package/dist/{simrel-C1YN71aW.js → simrel-CbLe5OAr.js} +1 -1
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +1 -1
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-UmvgIqDk.js → widget-base-COP8QwU3.js} +1 -1
- package/package.json +20 -6
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ChatTransportConfig } from '../common/api-paths.js';
|
|
2
|
+
import type { ActionEnrichmentContext, ProcessActionRequest, StreamCallbacks } from '../common/transport.js';
|
|
3
|
+
export type { ActionEnrichmentContext, BackendRequestMeta, InjectorAdapter, ProcessActionRequest, StreamCallbacks, } from '../common/transport.js';
|
|
4
|
+
/**
|
|
5
|
+
* Enriches action payloads with fields the backend expects.
|
|
6
|
+
* Only adds fields that are not already present in the payload.
|
|
7
|
+
*/
|
|
8
|
+
export declare function enrichActionPayload(action: {
|
|
9
|
+
title: string;
|
|
10
|
+
type: string;
|
|
11
|
+
payload?: unknown;
|
|
12
|
+
}, ctx: ActionEnrichmentContext): {
|
|
13
|
+
title: string;
|
|
14
|
+
type: string;
|
|
15
|
+
payload?: unknown;
|
|
16
|
+
};
|
|
17
|
+
export declare function sendChatMessage(request: ProcessActionRequest, callbacks: StreamCallbacks, transport: ChatTransportConfig): AbortController;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assistant-mode utilities for the chat widget.
|
|
3
|
+
*
|
|
4
|
+
* The chat widget can operate in multiple modes (shopping, beauty consulting,
|
|
5
|
+
* and account expert). This module contains the type,
|
|
6
|
+
* parsing helpers, and recognised mode list so the main index.ts stays focused
|
|
7
|
+
* on orchestration.
|
|
8
|
+
*/
|
|
9
|
+
export type AssistantMode = 'shopping' | 'beauty_consulting' | 'account_expert';
|
|
10
|
+
/** Return the value as an AssistantMode if it is a known mode string, otherwise null. */
|
|
11
|
+
export declare function toAssistantMode(value: unknown): AssistantMode | null;
|
|
12
|
+
/** Safely cast an unknown value to a plain Record, or null. */
|
|
13
|
+
export declare function asRecord(value: unknown): Record<string, unknown> | null;
|
|
14
|
+
/**
|
|
15
|
+
* Parse a redirect metadata payload and return the target assistant mode,
|
|
16
|
+
* or `null` if the payload is not a valid mode-switch redirect.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseRedirectMode(redirectPayload: unknown): AssistantMode | null;
|
|
19
|
+
/** Resolve the process_action type for staged image/file attachments in a mode. */
|
|
20
|
+
export declare function attachmentActionTypeForMode(mode: AssistantMode): 'user_message' | 'findSimilar';
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat widget — json-render catalog definition.
|
|
3
|
+
*
|
|
4
|
+
* This catalog describes all UI components the chat widget understands.
|
|
5
|
+
* The backend streams `ui_spec` events whose element types must match names
|
|
6
|
+
* defined here. Component implementations live in ./registry.tsx.
|
|
7
|
+
*
|
|
8
|
+
* HOW IT WORKS:
|
|
9
|
+
* 1. Backend streams NDJSON events including `ui_spec` events.
|
|
10
|
+
* 2. Each `ui_spec` event contains a `spec: UISpec` field.
|
|
11
|
+
* 3. The `<ChatRenderer>` component feeds specs into json-render's `<Renderer>`.
|
|
12
|
+
* 4. json-render looks up the element `type` in the registry and renders it.
|
|
13
|
+
*
|
|
14
|
+
* CUSTOMISING:
|
|
15
|
+
* Fork this repo, edit ./registry.tsx to swap in your own components.
|
|
16
|
+
* The catalog schema below stays the same — only the visual implementation changes.
|
|
17
|
+
*
|
|
18
|
+
* See: https://github.com/vercel-labs/json-render
|
|
19
|
+
*/
|
|
20
|
+
import { z } from 'zod';
|
|
21
|
+
export declare const chatCatalog: {
|
|
22
|
+
readonly components: {
|
|
23
|
+
readonly MessageBubble: {
|
|
24
|
+
readonly schema: z.ZodObject<{
|
|
25
|
+
role: z.ZodEnum<{
|
|
26
|
+
user: "user";
|
|
27
|
+
assistant: "assistant";
|
|
28
|
+
}>;
|
|
29
|
+
content: z.ZodString;
|
|
30
|
+
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
readonly description: "A single chat message bubble for user or assistant turns.";
|
|
33
|
+
};
|
|
34
|
+
readonly ProductCard: {
|
|
35
|
+
readonly schema: z.ZodObject<{
|
|
36
|
+
sku: z.ZodString;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
39
|
+
price: z.ZodOptional<z.ZodString>;
|
|
40
|
+
originalPrice: z.ZodOptional<z.ZodString>;
|
|
41
|
+
url: z.ZodString;
|
|
42
|
+
ctaLabel: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
readonly description: "A product card rendered inline in the chat stream.";
|
|
45
|
+
};
|
|
46
|
+
readonly ActionButtons: {
|
|
47
|
+
readonly schema: z.ZodObject<{
|
|
48
|
+
buttons: z.ZodArray<z.ZodObject<{
|
|
49
|
+
label: z.ZodString;
|
|
50
|
+
action: z.ZodObject<{
|
|
51
|
+
title: z.ZodString;
|
|
52
|
+
type: z.ZodString;
|
|
53
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
readonly description: "A horizontal row of quick-reply action buttons.";
|
|
58
|
+
};
|
|
59
|
+
readonly TypingIndicator: {
|
|
60
|
+
readonly schema: z.ZodObject<{}, z.core.$strip>;
|
|
61
|
+
readonly description: "An animated indicator shown while the assistant is typing.";
|
|
62
|
+
};
|
|
63
|
+
readonly Divider: {
|
|
64
|
+
readonly schema: z.ZodObject<{
|
|
65
|
+
label: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
readonly description: "A horizontal rule with an optional label.";
|
|
68
|
+
};
|
|
69
|
+
readonly ComparisonTable: {
|
|
70
|
+
readonly schema: z.ZodObject<{
|
|
71
|
+
recommended: z.ZodObject<{
|
|
72
|
+
sku: z.ZodString;
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
price: z.ZodString;
|
|
75
|
+
url: z.ZodOptional<z.ZodString>;
|
|
76
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
77
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
products: z.ZodArray<z.ZodObject<{
|
|
81
|
+
sku: z.ZodString;
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
price: z.ZodString;
|
|
84
|
+
url: z.ZodOptional<z.ZodString>;
|
|
85
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
86
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
90
|
+
label: z.ZodString;
|
|
91
|
+
values: z.ZodArray<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
highlights: z.ZodArray<z.ZodString>;
|
|
94
|
+
specialCases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
95
|
+
recommendedText: z.ZodOptional<z.ZodString>;
|
|
96
|
+
winnerHits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
97
|
+
positive: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
98
|
+
negative: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
99
|
+
}, z.core.$strip>>>;
|
|
100
|
+
productActions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
101
|
+
title: z.ZodString;
|
|
102
|
+
type: z.ZodString;
|
|
103
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
104
|
+
}, z.core.$strip>>>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
readonly description: "A product comparison table with recommended pick, attribute rows, and highlights.";
|
|
107
|
+
};
|
|
108
|
+
readonly AITopPicks: {
|
|
109
|
+
readonly schema: z.ZodObject<{
|
|
110
|
+
suggestions: z.ZodArray<z.ZodObject<{
|
|
111
|
+
product: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
112
|
+
role: z.ZodOptional<z.ZodString>;
|
|
113
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
114
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
115
|
+
label: z.ZodString;
|
|
116
|
+
sentiment: z.ZodOptional<z.ZodEnum<{
|
|
117
|
+
positive: "positive";
|
|
118
|
+
negative: "negative";
|
|
119
|
+
neutral: "neutral";
|
|
120
|
+
}>>;
|
|
121
|
+
}, z.core.$strip>>>;
|
|
122
|
+
expertQualityScore: z.ZodOptional<z.ZodNumber>;
|
|
123
|
+
reviewHighlight: z.ZodOptional<z.ZodString>;
|
|
124
|
+
action: z.ZodOptional<z.ZodObject<{
|
|
125
|
+
title: z.ZodString;
|
|
126
|
+
type: z.ZodString;
|
|
127
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
128
|
+
}, z.core.$strip>>;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
readonly description: "Rich AI-curated product suggestion cards with roles, sentiment labels, scores, and review quotes.";
|
|
132
|
+
};
|
|
133
|
+
readonly GroundingReviewCard: {
|
|
134
|
+
readonly schema: z.ZodObject<{
|
|
135
|
+
title: z.ZodOptional<z.ZodString>;
|
|
136
|
+
text: z.ZodOptional<z.ZodString>;
|
|
137
|
+
reviewCount: z.ZodOptional<z.ZodString>;
|
|
138
|
+
action: z.ZodObject<{
|
|
139
|
+
title: z.ZodString;
|
|
140
|
+
type: z.ZodString;
|
|
141
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
readonly description: "A card showing review grounding data with review count and CTA.";
|
|
145
|
+
};
|
|
146
|
+
readonly AIGroupingCards: {
|
|
147
|
+
readonly schema: z.ZodObject<{
|
|
148
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
149
|
+
name: z.ZodString;
|
|
150
|
+
image: z.ZodOptional<z.ZodString>;
|
|
151
|
+
description: z.ZodOptional<z.ZodString>;
|
|
152
|
+
action: z.ZodObject<{
|
|
153
|
+
title: z.ZodString;
|
|
154
|
+
type: z.ZodString;
|
|
155
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
readonly description: "Category grouping cards with images and labels for product discovery.";
|
|
160
|
+
};
|
|
161
|
+
readonly AISuggestedSearchCards: {
|
|
162
|
+
readonly schema: z.ZodObject<{
|
|
163
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
164
|
+
shortName: z.ZodString;
|
|
165
|
+
detailedMessage: z.ZodOptional<z.ZodString>;
|
|
166
|
+
whyDifferent: z.ZodOptional<z.ZodString>;
|
|
167
|
+
image: z.ZodOptional<z.ZodString>;
|
|
168
|
+
action: z.ZodObject<{
|
|
169
|
+
title: z.ZodString;
|
|
170
|
+
type: z.ZodString;
|
|
171
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
readonly description: "Suggested search cards with images, descriptions, and differentiation.";
|
|
176
|
+
};
|
|
177
|
+
readonly ProductDetailsPanel: {
|
|
178
|
+
readonly schema: z.ZodObject<{
|
|
179
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
180
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
181
|
+
name: z.ZodOptional<z.ZodString>;
|
|
182
|
+
images: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
183
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
184
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
price: z.ZodOptional<z.ZodString>;
|
|
187
|
+
originalPrice: z.ZodOptional<z.ZodString>;
|
|
188
|
+
discountReason: z.ZodOptional<z.ZodString>;
|
|
189
|
+
discount_reason: z.ZodOptional<z.ZodString>;
|
|
190
|
+
campaignReason: z.ZodOptional<z.ZodString>;
|
|
191
|
+
campaign_reason: z.ZodOptional<z.ZodString>;
|
|
192
|
+
originalPriceStyle: z.ZodOptional<z.ZodEnum<{
|
|
193
|
+
inline: "inline";
|
|
194
|
+
strikethrough: "strikethrough";
|
|
195
|
+
}>>;
|
|
196
|
+
price_original_style: z.ZodOptional<z.ZodEnum<{
|
|
197
|
+
inline: "inline";
|
|
198
|
+
strikethrough: "strikethrough";
|
|
199
|
+
}>>;
|
|
200
|
+
price_discount_rate: z.ZodOptional<z.ZodNumber>;
|
|
201
|
+
price_async: z.ZodOptional<z.ZodBoolean>;
|
|
202
|
+
inStock: z.ZodOptional<z.ZodBoolean>;
|
|
203
|
+
promotions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
204
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
205
|
+
name: z.ZodOptional<z.ZodString>;
|
|
206
|
+
value: z.ZodOptional<z.ZodString>;
|
|
207
|
+
option_value: z.ZodOptional<z.ZodString>;
|
|
208
|
+
attribute_value: z.ZodOptional<z.ZodString>;
|
|
209
|
+
type: z.ZodOptional<z.ZodString>;
|
|
210
|
+
attribute: z.ZodOptional<z.ZodString>;
|
|
211
|
+
option_name: z.ZodOptional<z.ZodString>;
|
|
212
|
+
attribute_name: z.ZodOptional<z.ZodString>;
|
|
213
|
+
variant_name: z.ZodOptional<z.ZodString>;
|
|
214
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
215
|
+
price: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
216
|
+
price_discounted: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
217
|
+
image: z.ZodOptional<z.ZodString>;
|
|
218
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
219
|
+
image_url: z.ZodOptional<z.ZodString>;
|
|
220
|
+
color: z.ZodOptional<z.ZodString>;
|
|
221
|
+
colour: z.ZodOptional<z.ZodString>;
|
|
222
|
+
color_hex: z.ZodOptional<z.ZodString>;
|
|
223
|
+
hex: z.ZodOptional<z.ZodString>;
|
|
224
|
+
swatch: z.ZodOptional<z.ZodString>;
|
|
225
|
+
swatchColor: z.ZodOptional<z.ZodString>;
|
|
226
|
+
in_stock: z.ZodOptional<z.ZodBoolean>;
|
|
227
|
+
inStock: z.ZodOptional<z.ZodBoolean>;
|
|
228
|
+
}, z.core.$strip>>>;
|
|
229
|
+
variantOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
230
|
+
name: z.ZodOptional<z.ZodString>;
|
|
231
|
+
value: z.ZodOptional<z.ZodString>;
|
|
232
|
+
option_value: z.ZodOptional<z.ZodString>;
|
|
233
|
+
attribute_value: z.ZodOptional<z.ZodString>;
|
|
234
|
+
type: z.ZodOptional<z.ZodString>;
|
|
235
|
+
attribute: z.ZodOptional<z.ZodString>;
|
|
236
|
+
option_name: z.ZodOptional<z.ZodString>;
|
|
237
|
+
attribute_name: z.ZodOptional<z.ZodString>;
|
|
238
|
+
variant_name: z.ZodOptional<z.ZodString>;
|
|
239
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
240
|
+
price: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
241
|
+
price_discounted: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
242
|
+
image: z.ZodOptional<z.ZodString>;
|
|
243
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
244
|
+
image_url: z.ZodOptional<z.ZodString>;
|
|
245
|
+
color: z.ZodOptional<z.ZodString>;
|
|
246
|
+
colour: z.ZodOptional<z.ZodString>;
|
|
247
|
+
color_hex: z.ZodOptional<z.ZodString>;
|
|
248
|
+
hex: z.ZodOptional<z.ZodString>;
|
|
249
|
+
swatch: z.ZodOptional<z.ZodString>;
|
|
250
|
+
swatchColor: z.ZodOptional<z.ZodString>;
|
|
251
|
+
in_stock: z.ZodOptional<z.ZodBoolean>;
|
|
252
|
+
inStock: z.ZodOptional<z.ZodBoolean>;
|
|
253
|
+
}, z.core.$strip>>>;
|
|
254
|
+
variant_options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
255
|
+
name: z.ZodOptional<z.ZodString>;
|
|
256
|
+
value: z.ZodOptional<z.ZodString>;
|
|
257
|
+
option_value: z.ZodOptional<z.ZodString>;
|
|
258
|
+
attribute_value: z.ZodOptional<z.ZodString>;
|
|
259
|
+
type: z.ZodOptional<z.ZodString>;
|
|
260
|
+
attribute: z.ZodOptional<z.ZodString>;
|
|
261
|
+
option_name: z.ZodOptional<z.ZodString>;
|
|
262
|
+
attribute_name: z.ZodOptional<z.ZodString>;
|
|
263
|
+
variant_name: z.ZodOptional<z.ZodString>;
|
|
264
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
265
|
+
price: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
266
|
+
price_discounted: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
267
|
+
image: z.ZodOptional<z.ZodString>;
|
|
268
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
269
|
+
image_url: z.ZodOptional<z.ZodString>;
|
|
270
|
+
color: z.ZodOptional<z.ZodString>;
|
|
271
|
+
colour: z.ZodOptional<z.ZodString>;
|
|
272
|
+
color_hex: z.ZodOptional<z.ZodString>;
|
|
273
|
+
hex: z.ZodOptional<z.ZodString>;
|
|
274
|
+
swatch: z.ZodOptional<z.ZodString>;
|
|
275
|
+
swatchColor: z.ZodOptional<z.ZodString>;
|
|
276
|
+
in_stock: z.ZodOptional<z.ZodBoolean>;
|
|
277
|
+
inStock: z.ZodOptional<z.ZodBoolean>;
|
|
278
|
+
}, z.core.$strip>>>;
|
|
279
|
+
productVariants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
280
|
+
name: z.ZodOptional<z.ZodString>;
|
|
281
|
+
value: z.ZodOptional<z.ZodString>;
|
|
282
|
+
option_value: z.ZodOptional<z.ZodString>;
|
|
283
|
+
attribute_value: z.ZodOptional<z.ZodString>;
|
|
284
|
+
type: z.ZodOptional<z.ZodString>;
|
|
285
|
+
attribute: z.ZodOptional<z.ZodString>;
|
|
286
|
+
option_name: z.ZodOptional<z.ZodString>;
|
|
287
|
+
attribute_name: z.ZodOptional<z.ZodString>;
|
|
288
|
+
variant_name: z.ZodOptional<z.ZodString>;
|
|
289
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
290
|
+
price: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
291
|
+
price_discounted: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
292
|
+
image: z.ZodOptional<z.ZodString>;
|
|
293
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
294
|
+
image_url: z.ZodOptional<z.ZodString>;
|
|
295
|
+
color: z.ZodOptional<z.ZodString>;
|
|
296
|
+
colour: z.ZodOptional<z.ZodString>;
|
|
297
|
+
color_hex: z.ZodOptional<z.ZodString>;
|
|
298
|
+
hex: z.ZodOptional<z.ZodString>;
|
|
299
|
+
swatch: z.ZodOptional<z.ZodString>;
|
|
300
|
+
swatchColor: z.ZodOptional<z.ZodString>;
|
|
301
|
+
in_stock: z.ZodOptional<z.ZodBoolean>;
|
|
302
|
+
inStock: z.ZodOptional<z.ZodBoolean>;
|
|
303
|
+
}, z.core.$strip>>>;
|
|
304
|
+
product_variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
305
|
+
name: z.ZodOptional<z.ZodString>;
|
|
306
|
+
value: z.ZodOptional<z.ZodString>;
|
|
307
|
+
option_value: z.ZodOptional<z.ZodString>;
|
|
308
|
+
attribute_value: z.ZodOptional<z.ZodString>;
|
|
309
|
+
type: z.ZodOptional<z.ZodString>;
|
|
310
|
+
attribute: z.ZodOptional<z.ZodString>;
|
|
311
|
+
option_name: z.ZodOptional<z.ZodString>;
|
|
312
|
+
attribute_name: z.ZodOptional<z.ZodString>;
|
|
313
|
+
variant_name: z.ZodOptional<z.ZodString>;
|
|
314
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
315
|
+
price: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
316
|
+
price_discounted: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
317
|
+
image: z.ZodOptional<z.ZodString>;
|
|
318
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
319
|
+
image_url: z.ZodOptional<z.ZodString>;
|
|
320
|
+
color: z.ZodOptional<z.ZodString>;
|
|
321
|
+
colour: z.ZodOptional<z.ZodString>;
|
|
322
|
+
color_hex: z.ZodOptional<z.ZodString>;
|
|
323
|
+
hex: z.ZodOptional<z.ZodString>;
|
|
324
|
+
swatch: z.ZodOptional<z.ZodString>;
|
|
325
|
+
swatchColor: z.ZodOptional<z.ZodString>;
|
|
326
|
+
in_stock: z.ZodOptional<z.ZodBoolean>;
|
|
327
|
+
inStock: z.ZodOptional<z.ZodBoolean>;
|
|
328
|
+
}, z.core.$strip>>>;
|
|
329
|
+
url: z.ZodOptional<z.ZodString>;
|
|
330
|
+
cartCode: z.ZodOptional<z.ZodString>;
|
|
331
|
+
description: z.ZodOptional<z.ZodString>;
|
|
332
|
+
description_html: z.ZodOptional<z.ZodString>;
|
|
333
|
+
descriptionHtml: z.ZodOptional<z.ZodString>;
|
|
334
|
+
facet_hits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
335
|
+
facetHits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
336
|
+
features: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
337
|
+
name: z.ZodOptional<z.ZodString>;
|
|
338
|
+
key: z.ZodOptional<z.ZodString>;
|
|
339
|
+
label: z.ZodOptional<z.ZodString>;
|
|
340
|
+
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
341
|
+
}, z.core.$strip>>>;
|
|
342
|
+
specifications: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodObject<{
|
|
343
|
+
key: z.ZodString;
|
|
344
|
+
value: z.ZodString;
|
|
345
|
+
}, z.core.$strip>>]>>;
|
|
346
|
+
}, z.core.$strip>>;
|
|
347
|
+
action: z.ZodOptional<z.ZodObject<{
|
|
348
|
+
title: z.ZodString;
|
|
349
|
+
type: z.ZodString;
|
|
350
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
351
|
+
}, z.core.$strip>>;
|
|
352
|
+
}, z.core.$strip>;
|
|
353
|
+
readonly description: "Full product detail view with images, specs, variants, and purchase actions.";
|
|
354
|
+
};
|
|
355
|
+
readonly ProductGrid: {
|
|
356
|
+
readonly schema: z.ZodObject<{
|
|
357
|
+
endOfList: z.ZodOptional<z.ZodBoolean>;
|
|
358
|
+
rankingState: z.ZodOptional<z.ZodEnum<{
|
|
359
|
+
pending: "pending";
|
|
360
|
+
final: "final";
|
|
361
|
+
}>>;
|
|
362
|
+
sequenceId: z.ZodOptional<z.ZodString>;
|
|
363
|
+
}, z.core.$strip>;
|
|
364
|
+
readonly description: "A scrollable grid of ProductCard children with optional \"more\" pagination.";
|
|
365
|
+
};
|
|
366
|
+
readonly ReviewHighlights: {
|
|
367
|
+
readonly schema: z.ZodObject<{
|
|
368
|
+
reviews: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
369
|
+
review_class: z.ZodOptional<z.ZodString>;
|
|
370
|
+
review_text: z.ZodOptional<z.ZodString>;
|
|
371
|
+
review_rating: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
372
|
+
review_tag: z.ZodOptional<z.ZodString>;
|
|
373
|
+
}, z.core.$strip>>>;
|
|
374
|
+
}, z.core.$strip>;
|
|
375
|
+
readonly description: "A list of highlighted customer reviews with sentiment and ratings.";
|
|
376
|
+
};
|
|
377
|
+
readonly ProsAndCons: {
|
|
378
|
+
readonly schema: z.ZodObject<{
|
|
379
|
+
productName: z.ZodOptional<z.ZodString>;
|
|
380
|
+
pros: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
381
|
+
cons: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
382
|
+
}, z.core.$strip>;
|
|
383
|
+
readonly description: "A pros and cons list for a product.";
|
|
384
|
+
};
|
|
385
|
+
readonly CategoriesContainer: {
|
|
386
|
+
readonly schema: z.ZodObject<{
|
|
387
|
+
groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
388
|
+
groupName: z.ZodString;
|
|
389
|
+
image: z.ZodOptional<z.ZodString>;
|
|
390
|
+
description: z.ZodOptional<z.ZodString>;
|
|
391
|
+
highlight: z.ZodOptional<z.ZodString>;
|
|
392
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
393
|
+
products: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
394
|
+
}, z.core.$strip>>>;
|
|
395
|
+
filterTags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
396
|
+
title: z.ZodString;
|
|
397
|
+
action: z.ZodOptional<z.ZodObject<{
|
|
398
|
+
title: z.ZodString;
|
|
399
|
+
type: z.ZodString;
|
|
400
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
401
|
+
}, z.core.$strip>>;
|
|
402
|
+
}, z.core.$strip>>>;
|
|
403
|
+
}, z.core.$strip>;
|
|
404
|
+
readonly description: "Tabbed product groups with optional filter tag buttons.";
|
|
405
|
+
};
|
|
406
|
+
readonly HandoffNotice: {
|
|
407
|
+
readonly schema: z.ZodObject<{
|
|
408
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
409
|
+
products_discussed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
410
|
+
user_sentiment: z.ZodOptional<z.ZodString>;
|
|
411
|
+
}, z.core.$strip>;
|
|
412
|
+
readonly description: "A notice shown when the conversation is escalated to a human agent.";
|
|
413
|
+
};
|
|
414
|
+
readonly PanelRestoreCard: {
|
|
415
|
+
readonly schema: z.ZodObject<{
|
|
416
|
+
eyebrow: z.ZodOptional<z.ZodString>;
|
|
417
|
+
title: z.ZodOptional<z.ZodString>;
|
|
418
|
+
showTitle: z.ZodOptional<z.ZodBoolean>;
|
|
419
|
+
ctaLabel: z.ZodOptional<z.ZodString>;
|
|
420
|
+
panelMessageId: z.ZodString;
|
|
421
|
+
highlightMessageId: z.ZodOptional<z.ZodString>;
|
|
422
|
+
threadId: z.ZodOptional<z.ZodString>;
|
|
423
|
+
products: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
424
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
425
|
+
name: z.ZodOptional<z.ZodString>;
|
|
426
|
+
}, z.core.$strip>>>;
|
|
427
|
+
}, z.core.$strip>;
|
|
428
|
+
readonly description: "A frontend-owned transcript card that reopens a related panel snapshot.";
|
|
429
|
+
};
|
|
430
|
+
readonly PhotoAnalysisCard: {
|
|
431
|
+
readonly schema: z.ZodObject<{
|
|
432
|
+
summary: z.ZodString;
|
|
433
|
+
strengths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
434
|
+
focus_points: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
435
|
+
celeb_style: z.ZodOptional<z.ZodString>;
|
|
436
|
+
celeb_style_reason: z.ZodOptional<z.ZodString>;
|
|
437
|
+
next_question: z.ZodOptional<z.ZodString>;
|
|
438
|
+
style_images: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
439
|
+
}, z.core.$strip>;
|
|
440
|
+
readonly description: "Structured photo analysis card with strengths, focus points, celeb vibe, and follow-up question.";
|
|
441
|
+
};
|
|
442
|
+
readonly BeautyPhotoStep: {
|
|
443
|
+
readonly schema: z.ZodObject<{
|
|
444
|
+
processing: z.ZodOptional<z.ZodBoolean>;
|
|
445
|
+
title: z.ZodOptional<z.ZodString>;
|
|
446
|
+
description: z.ZodOptional<z.ZodString>;
|
|
447
|
+
upload_label: z.ZodOptional<z.ZodString>;
|
|
448
|
+
skip_label: z.ZodOptional<z.ZodString>;
|
|
449
|
+
}, z.core.$strip>;
|
|
450
|
+
readonly description: "Transient selfie upload prompt for beauty consulting init flow.";
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
};
|
|
454
|
+
export type ChatCatalog = typeof chatCatalog;
|
|
455
|
+
export type ChatComponentName = keyof ChatCatalog['components'];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized chat presentation state (focus thread, scroll requests, read hints).
|
|
3
|
+
* Purpose-aligned with the legacy Redux presentation slice, without Redux.
|
|
4
|
+
*/
|
|
5
|
+
export type GroupReadState = 'seen' | 'unseen' | 'active_unread' | 'overflow_unread';
|
|
6
|
+
export type PresentationGroupMeta = {
|
|
7
|
+
id: string;
|
|
8
|
+
threadId: string;
|
|
9
|
+
readState: GroupReadState;
|
|
10
|
+
status: 'streaming' | 'complete';
|
|
11
|
+
updatedAt: number;
|
|
12
|
+
};
|
|
13
|
+
export type ScrollRequest = {
|
|
14
|
+
id: number;
|
|
15
|
+
type: 'thread' | 'bottom';
|
|
16
|
+
behavior: ScrollBehavior;
|
|
17
|
+
threadId?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare class ChatPresentationState {
|
|
20
|
+
/** Per-assistant-thread read / streaming metadata */
|
|
21
|
+
groups: Record<string, PresentationGroupMeta>;
|
|
22
|
+
pinnedToBottom: boolean;
|
|
23
|
+
userInteracting: boolean;
|
|
24
|
+
/** When set, transcript UI may collapse other threads until released */
|
|
25
|
+
focusedThreadId: string | null;
|
|
26
|
+
/** Drawer / widget considered visible */
|
|
27
|
+
shown: boolean;
|
|
28
|
+
lastAutoAnchoredGroupId: string | null;
|
|
29
|
+
scrollRequest: ScrollRequest | null;
|
|
30
|
+
private _nextScrollId;
|
|
31
|
+
setShown(shown: boolean): void;
|
|
32
|
+
reset(): void;
|
|
33
|
+
registerAssistantActivity(threadId: string): void;
|
|
34
|
+
finalizeAssistantGroup(threadId: string): void;
|
|
35
|
+
setGroupReadStates(updates: Array<{
|
|
36
|
+
groupId: string;
|
|
37
|
+
readState: GroupReadState;
|
|
38
|
+
}>): void;
|
|
39
|
+
requestThreadFocus(threadId: string, behavior?: ScrollBehavior): void;
|
|
40
|
+
requestScrollToBottom(behavior?: ScrollBehavior): void;
|
|
41
|
+
consumeScrollRequest(id: number): void;
|
|
42
|
+
releaseFocusedThread(): void;
|
|
43
|
+
/** Align focus with rollback / thread without queuing scroll */
|
|
44
|
+
setFocusedThreadId(threadId: string | null): void;
|
|
45
|
+
markGroupAutoAnchored(groupId: string): void;
|
|
46
|
+
/** Block soft stream scroll when user pulled away from bottom */
|
|
47
|
+
shouldBlockStreamAutoScroll(): boolean;
|
|
48
|
+
getAssistantReadState(threadId: string): GroupReadState | undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Latest assistant “group” with unread semantics (for auto-anchor).
|
|
52
|
+
*/
|
|
53
|
+
export declare function getLatestUnreadAssistantThreadId(orderedThreadIds: string[], state: ChatPresentationState): string | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Grouping Cards renderer.
|
|
3
|
+
*
|
|
4
|
+
* Desktop: compact card with image, name, and labels.
|
|
5
|
+
* Mobile: simple button list with arrow prefix (images hidden via CSS).
|
|
6
|
+
*
|
|
7
|
+
* Note: The media-rail layout is similar to `AISuggestedSearchCards` but with different tokens;
|
|
8
|
+
* a shared primitive may be extracted later if the visual system stabilizes.
|
|
9
|
+
*
|
|
10
|
+
* XSS safety: All text is set via textContent. Image URLs are validated
|
|
11
|
+
* for safe protocols. No innerHTML.
|
|
12
|
+
*/
|
|
13
|
+
import type { UIElement } from '../../common/types.js';
|
|
14
|
+
import type { ChatUISpecRenderContext } from '../types.js';
|
|
15
|
+
export declare function renderAIGroupingCards(element: UIElement, ctx: ChatUISpecRenderContext): HTMLElement;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Suggested Search Cards renderer.
|
|
3
|
+
*
|
|
4
|
+
* Cards with a larger image and a single clear title line.
|
|
5
|
+
* Secondary / tertiary supporting lines are intentionally omitted in chat so
|
|
6
|
+
* the module reads as a compact, visual category chooser.
|
|
7
|
+
*
|
|
8
|
+
* XSS safety: All text is set via textContent. Image URLs are validated
|
|
9
|
+
* for safe protocols. No innerHTML.
|
|
10
|
+
*/
|
|
11
|
+
import type { UIElement } from '../../common/types.js';
|
|
12
|
+
import type { ChatUISpecRenderContext } from '../types.js';
|
|
13
|
+
export declare function renderAISuggestedSearchCards(element: UIElement, ctx: ChatUISpecRenderContext): HTMLElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Top Picks renderer.
|
|
3
|
+
*
|
|
4
|
+
* DOM/layout parity with robot-engine-lean MainPane/AIAnalysisZone TopPicksResults:
|
|
5
|
+
* article: role badge, image, title, rating, price, labels, hover CTA.
|
|
6
|
+
*/
|
|
7
|
+
import type { UIElement } from '../../common/types.js';
|
|
8
|
+
import type { ChatUISpecRenderContext } from '../types.js';
|
|
9
|
+
export declare function renderAITopPicks(element: UIElement, ctx: ChatUISpecRenderContext): HTMLElement;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Beauty photo step card — a transient prompt rendered above the chat input
|
|
3
|
+
* asking the user to upload a selfie for skin/beauty analysis.
|
|
4
|
+
*
|
|
5
|
+
* The backend sends a `BeautyPhotoStep` UISpec during the beauty consulting
|
|
6
|
+
* init flow. The chat widget intercepts it and renders this component in a
|
|
7
|
+
* dedicated slot (not in the message stream or panel).
|
|
8
|
+
*
|
|
9
|
+
* Props (from UISpec):
|
|
10
|
+
* processing — boolean, disables upload button and shows processing label
|
|
11
|
+
* title — override heading text
|
|
12
|
+
* description — override body text
|
|
13
|
+
* upload_label — override upload button text
|
|
14
|
+
* skip_label — override skip button text
|
|
15
|
+
*/
|
|
16
|
+
import type { UIElement } from '../../common/types.js';
|
|
17
|
+
import type { ChatUISpecRenderContext } from '../types.js';
|
|
18
|
+
export interface BeautyPhotoStepProps {
|
|
19
|
+
processing: boolean;
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
uploadLabel?: string | undefined;
|
|
23
|
+
skipLabel?: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
/** Extract typed props from a raw UISpec element props bag. */
|
|
26
|
+
export declare function parseBeautyPhotoStepProps(props: Record<string, unknown>): BeautyPhotoStepProps;
|
|
27
|
+
export interface BeautyPhotoStepCallbacks {
|
|
28
|
+
onUpload?: (() => void) | undefined;
|
|
29
|
+
onSkip?: (() => void) | undefined;
|
|
30
|
+
}
|
|
31
|
+
export declare function renderBeautyPhotoStep(element: UIElement, ctx: ChatUISpecRenderContext, callbacks?: BeautyPhotoStepCallbacks): HTMLElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CategoriesContainer — renders grouped product lists with tab navigation
|
|
3
|
+
* and optional filter tags.
|
|
4
|
+
*
|
|
5
|
+
* The protocol adapter normalizes grouping payloads into this UISpec element.
|
|
6
|
+
*
|
|
7
|
+
* XSS safety: All text is set via textContent. No innerHTML.
|
|
8
|
+
*/
|
|
9
|
+
import type { UIElement } from '../../common/types.js';
|
|
10
|
+
import type { ChatUISpecRenderContext } from '../types.js';
|
|
11
|
+
export declare function renderCategoriesContainer(element: UIElement, context: ChatUISpecRenderContext): HTMLElement;
|