@alxxsck/ai-assistant 2.26.0 → 3.1.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/README.md +20 -2
- package/dist/{Avatar-Cr3PsHzw.js → Avatar-B9TOQAF_.js} +19082 -18842
- package/dist/ChatWidgetContent-BuhVlKYA.js +5376 -0
- package/dist/api/audio.api.d.ts +1 -1
- package/dist/api/messages.api.types.d.ts +2 -1
- package/dist/avatar/AnimationManager.d.ts +7 -3
- package/dist/avatar/Avatar.d.ts +20 -3
- package/dist/avatar/avatarMeshes.d.ts +8 -0
- package/dist/avatar/loaders.d.ts +16 -0
- package/dist/bridge-ai-chat-widget.es.js +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/context/ChatWidgetContext.d.ts +3 -2
- package/dist/domain/command/CommandRuntime.d.ts +9 -2
- package/dist/domain/command/UiCommandService.d.ts +4 -2
- package/dist/domain/command/command.types.d.ts +8 -0
- package/dist/domain/message/cable/CableContext.d.ts +1 -0
- package/dist/domain/message/message.store.d.ts +7 -0
- package/dist/domain/scenario-interaction/scenario-interaction.types.d.ts +3 -0
- package/dist/domain/speech/SpeechPlayer.d.ts +2 -0
- package/dist/domain/ui/widget-geometry.d.ts +7 -5
- package/dist/domain/voice/media/ReliableVoiceUplink.d.ts +4 -0
- package/dist/domain/voice/voice-audio-meter.d.ts +12 -0
- package/dist/domain/voice/voice-input-spectrum.d.ts +17 -0
- package/dist/domain/voice/voice.store.d.ts +5 -1
- package/dist/i18n/messages.d.ts +6 -2
- package/dist/index-DCsPGgIk.js +2891 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.types.d.ts +4 -2
- package/dist/inter-cyrillic-wght-italic.woff2 +0 -0
- package/dist/inter-cyrillic-wght-normal.woff2 +0 -0
- package/dist/inter-latin-ext-wght-italic.woff2 +0 -0
- package/dist/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/inter-latin-wght-italic.woff2 +0 -0
- package/dist/inter-latin-wght-normal.woff2 +0 -0
- package/dist/{mount-DCjHLj_e.js → mount-BpvW4tbc.js} +9631 -5577
- package/dist/roboto-cyrillic-400-normal.woff2 +0 -0
- package/dist/roboto-cyrillic-700-normal.woff2 +0 -0
- package/dist/roboto-latin-400-normal.woff2 +0 -0
- package/dist/roboto-latin-700-normal.woff2 +0 -0
- package/dist/roboto-latin-ext-400-normal.woff2 +0 -0
- package/dist/roboto-latin-ext-700-normal.woff2 +0 -0
- package/dist/ui/components/ChatInlineProgressStatus.d.ts +5 -0
- package/dist/ui/components/ChatListItem.d.ts +4 -1
- package/dist/ui/components/ChatSurfaceFrameContext.d.ts +6 -0
- package/dist/ui/components/ChatTopControls.d.ts +5 -5
- package/dist/ui/components/ChatUiActionProgress.d.ts +1 -0
- package/dist/ui/components/ChatVoiceMode.d.ts +5 -1
- package/dist/ui/components/ChatWidgetFrame.d.ts +5 -3
- package/dist/ui/components/VoiceComposer.d.ts +23 -0
- package/dist/ui/components/voice-waveform.d.ts +20 -0
- package/dist/ui/error-messages.d.ts +1 -0
- package/dist/ui/responder-visual-state.d.ts +7 -0
- package/dist/widget-fonts-CFulYNmT.js +16 -0
- package/dist/widget-fonts.d.ts +1 -0
- package/package.json +6 -2
- package/dist/ChatWidgetContent-DJ2Y9kKV.js +0 -8045
- package/dist/avatar/consolidateMaterialGroups.d.ts +0 -2
- package/dist/index-D01wjcEK.js +0 -2809
- package/dist/ui/chat-composer-layout.d.ts +0 -1
- package/dist/ui/components/overlays/ChatBlurOverlayTop.d.ts +0 -1
- package/dist/ui/components/overlays/ChatDarkOverlay.d.ts +0 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type MessageData } from "@/api/messages.api.types";
|
|
2
|
+
import type { SafeResponderPresentation } from "@/domain/support-presentation/support-presentation.types";
|
|
2
3
|
export interface ChatListItemProps {
|
|
3
4
|
threadId: string;
|
|
5
|
+
title: string | null;
|
|
4
6
|
message: MessageData;
|
|
7
|
+
responderPresentation: SafeResponderPresentation;
|
|
5
8
|
isSelected?: boolean;
|
|
6
9
|
onSelect: (threadId: string) => void;
|
|
7
10
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type ChatSurfacePresentation = "viewport" | "windowed";
|
|
2
|
+
export type ChatSurfaceFrameValue = {
|
|
3
|
+
presentation: ChatSurfacePresentation;
|
|
4
|
+
};
|
|
5
|
+
export declare const ChatSurfaceFrameContext: import("react").Context<ChatSurfaceFrameValue>;
|
|
6
|
+
export declare function useChatSurfaceFrame(): ChatSurfaceFrameValue;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
type ChatTopControlsLayoutProps = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
identity: React.ReactNode;
|
|
3
|
+
actions: React.ReactNode;
|
|
4
|
+
draggable?: boolean;
|
|
5
|
+
dragLabel?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare function ChatTopControlsLayout({
|
|
7
|
+
export declare function ChatTopControlsLayout({ identity, actions, draggable, dragLabel, }: ChatTopControlsLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare function ChatTopControls({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ChatUiActionProgress(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
type ChatVoiceModeProps = React.ComponentProps<"div"> & {
|
|
2
|
+
freezePresentation?: boolean;
|
|
3
|
+
};
|
|
4
|
+
export declare function ChatVoiceMode({ className, freezePresentation, }: ChatVoiceModeProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
|
2
|
+
import { type ChatSurfacePresentation } from "./ChatSurfaceFrameContext";
|
|
3
|
+
import type { SurfaceFocusDisposition } from "@/domain/scenario-interaction/scenario-interaction.types";
|
|
2
4
|
type ChatWidgetFrameProps = PropsWithChildren<{
|
|
3
5
|
open: boolean;
|
|
4
6
|
onOpenChange: (open: boolean) => void;
|
|
5
|
-
|
|
6
|
-
fullscreen: boolean;
|
|
7
|
+
presentation: ChatSurfacePresentation;
|
|
7
8
|
hideOpenButton: boolean;
|
|
8
9
|
loadingProgress: number;
|
|
9
10
|
launcherImageSrc: string;
|
|
@@ -13,9 +14,10 @@ type ChatWidgetFrameProps = PropsWithChildren<{
|
|
|
13
14
|
compactPreviewAnnouncement?: string;
|
|
14
15
|
compactPreviewCollapsible?: boolean;
|
|
15
16
|
compactPreviewSuspended?: boolean;
|
|
17
|
+
closeFocusDisposition?: SurfaceFocusDisposition;
|
|
16
18
|
storageScope?: string | null;
|
|
17
19
|
onLauncherDragSuspended?: (suspended: boolean) => void;
|
|
18
20
|
onCompactPreviewCollapse?: () => void;
|
|
19
21
|
}>;
|
|
20
|
-
export declare function ChatWidgetFrame({ open, onOpenChange,
|
|
22
|
+
export declare function ChatWidgetFrame({ open, onOpenChange, presentation, hideOpenButton, loadingProgress, launcherImageSrc, unreadIndicator, launcherDescriptionId, compactPreview, compactPreviewAnnouncement, compactPreviewCollapsible, compactPreviewSuspended, closeFocusDisposition, storageScope, onLauncherDragSuspended, onCompactPreviewCollapse, children, }: ChatWidgetFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type VoiceAudioMeter } from "@/domain/voice/voice-audio-meter";
|
|
2
|
+
import { type VoiceAssistantActivity, type VoiceComposerPhase } from "./voice-waveform";
|
|
3
|
+
export type { VoiceAssistantActivity, VoiceComposerPhase, } from "./voice-waveform";
|
|
4
|
+
type VoiceComposerProps = {
|
|
5
|
+
phase?: VoiceComposerPhase;
|
|
6
|
+
assistantActivity?: VoiceAssistantActivity;
|
|
7
|
+
microphoneEnabled?: boolean;
|
|
8
|
+
statusLabel: string;
|
|
9
|
+
microphoneLabel: string;
|
|
10
|
+
closeLabel: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
frozen?: boolean;
|
|
13
|
+
onToggleMicrophone: () => void;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
className?: string;
|
|
16
|
+
meter?: Pick<VoiceAudioMeter, "read" | "subscribe">;
|
|
17
|
+
spectrumSource?: VoiceSpectrumSource;
|
|
18
|
+
};
|
|
19
|
+
export type VoiceSpectrumSource = {
|
|
20
|
+
/** Overwrite every entry with a normalized low-to-high microphone band. */
|
|
21
|
+
readBands: (target: Float32Array) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare function VoiceComposer({ phase, assistantActivity, microphoneEnabled, statusLabel, microphoneLabel, closeLabel, disabled, frozen, onToggleMicrophone, onClose, className, meter, spectrumSource, }: VoiceComposerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type VoiceComposerPhase = "connecting" | "ready";
|
|
2
|
+
export type VoiceAssistantActivity = "idle" | "thinking" | "speaking";
|
|
3
|
+
export type VoiceWaveformFrame = Readonly<{
|
|
4
|
+
activity: number;
|
|
5
|
+
leftHeights: readonly number[];
|
|
6
|
+
rightHeights: readonly number[];
|
|
7
|
+
}>;
|
|
8
|
+
type VoiceWaveformLevels = Readonly<{
|
|
9
|
+
inputLevel: number;
|
|
10
|
+
outputLevel: number;
|
|
11
|
+
microphoneEnabled: boolean;
|
|
12
|
+
barCount?: number;
|
|
13
|
+
timeMs?: number;
|
|
14
|
+
inputBands?: ArrayLike<number>;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function writeFallbackVoiceBands(target: Float32Array, inputLevel: number, timeMs: number): void;
|
|
17
|
+
export declare function smoothVoiceLevel(currentLevel: number, targetLevel: number, elapsedMs: number): number;
|
|
18
|
+
export declare function writeVoiceWaveformHeights(leftTarget: Float32Array, rightTarget: Float32Array, inputLevel: number, microphoneEnabled: boolean, inputBands?: ArrayLike<number>, timeMs?: number): number;
|
|
19
|
+
export declare function createVoiceWaveformFrame({ inputLevel, outputLevel, microphoneEnabled, barCount, timeMs, inputBands, }: VoiceWaveformLevels): VoiceWaveformFrame;
|
|
20
|
+
export {};
|
|
@@ -5,6 +5,7 @@ export declare const CHAT_ERROR_MESSAGES: {
|
|
|
5
5
|
readonly agentResponseFailed: "error.agentResponseFailed";
|
|
6
6
|
readonly sendMessageFallback: "error.sendMessageFailed";
|
|
7
7
|
readonly conversationClosed: "error.conversationClosed";
|
|
8
|
+
readonly openChatFailed: "compact.openFailed";
|
|
8
9
|
};
|
|
9
10
|
export declare const translateChatError: (error: string, t: (key: TranslationKey) => string) => string;
|
|
10
11
|
export declare const VOICE_ERROR_MESSAGES: {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ResponderDisplayModel } from "@/ui/hooks/usePresentedResponderPresentation";
|
|
2
|
+
/**
|
|
3
|
+
* The visual handoff starts as soon as human support is routing or assigned.
|
|
4
|
+
* AI suspension is kept as an independent authority signal, but produces the
|
|
5
|
+
* same quiet, avatar-free chat presentation.
|
|
6
|
+
*/
|
|
7
|
+
export declare function usesHumanSupportVisualState(presentation: Pick<ResponderDisplayModel, "contractState" | "humanSupport" | "ai">, assistantSuspended?: boolean): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const n = "@font-face{font-family:Lola Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(" + new URL("./inter-cyrillic-wght-normal.woff2", import.meta.url).href + ') format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Lola Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(' + new URL("./inter-latin-ext-wght-normal.woff2", import.meta.url).href + ') format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lola Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(' + new URL("./inter-latin-wght-normal.woff2", import.meta.url).href + ') format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Lola Inter;font-style:italic;font-display:swap;font-weight:100 900;src:url(' + new URL("./inter-cyrillic-wght-italic.woff2", import.meta.url).href + ') format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Lola Inter;font-style:italic;font-display:swap;font-weight:100 900;src:url(' + new URL("./inter-latin-ext-wght-italic.woff2", import.meta.url).href + ') format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lola Inter;font-style:italic;font-display:swap;font-weight:100 900;src:url(' + new URL("./inter-latin-wght-italic.woff2", import.meta.url).href + ') format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Lola Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(' + new URL("./roboto-cyrillic-400-normal.woff2", import.meta.url).href + ') format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Lola Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(' + new URL("./roboto-latin-ext-400-normal.woff2", import.meta.url).href + ') format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lola Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(' + new URL("./roboto-latin-400-normal.woff2", import.meta.url).href + ') format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Lola Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(' + new URL("./roboto-cyrillic-700-normal.woff2", import.meta.url).href + ') format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Lola Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(' + new URL("./roboto-latin-ext-700-normal.woff2", import.meta.url).href + ') format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lola Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(' + new URL("./roboto-latin-700-normal.woff2", import.meta.url).href + ') format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}', r = "data-lola-widget-fonts", f = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
function a(o) {
|
|
3
|
+
let t = f.get(o);
|
|
4
|
+
if (!t) {
|
|
5
|
+
const U = o.createElement("style");
|
|
6
|
+
U.setAttribute(r, ""), U.textContent = n, o.head.appendChild(U), t = { references: 0, style: U }, f.set(o, t);
|
|
7
|
+
}
|
|
8
|
+
t.references += 1;
|
|
9
|
+
let e = !1;
|
|
10
|
+
return () => {
|
|
11
|
+
e || (e = !0, t.references -= 1, !(t.references > 0) && (t.style.remove(), f.delete(o)));
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
a as installWidgetFontStyles
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function installWidgetFontStyles(document: Document): () => void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alxxsck/ai-assistant",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.1.0",
|
|
5
5
|
"description": "Embeddable Lola AI assistant library",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/bridge-ai-chat-widget.es.js",
|
|
@@ -39,7 +39,9 @@
|
|
|
39
39
|
"build-lib": "vite build --config vite.config.lib.ts --mode production && tsc -p tsconfig.build.json && npm run verify:release-bundle",
|
|
40
40
|
"verify:release-bundle": "node scripts/verify-library-release.mjs",
|
|
41
41
|
"prepublishOnly": "npm run build-lib",
|
|
42
|
-
"push-assets-metamediastatic": "bash scripts/push-assets-to-metamediastatic.sh"
|
|
42
|
+
"push-assets-metamediastatic": "bash scripts/push-assets-to-metamediastatic.sh",
|
|
43
|
+
"assets:optimize": "node scripts/asset-pipeline/optimize-assets.mjs",
|
|
44
|
+
"assets:verify": "node scripts/asset-pipeline/verify-animations.mjs && node scripts/asset-pipeline/verify-render.mjs"
|
|
43
45
|
},
|
|
44
46
|
"dependencies": {
|
|
45
47
|
"@anycable/web": "^1.1.0",
|
|
@@ -64,6 +66,8 @@
|
|
|
64
66
|
"devDependencies": {
|
|
65
67
|
"@axe-core/playwright": "^4.11.1",
|
|
66
68
|
"@eslint/js": "^9.39.1",
|
|
69
|
+
"@fontsource-variable/inter": "^5.3.0",
|
|
70
|
+
"@fontsource/roboto": "^5.3.0",
|
|
67
71
|
"@playwright/test": "^1.62.0",
|
|
68
72
|
"@tailwindcss/postcss": "^4.1.18",
|
|
69
73
|
"@tailwindcss/vite": "^4.1.18",
|