@marketrix.ai/widget 3.8.470 → 3.8.472

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 CHANGED
@@ -80,7 +80,7 @@ These apply to every mode (script attribute → config key):
80
80
  | `show_widget` | — | boolean | When `false`, the widget initializes fully but its UI stays hidden. Default `true`. |
81
81
  | `use_screenshare` | `mtx-use-screenshare` | boolean | When `false`, screen-share requests are auto-denied and the Share Screen button is hidden. Default `true`. Disable via `mtx-use-screenshare="false"`. |
82
82
 
83
- Widget **appearance and behavior** (position, colors, sizing, border radius, animation, enabled Tell/Show/Do/Human features, device visibility, visibility, greeting toast, optional session recording, header/body/greeting text, and quick-action chips) are configured in the Marketrix dashboard and fetched from the API at init. A hidden widget stays visible in the dashboard preview.
83
+ Widget **appearance and behavior** (position, colors, sizing, border radius, animation, enabled Tell/Show/Do features, visibility, greeting toast, optional session recording, header/body/greeting text, and quick-action chips) are configured in the Marketrix dashboard and fetched from the API at init. A hidden widget stays visible in the dashboard preview.
84
84
 
85
85
  ### Full script-tag example
86
86
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { MarketrixConfig } from '../types';
3
- interface MarketrixWidgetProps {
3
+ interface WidgetRootProps {
4
4
  config: MarketrixConfig;
5
5
  }
6
- export declare const MarketrixWidget: React.FC<MarketrixWidgetProps>;
6
+ export declare const WidgetRoot: React.FC<WidgetRootProps>;
7
7
  export {};
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ interface ErrorBoundaryProps {
3
+ children: React.ReactNode;
4
+ label: string;
5
+ fallback?: React.ReactNode;
6
+ }
7
+ export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, {
8
+ hasError: boolean;
9
+ }> {
10
+ state: {
11
+ hasError: boolean;
12
+ };
13
+ static getDerivedStateFromError(): {
14
+ hasError: boolean;
15
+ };
16
+ componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
17
+ render(): React.ReactNode;
18
+ }
19
+ export {};
@@ -1,5 +1,4 @@
1
1
  import { type ElementType } from 'react';
2
- import { type RadiusToken } from '../../design-system/component-tokens';
3
2
  import type { ShadowToken } from '../../design-system/shadows';
4
3
  import { type LayoutProps } from './layoutProps';
5
4
  export type SurfaceBackground = 'default' | 'card';
@@ -9,7 +8,6 @@ export interface SurfaceProps extends LayoutProps, Omit<React.HTMLAttributes<HTM
9
8
  background?: SurfaceBackground;
10
9
  elevation?: ShadowToken;
11
10
  paddingPreset?: SurfacePadding;
12
- radius?: RadiusToken;
13
11
  /** @internal blocks/ only */
14
12
  className?: string;
15
13
  }
@@ -77,42 +77,7 @@ export declare const icons: {
77
77
  };
78
78
  readonly mousePointerClick: {
79
79
  readonly viewBox: "0 0 24 24";
80
- readonly paths: [{
81
- readonly d: "M14 4.1 12 6";
82
- readonly fill: "none";
83
- readonly stroke: "currentColor";
84
- readonly strokeWidth: 2;
85
- readonly strokeLinecap: "round";
86
- readonly strokeLinejoin: "round";
87
- }, {
88
- readonly d: "m5.1 8-2.9-.8";
89
- readonly fill: "none";
90
- readonly stroke: "currentColor";
91
- readonly strokeWidth: 2;
92
- readonly strokeLinecap: "round";
93
- readonly strokeLinejoin: "round";
94
- }, {
95
- readonly d: "m6 12-1.9 2";
96
- readonly fill: "none";
97
- readonly stroke: "currentColor";
98
- readonly strokeWidth: 2;
99
- readonly strokeLinecap: "round";
100
- readonly strokeLinejoin: "round";
101
- }, {
102
- readonly d: "M7.2 2.2 8 5.1";
103
- readonly fill: "none";
104
- readonly stroke: "currentColor";
105
- readonly strokeWidth: 2;
106
- readonly strokeLinecap: "round";
107
- readonly strokeLinejoin: "round";
108
- }, {
109
- readonly d: "M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z";
110
- readonly fill: "none";
111
- readonly stroke: "currentColor";
112
- readonly strokeWidth: 2;
113
- readonly strokeLinecap: "round";
114
- readonly strokeLinejoin: "round";
115
- }];
80
+ readonly paths: [IconPath, IconPath, IconPath, IconPath, IconPath];
116
81
  };
117
82
  readonly ticktick: {
118
83
  readonly viewBox: "0 0 24 24";
@@ -123,47 +88,19 @@ export declare const icons: {
123
88
  };
124
89
  readonly home: {
125
90
  readonly viewBox: "0 0 24 24";
126
- readonly paths: [{
127
- readonly d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6";
128
- readonly fill: "none";
129
- readonly stroke: "currentColor";
130
- readonly strokeWidth: 2;
131
- readonly strokeLinecap: "round";
132
- readonly strokeLinejoin: "round";
133
- }];
91
+ readonly paths: [IconPath];
134
92
  };
135
93
  readonly chat: {
136
94
  readonly viewBox: "0 0 24 24";
137
- readonly paths: [{
138
- readonly d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z";
139
- readonly fill: "none";
140
- readonly stroke: "currentColor";
141
- readonly strokeWidth: 2;
142
- readonly strokeLinecap: "round";
143
- readonly strokeLinejoin: "round";
144
- }];
95
+ readonly paths: [IconPath];
145
96
  };
146
97
  readonly send: {
147
98
  readonly viewBox: "0 0 24 24";
148
- readonly paths: [{
149
- readonly d: "M5 12h14m-7-7l7 7-7 7";
150
- readonly fill: "none";
151
- readonly stroke: "currentColor";
152
- readonly strokeWidth: 2;
153
- readonly strokeLinecap: "round";
154
- readonly strokeLinejoin: "round";
155
- }];
99
+ readonly paths: [IconPath];
156
100
  };
157
101
  readonly closeSmall: {
158
102
  readonly viewBox: "0 0 12 12";
159
- readonly paths: [{
160
- readonly d: "M9 3L3 9M3 3l6 6";
161
- readonly fill: "none";
162
- readonly stroke: "currentColor";
163
- readonly strokeWidth: 1.5;
164
- readonly strokeLinecap: "round";
165
- readonly strokeLinejoin: "round";
166
- }];
103
+ readonly paths: [IconPath];
167
104
  };
168
105
  readonly close: {
169
106
  readonly viewBox: "0 0 20 20";
@@ -176,36 +113,15 @@ export declare const icons: {
176
113
  };
177
114
  readonly chevronDown: {
178
115
  readonly viewBox: "0 0 24 24";
179
- readonly paths: [{
180
- readonly d: "M19 9l-7 7-7-7";
181
- readonly fill: "none";
182
- readonly stroke: "currentColor";
183
- readonly strokeWidth: 2.5;
184
- readonly strokeLinecap: "round";
185
- readonly strokeLinejoin: "round";
186
- }];
116
+ readonly paths: [IconPath];
187
117
  };
188
118
  readonly screenShare: {
189
119
  readonly viewBox: "0 0 24 24";
190
- readonly paths: [{
191
- readonly d: "M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z";
192
- readonly fill: "none";
193
- readonly stroke: "currentColor";
194
- readonly strokeWidth: 2;
195
- readonly strokeLinecap: "round";
196
- readonly strokeLinejoin: "round";
197
- }];
120
+ readonly paths: [IconPath];
198
121
  };
199
122
  readonly alertCircle: {
200
123
  readonly viewBox: "0 0 24 24";
201
- readonly paths: [{
202
- readonly d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z";
203
- readonly fill: "none";
204
- readonly stroke: "currentColor";
205
- readonly strokeWidth: 2;
206
- readonly strokeLinecap: "round";
207
- readonly strokeLinejoin: "round";
208
- }];
124
+ readonly paths: [IconPath];
209
125
  };
210
126
  };
211
127
  export type IconName = keyof typeof icons;
@@ -1,6 +1,44 @@
1
1
  import type { CSSProperties, ElementType } from 'react';
2
2
  export type SpacingToken = 'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
3
3
  export declare const SPACING_SCALE: Record<SpacingToken, string>;
4
+ declare const alignClasses: {
5
+ readonly start: "items-start";
6
+ readonly center: "items-center";
7
+ readonly end: "items-end";
8
+ readonly stretch: "items-stretch";
9
+ readonly baseline: "items-baseline";
10
+ };
11
+ declare const justifyClasses: {
12
+ readonly start: "justify-start";
13
+ readonly center: "justify-center";
14
+ readonly end: "justify-end";
15
+ readonly between: "justify-between";
16
+ readonly around: "justify-around";
17
+ };
18
+ declare const overflowClasses: {
19
+ readonly hidden: "overflow-hidden";
20
+ readonly auto: "overflow-auto";
21
+ readonly visible: "overflow-visible";
22
+ readonly scroll: "overflow-scroll";
23
+ };
24
+ declare const overflowYClasses: {
25
+ readonly hidden: "overflow-y-hidden";
26
+ readonly auto: "overflow-y-auto";
27
+ };
28
+ declare const widthClasses: {
29
+ readonly full: "w-full";
30
+ readonly auto: "w-auto";
31
+ };
32
+ declare const heightClasses: {
33
+ readonly full: "h-full";
34
+ readonly auto: "h-auto";
35
+ };
36
+ declare const borderSideClasses: {
37
+ readonly top: "border-t";
38
+ readonly bottom: "border-b";
39
+ readonly left: "border-l";
40
+ readonly right: "border-r";
41
+ };
4
42
  export interface LayoutProps {
5
43
  padding?: SpacingToken;
6
44
  paddingX?: SpacingToken;
@@ -8,18 +46,18 @@ export interface LayoutProps {
8
46
  paddingTop?: SpacingToken;
9
47
  paddingBottom?: SpacingToken;
10
48
  gap?: SpacingToken;
11
- align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline';
12
- justify?: 'start' | 'center' | 'end' | 'between' | 'around';
49
+ align?: keyof typeof alignClasses;
50
+ justify?: keyof typeof justifyClasses;
13
51
  grow?: boolean;
14
52
  shrink?: boolean;
15
53
  position?: 'relative' | 'absolute' | 'fixed' | 'sticky';
16
54
  inset?: SpacingToken | '0';
17
- overflow?: 'hidden' | 'auto' | 'visible' | 'scroll';
18
- overflowY?: 'hidden' | 'auto';
19
- width?: 'full' | 'auto';
20
- height?: 'full' | 'auto';
55
+ overflow?: keyof typeof overflowClasses;
56
+ overflowY?: keyof typeof overflowYClasses;
57
+ width?: keyof typeof widthClasses;
58
+ height?: keyof typeof heightClasses;
21
59
  minWidth?: '0';
22
- border?: boolean | 'top' | 'bottom' | 'left' | 'right';
60
+ border?: boolean | keyof typeof borderSideClasses;
23
61
  rounded?: boolean | 'none' | 'sm' | 'full' | 'lg' | 'theme' | 'md' | 'xl' | 'pill' | 'circle';
24
62
  animate?: 'spin' | 'ping' | 'pulse' | 'fadeIn' | 'none';
25
63
  hidden?: boolean;
@@ -28,3 +66,4 @@ export interface LayoutProps {
28
66
  }
29
67
  export declare function resolveLayoutClasses(props: LayoutProps): string;
30
68
  export declare function stripLayoutProps<T extends LayoutProps>(props: T): Omit<T, keyof LayoutProps>;
69
+ export {};
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
+ import type { InstructionType } from '../../types';
2
3
  import type { IconName } from '../base/icons';
3
4
  export interface ChatInputMode {
4
- id: string;
5
+ id: InstructionType;
5
6
  icon: IconName;
6
7
  label: string;
7
8
  }
@@ -10,8 +11,8 @@ export interface ChatInputProps {
10
11
  onChange: (value: string) => void;
11
12
  onSubmit: () => void;
12
13
  modes?: ChatInputMode[];
13
- activeMode?: string;
14
- onModeChange?: (mode: string) => void;
14
+ activeMode?: InstructionType;
15
+ onModeChange?: (mode: InstructionType) => void;
15
16
  disabled?: boolean;
16
17
  taskRunning?: boolean;
17
18
  onStop?: () => void;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { ResizeCorner } from '../../hooks/useResize';
2
+ import { type ResizeCorner } from '../../hooks/useResize';
3
3
  export interface ResizeHandlesProps {
4
4
  onResizeStart: (corner: ResizeCorner) => (e: React.MouseEvent) => void;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- /** MarketrixWidget publishes its own root here: a portal outside it escapes the element carrying the tenant tokens. */
2
+ /** WidgetRoot publishes its own root here: a portal outside it escapes the element carrying the tenant tokens. */
3
3
  export declare const PortalContainerContext: React.Context<HTMLElement | null>;
4
4
  export declare const usePortalContainer: () => HTMLElement;
5
5
  interface WidgetProvidersProps {
@@ -37,10 +37,11 @@ export declare function reduceError(state: SseState, messageId: string, text: st
37
37
  /** The transport gave up, so no id-bearing event is coming for whatever is still pending. */
38
38
  export declare function reduceTransportFailure(state: SseState, text: string): SseState;
39
39
  /**
40
- * A per-request watchdog: the stream can stay healthy (no `StreamGaveUpError`) while a single
41
- * dispatch's reply never arrives — a dropped correlation or a silent backend failure before it ever
42
- * acknowledges the request. `reduceTransportFailure` cannot see that, since nothing told the transport
43
- * it failed, so without this the bubble sits on "thinking" and the composer stays disabled forever.
40
+ * The stream can stay healthy (no `StreamGaveUpError`) while a single dispatch's reply never arrives —
41
+ * a dropped correlation, a silent backend failure before it ever acknowledges the request, or a reload
42
+ * into the gap where the api has no tab to push to. `reduceTransportFailure` cannot see that, since
43
+ * nothing told the transport it failed, so without this the bubble sits on "thinking" and the composer
44
+ * stays disabled forever.
44
45
  *
45
46
  * Only fires on a message that received ZERO signs of life — still `thinking` with no progress line
46
47
  * and no streamed text. A `do`/`show` task that is genuinely still running has already advanced past
@@ -1,6 +1,7 @@
1
1
  export type LayerTokens = {
2
+ screenEdgeGlow: number;
2
3
  panel: number;
3
- overlay: number;
4
+ dialog: number;
4
5
  toast: number;
5
6
  };
6
7
  export declare const LAYER_TOKENS: LayerTokens;
@@ -1,5 +1,27 @@
1
- export type ResizeCorner = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
2
- export declare function useResize(settingsWidth: string | undefined, settingsHeight: string | undefined, workspaceId: string, isPreviewMode: boolean): {
1
+ export declare const RESIZE_CORNERS: {
2
+ readonly 'top-left': {
3
+ readonly growX: -1;
4
+ readonly growY: -1;
5
+ readonly cursor: "nwse-resize";
6
+ };
7
+ readonly 'top-right': {
8
+ readonly growX: 1;
9
+ readonly growY: -1;
10
+ readonly cursor: "nesw-resize";
11
+ };
12
+ readonly 'bottom-left': {
13
+ readonly growX: -1;
14
+ readonly growY: 1;
15
+ readonly cursor: "nesw-resize";
16
+ };
17
+ readonly 'bottom-right': {
18
+ readonly growX: 1;
19
+ readonly growY: 1;
20
+ readonly cursor: "nwse-resize";
21
+ };
22
+ };
23
+ export type ResizeCorner = keyof typeof RESIZE_CORNERS;
24
+ export declare function useResize(settingsWidth: string | undefined, settingsHeight: string | undefined, tenantScope: string, isPreviewMode: boolean): {
3
25
  widthPx: string;
4
26
  heightPx: string;
5
27
  onResizeStart: (corner: ResizeCorner) => (e: React.MouseEvent) => void;
@@ -18,11 +18,12 @@ export interface UseScreenShareOptions {
18
18
  }
19
19
  export interface UseScreenShareReturn {
20
20
  isScreenSharing: boolean;
21
+ isAwaitingScreenAccess: boolean;
21
22
  showScreenAccessDialog: boolean;
22
23
  handleScreenAccessDialogAllow: () => Promise<void>;
23
- handleScreenAccessDialogDeny: () => void;
24
- handleScreenAccessAllow: () => Promise<void>;
25
- handleScreenAccessDeny: () => void;
24
+ handleScreenAccessDialogDismiss: () => void;
25
+ handleScreenAccessRequestAllow: () => Promise<void>;
26
+ handleScreenAccessRequestDeny: () => void;
26
27
  requestScreenAccess: (mode: InstructionType) => void;
27
28
  }
28
29
  export declare function useScreenShare({ onScreenSharingChange, onStartScreenShareRef, onStopScreenShareRef, onAddMessage, onUpdateMessage, onRemoveMessage, onSendMessage, pendingMessage, setPendingMessage, }: UseScreenShareOptions): UseScreenShareReturn;
@@ -1,6 +1,6 @@
1
1
  import type { MarketrixConfig, WidgetSettingsData, WidgetState } from '../types';
2
2
  export type ValidWidgetConfig = MarketrixConfig & Required<Pick<MarketrixConfig, keyof WidgetSettingsData>>;
3
- /** Every setting resolved: API settings plus the position and script-tag overrides MarketrixWidget layers on top. */
3
+ /** Every setting resolved: API settings plus the position and script-tag overrides WidgetRoot layers on top. */
4
4
  export declare const WidgetConfigContext: import("react").Context<ValidWidgetConfig | null>;
5
5
  export declare const useWidgetConfig: () => ValidWidgetConfig;
6
6
  export declare const useWidget: () => {
@@ -1,4 +1,4 @@
1
1
  import { type InstructionType } from '../sdk';
2
- import type { MarketrixConfig } from '../types';
2
+ import { type CredentialedConfig } from './StorageService';
3
3
  /** The reply does not come back from here — it arrives asynchronously as a chat/response event on the stream. */
4
- export declare function messageDispatch(config: MarketrixConfig, message: string, mode: InstructionType, requestId: string): Promise<void>;
4
+ export declare function messageDispatch(config: CredentialedConfig, message: string, mode: InstructionType, requestId: string): Promise<void>;
@@ -20,6 +20,7 @@ export interface ToolExecutionResult<T = TextData> {
20
20
  success: boolean;
21
21
  data: T;
22
22
  error?: string;
23
+ afterResponseSent?: () => void;
23
24
  }
24
25
  export declare class BrowserToolService {
25
26
  executeTool(browserToolName: string, args: Record<string, unknown>, mode?: string, explanation?: string): Promise<ToolExecutionResult<unknown>>;
@@ -38,8 +39,8 @@ export declare class BrowserToolService {
38
39
  /** Programmatic KeyboardEvents aren't "trusted", so manually reproduce each key's expected behavior. */
39
40
  private simulateKeyAction;
40
41
  /** Native value setter so React/Vue controlled inputs pick up the change. */
42
+ private setNativeValue;
41
43
  private setValueAndCaret;
42
- private uploadFile;
43
44
  private closeTab;
44
45
  private done;
45
46
  private getHtml;
@@ -1,7 +1,6 @@
1
1
  import type { ChatMessage, InstructionType } from '../types';
2
2
  import { type ChatSnapshot } from './StorageService';
3
3
  export declare class ChatService {
4
- private restored;
5
4
  restore(): ChatSnapshot;
6
5
  persist(snapshot: ChatSnapshot): void;
7
6
  }
@@ -5,7 +5,7 @@ export interface ValidatedElementResult {
5
5
  export declare class DomService {
6
6
  private index;
7
7
  private elementToSequence;
8
- private generateSelector;
8
+ private generateAnchoredSelector;
9
9
  private staleReason;
10
10
  private indexInteractableElements;
11
11
  /** `data-id` is the whole contract: the agent parses the snapshot for `[data-id]` and reads nothing else off it. */
@@ -15,8 +15,9 @@ export declare class ShowModeService {
15
15
  private clickHandler;
16
16
  private scrollHandler;
17
17
  private visibilityCheckInterval;
18
- showToolAction(options: ShowModeOptions): Promise<boolean>;
18
+ showToolAction(options: ShowModeOptions): Promise<void>;
19
19
  cleanup(): void;
20
+ private completeAction;
20
21
  /** Detach both settlers before calling one — the click handler, the Continue button and the two watchdogs race. */
21
22
  private takeSettlers;
22
23
  private createHighlight;
@@ -2,14 +2,16 @@ import type { ChatMessage, InstructionType, MarketrixConfig } from '../types';
2
2
  export type StoredMessage = Omit<ChatMessage, 'videoStream' | 'timestamp'> & {
3
3
  timestamp: string;
4
4
  };
5
- /** The durable half of the widget's React state. `isLoading` is deliberately absent — restoring it would
6
- * leave the FAB glowing for a request that died with the previous page. */
7
5
  export interface ChatSnapshot {
8
6
  messages: ChatMessage[];
9
7
  isTaskRunning: boolean;
10
8
  currentMode: InstructionType;
11
9
  isOpen: boolean;
12
10
  }
11
+ export type CredentialedConfig = MarketrixConfig & {
12
+ mtxId: string;
13
+ mtxKey: string;
14
+ };
13
15
  export type MarketrixChatContext = Omit<ChatSnapshot, 'messages'> & {
14
16
  chat_id: string | null;
15
17
  messages: StoredMessage[];
@@ -22,11 +24,10 @@ declare class StorageService {
22
24
  private context;
23
25
  getContext(): MarketrixChatContext;
24
26
  updateContext(updates: Partial<MarketrixChatContext>): void;
25
- /** window.name takes priority over localStorage — it is what survives host-page navigation. */
26
27
  getChatId(): string | null;
27
28
  setChatId(chatId: string): void;
28
- getConfig(): MarketrixConfig | null;
29
- setConfig(config: MarketrixConfig): void;
29
+ getCredentialedConfig(): CredentialedConfig | null;
30
+ setConfig(config: CredentialedConfig): void;
30
31
  }
31
32
  export declare const storageService: StorageService;
32
33
  export {};
@@ -12,7 +12,8 @@ export declare class StreamClient {
12
12
  private chatId;
13
13
  private status;
14
14
  private callbacks;
15
- private reconnectSuppressed;
15
+ private tornDown;
16
+ private credentialRejected;
16
17
  private reconnectAttempts;
17
18
  private readonly maxReconnectAttempts;
18
19
  private reconnectDelay;
@@ -26,6 +27,7 @@ export declare class StreamClient {
26
27
  addCallbacks(callbacks: StreamClientCallbacks): void;
27
28
  removeCallbacks(callbacks: StreamClientCallbacks): void;
28
29
  isConnected(): boolean;
30
+ private reconnectSuppressed;
29
31
  /** Whether a user-driven retry can achieve anything: there is a chat to rejoin and nothing has
30
32
  * suppressed reconnection. */
31
33
  canReconnect(): boolean;
@@ -39,6 +41,8 @@ export declare class StreamClient {
39
41
  disconnect(): void;
40
42
  send(command: WidgetCommand): Promise<void>;
41
43
  private notifyError;
44
+ private settleWaiters;
45
+ private giveUp;
42
46
  private handleMessage;
43
47
  private scheduleReconnect;
44
48
  private clearReconnectTimer;
@@ -1,6 +1,7 @@
1
1
  import { type WidgetSettingsData } from '../sdk';
2
2
  import type { MarketrixConfig } from '../types';
3
+ import type { CredentialedConfig } from './StorageService';
3
4
  export declare function createConfigFromSettings(widgetSettings: WidgetSettingsData, baseConfig?: Partial<MarketrixConfig>): MarketrixConfig;
4
5
  /** Per-tenant scope for browser-local keys: the credential id, else the application id. */
5
6
  export declare function tenantScope(config: MarketrixConfig): string;
6
- export declare function loadWidgetConfig(config: MarketrixConfig): Promise<MarketrixConfig>;
7
+ export declare function loadWidgetConfig(config: MarketrixConfig): Promise<CredentialedConfig>;
@@ -68,7 +68,4 @@ export type AddWidgetConfig = ({
68
68
  export interface MarketrixWidgetProps {
69
69
  settings: WidgetSettingsData;
70
70
  container?: HTMLElement;
71
- mtxId?: string;
72
- mtxKey?: string;
73
- mtxApiHost?: string;
74
71
  }
@@ -1,9 +1,15 @@
1
1
  import { type Root } from 'react-dom/client';
2
2
  import type { NotificationTone } from '../design-system/component-tokens';
3
3
  import type { MarketrixConfig } from '../types';
4
+ export interface WidgetMount {
5
+ instance: Root;
6
+ config: MarketrixConfig;
7
+ container: HTMLElement;
8
+ host: HTMLElement | undefined;
9
+ previewMode: boolean;
10
+ }
4
11
  export declare const widgetState: {
5
- instance: Root | null;
6
- config: MarketrixConfig | null;
12
+ mount: WidgetMount | null;
7
13
  };
8
14
  export declare const createWidgetContainer: (parentContainer?: HTMLElement) => {
9
15
  container: HTMLElement;
@@ -13,8 +19,6 @@ export declare const createWidgetContainer: (parentContainer?: HTMLElement) => {
13
19
  export declare const mountWidgetToContainer: (mountEl: HTMLElement, config: MarketrixConfig, previewMode?: boolean) => Root;
14
20
  export declare const isWidgetInitialized: () => boolean;
15
21
  export declare const getCurrentConfig: () => MarketrixConfig | null;
16
- /** ``tone`` because this one surface carries both the loading notice and the two hard init failures, and
17
- * a failure painted in the neutral palette reads as an informational notice on the host's page. */
18
- export declare const showWidgetSettingsLoader: (message: string, tone?: NotificationTone) => void;
19
- export declare const hideWidgetSettingsLoader: () => void;
22
+ export declare const showHostPageNotice: (message: string, tone?: NotificationTone) => void;
23
+ export declare const hideHostPageNotice: () => void;
20
24
  export declare const autoInitializeWidget: (initWidget: (config: MarketrixConfig) => Promise<void>) => void;
@@ -12,9 +12,8 @@ export declare function findMessageForProgress({ messages, isTaskRunning, curren
12
12
  message: ChatMessage;
13
13
  } | null;
14
14
  export declare const WAIT_FOR_USER_TOOLS: Set<string>;
15
- export declare function filterCancellationText(content: string): string;
16
15
  export declare function addProgressLine(message: ChatMessage, browserToolName: string, explanation: string): ChatMessage;
17
- export declare const markProgressLineComplete: (message: ChatMessage) => ChatMessage;
16
+ export declare const markProgressLineComplete: (message: ChatMessage, browserToolName: string) => ChatMessage;
18
17
  export declare function markProgressLineFailed(message: ChatMessage, browserToolName: string, error: string): ChatMessage;
19
18
  /** Tool id -> the phrase shown in the activity log. Also the allowlist of tools the agent may call. */
20
19
  export declare const BROWSER_TOOLS: Map<string, string>;
@@ -1 +1,2 @@
1
+ export declare const WIDGET_SHADOW_HOST_CLASS = "marketrix-widget-container";
1
2
  export declare function isInteractable(el: Element | null): boolean;