@epam/ai-dial-chat-hooks 1.1.0-dev.253 → 1.1.0-dev.255

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-chat-hooks",
3
3
  "description": "Framework-level React hooks extracted from AI DIAL Chat for building custom chat interfaces",
4
- "version": "1.1.0-dev.253",
4
+ "version": "1.1.0-dev.255",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -17,14 +17,14 @@
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": "^19.2.6",
20
- "@epam/ai-dial-attachment-canvas": "1.1.0-dev.253",
21
- "@epam/ai-dial-attachment-input": "1.1.0-dev.253",
22
- "@epam/ai-dial-chat-api-client": "1.1.0-dev.253",
23
- "@epam/ai-dial-chat-shared": "1.1.0-dev.253",
24
- "@epam/ai-dial-quotations": "1.1.0-dev.253",
20
+ "@epam/ai-dial-attachment-canvas": "1.1.0-dev.255",
21
+ "@epam/ai-dial-attachment-input": "1.1.0-dev.255",
22
+ "@epam/ai-dial-chat-api-client": "1.1.0-dev.255",
23
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.255",
24
+ "@epam/ai-dial-quotations": "1.1.0-dev.255",
25
25
  "@epam/ai-dial-react-file-manager": "*",
26
- "@epam/ai-dial-share": "1.1.0-dev.253",
27
- "@epam/ai-dial-source-panel": "1.1.0-dev.253",
26
+ "@epam/ai-dial-share": "1.1.0-dev.255",
27
+ "@epam/ai-dial-source-panel": "1.1.0-dev.255",
28
28
  "fflate": "^0.8.3"
29
29
  },
30
30
  "repository": {
@@ -0,0 +1,128 @@
1
+ import { ResponseFormat, Conversation, DeploymentFeatures } from '@epam/ai-dial-chat-shared';
2
+ /** Values emitted by the chat-settings modal when the user clicks Save. */
3
+ export interface ChatSettingsValues {
4
+ /** Updated response format, present when the response-format field was shown. */
5
+ responseFormat?: ResponseFormat;
6
+ /** Updated system prompt, present when the system-prompt field was shown. */
7
+ systemPrompt?: string;
8
+ /** Updated temperature, present when the temperature field was shown. */
9
+ temperature?: number;
10
+ }
11
+ /**
12
+ * Translatable strings the chat-settings form surfaces. Every field defaults
13
+ * to an English fallback inside the hook; pass translated values from the
14
+ * consuming app (e.g. via a `useTranslation`-backed labels hook).
15
+ */
16
+ export interface ChatSettingsFormLabels {
17
+ /** Dropdown item label and modal title. */
18
+ settings: string;
19
+ /** Toast/message text announced after a successful save. */
20
+ savedNotification: string;
21
+ /** Label for the response-format field. */
22
+ responseFormatLabel: string;
23
+ /** Helper text shown below the response-format field. */
24
+ responseFormatHint: string;
25
+ /** Label for the Markdown radio option. */
26
+ responseFormatMarkdown: string;
27
+ /** Label for the plain-text radio option. */
28
+ responseFormatPlainText: string;
29
+ /** Label for the system-prompt field. */
30
+ systemPromptLabel: string;
31
+ /** Tooltip for the system-prompt field. */
32
+ systemPromptTooltip: string;
33
+ /** Label for the temperature field. */
34
+ temperatureLabel: string;
35
+ /** Label for the precise end of the temperature slider. */
36
+ temperaturePrecise: string;
37
+ /** Label for the neutral midpoint of the temperature slider. */
38
+ temperatureNeutral: string;
39
+ /** Label for the creative end of the temperature slider. */
40
+ temperatureCreative: string;
41
+ /** Hint text shown below the temperature field. */
42
+ temperatureHint: string;
43
+ /** Save button label. */
44
+ saveLabel: string;
45
+ /** Tooltip shown on the disabled Save button. */
46
+ saveDisabledTooltip: string;
47
+ }
48
+ /** Configuration the chat-settings popover/modal consumes. */
49
+ export type UseChatSettingsFormConfigResult = {
50
+ /** Feature flags controlling which fields appear. */
51
+ features: {
52
+ systemPrompt: boolean;
53
+ temperature: boolean;
54
+ responseFormat: boolean;
55
+ };
56
+ /** Current response format pre-selected in the modal. */
57
+ responseFormat: ResponseFormat;
58
+ /** Current system prompt pre-populated in the modal. */
59
+ systemPrompt: string;
60
+ /** Current temperature pre-populated in the modal. */
61
+ temperature: number;
62
+ /** Called with updated values when the user clicks Save. */
63
+ onSave: (values: ChatSettingsValues) => void;
64
+ /** Label for the dropdown menu item. */
65
+ menuItemLabel: string;
66
+ /** Modal title. */
67
+ title: string;
68
+ /** Label for the response-format field. */
69
+ responseFormatLabel: string;
70
+ /** Helper text shown below the response-format field. */
71
+ responseFormatHint: string;
72
+ /** Label for the Markdown radio option. */
73
+ responseFormatMarkdownLabel: string;
74
+ /** Label for the plain-text radio option. */
75
+ responseFormatPlainTextLabel: string;
76
+ /** Label for the system-prompt field. */
77
+ systemPromptLabel: string;
78
+ /** Tooltip for the system-prompt field. */
79
+ systemPromptTooltip: string;
80
+ /** Label for the temperature field. */
81
+ temperatureLabel: string;
82
+ /** Slider endpoint labels, in `[precise, neutral, creative]` order. */
83
+ temperatureLabels: [string, string, string];
84
+ /** Hint text shown below the temperature field. */
85
+ temperatureHint: string;
86
+ /** Save button label. */
87
+ saveLabel: string;
88
+ /** Tooltip shown on the disabled Save button. */
89
+ saveDisabledTooltip: string;
90
+ };
91
+ interface LocalModeValues {
92
+ responseFormat: ResponseFormat;
93
+ systemPrompt: string;
94
+ temperature: number;
95
+ }
96
+ interface LocalModeParams {
97
+ mode: 'local';
98
+ values: LocalModeValues;
99
+ onValuesChange: (values: LocalModeValues) => void;
100
+ deploymentFeatures?: DeploymentFeatures;
101
+ /** True when the selected deployment is a Quick App. Its orchestrator sets its own fixed temperature, so the temperature field is forced off regardless of `deploymentFeatures`. */
102
+ isQuickApp?: boolean;
103
+ }
104
+ interface ConversationModeParams {
105
+ mode: 'conversation';
106
+ conversation: Conversation;
107
+ onConversationChange: (conversation: Conversation) => void;
108
+ deploymentFeatures?: DeploymentFeatures;
109
+ /** True when the conversation's deployment is a Quick App. Its orchestrator sets its own fixed temperature, so the temperature field is forced off regardless of `deploymentFeatures`. */
110
+ isQuickApp?: boolean;
111
+ }
112
+ type Params = LocalModeParams | ConversationModeParams;
113
+ /** Common, host-injected options shared by both modes. */
114
+ interface Options {
115
+ /** Translatable labels. Fields not provided fall back to English defaults. */
116
+ labels?: Partial<ChatSettingsFormLabels>;
117
+ /** Called after a successful save so the host can surface its own toast/notification. */
118
+ onSaved?: () => void;
119
+ }
120
+ /**
121
+ * Assembles the chat-settings form config (feature flags, current values, save
122
+ * handler, labels) for either an in-flight local composer or a persisted
123
+ * conversation. Headless: translation and notifications are the host's
124
+ * responsibility, supplied via `labels` and `onSaved`.
125
+ */
126
+ export declare const useChatSettingsFormConfig: (params: Params & Options) => UseChatSettingsFormConfigResult;
127
+ export {};
128
+ //# sourceMappingURL=useChatSettingsFormConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChatSettingsFormConfig.d.ts","sourceRoot":"","sources":["../../src/useChatSettingsFormConfig/useChatSettingsFormConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACxB,MAAM,2BAA2B,CAAC;AAGnC,2EAA2E;AAC3E,MAAM,WAAW,kBAAkB;IACjC,iFAAiF;IACjF,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,2CAA2C;IAC3C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yDAAyD;IACzD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,6CAA6C;IAC7C,uBAAuB,EAAE,MAAM,CAAC;IAChC,yCAAyC;IACzC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,2CAA2C;IAC3C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uCAAuC;IACvC,gBAAgB,EAAE,M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