@helpai/elements 0.54.3 → 0.56.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/configurator.mjs +12 -2
- package/elements-web-component.esm.js +29 -27
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +29 -27
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +29 -27
- package/elements.esm.js.map +4 -4
- package/elements.js +29 -27
- package/elements.js.map +4 -4
- package/index.d.ts +46 -3
- package/index.mjs +1002 -643
- package/package.json +1 -1
- package/schema.d.ts +13 -2
- package/schema.json +54 -6
- package/schema.mjs +13 -2
- package/style.css +1 -1
- package/web-component.mjs +999 -643
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, H as HandshakeResponse, L as Link, S as ServerConfig, b as SiteConfig, W as WidgetConfig, c as WidgetConfigPartial, d as WidgetSettings, e as WidgetSettingsPartial } from './deployment-
|
|
1
|
+
export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, H as HandshakeResponse, L as Link, S as ServerConfig, b as SiteConfig, W as WidgetConfig, c as WidgetConfigPartial, d as WidgetSettings, e as WidgetSettingsPartial } from './deployment-CWYT4rBr.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -40,7 +40,7 @@ interface ClientStorage {
|
|
|
40
40
|
* populated {@link Strings} map. UI components then read `strings.send` as a
|
|
41
41
|
* normal property access — no per-render lookup, no per-render allocation.
|
|
42
42
|
*/
|
|
43
|
-
type StringKey = "launcherOpen" | "launcherLabel" | "panelTitle" | "composerPlaceholder" | "send" | "stop" | "attach" | "micStart" | "micStop" | "micUnsupported" | "expand" | "collapse" | "fullscreen" | "exitFullscreen" | "resizeHandle" | "scrollToBottom" | "close" | "moreActions" | "soundOn" | "soundOff" | "language" | "theme" | "themeAuto" | "themeLight" | "themeDark" | "textSize" | "textSizeSmall" | "textSizeNormal" | "textSizeLarge" | "history" | "historyTitle" | "historyEmpty" | "historyLoading" | "historyBack" | "historyContinue" | "conversationLoading" | "conversationClosed" | "startNewConversation" | "dateToday" | "dateYesterday" | "dateLastWeek" | "dateOlder" | "newConversation" | "dropZone" | "attachmentTooLarge" | "attachmentTooMany" | "attachmentMimeRejected" | "errorRetry" | "errorGeneric" | "errorRateLimited" | "loading" | "thinking" | "thoughts" | "usedTool" | "toolResult" | "sources" | "collapseSidebar" | "expandSidebar" | "formSubmit" | "formSkip" | "formSubmitted" | "formSkipped" | "formFillOut" | "formRequired" | "formInvalidEmail" | "formInvalidTel" | "formInvalidUrl" | "formInvalidNumber" | "formTooShort" | "formTooLong" | "formNumberTooSmall" | "formNumberTooLarge" | "formPatternMismatch" | "formChooseAtLeast" | "formChooseAtMost" | "formOther" | "formOtherPlaceholder" | "inputRequired" | "inputBadge" | "inputAnswered" | "inputSkipped" | "inputSubmit" | "inputSubmitHint" | "inputSkip" | "confirmYes" | "confirmNo" | "approvalRequired" | "approve" | "reject" | "approved" | "rejected" | "approvalReason" | "approvalPrompt" | "approvalBody" | "approvalYourResponse" | "approvalEditHint" | "approvalSubmitting" | "edit" | "toolParameters" | "statusAwaiting" | "statusResponded" | "statusCompleted" | "statusDenied" | "statusError" | "statusRunning" | "statusSuperseded" | "tabHome" | "tabConversations" | "tabHelp" | "tabNews" | "modulesEmpty" | "moduleBack" | "contentLoading" | "homeGreeting" | "homeGreetingNamed" | "homeGreetingLead" | "homeSearchPlaceholder" | "homeContentTitle" | "homeStatus" | "helpTitle" | "helpSearchPlaceholder" | "helpEmpty" | "helpLoading" | "helpSearchEmpty" | "newsTitle" | "newsEmpty" | "newsLoading" | "newsBack" | "newsPublishedAt";
|
|
43
|
+
type StringKey = "launcherOpen" | "launcherLabel" | "panelTitle" | "composerPlaceholder" | "send" | "stop" | "attach" | "micStart" | "micStop" | "micUnsupported" | "expand" | "collapse" | "fullscreen" | "exitFullscreen" | "resizeHandle" | "scrollToBottom" | "close" | "moreActions" | "soundOn" | "soundOff" | "language" | "theme" | "themeAuto" | "themeLight" | "themeDark" | "textSize" | "textSizeSmall" | "textSizeNormal" | "textSizeLarge" | "history" | "historyTitle" | "historyEmpty" | "historyLoading" | "historyBack" | "historyContinue" | "conversationLoading" | "conversationClosed" | "startNewConversation" | "dateToday" | "dateYesterday" | "dateLastWeek" | "dateOlder" | "newConversation" | "dropZone" | "attachmentTooLarge" | "attachmentTooMany" | "attachmentMimeRejected" | "errorRetry" | "errorGeneric" | "errorRateLimited" | "loading" | "thinking" | "thoughts" | "usedTool" | "toolResult" | "sources" | "feedbackUp" | "feedbackDown" | "feedbackThanks" | "copy" | "copied" | "newMessages" | "collapseSidebar" | "expandSidebar" | "formSubmit" | "formSkip" | "formSubmitted" | "formSkipped" | "formFillOut" | "formRequired" | "formInvalidEmail" | "formInvalidTel" | "formInvalidUrl" | "formInvalidNumber" | "formTooShort" | "formTooLong" | "formNumberTooSmall" | "formNumberTooLarge" | "formPatternMismatch" | "formChooseAtLeast" | "formChooseAtMost" | "formOther" | "formOtherPlaceholder" | "inputRequired" | "inputBadge" | "inputAnswered" | "inputSkipped" | "inputSubmit" | "inputSubmitHint" | "inputSkip" | "confirmYes" | "confirmNo" | "approvalRequired" | "approve" | "reject" | "approved" | "rejected" | "approvalReason" | "approvalPrompt" | "approvalBody" | "approvalYourResponse" | "approvalEditHint" | "approvalSubmitting" | "edit" | "toolParameters" | "statusAwaiting" | "statusResponded" | "statusCompleted" | "statusDenied" | "statusError" | "statusRunning" | "statusSuperseded" | "tabHome" | "tabConversations" | "tabHelp" | "tabNews" | "modulesEmpty" | "moduleBack" | "contentLoading" | "homeGreeting" | "homeGreetingNamed" | "homeGreetingLead" | "homeSearchPlaceholder" | "homeContentTitle" | "homeStatus" | "helpTitle" | "helpSearchPlaceholder" | "helpEmpty" | "helpLoading" | "helpSearchEmpty" | "newsTitle" | "newsEmpty" | "newsLoading" | "newsBack" | "newsPublishedAt";
|
|
44
44
|
/** A partial map for one locale — what overrides look like on the wire. */
|
|
45
45
|
type LocaleStrings = Partial<Record<StringKey, string>>;
|
|
46
46
|
/**
|
|
@@ -124,6 +124,9 @@ interface UserPrefs {
|
|
|
124
124
|
textSize?: "small" | "normal" | "large";
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
/** A 👍/👎 reaction on an assistant message; `null` clears a prior choice. */
|
|
128
|
+
type FeedbackValue = "up" | "down" | null;
|
|
129
|
+
|
|
127
130
|
/** A tool reference on the wire: `{ code, config }`. `config` is opaque. */
|
|
128
131
|
interface ToolRef {
|
|
129
132
|
code: string;
|
|
@@ -260,6 +263,16 @@ type ThemePreference = "auto" | "light" | "dark";
|
|
|
260
263
|
* whole.
|
|
261
264
|
*/
|
|
262
265
|
type ResponseMode = "streaming" | "buffered";
|
|
266
|
+
/**
|
|
267
|
+
* How the message list anchors as a new turn arrives.
|
|
268
|
+
*
|
|
269
|
+
* - `'bottom'` (default) — classic chat: stick to the newest content at the
|
|
270
|
+
* bottom, following the streamed reply while the reader is near the edge.
|
|
271
|
+
* - `'turn'` — ChatGPT-style: pin the visitor's new question to the TOP of the
|
|
272
|
+
* viewport so the answer streams into the empty space below it. The view
|
|
273
|
+
* doesn't chase the bottom; the reader stays anchored to where they asked.
|
|
274
|
+
*/
|
|
275
|
+
type ScrollAnchor = "bottom" | "turn";
|
|
263
276
|
/**
|
|
264
277
|
* Identifiers for every header action the widget can render.
|
|
265
278
|
*
|
|
@@ -830,7 +843,8 @@ interface PresentationOptions {
|
|
|
830
843
|
*/
|
|
831
844
|
|
|
832
845
|
/**
|
|
833
|
-
* Section:
|
|
846
|
+
* Section: conversation runtime behaviour — auto-open, streaming mode, and the
|
|
847
|
+
* transcript surface (what renders, how it scrolls, reaction controls).
|
|
834
848
|
*/
|
|
835
849
|
interface BehaviorOptions {
|
|
836
850
|
/** When `true`, don't auto-open the panel on first visit. */
|
|
@@ -843,6 +857,12 @@ interface BehaviorOptions {
|
|
|
843
857
|
showToolCalls?: boolean;
|
|
844
858
|
/** Show citation sources (web links + document references) in the transcript. Default `false`. */
|
|
845
859
|
showSources?: boolean;
|
|
860
|
+
/** Fade the message list at its scroll edges (gradient mask). Default `true`. */
|
|
861
|
+
scrollFade?: boolean;
|
|
862
|
+
/** How the list anchors a new turn: stick to bottom, or pin the question to top. Default `'bottom'`. */
|
|
863
|
+
scrollAnchor?: ScrollAnchor;
|
|
864
|
+
/** Show 👍/👎 feedback controls on assistant replies. Default `true`. */
|
|
865
|
+
enableMessageFeedback?: boolean;
|
|
846
866
|
}
|
|
847
867
|
/**
|
|
848
868
|
* Section: panel header actions — the enabled set (`history`/`close` buttons +
|
|
@@ -1157,6 +1177,12 @@ interface ResolvedOptions {
|
|
|
1157
1177
|
showToolCalls: boolean;
|
|
1158
1178
|
/** Show citation sources (web links + document references) in the transcript. Default `false`. */
|
|
1159
1179
|
showSources: boolean;
|
|
1180
|
+
/** Fade the message list at its scroll edges (gradient mask). Default `true`. */
|
|
1181
|
+
scrollFade: boolean;
|
|
1182
|
+
/** How the list anchors a new turn: stick to bottom, or pin the question to top. Default `'bottom'`. */
|
|
1183
|
+
scrollAnchor: ScrollAnchor;
|
|
1184
|
+
/** Show 👍/👎 feedback controls on assistant replies. Default `true`. */
|
|
1185
|
+
enableMessageFeedback: boolean;
|
|
1160
1186
|
features: Required<Omit<FeatureFlags, "tools">> & {
|
|
1161
1187
|
tools?: Array<string | ToolRef>;
|
|
1162
1188
|
};
|
|
@@ -1374,6 +1400,23 @@ interface EventMap {
|
|
|
1374
1400
|
toolCallId: string;
|
|
1375
1401
|
approved: boolean;
|
|
1376
1402
|
};
|
|
1403
|
+
/**
|
|
1404
|
+
* User gave feedback on an assistant reply. `value` is `"up"` / `"down"`, or
|
|
1405
|
+
* `null` when they cleared a prior choice. `messageId` is the backend message
|
|
1406
|
+
* id. Also POSTed best-effort to `/pai/message-feedback`; a host listener can
|
|
1407
|
+
* mirror it to analytics.
|
|
1408
|
+
*/
|
|
1409
|
+
messageFeedback: {
|
|
1410
|
+
messageId: string;
|
|
1411
|
+
value: FeedbackValue;
|
|
1412
|
+
};
|
|
1413
|
+
/**
|
|
1414
|
+
* An assistant message scrolled into view for the first time (read tracking).
|
|
1415
|
+
* Fires once per message id. Anonymous — id only, never the text.
|
|
1416
|
+
*/
|
|
1417
|
+
messageSeen: {
|
|
1418
|
+
messageId: string;
|
|
1419
|
+
};
|
|
1377
1420
|
/** A content list (news / help / home block) rendered. */
|
|
1378
1421
|
contentView: {
|
|
1379
1422
|
section: string;
|